From f330386a0b9f625a21c38f48b3a02add8993d454 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sun, 21 May 2017 23:03:48 +0200 Subject: Prepare for KDE 5_17.05_02 for Slackware --- kde/patch/gwenview.patch | 4 + kde/patch/gwenview/gwenview-17.04.1_dataloss.patch | 131 +++++++++++++++++++++ kde/patch/kdenlive.patch | 4 + kde/patch/kdenlive/kdenlive_gcc7.patch | 32 +++++ kde/patch/libkleo.patch | 3 + kde/patch/libkleo/libkleo_gcc7.patch | 27 +++++ kdei/kde-l10n/kde-l10n.SlackBuild | 2 +- 7 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 kde/patch/gwenview.patch create mode 100644 kde/patch/gwenview/gwenview-17.04.1_dataloss.patch create mode 100644 kde/patch/kdenlive.patch create mode 100644 kde/patch/kdenlive/kdenlive_gcc7.patch create mode 100644 kde/patch/libkleo.patch create mode 100644 kde/patch/libkleo/libkleo_gcc7.patch diff --git a/kde/patch/gwenview.patch b/kde/patch/gwenview.patch new file mode 100644 index 0000000..8a88dea --- /dev/null +++ b/kde/patch/gwenview.patch @@ -0,0 +1,4 @@ +# Prevent dataloss when importing pictures; +# Will be fixed in 17.04.2: +cat $CWD/patch/gwenview/gwenview-17.04.1_dataloss.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/gwenview/gwenview-17.04.1_dataloss.patch b/kde/patch/gwenview/gwenview-17.04.1_dataloss.patch new file mode 100644 index 0000000..fa93428 --- /dev/null +++ b/kde/patch/gwenview/gwenview-17.04.1_dataloss.patch @@ -0,0 +1,131 @@ +From 6ce5d2f8d82f83c5a3d726ee5807ebaf7a6e3c6c Mon Sep 17 00:00:00 2001 +From: Henrik Fehlauer +Date: Thu, 11 May 2017 22:40:15 +0200 +Subject: Avoid data loss when importing pictures + +Summary: +Fix porting regressions, which left users of Gwenview Importer with: +- failed import (import destination still empty) +- additionally (when choosing "Delete" instead of "Keep" after import): + pictures also removed from import source, with no way to recover + +Correct additional problems remaining after fixing the import failure: +- hang on duplicate filenames +- identically named files with different content are never imported +- error dialog when deleting pictures from import source + +BUG: 379615 + +In detail: + +1st problem (introduced in 017b4fe5dc7f4b6e876cfd7b108dcebbf609ae94): + + Initially, pictures are copied to a temporary folder + (e.g. "foo/.gwenview_importer-IcQqvo/"), before being moved/renamed + to the final destination (e.g. "foo/"), which is determined by + calling "cd .." on the temporary folder. + + However, mistakenly this path contains a superfluous '/' + (e.g. "foo/.gwenview_importer-IcQqvo//"), resulting in the final + destination reading "foo/.gwenview_importer-IcQqvo/" instead of + "foo/". On cleanup, the temporary folder is removed, simultaneously + deleting all new pictures. + + Fix: Omit '/' where appropriate. + +2nd problem (broken by a3262e9b197ee97323ef8bf3a9dca1e13f61a74c): + + When trying to find a unique filename, the while loop "stat"ing the + file repeats forever. + + Fix: Call "KIO::stat" and "KJobWidgets::setWindow" + also inside the loop. + +3rd problem (introduced in 017b4fe5dc7f4b6e876cfd7b108dcebbf609ae94): + + If the destination directory already contains an identically named + file, we try to find a different name by appending a number. For + this, we need to strip the old filename from the full path. + Unfortunately, only calling "path()" is incorrect, giving + "foo/pict0001.jpg/pict0001_1.jpg", rather than "foo/pict0001_1.jpg". + + Fix: Use "adjusted(QUrl::RemoveFilename)". + +4th problem (broken by a3262e9b197ee97323ef8bf3a9dca1e13f61a74c): + + Although deletion works, we show a warning dialog stating failure. + + Fix: Invert the logic of "job->exec()", as the error handling should + be skipped by "break"ing out of the while loop. + +Test Plan: +Steps to reproduce (see https://bugs.kde.org/show_bug.cgi?id=379615) no longer result in data loss. + +Autotests for importer (separate review request in D5750) pass. Hopefully, this helps catching any future porting regressions. + +Reviewers: ltoscano, sandsmark, gateau + +Reviewed By: ltoscano + +Differential Revision: https://phabricator.kde.org/D5749 +--- + importer/fileutils.cpp | 5 ++++- + importer/importdialog.cpp | 2 +- + importer/importer.cpp | 4 ++-- + 3 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/importer/fileutils.cpp b/importer/fileutils.cpp +index 5293d56..a51a18c 100644 +--- a/importer/fileutils.cpp ++++ b/importer/fileutils.cpp +@@ -128,7 +128,10 @@ RenameResult rename(const QUrl& src, const QUrl& dst_, QWidget* authWindow) + } + result = RenamedUnderNewName; + +- dst.setPath(dst.path() + '/' + prefix + QString::number(count) + suffix); ++ dst.setPath(dst.adjusted(QUrl::RemoveFilename).path() + prefix + QString::number(count) + suffix); ++ statJob = KIO::stat(dst); ++ KJobWidgets::setWindow(statJob, authWindow); ++ + ++count; + } + +diff --git a/importer/importdialog.cpp b/importer/importdialog.cpp +index ee6f7cd..5e9e847 100644 +--- a/importer/importdialog.cpp ++++ b/importer/importdialog.cpp +@@ -121,7 +121,7 @@ public: + QList urls = importedUrls + skippedUrls; + while (true) { + KIO::Job* job = KIO::del(urls); +- if (!job->exec()) { ++ if (job->exec()) { + break; + } + // Deleting failed +diff --git a/importer/importer.cpp b/importer/importer.cpp +index 51c4b96..a7e1d4e 100644 +--- a/importer/importer.cpp ++++ b/importer/importer.cpp +@@ -98,7 +98,7 @@ struct ImporterPrivate + } + mCurrentUrl = mUrlList.takeFirst(); + QUrl dst = mTempImportDirUrl; +- dst.setPath(dst.path() + '/' + mCurrentUrl.fileName()); ++ dst.setPath(dst.path() + mCurrentUrl.fileName()); + KIO::Job* job = KIO::copy(mCurrentUrl, dst, KIO::HideProgressInfo); + KJobWidgets::setWindow(job, mAuthWindow); + QObject::connect(job, SIGNAL(result(KJob*)), +@@ -122,7 +122,7 @@ struct ImporterPrivate + } else { + fileName = src.fileName(); + } +- dst.setPath(dst.path() + '/' + fileName); ++ dst.setPath(dst.path() + fileName); + + FileUtils::RenameResult result = FileUtils::rename(src, dst, mAuthWindow); + switch (result) { +-- +cgit v0.11.2 + + diff --git a/kde/patch/kdenlive.patch b/kde/patch/kdenlive.patch new file mode 100644 index 0000000..926b94a --- /dev/null +++ b/kde/patch/kdenlive.patch @@ -0,0 +1,4 @@ +# Fix compilation with gcc7. +# Fixed in 17.04.2. +cat $CWD/patch/kdenlive/kdenlive_gcc7.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/kdenlive/kdenlive_gcc7.patch b/kde/patch/kdenlive/kdenlive_gcc7.patch new file mode 100644 index 0000000..a7ddb90 --- /dev/null +++ b/kde/patch/kdenlive/kdenlive_gcc7.patch @@ -0,0 +1,32 @@ +# Make kdenlive compile with gcc7 + +--- kdenlive-17.04.1/src/profiles/tree/profiletreemodel.cpp.orig 2017-05-08 19:52:35.000000000 +0200 ++++ kdenlive-17.04.1/src/profiles/tree/profiletreemodel.cpp 2017-05-19 08:09:04.986909338 +0200 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + + class ProfileItem +--- kdenlive-17.04.1/src/scopes/audioscopes/spectrogram.cpp.orig 2017-05-08 19:52:35.000000000 +0200 ++++ kdenlive-17.04.1/src/scopes/audioscopes/spectrogram.cpp 2017-05-19 08:09:04.993910503 +0200 +@@ -241,7 +241,7 @@ + x = leftDist + (m_innerScopeRect.width() - 1) * ((float)hz) / m_freqMax; + + // Hide text if it would overlap with the text drawn at the mouse position +- hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (leftDist + mouseX + 20)) < (int) minDistX + 16 ++ hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - ((int)leftDist + mouseX + 20)) < (int) minDistX + 16 + && mouseX < m_innerScopeRect.width() && mouseX >= 0; + + if (x <= rightBorder) { +@@ -268,7 +268,7 @@ + } + // Draw the line at the very right (maximum frequency) + x = leftDist + m_innerScopeRect.width() - 1; +- hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (leftDist + mouseX + 30)) < (int) minDistX ++ hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - ((int)leftDist + mouseX + 30)) < (int) minDistX + && mouseX < m_innerScopeRect.width() && mouseX >= 0; + davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height() + 6); + if (!hideText) { diff --git a/kde/patch/libkleo.patch b/kde/patch/libkleo.patch new file mode 100644 index 0000000..e2fe8ff --- /dev/null +++ b/kde/patch/libkleo.patch @@ -0,0 +1,3 @@ +# Compile libkleo with gcc7: +cat $CWD/patch/libkleo/libkleo_gcc7.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/libkleo/libkleo_gcc7.patch b/kde/patch/libkleo/libkleo_gcc7.patch new file mode 100644 index 0000000..40e0616 --- /dev/null +++ b/kde/patch/libkleo/libkleo_gcc7.patch @@ -0,0 +1,27 @@ +From 675ce908a33d16f3b78d3fc741b0ff45790e4770 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 17 May 2017 17:05:41 +0200 +Subject: Fix compilation with GCC 7 + +std::bind is part of functional, and GCC 7 requires an explicit include. +--- + src/kleo/enum.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/kleo/enum.cpp b/src/kleo/enum.cpp +index 15ea1fd..829d4fd 100644 +--- a/src/kleo/enum.cpp ++++ b/src/kleo/enum.cpp +@@ -33,6 +33,9 @@ + #include "enum.h" + #include "libkleo_debug.h" + #include "models/keycache.h" ++ ++#include ++ + #include + + #include +-- +cgit v0.11.2 + diff --git a/kdei/kde-l10n/kde-l10n.SlackBuild b/kdei/kde-l10n/kde-l10n.SlackBuild index 4d20231..8e07fd8 100755 --- a/kdei/kde-l10n/kde-l10n.SlackBuild +++ b/kdei/kde-l10n/kde-l10n.SlackBuild @@ -35,7 +35,7 @@ if [ ! -r ./languages ]; then done fi -[ -z $VERSION ] && export VERSION=17.04.0 +[ -z $VERSION ] && export VERSION=17.04.1 [ -z $ARCH ] && export ARCH=noarch [ -z $BUILD ] && export BUILD=1 -- cgit v1.2.3