summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-04-23 23:33:19 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 21:27:50 +0100
commit030c3aaf6f2c73b7fcab7e413ae015d06f6d538f (patch)
tree4e652f8847f957547205a705b2446516b1502ec8
parentAdd package herd support, even though none appear to have it at the moment. (diff)
downloadgentoobrowse-api-030c3aaf6f2c73b7fcab7e413ae015d06f6d538f.tar.bz2
gentoobrowse-api-030c3aaf6f2c73b7fcab7e413ae015d06f6d538f.tar.xz
gentoobrowse-api-030c3aaf6f2c73b7fcab7e413ae015d06f6d538f.zip
Use static sql writer instead of our own class
-rw-r--r--gentoobrowse-api/service/maintenanceimpl.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/gentoobrowse-api/service/maintenanceimpl.cpp b/gentoobrowse-api/service/maintenanceimpl.cpp
index 5ea6b8e..d6b13a2 100644
--- a/gentoobrowse-api/service/maintenanceimpl.cpp
+++ b/gentoobrowse-api/service/maintenanceimpl.cpp
@@ -121,14 +121,6 @@ namespace Gentoo {
dbc->execute(sql::maintenance::createTempFileListView::sql);
}
- class OrderByProcessOrder : public DB::SqlWriter {
- public:
- void writeSql(AdHoc::Buffer & sql) override
- {
- sql.append("(SELECT processOrder FROM gentoobrowse.filetypes ft WHERE ft.filetypeid = b.filetypeid) NULLS LAST");
- }
- };
-
void
Maintenance::processChanges(DB::Connection * dbc, const boost::filesystem::path & tmp)
{
@@ -140,7 +132,8 @@ namespace Gentoo {
tp.beforeDelete = boost::bind(&Maintenance::fileDeleted, this, dbc, tmp, _1);
tp.beforeUpdate = boost::bind(&Maintenance::fileChanged, this, dbc, tmp, _1);
tp.beforeInsert = boost::bind(&Maintenance::fileCreated, this, dbc, tmp, _1);
- OrderByProcessOrder obpo;
+ DB::StaticSqlWriter obpo(
+ "(SELECT processOrder FROM gentoobrowse.filetypes ft WHERE ft.filetypeid = b.filetypeid) NULLS LAST");
tp.order = &obpo;
dbc->patchTable(&tp);
boost::filesystem::remove_all(tmp);