Skip to content

Commit

Permalink
MythDisplay: Pass the full command line object to ConfigureQtGUI
Browse files Browse the repository at this point in the history
- allowing us to use other command line args, over and above the display
setting
  • Loading branch information
mark-kendall committed Jan 18, 2021
1 parent 6b3b2d6 commit 373ec9f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions mythtv/libs/libmythui/mythdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ void MythDisplay::DebugModes() const
* \note This function must be called before Qt/QPA is initialised i.e. before
* any call to QApplication.
*/
void MythDisplay::ConfigureQtGUI(int SwapInterval, const QString& _Display)
void MythDisplay::ConfigureQtGUI(int SwapInterval, const MythCommandLineParser& CmdLine)
{
#ifdef USING_QTWEBENGINE
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
Expand Down Expand Up @@ -1098,8 +1098,9 @@ void MythDisplay::ConfigureQtGUI(int SwapInterval, const QString& _Display)
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);

#ifdef USING_X11
MythXDisplay::SetQtX11Display(_Display);
if (auto display = CmdLine.toString("display"); !display.isEmpty())
MythXDisplay::SetQtX11Display(display);
#else
(void)_Display;
(void)CmdLine;
#endif
}
3 changes: 2 additions & 1 deletion mythtv/libs/libmythui/mythdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "referencecounter.h"
#include "mythdisplaymode.h"
#include "mythedid.h"
#include "mythcommandlineparser.h"

// Std
#include <cmath>
Expand All @@ -27,7 +28,7 @@ class MUI_PUBLIC MythDisplay : public QObject, public ReferenceCounter
virtual bool IsPlanar () { return false; }
virtual const MythDisplayModes& GetVideoModes();

static void ConfigureQtGUI (int SwapInterval = 1, const QString& Display = QString());
static void ConfigureQtGUI (int SwapInterval, const MythCommandLineParser& CmdLine);
static bool SpanAllScreens ();
static QString GetExtraScreenInfo (QScreen *qScreen);
QStringList GetDescription ();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythavtest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int main(int argc, char *argv[])
swapinterval = 0;
}

MythDisplay::ConfigureQtGUI(swapinterval, cmdline.toString("display"));
MythDisplay::ConfigureQtGUI(swapinterval, cmdline);

QApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHAVTEST);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ int main(int argc, char **argv)
return GENERIC_EXIT_OK;
}

MythDisplay::ConfigureQtGUI(1, cmdline.toString("display"));
MythDisplay::ConfigureQtGUI(1, cmdline);
QApplication::setSetuidAllowed(true);
QApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHFRONTEND);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythscreenwizard/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argc, char **argv)
return GENERIC_EXIT_OK;
}

MythDisplay::ConfigureQtGUI(1, cmdline.toString("display"));
MythDisplay::ConfigureQtGUI(1, cmdline);
QApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHSCREENWIZARD);

Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtv-setup/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ int main(int argc, char *argv[])

if (use_display)
{
MythDisplay::ConfigureQtGUI(1, cmdline.toString("display"));
MythDisplay::ConfigureQtGUI(1, cmdline);
app = std::make_unique<QApplication>(argc, argv);
}
else
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythwelcome/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(int argc, char **argv)
return GENERIC_EXIT_OK;
}

MythDisplay::ConfigureQtGUI(1, cmdline.toString("display"));
MythDisplay::ConfigureQtGUI(1, cmdline);
QApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHWELCOME);

Expand Down

0 comments on commit 373ec9f

Please sign in to comment.