summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-03-05 23:52:19 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2017-03-05 23:52:19 +0000
commitc71dcecdcdb9a9f141acaf6276be046a28551f23 (patch)
tree07a0b43c345eb8715f407115a138f4b0a4b31d5b
parentTest, fix and remove debug around git operation function name retrieval (diff)
downloadgentoobrowse-api-c71dcecdcdb9a9f141acaf6276be046a28551f23.tar.bz2
gentoobrowse-api-c71dcecdcdb9a9f141acaf6276be046a28551f23.tar.xz
gentoobrowse-api-c71dcecdcdb9a9f141acaf6276be046a28551f23.zip
Split setting up file processors from common constructor
-rw-r--r--gentoobrowse-api/service/maintenanceCommon.cpp10
-rw-r--r--gentoobrowse-api/service/maintenancePackageTree.cpp8
-rw-r--r--gentoobrowse-api/service/maintenanceimpl.h1
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<CategoryMetaProcessor>;
fpfs[PackageMetaProcessor::FILETYPEID] = &createFileProessor<PackageMetaProcessor>;
@@ -80,10 +80,6 @@ R"DATA( 10 category metadata 2 2 {"(2,metadata.xml)"}
fpfs[UpdatesProcessor::FILETYPEID] = &createFileProessor<UpdatesProcessor>;
}
- 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);