Hello community, here is the log from the commit of package kwidgetsaddons for openSUSE:Factory checked in at 2015-01-29 12:52:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kwidgetsaddons (Old) and /work/SRC/openSUSE:Factory/.kwidgetsaddons.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kwidgetsaddons" Changes: -------- --- /work/SRC/openSUSE:Factory/kwidgetsaddons/kwidgetsaddons.changes 2014-12-21 11:58:36.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kwidgetsaddons.new/kwidgetsaddons.changes 2015-01-29 12:52:18.000000000 +0100 @@ -1,0 +2,9 @@ +Sat Jan 3 18:03:25 UTC 2015 - [email protected] + +- Update to 5.6.0 + * Add runtime style element extension convenience functions + for widgets: KStyleExtensions + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.6.0.php + +------------------------------------------------------------------- Old: ---- kwidgetsaddons-5.5.0.tar.xz New: ---- kwidgetsaddons-5.6.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kwidgetsaddons.spec ++++++ --- /var/tmp/diff_new_pack.OBj170/_old 2015-01-29 12:52:19.000000000 +0100 +++ /var/tmp/diff_new_pack.OBj170/_new 2015-01-29 12:52:19.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package kwidgetsaddons # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,10 +18,10 @@ %define lname libKF5WidgetsAddons5 Name: kwidgetsaddons -Version: 5.5.0 +Version: 5.6.0 Release: 0 BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.5.0 +BuildRequires: extra-cmake-modules >= 1.6.0 BuildRequires: fdupes BuildRequires: kf5-filesystem BuildRequires: libqt5-linguist-devel >= 5.2.0 @@ -32,7 +32,7 @@ License: LGPL-2.1+ Group: System/GUI/KDE Url: http://www.kde.org -Source: http://download.kde.org/stable/frameworks/5.5/%{name}-%{version}.tar.xz +Source: http://download.kde.org/stable/frameworks/5.6/%{name}-%{version}.tar.xz Source1: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ kwidgetsaddons-5.5.0.tar.xz -> kwidgetsaddons-5.6.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/CMakeLists.txt new/kwidgetsaddons-5.6.0/CMakeLists.txt --- old/kwidgetsaddons-5.5.0/CMakeLists.txt 2014-12-06 13:47:03.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/CMakeLists.txt 2015-01-03 13:16:07.000000000 +0100 @@ -2,7 +2,7 @@ project(KWidgetsAddons) -find_package(ECM 1.5.0 REQUIRED NO_MODULE) +find_package(ECM 1.6.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) @@ -20,7 +20,7 @@ include(ECMPoQmTools) -set(KF5_VERSION "5.5.0") # handled by release scripts +set(KF5_VERSION "5.6.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KWIDGETSADDONS VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kwidgetsaddons_version.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/po/ca/kwidgetsaddons5_qt.po new/kwidgetsaddons-5.6.0/po/ca/kwidgetsaddons5_qt.po --- old/kwidgetsaddons-5.5.0/po/ca/kwidgetsaddons5_qt.po 2014-12-06 13:47:03.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/po/ca/kwidgetsaddons5_qt.po 2015-01-03 13:16:07.000000000 +0100 @@ -4,7 +4,7 @@ # version 3 or later versions approved by the membership of KDE e.V. # # Sebastià Pla i Sanz <[email protected]>, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007. -# Antoni Bella Pérez <[email protected]>, 2003, 2006, 2011, 2012, 2013, 2014. +# Antoni Bella Pérez <[email protected]>, 2003, 2006, 2011, 2012, 2013, 2014. # Albert Astals Cid <[email protected]>, 2004, 2005, 2007. # Josep Ma. Ferrer <[email protected]>, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014. # Robert Millan <[email protected]>, 2009. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/po/fi/kwidgetsaddons5_qt.po new/kwidgetsaddons-5.6.0/po/fi/kwidgetsaddons5_qt.po --- old/kwidgetsaddons-5.5.0/po/fi/kwidgetsaddons5_qt.po 2014-12-06 13:47:03.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/po/fi/kwidgetsaddons5_qt.po 2015-01-03 13:16:07.000000000 +0100 @@ -14,7 +14,7 @@ # Tommi Nieminen <[email protected]>, 2009, 2010, 2011. # Tommi Nieminen <[email protected]>, 2009. # Jorma Karvonen <[email protected]>, 2010. -# Lasse Liehu <[email protected]>, 2006, 2010, 2011, 2012, 2013, 2014. +# Lasse Liehu <[email protected]>, 2006, 2010, 2011, 2012, 2013, 2014, 2015. # # KDE Finnish translation sprint participants: # Author: Artnay @@ -29,7 +29,7 @@ "POT-Creation-Date: 2014-03-23 01:50+0000\n" "PO-Revision-Date: 2014-07-27 13:00+0300\n" "Last-Translator: Lasse Liehu <[email protected]>\n" -"Language-Team: Finnish <[email protected]>\n" +"Language-Team: Finnish <[email protected]>\n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/po/ko/kwidgetsaddons5_qt.po new/kwidgetsaddons-5.6.0/po/ko/kwidgetsaddons5_qt.po --- old/kwidgetsaddons-5.5.0/po/ko/kwidgetsaddons5_qt.po 2014-12-06 13:47:03.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/po/ko/kwidgetsaddons5_qt.po 2015-01-03 13:16:07.000000000 +0100 @@ -18,7 +18,6 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Lokalize 1.5\n" -"X-Qt-Contexts: true\n" #: fonthelpers.cpp:81 #, qt-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/src/CMakeLists.txt new/kwidgetsaddons-5.6.0/src/CMakeLists.txt --- old/kwidgetsaddons-5.5.0/src/CMakeLists.txt 2014-12-06 13:47:03.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/src/CMakeLists.txt 2015-01-03 13:16:07.000000000 +0100 @@ -69,6 +69,7 @@ kmimetypechooser.cpp kmimetypeeditor.cpp ksplittercollapserbutton.cpp + kstyleextensions.cpp ${kwidgetsaddons_QM_LOADER} ) @@ -159,6 +160,7 @@ KMimeTypeEditor KMessageBoxNotifyInterface KSplitterCollapserButton + KStyleExtensions REQUIRED_HEADERS KWidgetsAddons_HEADERS ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/src/kpageview.cpp new/kwidgetsaddons-5.6.0/src/kpageview.cpp --- old/kwidgetsaddons-5.5.0/src/kpageview.cpp 2014-12-06 13:47:03.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/src/kpageview.cpp 2015-01-03 13:16:07.000000000 +0100 @@ -264,8 +264,6 @@ header = model->data(index, Qt::DisplayRole).toString(); } - const QIcon icon = model->data(index, Qt::DecorationRole).value<QIcon>(); - titleWidget->setPixmap(icon.pixmap(22, 22)); titleWidget->setText(header); titleWidget->setVisible(q->showPageHeader()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/src/kstyleextensions.cpp new/kwidgetsaddons-5.6.0/src/kstyleextensions.cpp --- old/kwidgetsaddons-5.5.0/src/kstyleextensions.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/src/kstyleextensions.cpp 2015-01-03 13:16:07.000000000 +0100 @@ -0,0 +1,99 @@ +/* This file is part of the KDE libraries + Copyright (C) 2014 Thomas Lübking <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kstyleextensions.h" + +#include <QWidget> + +namespace KStyleExtensions +{ + + +/* + Custom Style Element runtime extension: + We reserve one StyleHint to let the effective style inform widgets whether it supports certain + string based style elements. + As this could lead to number conflicts (i.e. an app utilizing one of the hints itself for other + purposes) there're various safety mechanisms to rule out such interference. + + 1) It's most unlikely that a widget in some 3rd party app will accidentally call a general + QStyle/KStyle styleHint() or draw*() and (unconditionally) expect a valid return, however: + a. The StyleHint is not directly above Qt's custom base, assuming most 3rd party apps would + - in case - make use of such + b. In order to be accepted, the StyleHint query must pass a widget with a perfectly matching + name, containing the typical element prefix ("CE_", etc.) and being supported by the current + style + c. Instead using Qt's fragile qstyleoption_cast on the QStyleOption provided to the StyleHint + query, try to dump out a string and hope for the best, we now manipulate the widgets + objectName(). + Plain Qt dependent widgets can do that themselves and if a widget uses KStyle's + convenience access functions, it won't notice this at all + + 2) The key problem is that a common KDE widget will run into an apps custom style which will then + falsely respond to the styleHint() call with an invalid value. + To prevent this, supporting styles *must* set a Q_CLASSINFO "X-KDE-CustomElements". + + 3) If any of the above traps snaps, the returned id is 0 - the QStyle default, indicating + that this element is not supported by the current style. + + Obviously, this contains the "diminished clean" action to (temporarily) manipulate the + objectName() of a const QWidget* - but this happens completely inside KStyle or the widget, if + it does not make use of KStyles static convenience functions. + My biggest worry here would be, that in a multithreaded environment a thread (usually not being + owner of the widget) does something crucially relying on the widgets name property... + This however would also have to happen during the widget construction or stylechanges, when + the functions in doubt will typically be called. + So this is imho unlikely causing any trouble, ever. +*/ + +static const QStyle::StyleHint SH_KCustomStyleElement = (QStyle::StyleHint)0xff000001; +static const int X_KdeBase = 0xff000000; + +/* + The functions called by widgets that request custom element support, passed to the effective style. + Collected in a static inline function due to similarity. +*/ + +static inline int customStyleElement(QStyle::StyleHint type, const QString &element, QWidget *widget) +{ + if (!widget || widget->style()->metaObject()->indexOfClassInfo("X-KDE-CustomElements") < 0) + return 0; + + const QString originalName = widget->objectName(); + widget->setObjectName(element); + const int id = widget->style()->styleHint(type, 0, widget); + widget->setObjectName(originalName); + return id; +} + +QStyle::StyleHint customStyleHint(const QString &element, const QWidget *widget) +{ + return (QStyle::StyleHint) customStyleElement(SH_KCustomStyleElement, element, const_cast<QWidget*>(widget)); +} + +QStyle::ControlElement customControlElement(const QString &element, const QWidget *widget) +{ + return (QStyle::ControlElement) customStyleElement(SH_KCustomStyleElement, element, const_cast<QWidget*>(widget)); +} + +QStyle::SubElement customSubElement(const QString &element, const QWidget *widget) +{ + return (QStyle::SubElement) customStyleElement(SH_KCustomStyleElement, element, const_cast<QWidget*>(widget)); +} + +} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwidgetsaddons-5.5.0/src/kstyleextensions.h new/kwidgetsaddons-5.6.0/src/kstyleextensions.h --- old/kwidgetsaddons-5.5.0/src/kstyleextensions.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kwidgetsaddons-5.6.0/src/kstyleextensions.h 2015-01-03 13:16:07.000000000 +0100 @@ -0,0 +1,77 @@ +/* This file is part of the KDE libraries + Copyright (C) 2014 Thomas Lübking <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSTYLEEXTENSIONS_H +#define KSTYLEEXTENSIONS_H + +#include <QStyle> +#include <kwidgetsaddons_export.h> + +namespace KStyleExtensions +{ +/** + * Runtime style extensions + * You can use this to have a supporting QStyle implementation paint your widget + * This is just convenience and does /not/ require the using widgets style to inherit KStyle (i.e. + * calling this while using cleanlooks won't segfault but just return "0") + * + * For simplicity, only StyleHints, ControlElements and their SubElements are supported + * If you don't need extended SubElement functionality, just skip its usage + * + * The @p element string has to be of the form: "appname.(2-char-element-type)_element" + * The 2-char-element-type is the corresponding {SH, CE, SE} + * Widgets in KWidgetsAddons don't have to pass the appname + * + * Examples: "CE_CapacityBar", "amarok.CE_Analyzer" + * + * Important notes: + * 1) If your string lacks the matching "SH_", "CE_" or "SE_" token the element request will be ignored (return is 0) + * 2) Try to avoid custom elements and use default ones (if possible) to get better style support and keep UI coherency + * 3) If you cache this value (good idea, this requires a map lookup) do not forget to catch style changes in QWidget::changeEvent()! + */ + +/** + * Resolve a dynamic QStyle::ControlElement for eg. QStyle::drawControl() + * + * @returns a unique QStyle::ControlElement or 0 in case the style doesn't suuport this element + * @p element a valid element string appname.CE_element, eg. "amarok.CE_Analyzer" + * @p widget the widget to paint this element for. This parameter is mandatory, nullptr will return 0! + * @since 5.3 + */ +KWIDGETSADDONS_EXPORT QStyle::ControlElement customControlElement(const QString &element, const QWidget *widget); +/** + * Resolve a dynamic QStyle::StyleHint to query QStyle::styleHint() + * + * @returns a unique QStyle::StyleHint or 0 in case the style doesn't suuport this element + * @p element a valid element string appname.SH_element, eg. "amarok.SH_Analyzer" + * @p widget the widget to paint this element for. This parameter is mandatory, nullptr will return 0! + * @since 5.3 + */ +KWIDGETSADDONS_EXPORT QStyle::StyleHint customStyleHint(const QString &element, const QWidget *widget); +/** + * Resolve a dynamic QStyle::SubElement for eg. QStyle::subElementRect() + * + * @returns a unique QStyle::SubElement or 0 in case the style doesn't suuport this element + * @p element a valid element string appname.SE_element, eg. "amarok.SE_AnalyzerCanvas" + * @p widget the widget to paint this element for. This parameter is mandatory, nullptr will return 0! + * @since 5.3 + */ +KWIDGETSADDONS_EXPORT QStyle::SubElement customSubElement(const QString &element, const QWidget *widget); +} + +#endif // KSTYLEEXTENSIONS_H \ No newline at end of file -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
