diff options
-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); |