File 0001-add-opensuse-customizations.patch of Package QMPlay2
From: Simon Vogl <simon.vogl@gmx.net>
Date: Tue, 7 Dec 2021 21:41:49 UTC
Subject: [PATCH] Fix broken python detection of QMPlay2 when it tries to launch youtube-dl
This patch is required to prevent QMPlay2 from always preferring python2 over python3 which can lead to crashes in certain cases.
It also adds openSUSE branding to the about screen.
--- a/src/qmplay2/YouTubeDL.cpp
+++ b/src/qmplay2/YouTubeDL.cpp
@@ -434,22 +434,9 @@
QString program = m_ytDlPath;
#ifndef Q_OS_WIN
- QFile ytDlFile(program);
- if (ytDlFile.open(QFile::ReadOnly))
- {
- const auto shebang = ytDlFile.readLine(99).trimmed();
- const int idx = shebang.lastIndexOf("python");
- if (shebang.startsWith("#!") && idx > -1)
- {
- const auto pythonCmd = shebang.mid(idx);
- if (QStandardPaths::findExecutable(pythonCmd).endsWith(pythonCmd))
- {
- args.prepend(program);
- program = pythonCmd;
- }
- }
- ytDlFile.close();
- }
+ //Enforce execution command as "python3", disable automatic detection
+ args.prepend(program);
+ program = "python3";
#endif
m_process.start(program, args);
--- a/src/gui/AboutWidget.cpp
+++ b/src/gui/AboutWidget.cpp
@@ -43,6 +43,7 @@
labelText += "<b>QMPlay2:</b> " + tr("video and audio player");
labelText += "<br/><b>" + tr("Programmer") + ":</b> <a href='mailto:spaz16@wp.pl'>Błażej Szczygieł</a>";
labelText += "<br/><b>" + tr("Version") + ":</b> " + QMPlay2Core.getSettings().getString("Version") + " (" + QSysInfo::buildCpuArchitecture() + ")";
+ labelText += "<br/><b>This release was supplied by SUSE/openSUSE.</b>";
QLabel *label = new QLabel(labelText);
QLabel *iconL = new QLabel;