KDE Frameworks 5.42

OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=213
This commit is contained in:
Fabian Vogt 2018-01-17 15:06:52 +00:00 committed by Git OBS Bridge
parent 76923a8f97
commit 0ef31aa164
6 changed files with 147 additions and 41 deletions

View File

@ -1,34 +0,0 @@
From 23d031b1da60e5cf7a36ec2d5fd9affbc9fd4989 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@linux-m68k.org>
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

View File

@ -0,0 +1,126 @@
From bd5b09c1d126158b4ce155ef5106234b9e8068d4 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
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<const KFilePlacesModel *>(index.model());
- bool isLTR = option.direction == Qt::LeftToRight;
+ bool isLTR = opt.direction == Qt::LeftToRight;
QIcon icon = index.model()->data(index, Qt::DecorationRole).value<QIcon>();
- 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());
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:90c4c27959efec70849fd03e6cf9708d09c0101a15f3c14ab731ec0997bb649e
size 3108068

3
kio-5.42.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec1d0ef9523661614f347e3c99efe98813d0fab92e8fdb4a995685d013524694
size 3119252

View File

@ -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 Fri Jan 12 07:48:05 UTC 2018 - fabian@ritter-vogt.de

View File

@ -17,9 +17,9 @@
%bcond_without lang %bcond_without lang
%define _tar_path 5.41 %define _tar_path 5.42
Name: kio Name: kio
Version: 5.41.0 Version: 5.42.0
Release: 0 Release: 0
%define kf5_version %{version} %define kf5_version %{version}
# Full KF5 version (e.g. 5.33.0) # 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 # 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 Patch0: kio_help-fallback-to-kde4-docs.patch
# PATCH-FIX-UPSTREAM # PATCH-FIX-UPSTREAM
Patch1: fix-handling-of-KCookieAdvice_AcceptForSession.patch Patch1: 0001-Fix-KFilePreviewGenerator-LayoutBlocker.patch
# PATCH-FIX-UPSTREAM # PATCH-FIX-UPSTREAM
Patch2: 0001-Fix-KFilePreviewGenerator-LayoutBlocker.patch Patch2: fix-overlap-of-first-item-in-kfileplacesview.patch
BuildRequires: cmake >= 3.0 BuildRequires: cmake >= 3.0
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
BuildRequires: fdupes BuildRequires: fdupes