From 0ef31aa16442918b5ff23e11f9e6893920e58dc67002bef088fcc9e6d2fa3bd2 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Wed, 17 Jan 2018 15:06:52 +0000 Subject: [PATCH] KDE Frameworks 5.42 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=213 --- ...ng-of-KCookieAdvice_AcceptForSession.patch | 34 ----- ...lap-of-first-item-in-kfileplacesview.patch | 126 ++++++++++++++++++ kio-5.41.0.tar.xz | 3 - kio-5.42.0.tar.xz | 3 + kio.changes | 14 ++ kio.spec | 8 +- 6 files changed, 147 insertions(+), 41 deletions(-) delete mode 100644 fix-handling-of-KCookieAdvice_AcceptForSession.patch create mode 100644 fix-overlap-of-first-item-in-kfileplacesview.patch delete mode 100644 kio-5.41.0.tar.xz create mode 100644 kio-5.42.0.tar.xz diff --git a/fix-handling-of-KCookieAdvice_AcceptForSession.patch b/fix-handling-of-KCookieAdvice_AcceptForSession.patch deleted file mode 100644 index 0f88d12..0000000 --- a/fix-handling-of-KCookieAdvice_AcceptForSession.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 23d031b1da60e5cf7a36ec2d5fd9affbc9fd4989 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Thu, 2 Nov 2017 15:08:38 +0100 -Subject: [PATCH] kio: fix handling of KCookieAdvice::AcceptForSession - -Commit 23874cab9d broke the handling of KCookieAdvice::AcceptForSession -because strToAdvice(adviceToStr(KCookieAdvice::AcceptForSession)) now -returns KCookieAdvice::Dunno. Ignore spaces in the argument of -strToAdvice to properly recognize the AcceptForSession setting and -restore compatibility with previous configs. - -BUG: 386325 - -Differential Revision: https://phabricator.kde.org/D8545 ---- - src/kcms/kio/kcookiespolicyselectiondlg.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/kcms/kio/kcookiespolicyselectiondlg.h b/src/kcms/kio/kcookiespolicyselectiondlg.h -index 5efb7dad..7ee90245 100644 ---- a/src/kcms/kio/kcookiespolicyselectiondlg.h -+++ b/src/kcms/kio/kcookiespolicyselectiondlg.h -@@ -49,7 +49,7 @@ public: - if (_str.isEmpty()) - return KCookieAdvice::Dunno; - -- QString advice = _str.toLower(); -+ QString advice = _str.toLower().remove(' '); - - if (advice == QLatin1String ("accept")) - return KCookieAdvice::Accept; --- -2.13.6 - diff --git a/fix-overlap-of-first-item-in-kfileplacesview.patch b/fix-overlap-of-first-item-in-kfileplacesview.patch new file mode 100644 index 0000000..62b4cd9 --- /dev/null +++ b/fix-overlap-of-first-item-in-kfileplacesview.patch @@ -0,0 +1,126 @@ +From bd5b09c1d126158b4ce155ef5106234b9e8068d4 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Sat, 13 Jan 2018 18:46:50 +0100 +Subject: [PATCH] Fix overlap of the first item in KFilePlacesView + +Summary: +The first item overlapped both the section header and the item +below. This was caused by taking the spacing wrongly into account. +Additionally, the paint function's option's rect was not moved correctly, +as the unmodified option.rect was used in some places. + +Test Plan: https://i.imgur.com/LJuACt2.png -> https://i.imgur.com/nYpdoXn.png + +Reviewers: #frameworks, dfaure, renatoo + +Tags: #frameworks + +Differential Revision: https://phabricator.kde.org/D9863 +--- + src/filewidgets/kfileplacesview.cpp | 45 +++++++++++++++++++------------------ + 1 file changed, 23 insertions(+), 22 deletions(-) + +Index: kio-5.42.0/src/filewidgets/kfileplacesview.cpp +=================================================================== +--- kio-5.42.0.orig/src/filewidgets/kfileplacesview.cpp ++++ kio-5.42.0/src/filewidgets/kfileplacesview.cpp +@@ -170,10 +170,9 @@ void KFilePlacesViewDelegate::paint(QPai + drawSectionHeader(painter, opt, index); + } + ++ // Move the target rect to the actual item rect + const int headerHeight = sectionHeaderHeight(); +- const int headerSpace = (headerHeight / 2) + qMax(2, m_view->spacing()); +- painter->translate(0, headerSpace); +- opt.rect.translate(0, headerSpace); ++ opt.rect.translate(0, headerHeight); + opt.rect.setHeight(opt.rect.height() - headerHeight); + } + +@@ -193,22 +192,22 @@ void KFilePlacesViewDelegate::paint(QPai + QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter); + const KFilePlacesModel *placesModel = static_cast(index.model()); + +- bool isLTR = option.direction == Qt::LeftToRight; ++ bool isLTR = opt.direction == Qt::LeftToRight; + + QIcon icon = index.model()->data(index, Qt::DecorationRole).value(); +- QPixmap pm = icon.pixmap(m_iconSize, m_iconSize, (option.state & QStyle::State_Selected) && (option.state & QStyle::State_Active) ? QIcon::Selected : QIcon::Normal); +- QPoint point(isLTR ? option.rect.left() + LATERAL_MARGIN +- : option.rect.right() - LATERAL_MARGIN - m_iconSize, option.rect.top() + (option.rect.height() - m_iconSize) / 2); ++ QPixmap pm = icon.pixmap(m_iconSize, m_iconSize, (opt.state & QStyle::State_Selected) && (opt.state & QStyle::State_Active) ? QIcon::Selected : QIcon::Normal); ++ QPoint point(isLTR ? opt.rect.left() + LATERAL_MARGIN ++ : opt.rect.right() - LATERAL_MARGIN - m_iconSize, opt.rect.top() + (opt.rect.height() - m_iconSize) / 2); + painter->drawPixmap(point, pm); + +- if (option.state & QStyle::State_Selected) { ++ if (opt.state & QStyle::State_Selected) { + QPalette::ColorGroup cg = QPalette::Active; +- if (!(option.state & QStyle::State_Enabled)) { ++ if (!(opt.state & QStyle::State_Enabled)) { + cg = QPalette::Disabled; +- } else if (!(option.state & QStyle::State_Active)) { ++ } else if (!(opt.state & QStyle::State_Active)) { + cg = QPalette::Inactive; + } +- painter->setPen(option.palette.color(cg, QPalette::HighlightedText)); ++ painter->setPen(opt.palette.color(cg, QPalette::HighlightedText)); + } + + QRect rectText; +@@ -225,10 +224,10 @@ void KFilePlacesViewDelegate::paint(QPai + painter->save(); + painter->setOpacity(painter->opacity() * contentsOpacity(index)); + +- int height = option.fontMetrics.height() + CAPACITYBAR_HEIGHT; +- rectText = QRect(isLTR ? m_iconSize + LATERAL_MARGIN * 2 + option.rect.left() +- : 0, option.rect.top() + (option.rect.height() / 2 - height / 2), option.rect.width() - m_iconSize - LATERAL_MARGIN * 2, option.fontMetrics.height()); +- painter->drawText(rectText, Qt::AlignLeft | Qt::AlignTop, option.fontMetrics.elidedText(index.model()->data(index).toString(), Qt::ElideRight, rectText.width())); ++ int height = opt.fontMetrics.height() + CAPACITYBAR_HEIGHT; ++ rectText = QRect(isLTR ? m_iconSize + LATERAL_MARGIN * 2 + opt.rect.left() ++ : 0, opt.rect.top() + (opt.rect.height() / 2 - height / 2), opt.rect.width() - m_iconSize - LATERAL_MARGIN * 2, opt.fontMetrics.height()); ++ painter->drawText(rectText, Qt::AlignLeft | Qt::AlignTop, opt.fontMetrics.elidedText(index.model()->data(index).toString(), Qt::ElideRight, rectText.width())); + QRect capacityRect(isLTR ? rectText.x() : LATERAL_MARGIN, rectText.bottom() - 1, rectText.width() - LATERAL_MARGIN, CAPACITYBAR_HEIGHT); + KCapacityBar capacityBar(KCapacityBar::DrawTextInline); + capacityBar.setValue((info.used() * 100) / info.size()); +@@ -241,9 +240,9 @@ void KFilePlacesViewDelegate::paint(QPai + } + } + +- rectText = QRect(isLTR ? m_iconSize + LATERAL_MARGIN * 2 + option.rect.left() +- : 0, option.rect.top(), option.rect.width() - m_iconSize - LATERAL_MARGIN * 2, option.rect.height()); +- painter->drawText(rectText, Qt::AlignLeft | Qt::AlignVCenter, option.fontMetrics.elidedText(index.model()->data(index).toString(), Qt::ElideRight, rectText.width())); ++ rectText = QRect(isLTR ? m_iconSize + LATERAL_MARGIN * 2 + opt.rect.left() ++ : 0, opt.rect.top(), opt.rect.width() - m_iconSize - LATERAL_MARGIN * 2, opt.rect.height()); ++ painter->drawText(rectText, Qt::AlignLeft | Qt::AlignVCenter, opt.fontMetrics.elidedText(index.model()->data(index).toString(), Qt::ElideRight, rectText.width())); + + if (drawCapacityBar && contentsOpacity(index) > 0) { + painter->restore(); +@@ -434,12 +433,14 @@ void KFilePlacesViewDelegate::drawSectio + + QRect textRect(option.rect); + textRect.setLeft(textRect.left() + 3); +- textRect.setY(textRect.y() + qMax(2, m_view->spacing())); ++ /* Take spacing into account: ++ The spacing to the previous section compensates for the spacing to the first item.*/ ++ textRect.setY(textRect.y() /* + qMax(2, m_view->spacing()) - qMax(2, m_view->spacing())*/); + textRect.setHeight(sectionHeaderHeight()); + + painter->save(); + +- // based on dolphoin colors ++ // based on dolphin colors + const QColor c1 = textColor(option); + const QColor c2 = baseColor(option); + QColor penColor = mixedColor(c1, c2, 60); +@@ -473,8 +474,8 @@ QColor KFilePlacesViewDelegate::mixedCol + + int KFilePlacesViewDelegate::sectionHeaderHeight() const + { +- return QApplication::fontMetrics().height() + +- (qMax(2, m_view->spacing()) * 2); ++ // Account for the spacing between header and item ++ return QApplication::fontMetrics().height() + qMax(2, m_view->spacing()); + } + + diff --git a/kio-5.41.0.tar.xz b/kio-5.41.0.tar.xz deleted file mode 100644 index 498cc61..0000000 --- a/kio-5.41.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:90c4c27959efec70849fd03e6cf9708d09c0101a15f3c14ab731ec0997bb649e -size 3108068 diff --git a/kio-5.42.0.tar.xz b/kio-5.42.0.tar.xz new file mode 100644 index 0000000..49dba72 --- /dev/null +++ b/kio-5.42.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec1d0ef9523661614f347e3c99efe98813d0fab92e8fdb4a995685d013524694 +size 3119252 diff --git a/kio.changes b/kio.changes index fa3f7f3..3de385b 100644 --- a/kio.changes +++ b/kio.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Tue Jan 16 22:50:18 CET 2018 - lbeltrame@kde.org + +- Update to 5.42.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.42.0.php +- Changes since 5.41.0: + * Too many changes to list here +- Add upstream patch fix-overlap-of-first-item-in-kfileplacesview.patch: + * Fixes overlapping in items in the places view +- Dropped patches, now upstream: + * fix-handling-of-KCookieAdvice_AcceptForSession.patch + ------------------------------------------------------------------- Fri Jan 12 07:48:05 UTC 2018 - fabian@ritter-vogt.de diff --git a/kio.spec b/kio.spec index 742716b..ab2e27d 100644 --- a/kio.spec +++ b/kio.spec @@ -17,9 +17,9 @@ %bcond_without lang -%define _tar_path 5.41 +%define _tar_path 5.42 Name: kio -Version: 5.41.0 +Version: 5.42.0 Release: 0 %define kf5_version %{version} # Full KF5 version (e.g. 5.33.0) @@ -35,9 +35,9 @@ Source1: baselibs.conf # PATCH-FIX-OPENSUSE kio_help-fallback-to-kde4-docs.patch -- allow kio_help to see into kde4 documentation, needed especially for khelpcenter5 Patch0: kio_help-fallback-to-kde4-docs.patch # PATCH-FIX-UPSTREAM -Patch1: fix-handling-of-KCookieAdvice_AcceptForSession.patch +Patch1: 0001-Fix-KFilePreviewGenerator-LayoutBlocker.patch # PATCH-FIX-UPSTREAM -Patch2: 0001-Fix-KFilePreviewGenerator-LayoutBlocker.patch +Patch2: fix-overlap-of-first-item-in-kfileplacesview.patch BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes