forked from pool/musescore
- Add no-webview-in-startcentre.patch to prevent that webview is
used in startcentre (boo#1181604) OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/musescore?expand=0&rev=92
This commit is contained in:
parent
56c053549b
commit
097af08b1d
@ -1,7 +1,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Comment=WYSIWYG Music score typesetter
|
Comment=WYSIWYG Music score typesetter
|
||||||
Comment[de]=WYSIWYG Noteneditor
|
Comment[de]=WYSIWYG Noteneditor
|
||||||
Exec=mscore
|
Exec=mscore -w
|
||||||
GenericName=mscore
|
GenericName=mscore
|
||||||
Icon=mscore
|
Icon=mscore
|
||||||
Name=MuseScore
|
Name=MuseScore
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Apr 24 12:43:24 UTC 2021 - Cor Blom <cornelis@solcon.nl>
|
||||||
|
|
||||||
|
- Add no-webview-in-startcentre.patch to prevent that webview is
|
||||||
|
used in startcentre (boo#1181604)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Feb 9 14:06:26 UTC 2021 - Fabian Vogt <fabian@ritter-vogt.de>
|
Tue Feb 9 14:06:26 UTC 2021 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ Source1: %{rname}.desktop
|
|||||||
Patch0: use-qtmake-qt5.patch
|
Patch0: use-qtmake-qt5.patch
|
||||||
# PATCH-FIX-OPENSUSE: don't install qtwebengine files, they are not needed
|
# PATCH-FIX-OPENSUSE: don't install qtwebengine files, they are not needed
|
||||||
Patch1: use-system-qtwebengine-files.patch
|
Patch1: use-system-qtwebengine-files.patch
|
||||||
|
# PATCH-FIX-OPENSUSE: don't use webview in startcentre (boo#1181604)
|
||||||
|
Patch2: no-webview-in-startcentre.patch
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -127,6 +129,7 @@ mv -f tmpfile thirdparty/portmidi/README.txt
|
|||||||
-DMUSESCORE_BUILD_CONFIG=release \
|
-DMUSESCORE_BUILD_CONFIG=release \
|
||||||
-DUSE_SYSTEM_FREETYPE="ON" \
|
-DUSE_SYSTEM_FREETYPE="ON" \
|
||||||
-DBUILD_WEBENGINE="ON" \
|
-DBUILD_WEBENGINE="ON" \
|
||||||
|
-DBUILD_TELEMETRY_MODULE=OFF \
|
||||||
-DMUSESCORE_REVISION=%{revision}
|
-DMUSESCORE_REVISION=%{revision}
|
||||||
%make_jobs lrelease all
|
%make_jobs lrelease all
|
||||||
|
|
||||||
|
176
no-webview-in-startcentre.patch
Normal file
176
no-webview-in-startcentre.patch
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
diff -ur a/mscore/startcenter.cpp b/mscore/startcenter.cpp
|
||||||
|
--- a/mscore/startcenter.cpp 2021-02-08 13:16:37.000000000 +0100
|
||||||
|
+++ b/mscore/startcenter.cpp 2021-04-24 14:18:23.888027687 +0200
|
||||||
|
@@ -58,43 +58,6 @@
|
||||||
|
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
|
setStyleSheet(QString("QPushButton { background-color: %1 }").arg(openScore->palette().color(QPalette::Base).name()));
|
||||||
|
|
||||||
|
-#ifdef USE_WEBENGINE
|
||||||
|
- if (!noWebView) {
|
||||||
|
-#if defined(WIN_PORTABLE)
|
||||||
|
- QWebEngineProfile* defaultProfile = QWebEngineProfile::defaultProfile();
|
||||||
|
- defaultProfile->setCachePath(QDir::cleanPath(QString("%1/../../../Data/settings/QWebEngine").arg(QCoreApplication::applicationDirPath())));
|
||||||
|
- defaultProfile->setPersistentStoragePath(QDir::cleanPath(QString("%1/../../../Data/settings/QWebEngine").arg(QCoreApplication::applicationDirPath())));
|
||||||
|
-#endif
|
||||||
|
- _webView = new MyWebView(this);
|
||||||
|
- _webView->setMaximumWidth(200);
|
||||||
|
-
|
||||||
|
- MyWebEnginePage* page = new MyWebEnginePage(this);
|
||||||
|
- MyWebUrlRequestInterceptor* wuri = new MyWebUrlRequestInterceptor(page);
|
||||||
|
- QWebEngineProfile* profile = page->profile();
|
||||||
|
-#if defined(WIN_PORTABLE)
|
||||||
|
- profile->setCachePath(QDir::cleanPath(QString("%1/../../../Data/settings/QWebEngine").arg(QCoreApplication::applicationDirPath())));
|
||||||
|
- profile->setPersistentStoragePath(QDir::cleanPath(QString("%1/../../../Data/settings/QWebEngine").arg(QCoreApplication::applicationDirPath())));
|
||||||
|
-#endif
|
||||||
|
- profile->setRequestInterceptor(wuri);
|
||||||
|
- _webView->setPage(page);
|
||||||
|
-
|
||||||
|
- auto extendedVer = QString(VERSION) + "." + QString(BUILD_NUMBER);
|
||||||
|
- QUrl connectPageUrl = QUrl(QString("https://connect2.musescore.com/?version=%1").arg(extendedVer));
|
||||||
|
- _webView->setUrl(connectPageUrl);
|
||||||
|
-
|
||||||
|
- horizontalLayout->addWidget(_webView);
|
||||||
|
-
|
||||||
|
- //workaround for the crashes sometimes happening in Chromium on macOS with Qt 5.12
|
||||||
|
- connect(_webView, &QWebEngineView::renderProcessTerminated, this, [this, profile, connectPageUrl](QWebEnginePage::RenderProcessTerminationStatus terminationStatus, int exitCode)
|
||||||
|
- {
|
||||||
|
- qDebug() << "Login page loading terminated" << terminationStatus << " " << exitCode;
|
||||||
|
- profile->clearHttpCache();
|
||||||
|
- _webView->load(connectPageUrl);
|
||||||
|
- _webView->show();
|
||||||
|
- });
|
||||||
|
- }
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
// if (enableExperimental)
|
||||||
|
// right now don’t know how it use in WebEngine @handrok
|
||||||
|
// QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
|
||||||
|
@@ -217,62 +180,5 @@
|
||||||
|
AbstractDialog::keyReleaseEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
-#ifdef USE_WEBENGINE
|
||||||
|
-
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-// MyWebView
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-
|
||||||
|
-MyWebView::MyWebView(QWidget *parent):
|
||||||
|
- QWebEngineView(parent)
|
||||||
|
- {
|
||||||
|
- if (!enableExperimental)
|
||||||
|
- setContextMenuPolicy(Qt::NoContextMenu);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-// ~MyWebView
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-
|
||||||
|
-MyWebView::~MyWebView()
|
||||||
|
- {
|
||||||
|
- disconnect(this, SIGNAL(loadFinished(bool)), this, SLOT(stopBusy(bool)));
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-// sizeHint
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-
|
||||||
|
-QSize MyWebView::sizeHint() const
|
||||||
|
- {
|
||||||
|
- return QSize(200 , 600);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-bool MyWebEnginePage::acceptNavigationRequest(const QUrl & url, QWebEnginePage::NavigationType type, bool isMainFrame)
|
||||||
|
- {
|
||||||
|
- qDebug() << "acceptNavigationRequest(" << url << "," << type << "," << isMainFrame << ")";
|
||||||
|
-
|
||||||
|
- if (type == QWebEnginePage::NavigationTypeLinkClicked)
|
||||||
|
- {
|
||||||
|
- QString path(url.path());
|
||||||
|
- QFileInfo fi(path);
|
||||||
|
- if (fi.suffix() == "mscz" || fi.suffix() == "xml"
|
||||||
|
- || fi.suffix() == "musicxml" || fi.suffix() == "mxl") {
|
||||||
|
- mscore->loadFile(url);
|
||||||
|
- QAction* a = getAction("startcenter");
|
||||||
|
- a->setChecked(false);
|
||||||
|
- mscore->showStartcenter(false);
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- QDesktopServices::openUrl(url);
|
||||||
|
-
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-#endif //USE_WEBENGINE
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -ur a/mscore/startcenter.h b/mscore/startcenter.h
|
||||||
|
--- a/mscore/startcenter.h 2021-02-08 13:16:37.000000000 +0100
|
||||||
|
+++ b/mscore/startcenter.h 2021-04-24 14:19:16.684029679 +0200
|
||||||
|
@@ -19,62 +19,12 @@
|
||||||
|
|
||||||
|
namespace Ms {
|
||||||
|
|
||||||
|
-#ifdef USE_WEBENGINE
|
||||||
|
-
|
||||||
|
-class MyWebUrlRequestInterceptor : public QWebEngineUrlRequestInterceptor {
|
||||||
|
- Q_OBJECT
|
||||||
|
-
|
||||||
|
- public:
|
||||||
|
- MyWebUrlRequestInterceptor(QObject* p = Q_NULLPTR)
|
||||||
|
- : QWebEngineUrlRequestInterceptor(p) {}
|
||||||
|
-
|
||||||
|
- void interceptRequest(QWebEngineUrlRequestInfo& info)
|
||||||
|
- {
|
||||||
|
- info.setHttpHeader("Accept-Language",
|
||||||
|
- QString("%1;q=0.8,en-US;q=0.6,en;q=0.4").arg(mscore->getLocaleISOCode()).toUtf8());
|
||||||
|
- }
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-// MyWebEnginePage
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-
|
||||||
|
-class MyWebEnginePage : public QWebEnginePage {
|
||||||
|
- Q_OBJECT
|
||||||
|
-
|
||||||
|
- public:
|
||||||
|
- MyWebEnginePage(QObject* parent = Q_NULLPTR)
|
||||||
|
- : QWebEnginePage(parent) {}
|
||||||
|
-
|
||||||
|
- bool acceptNavigationRequest(const QUrl& url, QWebEnginePage::NavigationType type, bool isMainFrame);
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-// MyWebEngineView
|
||||||
|
-//---------------------------------------------------------
|
||||||
|
-
|
||||||
|
-class MyWebView : public QWebEngineView {
|
||||||
|
- Q_OBJECT
|
||||||
|
-
|
||||||
|
- public slots:
|
||||||
|
-
|
||||||
|
- public:
|
||||||
|
- MyWebView(QWidget* parent = 0);
|
||||||
|
- ~MyWebView();
|
||||||
|
- virtual QSize sizeHint() const;
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
-#endif //USE_WEBENGINE
|
||||||
|
-
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// Startcenter
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
class Startcenter : public AbstractDialog, public Ui::Startcenter {
|
||||||
|
Q_OBJECT
|
||||||
|
-#ifdef USE_WEBENGINE
|
||||||
|
- MyWebView* _webView;
|
||||||
|
-#endif
|
||||||
|
virtual void closeEvent(QCloseEvent*);
|
||||||
|
|
||||||
|
private slots:
|
Loading…
Reference in New Issue
Block a user