commit d82235df8506090aa2d0437875c08b6286a25d2b
parent f25d557219a0b359bfbf803cb45fdbdeec70170d
Author: cfillion <cfillion@users.noreply.github.com>
Date: Tue, 19 Apr 2016 03:00:22 -0400
mild refactoring
Diffstat:
4 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/src/listview.cpp b/src/listview.cpp
@@ -194,11 +194,6 @@ void ListView::setSelected(const int index, const bool select)
select ? LVIS_SELECTED : 0, LVIS_SELECTED);
}
-bool ListView::hasSelection() const
-{
- return selectionSize() > 0;
-}
-
int ListView::currentIndex() const
{
const int internalIndex = ListView_GetNextItem(handle(), -1, LVNI_SELECTED);
diff --git a/src/listview.hpp b/src/listview.hpp
@@ -52,7 +52,7 @@ public:
void unselectAll() { unselect(-1); }
int selectionSize() const;
- bool hasSelection() const;
+ bool hasSelection() const { return selectionSize() > 0; }
int currentIndex() const;
std::vector<int> selection() const;
int itemUnderMouse() const;
diff --git a/src/package.cpp b/src/package.cpp
@@ -62,6 +62,12 @@ Package::Package(const Type type, const string &name, const Category *cat)
throw reapack_error("empty package name");
}
+Package::~Package()
+{
+ for(const Version *ver : m_versions)
+ delete ver;
+}
+
string Package::fullName() const
{
return m_category ? m_category->fullName() + "/" + m_name : m_name;
@@ -72,12 +78,6 @@ string Package::displayType() const
return displayType(m_type);
}
-Package::~Package()
-{
- for(const Version *ver : m_versions)
- delete ver;
-}
-
void Package::addVersion(const Version *ver)
{
if(ver->package() != this)
diff --git a/test/database.cpp b/test/database.cpp
@@ -82,8 +82,6 @@ TEST_CASE("bind values and clear", M) {
Database db;
db.exec("CREATE TABLE test (value TEXT NOT NULL)");
- vector<string> values;
-
Statement *stmt = db.prepare("INSERT INTO test VALUES (?)");
stmt->bind(1, "hello");
stmt->exec();