Permalink
Browse files

Rename noPrompt variable noAutodetect to reflect it's actual meaning …

…and fix one incorrect assumption made because of the old name.
  • Loading branch information...
1 parent 47fb47c commit fe25cc5425ff37c65ce39193f2aba6db1b75619e @daniel-kristjansson daniel-kristjansson committed Apr 27, 2012
Showing with 6 additions and 9 deletions.
  1. +6 −9 mythtv/libs/libmyth/mythcontext.cpp
View
15 mythtv/libs/libmyth/mythcontext.cpp
@@ -327,10 +327,10 @@ bool MythContextPrivate::Init(const bool gui,
* Despite its name, the disable argument currently only disables the chooser.
* If set, autoconfigure will still be attempted in some situations.
*/
-bool MythContextPrivate::FindDatabase(const bool prompt, const bool noPrompt)
+bool MythContextPrivate::FindDatabase(bool prompt, bool noAutodetect)
{
- // The two bool. args actually form a Yes/Maybe/No (A tristate bool :-)
- bool manualSelect = prompt && !noPrompt;
+ // We can only prompt if autodiscovery is enabled..
+ bool manualSelect = prompt && !noAutodetect;
QString failure;
@@ -377,14 +377,11 @@ bool MythContextPrivate::FindDatabase(const bool prompt, const bool noPrompt)
goto DBfound;
}
- if (count > 1 || count == -1) // Multiple BEs, or needs PIN.
- manualSelect = !noPrompt; // If allowed, prompt user
+ // Multiple BEs, or needs PIN.
+ manualSelect |= (count > 1 || count == -1);
}
- if (!m_gui)
- manualSelect = false; // no interactive command-line chooser yet
-
-
+ manualSelect &= m_gui; // no interactive command-line chooser yet
// Last, get the user to select a backend from a possible list:
if (manualSelect)

0 comments on commit fe25cc5

Please sign in to comment.