Skip to content

Commit

Permalink
Set use_display before QApplication is instanciated.
Browse files Browse the repository at this point in the history
Otherwise we may try to connect to the display when it isn't necessary.

Discovered by Siv Chand Koripella <sivchand@digital-nirvana.com>
  • Loading branch information
daniel-kristjansson committed Jan 3, 2012
1 parent b3bb76d commit 3a75bdf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mythtv/programs/mythtv-setup/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ int main(int argc, char *argv[])
uint scanCardId = 0;
QString scanTableName = "atsc-vsb8-us";
QString scanInputName = "";
bool use_display = true;

MythTVSetupCommandLineParser cmdline;
if (!cmdline.Parse(argc, argv))
Expand All @@ -251,6 +250,13 @@ int main(int argc, char *argv[])
return GENERIC_EXIT_OK;
}

bool quiet = false, use_display = true;
if (cmdline.toBool("scan"))
{
quiet = true;
use_display = false;
}

CleanupGuard callCleanup(cleanup);

#ifdef Q_WS_MACX
Expand All @@ -266,13 +272,6 @@ int main(int argc, char *argv[])
if (cmdline.toBool("geometry"))
geometry = cmdline.toString("geometry");

bool quiet = false;
if (cmdline.toBool("scan"))
{
quiet = true;
use_display = false;
}

int retval;
QString mask("general");
if ((retval = cmdline.ConfigureLogging(mask, quiet)) != GENERIC_EXIT_OK)
Expand Down

0 comments on commit 3a75bdf

Please sign in to comment.