commit kguiaddons for openSUSE:Factory
Hello community, here is the log from the commit of package kguiaddons for openSUSE:Factory checked in at 2014-04-02 17:22:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kguiaddons (Old) and /work/SRC/openSUSE:Factory/.kguiaddons.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kguiaddons" Changes: -------- --- /work/SRC/openSUSE:Factory/kguiaddons/kguiaddons.changes 2014-03-10 12:17:28.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kguiaddons.new/kguiaddons.changes 2014-04-02 17:22:51.000000000 +0200 @@ -1,0 +2,22 @@ +Sat Mar 29 19:47:38 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 4.98.0 + * API improvements and cleanups + * Buildsystem fixes + * For more details please see: + http://www.kde.org/announcements/announce-frameworks5-beta1.php +- Drop upstream patches: + 0001-Replace-use-of-QPA-headers-with-optional-dep-on-QX11.patch and + 0002-Port-KWordWrap-to-QExplicitelySharedDataPointer-to-a.patch + +------------------------------------------------------------------- +Tue Mar 18 19:03:29 UTC 2014 - hrvoje.senjan@gmail.com + +- Added patches from upstream: + 0001-Replace-use-of-QPA-headers-with-optional-dep-on-QX11.patch, + 0002-Port-KWordWrap-to-QExplicitelySharedDataPointer-to-a.patch: + first patch reimplements X11 usage (so QtGui private headers aren't + needed anymore, and X11Extras are used instead), second one + improves API + +------------------------------------------------------------------- Old: ---- kguiaddons-4.97.0.tar.xz New: ---- kguiaddons-4.98.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kguiaddons.spec ++++++ --- /var/tmp/diff_new_pack.2YV226/_old 2014-04-02 17:22:51.000000000 +0200 +++ /var/tmp/diff_new_pack.2YV226/_new 2014-04-02 17:22:51.000000000 +0200 @@ -18,21 +18,17 @@ %define lname libKF5GuiAddons5 Name: kguiaddons -Version: 4.97.0 +Version: 4.98.0 Release: 0 BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 0.0.11 +BuildRequires: extra-cmake-modules >= 0.0.12 BuildRequires: fdupes BuildRequires: kf5-filesystem BuildRequires: pkgconfig(Qt5Gui) >= 5.2.0 # Tests BuildRequires: pkgconfig(Qt5Test) >= 5.2.0 BuildRequires: pkgconfig(Qt5Widgets) >= 5.2.0 -# [ 142s] /home/abuild/rpmbuild/BUILD/kguiaddons-4.97.0/src/util/kmodifierkeyinfoprovider_x11.cpp:26:42: -# fatal error: qpa/qplatformnativeinterface.h: No such file or directory -#BuildRequires: libQt5Gui-private-headers-devel -# TODO change to above once latest Qt5 is in O:F -BuildRequires: libqt5-qtbase-private-headers-devel >= 5.2.0 +BuildRequires: pkgconfig(Qt5X11Extras) >= 5.2.0 BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcb) Summary: Utilities for graphical user interfaces ++++++ kguiaddons-4.97.0.tar.xz -> kguiaddons-4.98.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/CMakeLists.txt new/kguiaddons-4.98.0/CMakeLists.txt --- old/kguiaddons-4.97.0/CMakeLists.txt 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/CMakeLists.txt 2014-03-28 19:16:51.000000000 +0100 @@ -2,7 +2,7 @@ project(KGuiAddons) -find_package(ECM 0.0.11 REQUIRED NO_MODULE) +find_package(ECM 0.0.12 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) @@ -21,7 +21,7 @@ include(GenerateExportHeader) include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "4.97.0") +set(KF5_VERSION "4.98.0") ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KGUIADDONS VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kguiaddons_version.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/autotests/kwordwraptest.cpp new/kguiaddons-4.98.0/autotests/kwordwraptest.cpp --- old/kguiaddons-4.97.0/autotests/kwordwraptest.cpp 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/autotests/kwordwraptest.cpp 2014-03-28 19:16:51.000000000 +0100 @@ -45,17 +45,15 @@ QFontMetrics fm(font); QRect r(0, 0, 100, -1); QString str = "test wadabada [/foo/bar/waba]"; - KWordWrap *ww = KWordWrap::formatText(fm, r, 0, str); - //qDebug() << str << " => " << ww->truncatedString(); - QVERIFY(ww->truncatedString().endsWith("...")); - delete ww; + KWordWrap ww = KWordWrap::formatText(fm, r, 0, str); + //qDebug() << str << " => " << ww.truncatedString(); + QVERIFY(ww.truncatedString().endsWith("...")); str = "</p></p></p></p>"; for (; r.width() > 0; r.setWidth(r.width() - 10)) { ww = KWordWrap::formatText(fm, r, 0, str); - //qDebug() << str << " => " << ww->truncatedString(); - QVERIFY(ww->truncatedString().endsWith("...")); - delete ww; + //qDebug() << str << " => " << ww.truncatedString(); + QVERIFY(ww.truncatedString().endsWith("...")); } } @@ -65,10 +63,9 @@ QFont font("helvetica", 12); // let's hope we all have the same... QFontMetrics fm(font); QString inputString = "The title here\nFoo (bar)\nFoo2 (bar2)"; - KWordWrap *ww = KWordWrap::formatText(fm, r, 0, inputString); - QString str = ww->wrappedString(); + KWordWrap ww = KWordWrap::formatText(fm, r, 0, inputString); + QString str = ww.wrappedString(); QCOMPARE(str, inputString); - delete ww; } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/src/CMakeLists.txt new/kguiaddons-4.98.0/src/CMakeLists.txt --- old/kguiaddons-4.97.0/src/CMakeLists.txt 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/src/CMakeLists.txt 2014-03-28 19:16:51.000000000 +0100 @@ -14,18 +14,21 @@ util/urlhandler.cpp ) +set (kmodifierkeyinfoprovider_impl "dummy") if (NOT APPLE AND X11_FOUND AND X11_Xkb_FOUND AND XCB_XCB_FOUND) - include_directories ( - ${X11_Xkb_INCLUDE_PATH} - ${X11_Xlib_INCLUDE_PATH} - ${XCB_XCB_INCLUDE_DIR} - ${Qt5Gui_PRIVATE_INCLUDE_DIRS} - ) - set(kguiaddons_LIB_SRCS ${kguiaddons_LIB_SRCS} util/kmodifierkeyinfoprovider_x11.cpp) -else () - set (kguiaddons_LIB_SRCS ${kguiaddons_LIB_SRCS} util/kmodifierkeyinfoprovider_dummy.cpp) + find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE) + if (Qt5X11Extras_FOUND) + include_directories ( + ${X11_Xkb_INCLUDE_PATH} + ${X11_Xlib_INCLUDE_PATH} + ${XCB_XCB_INCLUDE_DIR} + ) + set (kmodifierkeyinfoprovider_impl "x11") + endif() endif () +set (kguiaddons_LIB_SRCS ${kguiaddons_LIB_SRCS} util/kmodifierkeyinfoprovider_${kmodifierkeyinfoprovider_impl}.cpp) + add_library(KF5GuiAddons ${kguiaddons_LIB_SRCS}) generate_export_header(KF5GuiAddons BASE_NAME KGuiAddons) @@ -42,8 +45,8 @@ target_compile_definitions(KF5GuiAddons INTERFACE "$<INSTALL_INTERFACE:KGUIADDONS_LIB>") target_link_libraries(KF5GuiAddons PUBLIC Qt5::Gui) -if(X11_FOUND AND X11_Xkb_FOUND) - target_link_libraries(KF5GuiAddons LINK_PRIVATE ${X11_LIBRARIES} ${XCB_XCB_LIBRARY}) +if (kmodifierkeyinfoprovider_impl STREQUAL "x11") + target_link_libraries(KF5GuiAddons LINK_PRIVATE ${X11_LIBRARIES} ${XCB_XCB_LIBRARY} Qt5::X11Extras) endif() set_target_properties(KF5GuiAddons PROPERTIES VERSION ${KGUIADDONS_VERSION_STRING} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/src/colors/kcolorutils.cpp new/kguiaddons-4.98.0/src/colors/kcolorutils.cpp --- old/kguiaddons-4.97.0/src/colors/kcolorutils.cpp 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/src/colors/kcolorutils.cpp 2014-03-28 19:16:51.000000000 +0100 @@ -24,13 +24,7 @@ #include <QColor> #include <QImage> - -#include <math.h> - -#ifdef Q_CC_MSVC -#include <float.h> -#define isnan(n) _isnan(n) -#endif +#include <QtNumeric> // qIsNaN // BEGIN internal helper functions static inline qreal mixQreal(qreal a, qreal b, qreal bias) @@ -112,7 +106,7 @@ if (amount >= 1.0) { return color; } - if (isnan(amount)) { + if (qIsNaN(amount)) { return base; } @@ -142,7 +136,7 @@ if (bias >= 1.0) { return c2; } - if (isnan(bias)) { + if (qIsNaN(bias)) { return c1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/src/fonts/kfontutils.h new/kguiaddons-4.98.0/src/fonts/kfontutils.h --- old/kguiaddons-4.97.0/src/fonts/kfontutils.h 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/src/fonts/kfontutils.h 2014-03-28 19:16:51.000000000 +0100 @@ -55,7 +55,7 @@ in the given dimensions. Can return smaller than minFontSize, that means the text doesn't fit in the given rectangle. Can return -1 on error - @since KDE 4.7 + @since 4.7 */ qreal KGUIADDONS_EXPORT adaptFontSize(QPainter &painter, const QString &text, @@ -66,7 +66,7 @@ AdaptFontSizeOptions flags = NoFlags); /** Convenience function for adaptFontSize that accepts a QSizeF instead two qreals - @since KDE 4.7 + @since 4.7 */ qreal KGUIADDONS_EXPORT adaptFontSize(QPainter &painter, const QString &text, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/src/text/kwordwrap.cpp new/kguiaddons-4.98.0/src/text/kwordwrap.cpp --- old/kguiaddons-4.97.0/src/text/kwordwrap.cpp 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/src/text/kwordwrap.cpp 2014-03-28 19:16:51.000000000 +0100 @@ -21,7 +21,7 @@ #include <QPainter> #include <QtCore/QVector> -class KWordWrapPrivate +class KWordWrapPrivate : public QSharedData { public: QRect m_constrainingRect; @@ -32,23 +32,23 @@ }; KWordWrap::KWordWrap(const QRect &r) - : d(new KWordWrapPrivate) + : d(new KWordWrapPrivate) { d->m_constrainingRect = r; } -KWordWrap *KWordWrap::formatText(QFontMetrics &fm, const QRect &r, int /*flags*/, const QString &str, int len) +KWordWrap KWordWrap::formatText(QFontMetrics &fm, const QRect &r, int /*flags*/, const QString &str, int len) { - KWordWrap *kw = new KWordWrap(r); + KWordWrap kw(r); // The wordwrap algorithm // The variable names and the global shape of the algorithm are inspired // from QTextFormatterBreakWords::format(). //qDebug() << "KWordWrap::formatText " << str << " r=" << r.x() << "," << r.y() << " " << r.width() << "x" << r.height(); int height = fm.height(); if (len == -1) { - kw->d->m_text = str; + kw.d->m_text = str; } else { - kw->d->m_text = str.left(len); + kw.d->m_text = str.left(len); } if (len == -1) { len = str.length(); @@ -107,15 +107,15 @@ lastBreak = -1; } // remove the line feed from the string - kw->d->m_text.remove(i, 1); + kw.d->m_text.remove(i, 1); inputString.remove(i, 1); len--; } if (breakAt != -1) { //qDebug() << "KWordWrap::formatText breaking after " << breakAt; - kw->d->m_breakPositions.append(breakAt); + kw.d->m_breakPositions.append(breakAt); int thisLineWidth = lastBreak == -1 ? x + ww : lineWidth; - kw->d->m_lineWidths.append(thisLineWidth); + kw.d->m_lineWidths.append(thisLineWidth); textwidth = qMax(textwidth, thisLineWidth); x = 0; y += height; @@ -136,7 +136,7 @@ wasParens = isParens; } textwidth = qMax(textwidth, x); - kw->d->m_lineWidths.append(x); + kw.d->m_lineWidths.append(x); y += height; //qDebug() << "KWordWrap::formatText boundingRect:" << r.x() << "," << r.y() << " " << textwidth << "x" << y; if (r.height() >= 0 && y > r.height()) { @@ -149,13 +149,23 @@ } realY = qMax(realY, 0); } - kw->d->m_boundingRect.setRect(0, 0, textwidth, realY); + kw.d->m_boundingRect.setRect(0, 0, textwidth, realY); return kw; } KWordWrap::~KWordWrap() { - delete d; +} + +KWordWrap::KWordWrap(const KWordWrap &other) + : d(other.d) +{ +} + +KWordWrap &KWordWrap::operator=(const KWordWrap &other) +{ + d = other.d; + return *this; } QString KWordWrap::wrappedString() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/src/text/kwordwrap.h new/kguiaddons-4.98.0/src/text/kwordwrap.h --- old/kguiaddons-4.97.0/src/text/kwordwrap.h 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/src/text/kwordwrap.h 2014-03-28 19:16:51.000000000 +0100 @@ -20,13 +20,14 @@ #define kwordwrap_h #include <kguiaddons_export.h> -#include <qglobal.h> +#include <QSharedDataPointer> #include <qnamespace.h> class QFontMetrics; class QRect; class QString; class QPainter; +class KWordWrapPrivate; /** * Word-wrap algorithm that takes into account beautifulness ;) @@ -67,7 +68,7 @@ * @param len Length of text to wrap (default is -1 for all). * @return a KWordWrap instance. The caller is responsible for storing and deleting the result. */ - static KWordWrap *formatText(QFontMetrics &fm, const QRect &r, int flags, const QString &str, int len = -1); // KDE5 TODO: return a value, not a pointer, and use QSharedDataPointer. + static KWordWrap formatText(QFontMetrics &fm, const QRect &r, int flags, const QString &str, int len = -1); /** * @return the bounding rect, calculated by formatText. The width is the @@ -110,6 +111,15 @@ ~KWordWrap(); /** + * Copy constructor + */ + KWordWrap(const KWordWrap &other); + /** + * Assignment operator + */ + KWordWrap &operator=(const KWordWrap &other); + + /** * Draws the string @p t at the given coordinates, if it does not * @p fit into @p maxW the text will be faded out. * @param p the painter to use. Must have set the pen for the text @@ -136,9 +146,8 @@ const QString &t); private: - Q_DISABLE_COPY(KWordWrap) KWordWrap(const QRect &r); - class KWordWrapPrivate *const d; + QExplicitlySharedDataPointer<KWordWrapPrivate> d; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-4.97.0/src/util/kmodifierkeyinfoprovider_x11.cpp new/kguiaddons-4.98.0/src/util/kmodifierkeyinfoprovider_x11.cpp --- old/kguiaddons-4.97.0/src/util/kmodifierkeyinfoprovider_x11.cpp 2014-03-01 12:50:50.000000000 +0100 +++ new/kguiaddons-4.98.0/src/util/kmodifierkeyinfoprovider_x11.cpp 2014-03-28 19:16:51.000000000 +0100 @@ -23,7 +23,7 @@ #include "kmodifierkeyinfoprovider_p.h" #include <QGuiApplication> -#include <qpa/qplatformnativeinterface.h> +#include <QX11Info> #define XK_MISCELLANY #define XK_XKB_KEYS @@ -68,21 +68,6 @@ return mask; } -// same as QX11Info::display, reimplemented to not have to link QtX11Extras -Display *display() -{ - if (!qApp) { - return NULL; - } - QPlatformNativeInterface *native = qApp->platformNativeInterface(); - if (!native) { - return NULL; - } - - void *display = native->nativeResourceForScreen(QByteArray("display"), QGuiApplication::primaryScreen()); - return reinterpret_cast<Display *>(display); -} - KModifierKeyInfoProvider::KModifierKeyInfoProvider() : QObject(0) , QAbstractNativeEventFilter() @@ -92,17 +77,17 @@ if (qApp) { if (qApp->platformName() == QStringLiteral("xcb")) { int code, xkberr, maj, min; - m_xkbAvailable = XkbQueryExtension(display(), &code, &m_xkbEv, &xkberr, &maj, &min); + m_xkbAvailable = XkbQueryExtension(QX11Info::display(), &code, &m_xkbEv, &xkberr, &maj, &min); } } if (m_xkbAvailable) { - XkbSelectEvents(display(), XkbUseCoreKbd, + XkbSelectEvents(QX11Info::display(), XkbUseCoreKbd, XkbStateNotifyMask | XkbMapNotifyMask, XkbStateNotifyMask | XkbMapNotifyMask); unsigned long int stateMask = XkbModifierStateMask | XkbModifierBaseMask | XkbModifierLatchMask | XkbModifierLockMask | XkbPointerButtonMask; - XkbSelectEventDetails(display(), XkbUseCoreKbd, XkbStateNotifyMask, + XkbSelectEventDetails(QX11Info::display(), XkbUseCoreKbd, XkbStateNotifyMask, stateMask, stateMask); } @@ -118,7 +103,7 @@ // get the initial state if (m_xkbAvailable) { XkbStateRec state; - XkbGetState(display(), XkbUseCoreKbd, &state); + XkbGetState(QX11Info::display(), XkbUseCoreKbd, &state); xkbModifierStateChanged(state.mods, state.latched_mods, state.locked_mods); xkbButtonStateChanged(state.ptr_buttons); @@ -139,7 +124,7 @@ return false; } - return XkbLatchModifiers(display(), XkbUseCoreKbd, + return XkbLatchModifiers(QX11Info::display(), XkbUseCoreKbd, m_xkbModifiers[key], latched ? m_xkbModifiers[key] : 0); } @@ -149,7 +134,7 @@ return false; } - return XkbLockModifiers(display(), XkbUseCoreKbd, + return XkbLockModifiers(QX11Info::display(), XkbUseCoreKbd, m_xkbModifiers[key], locked ? m_xkbModifiers[key] : 0); } @@ -328,7 +313,7 @@ << ModifierDefinition(Qt::Key_CapsLock, LockMask, 0, 0) << ModifierDefinition(Qt::Key_ScrollLock, 0, "ScrollLock", XK_Scroll_Lock); - XkbDescPtr xkb = XkbGetKeyboard(display(), XkbAllComponentsMask, XkbUseCoreKbd); + XkbDescPtr xkb = XkbGetKeyboard(QX11Info::display(), XkbAllComponentsMask, XkbUseCoreKbd); QList<ModifierDefinition>::const_iterator it; QList<ModifierDefinition>::const_iterator end = srcModifiers.constEnd(); @@ -340,13 +325,13 @@ mask = xkbVirtualModifier(xkb, it->name); } if (mask == 0 && it->keysym != 0) { - mask = XkbKeysymToModifiers(display(), it->keysym); + mask = XkbKeysymToModifiers(QX11Info::display(), it->keysym); } else if (mask == 0) { // special case for AltGr - mask = XkbKeysymToModifiers(display(), XK_Mode_switch) | - XkbKeysymToModifiers(display(), XK_ISO_Level3_Shift) | - XkbKeysymToModifiers(display(), XK_ISO_Level3_Latch) | - XkbKeysymToModifiers(display(), XK_ISO_Level3_Lock); + mask = XkbKeysymToModifiers(QX11Info::display(), XK_Mode_switch) | + XkbKeysymToModifiers(QX11Info::display(), XK_ISO_Level3_Shift) | + XkbKeysymToModifiers(QX11Info::display(), XK_ISO_Level3_Latch) | + XkbKeysymToModifiers(QX11Info::display(), XK_ISO_Level3_Lock); } } -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de