[med-svn] [sleepyhead] 01/08: Fix compiling against Qt 5.8
Sergio Durigan Junior
sergiodj-guest at moszumanska.debian.org
Mon Aug 21 05:33:00 UTC 2017
This is an automated email from the git hooks/post-receive script.
sergiodj-guest pushed a commit to branch master
in repository sleepyhead.
commit 19741bf5bf3d3c83d7cf556f8024be685708965a
Author: Sergio Durigan Junior <sergiodj at sergiodj.net>
Date: Mon Aug 21 01:03:23 2017 -0400
Fix compiling against Qt 5.8
Qt 5.8 introduced a new overload to QStringRef::compare that now causes
many ambiguities and the compile to fail. The fix is to wrap strings
being compared with QLatin1String to remove the ambiguity.
Closes: #872538
Thanks: Kevin Lewis (<https://gitlab.com/kll>) for the patch.
---
.../0004-Fix-compiling-against-Qt-5.8.patch | 111 +++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 112 insertions(+)
diff --git a/debian/patches/0004-Fix-compiling-against-Qt-5.8.patch b/debian/patches/0004-Fix-compiling-against-Qt-5.8.patch
new file mode 100644
index 0000000..fe42199
--- /dev/null
+++ b/debian/patches/0004-Fix-compiling-against-Qt-5.8.patch
@@ -0,0 +1,111 @@
+From: Sergio Durigan Junior <sergiodj at sergiodj.net>
+Date: Mon, 21 Aug 2017 01:01:59 -0400
+Subject: Fix compiling against Qt 5.8
+
+>From <https://gitlab.com/sleepyhead/sleepyhead-code/merge_requests/3>:
+
+ Qt 5.8 introduced a new overload to QStringRef::compare that now causes
+ many ambiguities and the compile to fail. I wrapped the strings being
+ compared with QLatin1String to remove the ambiguity. The specific
+ overload being used was added in Qt 4.8 so it will not break the build
+ when using Qt 5.5 mentioned in the readme.
+
+Thanks to Kevin Lewis (<https://gitlab.com/kll>) for the patch.
+---
+ sleepyhead/updateparser.cpp | 42 +++++++++++++++++++++---------------------
+ 1 file changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/sleepyhead/updateparser.cpp b/sleepyhead/updateparser.cpp
+index 4b00294..42fad33 100644
+--- a/sleepyhead/updateparser.cpp
++++ b/sleepyhead/updateparser.cpp
+@@ -250,7 +250,7 @@ void UpdatesParser::readUpdates()
+ Q_ASSERT(xml.isStartElement() && xml.name() == "Updates");
+
+ while (xml.readNextStartElement()) {
+- if (xml.name().compare("PackageUpdate",Qt::CaseInsensitive)==0) {
++ if (xml.name().compare(QLatin1String("PackageUpdate"),Qt::CaseInsensitive)==0) {
+ readPackageUpdate();
+ } else {
+ qDebug() << "Skipping Updates.xml tag" << xml.name();
+@@ -262,52 +262,52 @@ void UpdatesParser::readUpdates()
+
+ void UpdatesParser::readPackageUpdate()
+ {
+- Q_ASSERT(xml.isStartElement() && (xml.name().compare("PackageUpdate",Qt::CaseInsensitive)==0));
++ Q_ASSERT(xml.isStartElement() && (xml.name().compare(QLatin1String("PackageUpdate"),Qt::CaseInsensitive)==0));
+ package = PackageUpdate();
+
+ while (xml.readNextStartElement()) {
+- if (xml.name().compare("Name",Qt::CaseInsensitive)==0) {
++ if (xml.name().compare(QLatin1String("Name"),Qt::CaseInsensitive)==0) {
+ package.name = xml.readElementText().toLower();
+- } else if (xml.name().compare("DisplayName",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("DisplayName"),Qt::CaseInsensitive)==0) {
+ package.displayName = xml.readElementText();
+- } else if (xml.name().compare("Description",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("Description"),Qt::CaseInsensitive)==0) {
+ package.description = xml.readElementText();
+- } else if (xml.name().compare("Version",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("Version"),Qt::CaseInsensitive)==0) {
+ package.versionString = xml.readElementText();
+- } else if (xml.name().compare("ReleaseDate",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("ReleaseDate"),Qt::CaseInsensitive)==0) {
+ package.releaseDate = QDate().fromString(xml.readElementText(), "yyyy-MM-dd");
+- } else if (xml.name().compare("Default",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("Default"),Qt::CaseInsensitive)==0) {
+ package.defaultInstall = xml.readElementText().compare("true") == 0;
+- } else if (xml.name().compare("ForcedInstallation",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("ForcedInstallation"),Qt::CaseInsensitive)==0) {
+ package.forcedInstall = xml.readElementText().compare("true") == 0;
+- } else if (xml.name().compare("Script",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("Script"),Qt::CaseInsensitive)==0) {
+ package.script = xml.readElementText();
+- } else if (xml.name().compare("Dependencies",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("Dependencies"),Qt::CaseInsensitive)==0) {
+ package.dependencies = xml.readElementText().split(",");
+- } else if (xml.name().compare("UpdateFile",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("UpdateFile"),Qt::CaseInsensitive)==0) {
+ for (int i=0; i<xml.attributes().size(); ++i) {
+ const QXmlStreamAttribute & at = xml.attributes().at(i);
+- if (at.name().compare("CompressedSize", Qt::CaseInsensitive)==0) {
++ if (at.name().compare(QLatin1String("CompressedSize"), Qt::CaseInsensitive)==0) {
+ package.compressedSize = at.value().toLong();
+- } else if (at.name().compare("UncompressedSize",Qt::CaseInsensitive)==0) {
++ } else if (at.name().compare(QLatin1String("UncompressedSize"),Qt::CaseInsensitive)==0) {
+ package.uncompressedSize = at.value().toLong();
+- } else if (at.name().compare("OS",Qt::CaseInsensitive)==0) {
++ } else if (at.name().compare(QLatin1String("OS"),Qt::CaseInsensitive)==0) {
+ package.os = at.value().toString();
+ }
+ }
+ xml.skipCurrentElement();
+- } else if (xml.name().compare("DownloadableArchives")==0) {
++ } else if (xml.name().compare(QLatin1String("DownloadableArchives"))==0) {
+ package.downloadArchives = xml.readElementText().split(",");
+- } else if (xml.name().compare("Licenses",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("Licenses"),Qt::CaseInsensitive)==0) {
+ while (xml.readNextStartElement()) {
+- if (xml.name().compare("License",Qt::CaseInsensitive)==0) {
++ if (xml.name().compare(QLatin1String("License"),Qt::CaseInsensitive)==0) {
+ QString name;
+ QString file;
+ for (int i=0; i<xml.attributes().size(); ++i) {
+ const QXmlStreamAttribute & at = xml.attributes().at(i);
+- if (at.name().compare("name", Qt::CaseInsensitive)==0) {
++ if (at.name().compare(QLatin1String("name"), Qt::CaseInsensitive)==0) {
+ name = at.value().toString();
+- } else if (at.name().compare("file",Qt::CaseInsensitive)==0) {
++ } else if (at.name().compare(QLatin1String("file"),Qt::CaseInsensitive)==0) {
+ file = at.value().toString();
+ }
+ }
+@@ -319,7 +319,7 @@ void UpdatesParser::readPackageUpdate()
+ xml.skipCurrentElement();
+ }
+ }
+- } else if (xml.name().compare("SHA1",Qt::CaseInsensitive)==0) {
++ } else if (xml.name().compare(QLatin1String("SHA1"),Qt::CaseInsensitive)==0) {
+ package.sha1 = xml.readElementText();
+ } else {
+ qDebug() << "UP Skipping Updates.xml tag" << xml.name();
diff --git a/debian/patches/series b/debian/patches/series
index ba21df5..c768a90 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
0001-Do-not-use-bundled-libraries.patch
0002-Create-install-rule-on-Makefile.patch
0003-Adapt-source-code-to-generate-reproducible-builds.patch
+0004-Fix-compiling-against-Qt-5.8.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/sleepyhead.git
More information about the debian-med-commit
mailing list