Skip to content

Commit

Permalink
Add HardwareProfile task to assorted applications.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wagnerrp committed Jun 2, 2013
1 parent 8909136 commit 0b67590
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
8 changes: 8 additions & 0 deletions mythtv/programs/mythbackend/main_helpers.cpp
Expand Up @@ -50,6 +50,7 @@
#include "mythtranslation.h"
#include "mythtimezone.h"
#include "signalhandling.h"
#include "hardwareprofile.h"

#include "mediaserver.h"
#include "httpstatus.h"
Expand Down Expand Up @@ -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"))
Expand Down
20 changes: 11 additions & 9 deletions mythtv/programs/mythfrontend/main.cpp
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -1731,6 +1731,8 @@ int main(int argc, char **argv)

PreviewGeneratorQueue::TeardownPreviewGeneratorQueue();

delete housekeeping;

if (themeUpdateChecker)
delete themeUpdateChecker;

Expand Down
10 changes: 10 additions & 0 deletions mythtv/programs/mythjobqueue/main.cpp
Expand Up @@ -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: ")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0b67590

Please sign in to comment.