Skip to content

Commit

Permalink
revert changes needed prior to beta 3
Browse files Browse the repository at this point in the history
plus a workaround for QTBUG-83282 in Qt 5.15.0 beta 3
And clarifying some earlier changes
  • Loading branch information
Jojo-Schmitz committed Apr 11, 2020
1 parent 0d413cd commit 8dc3e9f
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 45 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -84,6 +84,7 @@ SET(QT_MIN_VERSION "5.7.0")
endif (SCRIPT_INTERFACE)
# Include modules
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build" ${CMAKE_MODULE_PATH})
SET(QT5_STRICT_PLUGIN_GLOB TRUE) # workaround for QTBUG-83282
include (FindQt5)
include (UsePkgConfig1) # Defines MACRO(PKGCONFIG1 _package _minVersion _include_DIR _link_DIR _link_FLAGS _cflags)
include (FindPulseAudio)
Expand Down
2 changes: 1 addition & 1 deletion importexport/guitarpro/importgtp-gp6.cpp
Expand Up @@ -2318,7 +2318,7 @@ void GuitarPro6::readMasterBars(GPPartInfo* partInfo)
currentFermata = currentFermata.nextSibling();

// get the fermata information and construct a gpFermata from them
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList fermataComponents = fermata.split("/", Qt::SkipEmptyParts);
#else
QStringList fermataComponents = fermata.split("/", QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion importexport/guitarpro/importgtp.cpp
Expand Up @@ -738,7 +738,7 @@ void GuitarPro::readLyrics()
QString lyrics = readWordPascalString();
lyrics.replace(QRegExp("\n"), " ");
lyrics.replace(QRegExp("\r"), " ");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
auto sl = lyrics.split(" ", Qt::KeepEmptyParts);
//gpLyrics.lyrics = lyrics.split(" ", Qt::KeepEmptyParts);
#else
Expand Down
2 changes: 1 addition & 1 deletion importexport/musedata/musedata.cpp
Expand Up @@ -48,7 +48,7 @@ namespace Ms {

void MuseData::musicalAttribute(QString s, Part* part)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList al = s.mid(3).split(" ", Qt::SkipEmptyParts);
#else
QStringList al = s.mid(3).split(" ", QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion importexport/musicxml/importmxmlpass2.cpp
Expand Up @@ -3279,7 +3279,7 @@ void MusicXMLParserPass2::doEnding(const QString& partId, Measure* measure,
else if (type.isEmpty())
_logger->logError("empty ending type", &_e);
else {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = number.split(",", Qt::SkipEmptyParts);
#else
QStringList sl = number.split(",", QString::SkipEmptyParts);
Expand Down
4 changes: 2 additions & 2 deletions importexport/ove/ove.cpp
Expand Up @@ -3029,7 +3029,7 @@ QString NumericEnding::getText() const {

QList<int> NumericEnding::getNumbers() const {
int i;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList strs = text_.split(",", Qt::SkipEmptyParts);
#else
QStringList strs = text_.split(",", QString::SkipEmptyParts);
Expand Down Expand Up @@ -7282,7 +7282,7 @@ void LyricChunkParse::processLyricInfo(const LyricInfo& info) {
bool changeMeasure = true;
MeasureData* measureData = 0;
int trackMeasureCount = ove_->getTrackBarCount();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList words = info.lyric_.split(" ", Qt::SkipEmptyParts);
#else
QStringList words = info.lyric_.split(" ", QString::SkipEmptyParts);
Expand Down
6 changes: 3 additions & 3 deletions libmscore/chordlist.cpp
Expand Up @@ -30,7 +30,7 @@ HChord::HChord(const QString& str)
{ "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B" }
};
keys = 0;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = str.split(" ", Qt::SkipEmptyParts);
#else
QStringList sl = str.split(" ", QString::SkipEmptyParts);
Expand Down Expand Up @@ -298,14 +298,14 @@ void HChord::add(const QList<HDegree>& degreeList)
static void readRenderList(QString val, QList<RenderAction>& renderList)
{
renderList.clear();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = val.split(" ", Qt::SkipEmptyParts);
#else
QStringList sl = val.split(" ", QString::SkipEmptyParts);
#endif
for (const QString& s : sl) {
if (s.startsWith("m:")) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList ssl = s.split(":", Qt::SkipEmptyParts);
#else
QStringList ssl = s.split(":", QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion libmscore/figuredbass.cpp
Expand Up @@ -1312,7 +1312,7 @@ void FiguredBass::endEdit(EditData& ed)
return;

// split text into lines and create an item for each line
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList list = txt.split("\n", Qt::SkipEmptyParts);
#else
QStringList list = txt.split('\n', QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion libmscore/harmony.cpp
Expand Up @@ -1954,7 +1954,7 @@ QString Harmony::screenReaderInfo() const
aux = aux.replace("#", QObject::tr("♯")).replace("<", "");
QString extension = "";

#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
for (QString s : aux.split(">", Qt::SkipEmptyParts)) {
#else
for (QString s : aux.split(">", QString::SkipEmptyParts)) {
Expand Down
2 changes: 1 addition & 1 deletion libmscore/lyrics.cpp
Expand Up @@ -381,7 +381,7 @@ void Lyrics::paste(EditData& ed)
#endif
QString txt = QApplication::clipboard()->text(mode);
QString regex = QString("[^\\S") + QChar(0xa0) + QChar(0x202F) + "]+";
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = txt.split(QRegExp(regex), Qt::SkipEmptyParts);
#else
QStringList sl = txt.split(QRegExp(regex), QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion libmscore/read114.cpp
Expand Up @@ -1215,7 +1215,7 @@ static void readVolta114(XmlReader& e, Volta* volta)
const QStringRef& tag(e.name());
if (tag == "endings") {
QString s = e.readElementText();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = s.split(",", Qt::SkipEmptyParts);
#else
QStringList sl = s.split(",", QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion libmscore/read206.cpp
Expand Up @@ -2369,7 +2369,7 @@ static void readVolta206(XmlReader& e, Volta* volta)
const QStringRef& tag(e.name());
if (tag == "endings") {
QString s = e.readElementText();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = s.split(",", Qt::SkipEmptyParts);
#else
QStringList sl = s.split(",", QString::SkipEmptyParts);
Expand Down
2 changes: 1 addition & 1 deletion libmscore/volta.cpp
Expand Up @@ -131,7 +131,7 @@ void Volta::read(XmlReader& e)
const QStringRef& tag(e.name());
if (tag == "endings") {
QString s = e.readElementText();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = s.split(",", Qt::SkipEmptyParts);
#else
QStringList sl = s.split(",", QString::SkipEmptyParts);
Expand Down
5 changes: 0 additions & 5 deletions mscore/editstyle.cpp
Expand Up @@ -628,13 +628,8 @@ EditStyle::EditStyle(Score* s, QWidget* parent)

resetTextStyleFrameType->setIcon(*icons[int(Icons::reset_ICON)]);
connect(resetTextStyleFrameType, &QToolButton::clicked, [=](){ resetTextStyle(Pid::FRAME_TYPE); });
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //???
connect(textStyleFrameType, QOverload<int, const QString&>::of(&QComboBox::currentIndexChanged),
[=](){ textStyleValueChanged(Pid::FRAME_TYPE, textStyleFrameType->currentIndex()); }
#else
connect(textStyleFrameType, QOverload<int>::of(&QComboBox::currentIndexChanged),
[=](){ textStyleValueChanged(Pid::FRAME_TYPE, textStyleFrameType->currentIndex()); }
#endif
);

resetTextStyleFramePadding->setIcon(*icons[int(Icons::reset_ICON)]);
Expand Down
8 changes: 2 additions & 6 deletions mscore/inspector/inspectorBase.cpp
Expand Up @@ -126,7 +126,7 @@ QVariant InspectorBase::getValue(const InspectorItem& ii) const
v = QVariant::fromValue<Direction>(Direction(v.toInt()));
break;
case P_TYPE::INT_LIST: {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList sl = v.toString().split(",", Qt::SkipEmptyParts);
#else
QStringList sl = v.toString().split(",", QString::SkipEmptyParts);
Expand Down Expand Up @@ -600,11 +600,7 @@ void InspectorBase::mapSignals(const std::vector<InspectorItem>& il, const std::
else if (qobject_cast<QFontComboBox*>(w))
connect(qobject_cast<QFontComboBox*>(w), QOverload<const QFont&>::of(&QFontComboBox::currentFontChanged), [=] { valueChanged(i); });
else if (qobject_cast<QComboBox*>(w))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //???
connect(qobject_cast<QComboBox*>(w), QOverload<int, const QString&>::of(&QComboBox::currentIndexChanged), [=] { valueChanged(i); });
#else
connect(qobject_cast<QComboBox*>(w), QOverload<int>::of(&QComboBox::currentIndexChanged), [=] { valueChanged(i); });
#endif
connect(qobject_cast<QComboBox*>(w), QOverload<int>::of(&QComboBox::currentIndexChanged), [=] { valueChanged(i); });
else if (qobject_cast<QCheckBox*>(w))
connect(qobject_cast<QCheckBox*>(w), QOverload<bool>::of(&QCheckBox::toggled), [=] { valueChanged(i); });
else if (qobject_cast<Awl::ColorLabel*>(w))
Expand Down
3 changes: 1 addition & 2 deletions mscore/musescore.cpp
Expand Up @@ -170,8 +170,7 @@ extern Ms::Synthesizer* createZerberus();
#include "telemetrymanager.h"

#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //???
#define endl Qt::endl
//#define error() networkError()
# define endl Qt::endl
#endif

namespace Ms {
Expand Down
3 changes: 0 additions & 3 deletions mscore/network/loginmanager.cpp
Expand Up @@ -23,9 +23,6 @@
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#define qrand() QRandomGenerator::global()->generate()
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //???
//#define error() networkError()
#endif

namespace Ms {

Expand Down
9 changes: 0 additions & 9 deletions mscore/scorecmp/scorecmp.cpp
Expand Up @@ -35,21 +35,12 @@ ScoreComparisonTool::ScoreComparisonTool(QWidget* parent)
_mode = Mode::INTELLIGENT;
_ui->intelligentModeRadioButton->setChecked(true);
_ui->diffWidget->setCurrentWidget(_ui->pageIntelligentDiff);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //???
connect(
_ui->score1ComboBox, QOverload<int, const QString&>::of(&QComboBox::currentIndexChanged),
this, &ScoreComparisonTool::selectedVersionsChanged);
connect(
_ui->score2ComboBox, QOverload<int, const QString&>::of(&QComboBox::currentIndexChanged),
this, &ScoreComparisonTool::selectedVersionsChanged);
#else
connect(
_ui->score1ComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ScoreComparisonTool::selectedVersionsChanged);
connect(
_ui->score2ComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ScoreComparisonTool::selectedVersionsChanged);
#endif
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion mscore/shortcut.cpp
Expand Up @@ -4476,7 +4476,7 @@ QKeySequence Shortcut::keySeqFromString(const QString& str, QKeySequence::Sequen
for (i = 0; i < KEYSEQ_SIZE; ++i)
code[i] = 0;

#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //??
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList strList = str.split(QRegularExpression("(?<!\\\\),|(?<=\\\\\\\\),"), Qt::SkipEmptyParts);
#else
QStringList strList = str.split(QRegularExpression("(?<!\\\\),|(?<=\\\\\\\\),"), QString::SkipEmptyParts);
Expand Down
4 changes: 0 additions & 4 deletions mscore/updatechecker.cpp
Expand Up @@ -54,11 +54,7 @@ UpdateChecker::UpdateChecker(QObject* parent)

void UpdateChecker::onRequestFinished(QNetworkReply* reply)
{
//#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) //???
// if (reply->networkError() != QNetworkReply::NoError) {
//#else
if (reply->error() != QNetworkReply::NoError) {
//#endif
qDebug("Error while checking update [%s]", reply->errorString().toLatin1().constData());
return;
}
Expand Down

0 comments on commit 8dc3e9f

Please sign in to comment.