Hello community,
here is the log from the commit of package frameworkintegration for openSUSE:Factory checked in at 2014-04-02 17:21:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/frameworkintegration (Old)
and /work/SRC/openSUSE:Factory/.frameworkintegration.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "frameworkintegration"
Changes:
--------
--- /work/SRC/openSUSE:Factory/frameworkintegration/frameworkintegration.changes 2014-03-10 12:18:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.frameworkintegration.new/frameworkintegration.changes 2014-04-02 17:21:45.000000000 +0200
@@ -1,0 +2,9 @@
+Sat Mar 29 19:47:19 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
+
+-------------------------------------------------------------------
Old:
----
frameworkintegration-4.97.0.tar.xz
New:
----
frameworkintegration-4.98.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ frameworkintegration.spec ++++++
--- /var/tmp/diff_new_pack.TE0t96/_old 2014-04-02 17:21:46.000000000 +0200
+++ /var/tmp/diff_new_pack.TE0t96/_new 2014-04-02 17:21:46.000000000 +0200
@@ -18,10 +18,10 @@
%define lname libKF5Style5
Name: frameworkintegration
-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: kconfig-devel >= %{_kf5_version}
BuildRequires: kconfigwidgets-devel >= %{_kf5_version}
++++++ frameworkintegration-4.97.0.tar.xz -> frameworkintegration-4.98.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/CMakeLists.txt new/frameworkintegration-4.98.0/CMakeLists.txt
--- old/frameworkintegration-4.97.0/CMakeLists.txt 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/CMakeLists.txt 2014-03-28 19:15:59.000000000 +0100
@@ -2,7 +2,7 @@
project(FrameworkIntegration)
-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})
@@ -19,7 +19,7 @@
set(REQUIRED_QT_VERSION 5.2.0)
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus)
-set(KF5_VERSION "4.97.0")
+set(KF5_VERSION "4.98.0")
ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX FRAMEWORKINTEGRATION
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/frameworkintegration_version.h"
@@ -34,6 +34,13 @@
find_package(KF5Notifications ${KF5_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_VERSION} REQUIRED)
+find_package(OxygenFont 0.4)
+
+set_package_properties(OxygenFont PROPERTIES
+ PURPOSE "Default font for KDE Applications"
+ TYPE RUNTIME
+)
+
add_subdirectory(src)
add_subdirectory(autotests)
add_subdirectory(tests)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/autotests/CMakeLists.txt new/frameworkintegration-4.98.0/autotests/CMakeLists.txt
--- old/frameworkintegration-4.97.0/autotests/CMakeLists.txt 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/autotests/CMakeLists.txt 2014-03-28 19:15:59.000000000 +0100
@@ -19,7 +19,7 @@
add_executable(${_testname} ${_testname}.cpp ${ARGN})
add_test(frameworkintegration-${_testname} ${_testname})
ecm_mark_as_test(${_testname})
- target_link_libraries(${_testname} Qt5::Test Qt5::DBus KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::Style KF5::KIOFileWidgets KF5::I18n)
+ target_link_libraries(${_testname} Qt5::Test Qt5::DBus KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::Style KF5::KIOFileWidgets KF5::I18n KF5::Notifications)
endmacro()
frameworkintegration_tests(
@@ -28,6 +28,7 @@
../src/platformtheme/kfontsettingsdata.cpp
../src/platformtheme/khintssettings.cpp
../src/platformtheme/kdeplatformfiledialoghelper.cpp
+ ../src/platformtheme/kdeplatformsystemtrayicon.cpp
)
frameworkintegration_tests(
@@ -38,3 +39,7 @@
frameworkintegration_tests(
kstyle_unittest
)
+
+frameworkintegration_tests(
+ kfiledialog_unittest
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/autotests/kfiledialog_unittest.cpp new/frameworkintegration-4.98.0/autotests/kfiledialog_unittest.cpp
--- old/frameworkintegration-4.97.0/autotests/kfiledialog_unittest.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/frameworkintegration-4.98.0/autotests/kfiledialog_unittest.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ * Copyright 2014 Dominik Haumann
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License or ( at
+ * your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ * act as a proxy as in section 14 of the GPLv3 ), any later version.
+ *
+ * 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 Lesser 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 <QTest>
+#include <QFileDialog>
+
+#include <QDebug>
+
+class KFileDialog_UnitTest : public QObject
+{
+ Q_OBJECT
+private Q_SLOTS:
+ void initTestCase()
+ {
+ }
+
+ void cleanupTestCase()
+ {
+ }
+
+ void testSetNameFilters()
+ {
+ QFileDialog dialog;
+
+ QStringList nameFilterList = QStringList() << "c (*.cpp)" << "h (*.h)";
+ dialog.setNameFilters(nameFilterList);
+ QCOMPARE(dialog.nameFilters(), nameFilterList);
+ }
+
+ void testSelectNameFilter()
+ {
+ QFileDialog dialog;
+
+ QStringList nameFilterList = QStringList() << "c (*.cpp)" << "h (*.h)";
+ dialog.setNameFilters(nameFilterList);
+ QCOMPARE(dialog.nameFilters(), nameFilterList);
+
+ QString selectNameFilter("h (*.h)");
+ dialog.selectNameFilter(selectNameFilter);
+ QEXPECT_FAIL("", "Does currently not work. Works, once the dialog gets shown, though.", Continue);
+ QCOMPARE(dialog.selectedNameFilter(), selectNameFilter);
+
+ dialog.show();
+ QCOMPARE(dialog.selectedNameFilter(), selectNameFilter);
+ }
+
+};
+
+QTEST_MAIN(KFileDialog_UnitTest)
+
+#include "kfiledialog_unittest.moc"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/autotests/kfontsettingsdata_unittest.cpp new/frameworkintegration-4.98.0/autotests/kfontsettingsdata_unittest.cpp
--- old/frameworkintegration-4.97.0/autotests/kfontsettingsdata_unittest.cpp 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/autotests/kfontsettingsdata_unittest.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -51,7 +51,10 @@
QFile::copy(CONFIGFILE, configPath);
}
-Q_COREAPP_STARTUP_FUNCTION(prepareEnvironment);
+// Run prepareEnvironment before qApp is created! slightly incorrect, QFile::encodeName can be wrong then.
+// But we can't use Q_COREAPP_STARTUP_FUNCTION because the platform theme ends up being created
+// first, with the wrong environment.
+Q_CONSTRUCTOR_FUNCTION(prepareEnvironment);
class KFontSettingsData_UnitTest : public QWidget
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/Messages.sh new/frameworkintegration-4.98.0/src/Messages.sh
--- old/frameworkintegration-4.97.0/src/Messages.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/Messages.sh 2014-03-28 19:15:59.000000000 +0100
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources.
+# The results are stored in a pseudo .cpp file to be picked up by xgettext.
+lst=`find . -name \*.rc -o -name \*.ui -o -name \*.kcfg`
+if [ -n "$lst" ] ; then
+ $EXTRACTRC $lst >> rc.cpp
+fi
+
+# If your framework contains tips-of-the-day, call preparetips as well.
+if [ -f "data/tips" ] ; then
+ ( cd data && $PREPARETIPS > ../tips.cpp )
+fi
+
+# Extract strings from all source files.
+# If your framework depends on KI18n, use $XGETTEXT. If it uses Qt translation
+# system, use $EXTRACT_TR_STRINGS.
+$XGETTEXT `find . -name \*.cpp -o -name \*.h -name \*.qml` -o $podir/frameworkintegration5.pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/CMakeLists.txt new/frameworkintegration-4.98.0/src/platformtheme/CMakeLists.txt
--- old/frameworkintegration-4.97.0/src/platformtheme/CMakeLists.txt 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/CMakeLists.txt 2014-03-28 19:15:59.000000000 +0100
@@ -4,6 +4,7 @@
kfontsettingsdata.cpp
khintssettings.cpp
kdeplatformfiledialoghelper.cpp
+ kdeplatformsystemtrayicon.cpp
main.cpp
)
@@ -23,6 +24,7 @@
KF5::IconThemes
KF5::KIOFileWidgets
KF5::I18n
+ KF5::Notifications
)
install(TARGETS KDEPlatformTheme DESTINATION ${QT_PLUGIN_INSTALL_DIR}/platformthemes)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformfiledialoghelper.cpp new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformfiledialoghelper.cpp
--- old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformfiledialoghelper.cpp 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformfiledialoghelper.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -173,6 +173,9 @@
QStringList nameFilters = options()->nameFilters();
if (!nameFilters.isEmpty()) {
m_dialog->m_fileWidget->setFilter(qt2KdeFilter(nameFilters));
+ if (!options()->initiallySelectedNameFilter().isEmpty()) {
+ selectNameFilter(options()->initiallySelectedNameFilter());
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformsystemtrayicon.cpp new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformsystemtrayicon.cpp
--- old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformsystemtrayicon.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformsystemtrayicon.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -0,0 +1,327 @@
+/* This file is part of the KDE libraries
+ * Copyright 2014 Martin Gräßlin
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License or ( at
+ * your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ * act as a proxy as in section 14 of the GPLv3 ), any later version.
+ *
+ * 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 Lesser 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 "kdeplatformsystemtrayicon.h"
+#include
+#include <QAction>
+#include <QIcon>
+#include <QMenu>
+#include <QRect>
+#include <QApplication>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
+SystemTrayMenu::SystemTrayMenu()
+ : QPlatformMenu()
+ , m_tag(0)
+ , m_menu(new QMenu())
+{
+ connect(m_menu.data(), &QMenu::aboutToShow, this, &QPlatformMenu::aboutToShow);
+ connect(m_menu.data(), &QMenu::aboutToHide, this, &QPlatformMenu::aboutToHide);
+}
+
+SystemTrayMenu::~SystemTrayMenu()
+{
+}
+
+QPlatformMenuItem *SystemTrayMenu::createMenuItem() const
+{
+ return new SystemTrayMenuItem();
+}
+
+void SystemTrayMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before)
+{
+ if (SystemTrayMenuItem *ours = qobject_cast(menuItem)) {
+ bool inserted = false;
+ if (SystemTrayMenuItem *oursBefore = qobject_cast(before)) {
+ for (auto it = m_items.begin(); it != m_items.end(); ++it) {
+ if (*it == oursBefore) {
+ m_items.insert(it, ours);
+ m_menu->insertAction(oursBefore->action(), ours->action());
+ inserted = true;
+ break;
+ }
+ }
+ }
+ if (!inserted) {
+ m_items.append(ours);
+ m_menu->addAction(ours->action());
+ }
+ }
+}
+
+QPlatformMenuItem *SystemTrayMenu::menuItemAt(int position) const
+{
+ if (position < m_items.size()) {
+ return m_items.at(position);
+ }
+ return Q_NULLPTR;
+}
+
+QPlatformMenuItem *SystemTrayMenu::menuItemForTag(quintptr tag) const
+{
+ auto it = std::find_if(m_items.constBegin(), m_items.constEnd(), [tag](SystemTrayMenuItem *item) {
+ return item->tag() == tag;
+ });
+ if (it != m_items.constEnd()) {
+ return *it;
+ }
+ return Q_NULLPTR;
+}
+
+void SystemTrayMenu::removeMenuItem(QPlatformMenuItem *menuItem)
+{
+ if (SystemTrayMenuItem *ours = qobject_cast(menuItem)) {
+ m_items.removeOne(ours);
+ m_menu->removeAction(ours->action());
+ }
+}
+
+void SystemTrayMenu::setEnabled(bool enabled)
+{
+ m_menu->setEnabled(enabled);
+}
+
+void SystemTrayMenu::setIcon(const QIcon &icon)
+{
+ m_menu->setIcon(icon);
+}
+
+void SystemTrayMenu::setTag(quintptr tag)
+{
+ m_tag = tag;
+}
+
+void SystemTrayMenu::setText(const QString &text)
+{
+ m_menu->setTitle(text);
+}
+
+void SystemTrayMenu::setVisible(bool visible)
+{
+ m_menu->setVisible(visible);
+}
+
+void SystemTrayMenu::syncMenuItem(QPlatformMenuItem *menuItem)
+{
+ Q_UNUSED(menuItem)
+ // nothing to do
+}
+
+void SystemTrayMenu::syncSeparatorsCollapsible(bool enable)
+{
+ m_menu->setSeparatorsCollapsible(enable);
+}
+
+quintptr SystemTrayMenu::tag() const
+{
+ return m_tag;
+}
+
+QMenu *SystemTrayMenu::menu() const
+{
+ return m_menu.data();
+}
+
+SystemTrayMenuItem::SystemTrayMenuItem()
+ : QPlatformMenuItem()
+ , m_tag(0)
+ , m_menu(Q_NULLPTR)
+ , m_action(new QAction(this))
+{
+ connect(m_action, &QAction::triggered, this, &QPlatformMenuItem::activated);
+ connect(m_action, &QAction::hovered, this, &QPlatformMenuItem::hovered);
+}
+
+SystemTrayMenuItem::~SystemTrayMenuItem()
+{
+}
+
+void SystemTrayMenuItem::setCheckable(bool checkable)
+{
+ m_action->setCheckable(checkable);
+}
+
+void SystemTrayMenuItem::setChecked(bool isChecked)
+{
+ m_action->setChecked(isChecked);
+}
+
+void SystemTrayMenuItem::setEnabled(bool enabled)
+{
+ m_action->setEnabled(enabled);
+}
+
+void SystemTrayMenuItem::setFont(const QFont &font)
+{
+ m_action->setFont(font);
+}
+
+void SystemTrayMenuItem::setIcon(const QIcon &icon)
+{
+ m_action->setIcon(icon);
+}
+
+void SystemTrayMenuItem::setIsSeparator(bool isSeparator)
+{
+ m_action->setSeparator(isSeparator);
+}
+
+void SystemTrayMenuItem::setMenu(QPlatformMenu *menu)
+{
+ m_menu = menu;
+}
+
+void SystemTrayMenuItem::setRole(QPlatformMenuItem::MenuRole role)
+{
+ Q_UNUSED(role)
+}
+
+void SystemTrayMenuItem::setShortcut(const QKeySequence &shortcut)
+{
+ m_action->setShortcut(shortcut);
+}
+
+void SystemTrayMenuItem::setTag(quintptr tag)
+{
+ m_tag = tag;
+}
+
+void SystemTrayMenuItem::setText(const QString &text)
+{
+ m_action->setText(text);
+}
+
+void SystemTrayMenuItem::setVisible(bool isVisible)
+{
+ m_action->setVisible(isVisible);
+}
+
+quintptr SystemTrayMenuItem::tag() const
+{
+ return m_tag;
+}
+
+QAction *SystemTrayMenuItem::action() const
+{
+ return m_action;
+}
+#endif
+
+KDEPlatformSystemTrayIcon::KDEPlatformSystemTrayIcon()
+ : QPlatformSystemTrayIcon()
+ , m_sni(Q_NULLPTR)
+{
+}
+
+KDEPlatformSystemTrayIcon::~KDEPlatformSystemTrayIcon()
+{
+}
+
+void KDEPlatformSystemTrayIcon::init()
+{
+ if (!m_sni) {
+ m_sni = new KStatusNotifierItem();
+ m_sni->setTitle(QApplication::applicationDisplayName());
+ connect(m_sni, &KStatusNotifierItem::activateRequested, [this](bool active, const QPoint &pos) {
+ Q_UNUSED(active)
+ Q_UNUSED(pos)
+ emit activated(QPlatformSystemTrayIcon::Trigger);
+ });
+ connect(m_sni, &KStatusNotifierItem::secondaryActivateRequested, [this](const QPoint &pos) {
+ Q_UNUSED(pos)
+ emit activated(QPlatformSystemTrayIcon::Context);
+ });
+ }
+}
+
+void KDEPlatformSystemTrayIcon::cleanup()
+{
+ delete m_sni;
+ m_sni = Q_NULLPTR;
+}
+
+void KDEPlatformSystemTrayIcon::updateIcon(const QIcon &icon)
+{
+ if (!m_sni) {
+ return;
+ }
+ if (icon.name().isEmpty()) {
+ m_sni->setIconByPixmap(icon);
+ m_sni->setToolTipIconByPixmap(icon);
+ } else {
+ m_sni->setIconByName(icon.name());
+ m_sni->setToolTipIconByName(icon.name());
+ }
+}
+
+void KDEPlatformSystemTrayIcon::updateToolTip(const QString &tooltip)
+{
+ if (!m_sni) {
+ return;
+ }
+ m_sni->setToolTipTitle(tooltip);
+}
+
+void KDEPlatformSystemTrayIcon::updateMenu(QPlatformMenu *menu)
+{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
+ if (!m_sni) {
+ return;
+ }
+ if (SystemTrayMenu *ourMenu = qobject_cast(menu)) {
+ m_sni->setContextMenu(ourMenu->menu());
+ }
+#else
+ Q_UNUSED(menu)
+#endif
+}
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
+QPlatformMenu *KDEPlatformSystemTrayIcon::createMenu() const
+{
+ return new SystemTrayMenu();
+}
+#endif
+
+QRect KDEPlatformSystemTrayIcon::geometry() const
+{
+ // StatusNotifierItem doesn't provide the geometry
+ return QRect();
+}
+
+void KDEPlatformSystemTrayIcon::showMessage(const QString &msg, const QString &title,
+ const QIcon &icon, MessageIcon iconType, int secs)
+{
+ Q_UNUSED(iconType)
+ if (!m_sni) {
+ return;
+ }
+ m_sni->showMessage(title, msg, icon.themeName(), secs);
+}
+
+bool KDEPlatformSystemTrayIcon::isSystemTrayAvailable() const
+{
+ // TODO: check on DBus
+ return true;
+}
+
+bool KDEPlatformSystemTrayIcon::supportsMessages() const
+{
+ return true;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformsystemtrayicon.h new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformsystemtrayicon.h
--- old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformsystemtrayicon.h 1970-01-01 01:00:00.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformsystemtrayicon.h 2014-03-28 19:15:59.000000000 +0100
@@ -0,0 +1,115 @@
+/* This file is part of the KDE libraries
+ * Copyright 2014 Martin Gräßlin
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License or ( at
+ * your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ * act as a proxy as in section 14 of the GPLv3 ), any later version.
+ *
+ * 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 Lesser 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 KDEPLATFORMSYSTEMTRAYICON_H
+#define KDEPLATFORMSYSTEMTRAYICON_H
+
+#include
+#include
+
+class KStatusNotifierItem;
+class SystemTrayMenuItem;
+class QAction;
+class QMenu;
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
+class SystemTrayMenu : public QPlatformMenu
+{
+ Q_OBJECT
+public:
+ SystemTrayMenu();
+ ~SystemTrayMenu() Q_DECL_OVERRIDE;
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
+ QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE;
+ void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
+ void setEnabled(bool enabled) Q_DECL_OVERRIDE;
+ void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
+ void setTag(quintptr tag) Q_DECL_OVERRIDE;
+ void setText(const QString &text) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
+ void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE;
+ quintptr tag() const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *createMenuItem() const Q_DECL_OVERRIDE;
+
+ QMenu *menu() const;
+
+private:
+ quintptr m_tag;
+ QScopedPointer<QMenu> m_menu;
+ QList m_items;
+};
+
+class SystemTrayMenuItem : public QPlatformMenuItem
+{
+ Q_OBJECT
+public:
+ SystemTrayMenuItem();
+ ~SystemTrayMenuItem() Q_DECL_OVERRIDE;
+ void setCheckable(bool checkable) Q_DECL_OVERRIDE;
+ void setChecked(bool isChecked) Q_DECL_OVERRIDE;
+ void setEnabled(bool enabled) Q_DECL_OVERRIDE;
+ void setFont(const QFont &font) Q_DECL_OVERRIDE;
+ void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
+ void setIsSeparator(bool isSeparator) Q_DECL_OVERRIDE;
+ void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
+ void setRole(MenuRole role) Q_DECL_OVERRIDE;
+ void setShortcut(const QKeySequence &shortcut) Q_DECL_OVERRIDE;
+ void setTag(quintptr tag) Q_DECL_OVERRIDE;
+ void setText(const QString &text) Q_DECL_OVERRIDE;
+ void setVisible(bool isVisible) Q_DECL_OVERRIDE;
+ quintptr tag() const Q_DECL_OVERRIDE;
+
+ QAction *action() const;
+
+private:
+ quintptr m_tag;
+ QPlatformMenu *m_menu;
+ QAction *m_action;
+};
+#endif
+
+class KDEPlatformSystemTrayIcon : public QPlatformSystemTrayIcon
+{
+public:
+ KDEPlatformSystemTrayIcon();
+ ~KDEPlatformSystemTrayIcon() Q_DECL_OVERRIDE;
+
+ void init() Q_DECL_OVERRIDE;
+ void cleanup() Q_DECL_OVERRIDE;
+ void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE;
+ void updateToolTip(const QString &tooltip) Q_DECL_OVERRIDE;
+ void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
+ QRect geometry() const Q_DECL_OVERRIDE;
+ void showMessage(const QString &msg, const QString &title,
+ const QIcon &icon, MessageIcon iconType, int secs) Q_DECL_OVERRIDE;
+
+ bool isSystemTrayAvailable() const Q_DECL_OVERRIDE;
+ bool supportsMessages() const Q_DECL_OVERRIDE;
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
+ QPlatformMenu *createMenu() const Q_DECL_OVERRIDE;
+#endif
+
+private:
+ KStatusNotifierItem *m_sni;
+};
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformtheme.cpp new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformtheme.cpp
--- old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformtheme.cpp 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformtheme.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -23,6 +23,7 @@
#include "kfontsettingsdata.h"
#include "khintssettings.h"
#include "kdeplatformfiledialoghelper.h"
+#include "kdeplatformsystemtrayicon.h"
#include <QCoreApplication>
#include <QFont>
@@ -211,3 +212,8 @@
return 0;
}
}
+
+QPlatformSystemTrayIcon *KdePlatformTheme::createPlatformSystemTrayIcon() const
+{
+ return new KDEPlatformSystemTrayIcon;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformtheme.h new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformtheme.h
--- old/frameworkintegration-4.97.0/src/platformtheme/kdeplatformtheme.h 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/kdeplatformtheme.h 2014-03-28 19:15:59.000000000 +0100
@@ -46,6 +46,8 @@
virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;
virtual bool usePlatformNativeDialog(DialogType type) const;
+ virtual QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
+
private:
void loadSettings();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/kfontsettingsdata.cpp new/frameworkintegration-4.98.0/src/platformtheme/kfontsettingsdata.cpp
--- old/frameworkintegration-4.97.0/src/platformtheme/kfontsettingsdata.cpp 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/kfontsettingsdata.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -52,12 +52,12 @@
static const char DefaultFont[] = "Sans Serif";
static const KFontData DefaultFontData[KFontSettingsData::FontTypesCount] = {
- { GeneralId, "font", DefaultFont, 9, -1, QFont::SansSerif },
- { GeneralId, "fixed", "Monospace", 9, -1, QFont::TypeWriter },
- { GeneralId, "toolBarFont", DefaultFont, 8, -1, QFont::SansSerif },
- { GeneralId, "menuFont", DefaultFont, 9, -1, QFont::SansSerif },
- { "WM", "activeFont", DefaultFont, 8, -1, QFont::SansSerif },
- { GeneralId, "taskbarFont", DefaultFont, 9, -1, QFont::SansSerif },
+ { GeneralId, "font", DefaultFont, 10, -1, QFont::SansSerif },
+ { GeneralId, "fixed", "Oxygen Mono", 9, -1, QFont::TypeWriter },
+ { GeneralId, "toolBarFont", DefaultFont, 9, -1, QFont::SansSerif },
+ { GeneralId, "menuFont", DefaultFont, 10, -1, QFont::SansSerif },
+ { "WM", "activeFont", DefaultFont, 10, -1, QFont::SansSerif },
+ { GeneralId, "taskbarFont", DefaultFont, 10, -1, QFont::SansSerif },
{ GeneralId, "smallestReadableFont", DefaultFont, 8, -1, QFont::SansSerif }
};
@@ -71,7 +71,7 @@
cachedFont->setStyleHint(fontData.StyleHint);
if (!mKdeGlobals) {
- mKdeGlobals = KSharedConfig::openConfig("kdeglobals");
+ mKdeGlobals = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals);
}
const KConfigGroup configGroup(mKdeGlobals, fontData.ConfigGroupKey);
QString fontInfo = configGroup.readEntry(fontData.ConfigKey, QString());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/khintssettings.cpp new/frameworkintegration-4.98.0/src/platformtheme/khintssettings.cpp
--- old/frameworkintegration-4.97.0/src/platformtheme/khintssettings.cpp 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/khintssettings.cpp 2014-03-28 19:15:59.000000000 +0100
@@ -44,21 +44,21 @@
KHintsSettings::KHintsSettings() : QObject(0)
{
- KSharedConfig::Ptr ptr = KSharedConfig::openConfig("kdeglobals");
- KConfigGroup cg(ptr, "KDE");
+ mKdeGlobals = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals);
+ KConfigGroup cg(mKdeGlobals, "KDE");
m_hints[QPlatformTheme::CursorFlashTime] = qBound(200, cg.readEntry("CursorBlinkRate", 1000), 2000);
m_hints[QPlatformTheme::MouseDoubleClickInterval] = cg.readEntry("DoubleClickInterval", 400);
m_hints[QPlatformTheme::StartDragDistance] = cg.readEntry("StartDragDist", 10);
m_hints[QPlatformTheme::StartDragTime] = cg.readEntry("StartDragTime", 500);
- KConfigGroup cgToolbar(ptr, "Toolbar style");
+ KConfigGroup cgToolbar(mKdeGlobals, "Toolbar style");
m_hints[QPlatformTheme::ToolButtonStyle] = toolButtonStyle(cgToolbar);
- KConfigGroup cgToolbarIcon(ptr, "MainToolbarIcons");
+ KConfigGroup cgToolbarIcon(mKdeGlobals, "MainToolbarIcons");
m_hints[QPlatformTheme::ToolBarIconSize] = cgToolbarIcon.readEntry("Size", 22);
m_hints[QPlatformTheme::ItemViewActivateItemOnSingleClick] = cg.readEntry("SingleClick", true);
- KConfigGroup cgIcons(ptr, "Icons");
+ KConfigGroup cgIcons(mKdeGlobals, "Icons");
m_hints[QPlatformTheme::SystemIconThemeName] = cgIcons.readEntry("Theme", "oxygen");
m_hints[QPlatformTheme::SystemIconFallbackThemeName] = "hicolor";
m_hints[QPlatformTheme::IconThemeSearchPaths] = xdgIconThemePaths();
@@ -131,9 +131,8 @@
void KHintsSettings::toolbarStyleChanged()
{
- KSharedConfig::Ptr ptr = KSharedConfig::openConfig("kdeglobals");
- ptr->reparseConfiguration();
- KConfigGroup cg(ptr, "Toolbar style");
+ mKdeGlobals->reparseConfiguration();
+ KConfigGroup cg(mKdeGlobals, "Toolbar style");
m_hints[QPlatformTheme::ToolButtonStyle] = toolButtonStyle(cg);
//from gtksymbol.cpp
@@ -149,9 +148,8 @@
void KHintsSettings::slotNotifyChange(int type, int arg)
{
- KSharedConfig::Ptr ptr = KSharedConfig::openConfig("kdeglobals");
- ptr->reparseConfiguration();
- KConfigGroup cg(ptr, "KDE");
+ mKdeGlobals->reparseConfiguration();
+ KConfigGroup cg(mKdeGlobals, "KDE");
switch (type) {
case PaletteChanged: {
@@ -205,8 +203,7 @@
{
KIconLoader::Group iconGroup = (KIconLoader::Group) group;
if (iconGroup != KIconLoader::MainToolbar) {
- KSharedConfig::Ptr ptr = KSharedConfig::openConfig("kdeglobals");
- KConfigGroup cgIcons(ptr, "Icons");
+ KConfigGroup cgIcons(mKdeGlobals, "Icons");
m_hints[QPlatformTheme::SystemIconThemeName] = cgIcons.readEntry("Theme", "oxygen");
return;
}
@@ -273,6 +270,5 @@
qDeleteAll(m_palettes);
m_palettes.clear();
- KSharedConfig::Ptr globals = KSharedConfig::openConfig("kdeglobals");
- m_palettes[QPlatformTheme::SystemPalette] = new QPalette(KColorScheme::createApplicationPalette(globals));
+ m_palettes[QPlatformTheme::SystemPalette] = new QPalette(KColorScheme::createApplicationPalette(mKdeGlobals));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frameworkintegration-4.97.0/src/platformtheme/khintssettings.h new/frameworkintegration-4.98.0/src/platformtheme/khintssettings.h
--- old/frameworkintegration-4.97.0/src/platformtheme/khintssettings.h 2014-03-01 12:50:02.000000000 +0100
+++ new/frameworkintegration-4.98.0/src/platformtheme/khintssettings.h 2014-03-28 19:15:59.000000000 +0100
@@ -25,6 +25,7 @@
#include <QVariant>
#include
+#include
class KConfigGroup;
@@ -80,6 +81,7 @@
QStringList xdgIconThemePaths() const;
QHash m_palettes;
QHash m_hints;
+ KSharedConfigPtr mKdeGlobals;
};
#endif //KHINTS_SETTINGS_H
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org