From c71dcecdcdb9a9f141acaf6276be046a28551f23 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 5 Mar 2017 23:52:19 +0000 Subject: Split setting up file processors from common constructor --- gentoobrowse-api/service/maintenanceCommon.cpp | 10 ++++++++++ gentoobrowse-api/service/maintenancePackageTree.cpp | 8 ++------ gentoobrowse-api/service/maintenanceimpl.h | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gentoobrowse-api/service/maintenanceCommon.cpp b/gentoobrowse-api/service/maintenanceCommon.cpp index d7fdc1b..77a9dea 100644 --- a/gentoobrowse-api/service/maintenanceCommon.cpp +++ b/gentoobrowse-api/service/maintenanceCommon.cpp @@ -9,6 +9,16 @@ namespace Gentoo { namespace Service { + Maintenance::Maintenance(IceTray::DatabasePoolPtr d) : + IceTray::AbstractDatabaseClient(d) + { + setupFileProcessors(); + } + + Maintenance::~Maintenance() + { + } + Maintenance::FileProcessor::FileProcessor(bool v) : vcsMode(v) { diff --git a/gentoobrowse-api/service/maintenancePackageTree.cpp b/gentoobrowse-api/service/maintenancePackageTree.cpp index 531dc47..50580d5 100644 --- a/gentoobrowse-api/service/maintenancePackageTree.cpp +++ b/gentoobrowse-api/service/maintenancePackageTree.cpp @@ -66,8 +66,8 @@ R"DATA( 10 category metadata 2 2 {"(2,metadata.xml)"} return FileProcessorPtr(new T(vcsMode)); } - Maintenance::Maintenance(IceTray::DatabasePoolPtr d) : - IceTray::AbstractDatabaseClient(d) + void + Maintenance::setupFileProcessors() { fpfs[CategoryMetaProcessor::FILETYPEID] = &createFileProessor; fpfs[PackageMetaProcessor::FILETYPEID] = &createFileProessor; @@ -80,10 +80,6 @@ R"DATA( 10 category metadata 2 2 {"(2,metadata.xml)"} fpfs[UpdatesProcessor::FILETYPEID] = &createFileProessor; } - Maintenance::~Maintenance() - { - } - void Maintenance::fileDeleted(DB::Connection * dbc, const FileProcessors * fps, const boost::filesystem::path & tmp, const RepoMap * repos, DB::SelectCommandPtr s) { diff --git a/gentoobrowse-api/service/maintenanceimpl.h b/gentoobrowse-api/service/maintenanceimpl.h index 33cccd3..b9974f1 100644 --- a/gentoobrowse-api/service/maintenanceimpl.h +++ b/gentoobrowse-api/service/maintenanceimpl.h @@ -48,6 +48,7 @@ namespace Gentoo { void sendNotifications(const Ice::Current &) override; private: + void setupFileProcessors(); void updateFileTypes(DB::Connection *) const; static RepoMap createTempFileList(DB::Connection *, const boost::filesystem::path &); void processChanges(DB::Connection *, const boost::filesystem::path &, const RepoMap & repos); -- cgit v1.2.3