commit 514cd73f9d671b835e1028258befafb660f035a2
parent 6bcbe4baf4e033617a2b0cf7e5b8a1b1060fa4ea
Author: cfillion <cfillion@users.noreply.github.com>
Date: Mon, 27 Feb 2017 00:16:34 -0500
source: remove Source::fullName (unused since 8304cbe068518ee6fdd6f56cd561b22fcaa3eea6)
Diffstat:
3 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/src/source.cpp b/src/source.cpp
@@ -83,16 +83,6 @@ void Source::setSections(int sections)
m_sections = sections;
}
-string Source::fullName() const
-{
- if(!m_version)
- return Path(file()).basename();
- else if(m_file.empty())
- return m_version->fullName();
-
- return m_version->fullName() + " (" + Path(m_file).basename() + ")";
-}
-
Path Source::targetPath() const
{
Path path;
diff --git a/src/source.hpp b/src/source.hpp
@@ -39,10 +39,10 @@ public:
static Section detectSection(const std::string &category);
Source(const std::string &file, const std::string &url, const Version *);
+ const Version *version() const { return m_version; }
void setPlatform(Platform p) { m_platform = p; }
Platform platform() const { return m_platform; }
-
void setTypeOverride(Package::Type t) { m_type = t; }
Package::Type typeOverride() const { return m_type; }
Package::Type type() const;
@@ -51,9 +51,6 @@ public:
void setSections(int);
int sections() const { return m_sections; }
- const Version *version() const { return m_version; }
-
- std::string fullName() const;
Path targetPath() const;
private:
diff --git a/test/source.cpp b/test/source.cpp
@@ -127,22 +127,6 @@ TEST_CASE("empty source url", M) {
}
}
-TEST_CASE("source full name", M) {
- MAKE_VERSION;
-
- SECTION("with file name") {
- const Source source("path/to/file", "b", &ver);
-
- REQUIRE(source.fullName() == ver.fullName() + " (file)");
- }
-
- SECTION("without file name") {
- const Source source({}, "b", &ver);
-
- REQUIRE(source.fullName() == ver.fullName());
- }
-}
-
TEST_CASE("source target path", M) {
MAKE_VERSION;