diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-23 23:33:19 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-25 21:27:50 +0100 |
commit | 865141d5df25104532d4cbe982eaebdc37fa27fd (patch) | |
tree | 4e652f8847f957547205a705b2446516b1502ec8 | |
parent | Add package herd support, even though none appear to have it at the moment. (diff) | |
download | gentoobrowse-api-865141d5df25104532d4cbe982eaebdc37fa27fd.tar.bz2 gentoobrowse-api-865141d5df25104532d4cbe982eaebdc37fa27fd.tar.xz gentoobrowse-api-865141d5df25104532d4cbe982eaebdc37fa27fd.zip |
Use static sql writer instead of our own class
-rw-r--r-- | gentoobrowse-api/service/maintenanceimpl.cpp | 11 |
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); |