diff options
author | Miroslav Šulc <fordfrog@gentoo.org> | 2020-01-04 15:58:14 +0100 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2020-01-04 15:58:31 +0100 |
commit | cbcd81d0463012d030b33ed6adc50ec87e5f0c03 (patch) | |
tree | 06c11e25fa4559bc8e7d1f32c26b8dd6e7ecdbf3 /media-sound/musescore/files | |
parent | sci-libs/indilib: 1.8.3 version bump (diff) | |
download | gentoo-cbcd81d0463012d030b33ed6adc50ec87e5f0c03.tar.gz gentoo-cbcd81d0463012d030b33ed6adc50ec87e5f0c03.tar.bz2 gentoo-cbcd81d0463012d030b33ed6adc50ec87e5f0c03.zip |
media-sound/musescore: fixed compilation against qt 5.14
Closes: https://bugs.gentoo.org/703706
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'media-sound/musescore/files')
-rw-r--r-- | media-sound/musescore/files/5583.patch | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/media-sound/musescore/files/5583.patch b/media-sound/musescore/files/5583.patch new file mode 100644 index 000000000000..da4d0c52d041 --- /dev/null +++ b/media-sound/musescore/files/5583.patch @@ -0,0 +1,212 @@ +From 09d138946aad53962ce23298093747f0ce52304f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com> +Date: Tue, 31 Dec 2019 17:39:34 +0100 +Subject: [PATCH 1/2] Specializes template routines. + +Qt 5.14 introduces serialisation/deserialisation for enum classes, +this results in ambiguous templates between qdatastream.h and preferences.h. +we specialize everything to workaround this. +--- + mscore/preferences.h | 41 ++++++++++++++++++++++++++++++++++++----- + 1 file changed, 36 insertions(+), 5 deletions(-) + +diff --git a/mscore/preferences.h b/mscore/preferences.h +index bef3df8536..8c3ac9b0ed 100644 +--- a/mscore/preferences.h ++++ b/mscore/preferences.h +@@ -233,21 +233,52 @@ extern Preferences preferences; + + // Stream operators for enum classes + // enum classes don't play well with QSettings without custom serialization +-template<typename T, typename std::enable_if<std::is_enum<T>::value>::type* = nullptr> +-inline QDataStream &operator<<(QDataStream &out, const T &val) ++inline QDataStream& ++operator<<(QDataStream &out, const Ms::MuseScoreStyleType &val) + { + return out << static_cast<int>(val); + } + +-template<typename T, typename std::enable_if<std::is_enum<T>::value>::type* = nullptr> +-inline QDataStream &operator>>(QDataStream &in, T &val) ++inline QDataStream& ++operator>>(QDataStream &in, Ms::MuseScoreStyleType &val) + { + int tmp; + in >> tmp; +- val = static_cast<T>(tmp); ++ val = static_cast<Ms::MuseScoreStyleType>(tmp); + return in; + } + ++inline QDataStream& ++operator<<(QDataStream &out, const Ms::SessionStart &val) ++{ ++ return out << static_cast<int>(val); ++} ++ ++inline QDataStream& ++operator>>(QDataStream &in, Ms::SessionStart &val) ++{ ++ int tmp; ++ in >> tmp; ++ val = static_cast<Ms::SessionStart>(tmp); ++ return in; ++} ++ ++inline QDataStream& ++operator<<(QDataStream &out, const Ms::MusicxmlExportBreaks &val) ++{ ++ return out << static_cast<int>(val); ++} ++ ++inline QDataStream& ++operator>>(QDataStream &in, Ms::MusicxmlExportBreaks &val) ++{ ++ int tmp; ++ in >> tmp; ++ val = static_cast<Ms::MusicxmlExportBreaks>(tmp); ++ return in; ++} ++ ++ + class PreferenceVisitor { + public: + virtual void visit(QString key, IntPreference*) = 0; + +From 6b759bb5ee7b83fd8a82429e4cdb74279c5d33b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com> +Date: Tue, 31 Dec 2019 17:42:04 +0100 +Subject: [PATCH 2/2] fix warnings: replace QString::null, with QString() + +--- + mscore/capella.cpp | 2 +- + mscore/importmidi/importmidi.cpp | 2 +- + mscore/instrdialog.cpp | 2 +- + mscore/musescore.cpp | 12 ++++++------ + mscore/musescore.h | 2 +- + mscore/network/loginmanager.cpp | 2 +- + 6 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/mscore/capella.cpp b/mscore/capella.cpp +index 7144414e32..6243c8cca6 100644 +--- a/mscore/capella.cpp ++++ b/mscore/capella.cpp +@@ -2708,7 +2708,7 @@ Score::FileError importCapella(MasterScore* score, const QString& name) + QMessageBox::warning(0, + QWidget::tr("Import Capella"), + QWidget::tr("Load failed: %1").arg(cf.error(errNo)), +- QString::null, QWidget::tr("Quit"), QString::null, 0, 1); ++ QString(), QWidget::tr("Quit"), QString(), 0, 1); + } + fp.close(); + // avoid another error message box +diff --git a/mscore/importmidi/importmidi.cpp b/mscore/importmidi/importmidi.cpp +index a5d8894686..8091a83369 100644 +--- a/mscore/importmidi/importmidi.cpp ++++ b/mscore/importmidi/importmidi.cpp +@@ -1200,7 +1200,7 @@ Score::FileError importMidi(MasterScore *score, const QString &name) + QMessageBox::warning(0, + QWidget::tr("Load MIDI"), + QWidget::tr("Load failed: %1").arg(errorText), +- QString::null, QWidget::tr("Quit"), QString::null, 0, 1); ++ QString(), QWidget::tr("Quit"), QString(), 0, 1); + } + fp.close(); + qDebug("importMidi: bad file format"); +diff --git a/mscore/instrdialog.cpp b/mscore/instrdialog.cpp +index fa7bacd622..8d81fe9e20 100644 +--- a/mscore/instrdialog.cpp ++++ b/mscore/instrdialog.cpp +@@ -138,7 +138,7 @@ void InstrumentsDialog::on_loadButton_clicked() + QMessageBox::warning(0, + QWidget::tr("Load Style Failed"), + QString(strerror(errno)), +- QString::null, QWidget::tr("Quit"), QString::null, 0, 1); ++ QString(), QWidget::tr("Quit"), QString(), 0, 1); + return; + } + instrumentsWidget->buildTemplateList(); +diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp +index dd4a4b95ca..07cb596abe 100644 +--- a/mscore/musescore.cpp ++++ b/mscore/musescore.cpp +@@ -4013,7 +4013,7 @@ bool MuseScore::readLanguages(const QString& path) + QMessageBox::warning(0, + QWidget::tr("Load Languages Failed:"), + error, +- QString::null, QWidget::tr("Quit"), QString::null, 0, 1); ++ QString(), QWidget::tr("Quit"), QString(), 0, 1); + return false; + } + +@@ -6753,7 +6753,7 @@ bool MuseScore::saveMp3(Score* score, const QString& name) + QMessageBox::warning(0, + tr("Encoding Error"), + tr("Unable to open target file for writing"), +- QString::null, QString::null); ++ QString(), QString()); + } + return false; + } +@@ -6792,7 +6792,7 @@ bool MuseScore::saveMp3(Score* score, QIODevice* device, bool& wasCanceled) + QMessageBox::warning(0, + tr("Error Opening LAME library"), + tr("Could not open MP3 encoding library!"), +- QString::null, QString::null); ++ QString(), QString()); + qDebug("Could not open MP3 encoding library!"); + return false; + } +@@ -6804,7 +6804,7 @@ bool MuseScore::saveMp3(Score* score, QIODevice* device, bool& wasCanceled) + QMessageBox::warning(0, + tr("Error Opening LAME library"), + tr("Not a valid or supported MP3 encoding library!"), +- QString::null, QString::null); ++ QString(), QString()); + qDebug("Not a valid or supported MP3 encoding library!"); + return false; + } +@@ -6829,7 +6829,7 @@ bool MuseScore::saveMp3(Score* score, QIODevice* device, bool& wasCanceled) + if (!MScore::noGui) { + QMessageBox::warning(0, tr("Encoding Error"), + tr("Unable to initialize MP3 stream"), +- QString::null, QString::null); ++ QString(), QString()); + } + qDebug("Unable to initialize MP3 stream"); + MScore::sampleRate = oldSampleRate; +@@ -6996,7 +6996,7 @@ bool MuseScore::saveMp3(Score* score, QIODevice* device, bool& wasCanceled) + QMessageBox::warning(0, + tr("Encoding Error"), + tr("Error %1 returned from MP3 encoder").arg(bytes), +- QString::null, QString::null); ++ QString(), QString()); + break; + } + else +diff --git a/mscore/musescore.h b/mscore/musescore.h +index 434072a12f..d8089a345c 100644 +--- a/mscore/musescore.h ++++ b/mscore/musescore.h +@@ -142,7 +142,7 @@ struct LanguageItem { + LanguageItem(const QString k, const QString n) { + key = k; + name = n; +- handbook = QString::null; ++ handbook = QString(); + } + LanguageItem(const QString k, const QString n, const QString h) { + key = k; +diff --git a/mscore/network/loginmanager.cpp b/mscore/network/loginmanager.cpp +index 7bcfd892e0..4abf7e3e4e 100644 +--- a/mscore/network/loginmanager.cpp ++++ b/mscore/network/loginmanager.cpp +@@ -680,7 +680,7 @@ void LoginManager::mediaUploadFinished() + QMessageBox::warning(0, + tr("Upload Error"), + tr("Sorry, MuseScore couldn't upload the audio file. Error %1").arg(e), +- QString::null, QString::null); ++ QString(), QString()); + } + } + |