From 0b67590b5cb2e8698c420d1e6d9633a021b5d0f5 Mon Sep 17 00:00:00 2001 From: Raymond Wagner Date: Sat, 1 Jun 2013 21:05:09 -0400 Subject: [PATCH] Add HardwareProfile task to assorted applications. This replaces the initial HardwareProfile startup check in mythfrontend with the new task run through the housekeeper, and adds the check to mythbackend and mythjobqueue as well. --- mythtv/programs/mythbackend/main_helpers.cpp | 8 ++++++++ mythtv/programs/mythfrontend/main.cpp | 20 +++++++++++--------- mythtv/programs/mythjobqueue/main.cpp | 10 ++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/mythtv/programs/mythbackend/main_helpers.cpp b/mythtv/programs/mythbackend/main_helpers.cpp index e7724f6bf21..818cf9ac675 100644 --- a/mythtv/programs/mythbackend/main_helpers.cpp +++ b/mythtv/programs/mythbackend/main_helpers.cpp @@ -50,6 +50,7 @@ #include "mythtranslation.h" #include "mythtimezone.h" #include "signalhandling.h" +#include "hardwareprofile.h" #include "mediaserver.h" #include "httpstatus.h" @@ -623,6 +624,13 @@ int run_backend(MythBackendCommandLineParser &cmdline) } housekeeping->RegisterTask(new JobQueueRecoverTask()); +#ifdef __linux__ + #ifdef CONFIG_BINDINGS_PYTHON + housekeeping->RegisterTask(new HardwareProfileTask()); + #endif +#endif + + housekeeping->Start(); } if (!cmdline.toBool("nojobqueue")) diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index dfd6d34558c..fb959654150 100644 --- a/mythtv/programs/mythfrontend/main.cpp +++ b/mythtv/programs/mythfrontend/main.cpp @@ -1665,15 +1665,6 @@ int main(int argc, char **argv) .arg(port)); } -#ifdef __linux__ -#ifdef CONFIG_BINDINGS_PYTHON - HardwareProfile *profile = new HardwareProfile(); - if (profile && profile->NeedsUpdate()) - profile->SubmitProfile(); - delete profile; -#endif -#endif - if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename)) { return GENERIC_EXIT_NO_THEME; @@ -1690,6 +1681,15 @@ int main(int argc, char **argv) PreviewGeneratorQueue::CreatePreviewGeneratorQueue( PreviewGenerator::kRemote, 50, 60); + HouseKeeper *housekeeping = new HouseKeeper(); +#ifdef __linux__ + #ifdef CONFIG_BINDINGS_PYTHON + housekeeping->RegisterTask(new HardwareProfileTask()); + #endif +#endif + housekeeping->Start(); + + if (cmdline.toBool("runplugin")) { QStringList plugins = pmanager->EnumeratePlugins(); @@ -1731,6 +1731,8 @@ int main(int argc, char **argv) PreviewGeneratorQueue::TeardownPreviewGeneratorQueue(); + delete housekeeping; + if (themeUpdateChecker) delete themeUpdateChecker; diff --git a/mythtv/programs/mythjobqueue/main.cpp b/mythtv/programs/mythjobqueue/main.cpp index 486cde6002a..9ced369a0b2 100644 --- a/mythtv/programs/mythjobqueue/main.cpp +++ b/mythtv/programs/mythjobqueue/main.cpp @@ -29,6 +29,8 @@ #include "mythsystemevent.h" #include "mythlogging.h" #include "signalhandling.h" +#include "housekeeper.h" +#include "hardwareprofile.h" #define LOC QString("MythJobQueue: ") #define LOC_WARN QString("MythJobQueue, Warning: ") @@ -140,6 +142,14 @@ int main(int argc, char *argv[]) MythSystemEventHandler *sysEventHandler = new MythSystemEventHandler(); + HouseKeeper *housekeeping = new HouseKeeper(); +#ifdef __linux__ + #ifdef CONFIG_BINDINGS_PYTHON + housekeeping->RegisterTask(new HardwareProfileTask()); + #endif +#endif + housekeeping->Start(); + int exitCode = a.exec(); if (sysEventHandler)