From 865141d5df25104532d4cbe982eaebdc37fa27fd Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 23 Apr 2016 23:33:19 +0100 Subject: Use static sql writer instead of our own class --- gentoobrowse-api/service/maintenanceimpl.cpp | 11 ++--------- 1 file 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); -- cgit v1.2.3