diff --git a/AUTHORS b/AUTHORS index 06a7892..717d2f2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,8 +3,7 @@ Upstream Authors: Hong Jen Yee (PCMan) Copyright: - Copyright (c) 2013-2014 LXQt team + Copyright (c) 2013-2016 LXQt team License: LGPL-2.1+ The full text of the licenses can be found in the 'COPYING' file. -src/qiconloader_p.h is under LGPL-2.1 or 3 with Digia Qt LGPL Exception version 1.1 diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..c595fe3 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,72 @@ + +lxqt-qtplugin-0.11.0 / 2016-09-24 +================================= + + * Add Qt5XdgIconLoader as dependency (#13) + * Update README.md + * statusnotifieritem: Correctly handle menu + * Cleaned up licenses + * Use XdgIconLoader library (#10) + * xdgIconThemePaths: Use QString::SkipEmptyParts + * xdgIconThemePaths: Remove duplicated paths + * Adds $XDG_DATA_HOME to the XdgIconThemePaths + * Bump year in AUTHORS + +0.10.0 / 2015-11-02 +=================== + + * Remove unnecessary qDebug calls + * Use markdown for README + * Fix license file + * Fix mixed indents + * Remove Qt >= 5.3 check + * Removed GPL2, added Digia Qt LGPL Exception version 1.1 + * SNI: don't create a SNI if support isn't available + * SNI: monitor the watcher in case the host restarts + * SNI: implement scroll, showMessage and improve icons + * SNI: create default context menu + * Support the StatusNotifierItem spec natively + * Use the standard palette of the current Qt theme + * Handles CMake policy CMP0063 + * Use the LXQtCompilerSettings CMake module + * Add .gitignore + * Updates the build system to use the Targets infrastructure + * Remove trailing whitespaces + * removed debug (which makes every app too verbose) + +0.9.0 / 2015-01-19 +================== + + * Try to workaround bug #441 - All LXQt::Settings and QSettings file change monitoring stop working. + * - Unify naming for a unique lxqt. No more suffixes + * Qt5: Use XDG_DATA_DIR for themeHint::IconThemeSearchPaths + * CMakeLists.txt cleanuop and drop Qt4 support + +0.8.0 / 2014-07-18 +================== + + * Apply the default application font on program startup. + * Apply the new font to all apps correctly and fix lxde/lxde-qt bug #212 - Changing font or theme in lxqt-config-appearance has no effect. + * Make the code compile with Qt 5.2, fix lxde-qt bug #207. + * Fix lxde-qt bug #207: lxqt-qtplugin fail to build with Qt5. + * Use qmake to query the path of Qt5 plugin dir, which is much more reliable. + * Update README and provide information for usage and debugging. + * Use a more reliable and portable way to get the path of Qt5 plugin dir. + * Support setting default UI font. + * Make "oxygen" the default icon theme name. * Apply new style name and icon theme name when the config file is changed. + * Simplify the Qt5 plugin and remove liblxqt dependency from it. + * Correctly read config values. + * Try to load some Qt settings. + * Implement a very basic Qt5 platform theme plugin. + * Prepare for Qt5 support. + * Use preferred header style. + * Remove unnecessary debug messages. + * Fix int-to-enum casting + +0.7.0 / 2014-04-29 +================== + + * Update AUTHORS and COPYING + * Add CPack rules for creating tarball + * Support toolbar styles and activating items with single click. + * Initial import. diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c3bcb7..3e3607f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ find_package(Qt5DBus REQUIRED QUIET) find_package(dbusmenu-qt5 REQUIRED QUIET) find_package(lxqt REQUIRED QUIET) +find_package(Qt5XdgIconLoader REQUIRED QUIET) include(LXQtCompilerSettings NO_POLICY_SCOPE) diff --git a/Digia-Qt-LGPL-Exception-version-1.1 b/Digia-Qt-LGPL-Exception-version-1.1 deleted file mode 100644 index 6e6fb3a..0000000 --- a/Digia-Qt-LGPL-Exception-version-1.1 +++ /dev/null @@ -1,25 +0,0 @@ -Digia Qt LGPL Exception version 1.1 -=================================== - -As an additional permission to the GNU Lesser General Public License version -2.1, the object code form of a "work that uses the Library" may incorporate -material from a header file that is part of the Library. You may distribute -such object code under terms of your choice, provided that: - - (i) the header files of the Library have not been modified; and - (ii) the incorporated material is limited to numerical parameters, data - structure layouts, accessors, macros, inline functions and - templates; and - (iii) you comply with the terms of Section 6 of the GNU Lesser General - Public License version 2.1. - -Moreover, you may apply this exception to a modified version of the Library, -provided that such modification does not involve copying material from the -Library into the modified Library's header files unless such material is -limited to (i) numerical parameters; (ii) data structure layouts; -(iii) accessors; and (iv) small macros, templates and inline functions of -five lines or less in length. - -Furthermore, you are not required to apply this additional permission to a -modified version of the Library. - diff --git a/README.md b/README.md index 47be4e2..c3c1e6c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,27 @@ -# libqtlxqt +# lxqt-qtplugin -LXQt system integration plugin for Qt. +## Overview -With this plugin, all Qt-based programs can adopt settings of -LXQt, such as the icon theme. +This repository is providing a library `libqtlxqt` to integrate Qt with LXQt. -To use the plugin in Qt 5, we have to export the environment -variable QT_QPA_PLATFORMTHEME=lxqt. Then every Qt5 program -can load the theme plugin. -If, for some unknown reasons, the plugin is not loaded, we can -debug the plugin by exporting QT_DEBUG_PLUGINS=1. -Then, Qt5 will print detailed information and error messages -about all plugins in the console when running any Qt5 programs. +With this plugin, all Qt-based programs can adopt settings of LXQt, such as the icon theme. + +## Installation + +### Compiling source code + +Runtime dependencies are libdbusmenu-qt5 and [liblxqt](https://github.com/lxde/liblxqt). +Additional build dependencies are CMake and qttools, optionally Git to pull latest VCS checkouts. + +Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` has to be set to `/usr` on most operating systems. + +To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual. + +### Binary packages + +Official binary packages are provided by all major Linux distributions like Arch Linux, Debian (as of Debian stretch only), Fedora and openSUSE. Just use your package manager to search for string `lxqt-qtplugin`. + +## Configuration, Usage + +To use the plugin in Qt 5, we have to export environment variable `QT_QPA_PLATFORMTHEME=lxqt`. Then every Qt5 program can load the theme plugin. +If, for some unknown reasons, the plugin is not loaded, we can debug the plugin by exporting `QT_DEBUG_PLUGINS=1`. Then, Qt5 will print detailed information and error messages about all plugins in the console when running any Qt5 programs. diff --git a/debian/.gitignore b/debian/.gitignore index 469769b..3d846cb 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1,7 +1,7 @@ /*.debhelper /*.log /*.substvars +/debhelper-build-stamp /files /lxqt-qtplugin/ -/lxqt-qtplugin-dbg/ diff --git a/debian/README.Debian b/debian/README.Debian deleted file mode 100644 index 9cf92cc..0000000 --- a/debian/README.Debian +++ /dev/null @@ -1,4 +0,0 @@ -lxqt-qtplugin for Debian ------------------------- - -'LGPL_EXCEPTION.txt' move to debian/copyright LGPL-2.1-or-3-with-Digia-1.1-exception section. diff --git a/debian/changelog b/debian/changelog index 006c28d..8034590 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,30 @@ +lxqt-qtplugin (0.11.0-3) unstable; urgency=medium + + * Cherry-picking upstream release 0.11.0. + * Synced debian foo with experimental + * Added Multi-Arch: same, following the Multiarch hinter + * Bumped compat to 10 + * Removed --parallel from rules, standard in compat 10 + * Bumped Standards to 3.9.8, no changes needed + * Bumped minimum version debhelper (>= 10) + * Bumped minimum version liblxqt-dev (>= 0.11.0) + * Bumped minimum version libqtxdg-dev (>= 2.0.0) + * Added build dependency libqt5svg5-dev + * Added build dependency libqt5xdgiconloader-dev + * Fixed VCS fields, using https and plain /git/ + * Removed README.debian, no longer needed + * Fixed copyrights Format field to https + * Bumped years in copyrights + * Fixed copyrights Source field + * Removed outdated file and license from copyrights + * Added hardening options + * Added translation control to rules + * Set CMAKE_BUILD_TYPE=RelWithDebInfo + * Exported LC_ALL=C.UTF-8, make builds reproducible + * Added a basic gbp.conf + + -- Alf Gaida Tue, 18 Oct 2016 17:44:28 +0200 + lxqt-qtplugin (0.10.0-3) unstable; urgency=medium * Remove dbg package in favor of dbgsym. diff --git a/debian/compat b/debian/compat index ec63514..f599e28 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +10 diff --git a/debian/control b/debian/control index 86e291f..588f54b 100644 --- a/debian/control +++ b/debian/control @@ -5,29 +5,32 @@ Uploaders: Alf Gaida , Yukiharu YABUKI Section: x11 Priority: optional -Build-Depends: debhelper (>= 9), +Build-Depends: debhelper (>= 10), cmake (>= 3.0.2), libdbusmenu-qt5-dev, libkf5windowsystem-dev, - liblxqt0-dev (>= 0.10.0), + liblxqt0-dev (>= 0.11.0), + libqt5svg5-dev, libqt5x11extras5-dev, - libqt5xdg-dev (>= 1.3.0), + libqt5xdg-dev (>= 2.0.0), + libqt5xdgiconloader-dev, libx11-dev, pkg-config, qtbase5-private-dev, qttools5-dev, - qttools5-dev-tools, -Standards-Version: 3.9.6 -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-lxqt/lxqt-qtplugin.git/?h=debian/sid -Vcs-Git: git://anonscm.debian.org/pkg-lxqt/lxqt-qtplugin.git -b debian/sid + qttools5-dev-tools +Standards-Version: 3.9.8 +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-qtplugin.git/?h=debian/sid +Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-qtplugin.git -b debian/sid Homepage: https://github.com/lxde/lxqt-qtplugin Package: lxqt-qtplugin Architecture: any +Multi-Arch: same Depends: ${misc:Depends}, - ${shlibs:Depends}, + ${shlibs:Depends} Description: LXQt system integration plugin for Qt With this plugin, all Qt-based programs can adopt settings of LXQt, such as the icon theme. . - This package provides the lxqt qtplugin interface. + This package provides the LXQt qtplugin interface. diff --git a/debian/copyright b/debian/copyright index 93ee9bb..3784852 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,20 +1,14 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: lxqt-qtplugin -Source: https://github.com/lxde/lxqt-panel +Source: https://github.com/lxde/lxqt-qtplugin Files: * -Copyright: 2013-2015 LXQt team +Copyright: 2013-2016 LXQt team 2010-2012 Razor team License: LGPL-2.1+ -Files: src/qiconloader_p.h -Copyright: 2013 Digia Plc and/or its subsidiary(-ies). - 2010-2012 Razor team - 2013-2015 LXQt team -License: LGPL-2.1-or-3-with-Digia-1.1-exception - Files: debian/* -Copyright: 2014-2015 Alf Gaida +Copyright: 2014-2016 Alf Gaida 2015 ChangZhuo Chen (陳昌倬) 2015 Yukiharu YABUKI License: LGPL-2.1+ @@ -32,43 +26,3 @@ License: LGPL-2.1+ . On Debian systems, the complete text of the GNU Lesser General Public License version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1". - -License: LGPL-2.1-or-3-with-Digia-1.1-exception - GNU Lesser General Public License: - This file may be used under the terms of the GNU Lesser General Public - License version 2.1 or version 3 as published by the Free Software - Foundation and appearing in the file LICENSE.LGPLv21 and LICENSE.LGPLv3 - included in the packaging of this file. Please review the following - information to ensure the GNU Lesser General Public License requirements - will be met: https://www.gnu.org/licenses/lgpl.html. - . - On Debian systems, the complete text of the GNU Lesser General Public - License 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1`. - The complete text of the GNU Lesser General Public License version 3 can be - found in `/usr/share/common-licenses/LGPL-3`. - . - In addition, as a special exception, Digia gives you certain additional - rights. - . - Digia Qt LGPL Exception version 1.1: - As an additional permission to the GNU Lesser General Public License version - 2.1, the object code form of a "work that uses the Library" may incorporate - material from a header file that is part of the Library. You may distribute - such object code under terms of your choice, provided that: - . - (i) the header files of the Library have not been modified; and - (ii) the incorporated material is limited to numerical parameters, data - structure layouts, accessors, macros, inline functions and - templates; and - (iii) you comply with the terms of Section 6 of the GNU Lesser General - Public License version 2.1. - . - Moreover, you may apply this exception to a modified version of the Library, - provided that such modification does not involve copying material from the - Library into the modified Library's header files unless such material is - limited to (i) numerical parameters; (ii) data structure layouts; - (iii) accessors; and (iv) small macros, templates and inline functions of - five lines or less in length. - . - Furthermore, you are not required to apply this additional permission to a - modified version of the Library. diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..7a9f00a --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,8 @@ +[DEFAULT] +debian-branch = debian/sid +upstream-branch = upstream/latest +pristine-tar = True + +[import-orig] +# Use git cherrypick -n upstream instead. +merge = False diff --git a/debian/rules b/debian/rules index e8abf41..c03819d 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,15 @@ #!/usr/bin/make -f -#export DH_VERBOSE=1 +# export DH_VERBOSE=1 +export LC_ALL=C.UTF-8 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: - dh ${@} --buildsystem cmake \ - --parallel + dh ${@} --buildsystem cmake + +override_dh_auto_configure: + dh_auto_configure --\ + -DPULL_TRANSLATIONS=OFF\ + -DUPDATE_TRANSLATIONS=OFF\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc index 05cd1df..4936633 100644 --- a/debian/upstream/signing-key.asc +++ b/debian/upstream/signing-key.asc @@ -1,63 +1,50 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v2.0.22 (GNU/Linux) -mQINBFJevCYBEACx+Hvy+Vsuf+V5jeLUnzjAmHoy8DfTeGWr3ts30IapLHrfi0+U -WpzNnISO77yTr4VNboVZH+GHM/rnPfieODfB4ZW6CZLlInMSKUXcgQsEqXpyBZhA -Ib/SPy2bOfHly1uRJes0uRDsH5+v/hD74sByfnjQlrvI68O6wvGZmDFMNNPVO8+/ -OWBSBNkBuVrrZOMSPsLwQGJ4UtUQ4whburaPJG4VZJc5DLbzJGbEuACc0IAEYJS3 -7AfXVXn4j4Gc9F3o1xTUnbOBnwGPquWwUIm3FM7Ec2OdkvMt3EwvnkMAfeVrq3iE -FDD/KZTxdL0BZH3QD8gB7Jm4v4f3Nkobg6JCvCbcH3wBdZW4mASbwWzfRaDC2zHb -ErTglD7PpShLKZZ0pr9okWZEGw4Ku3q8ALi1JXK/ePTmsBlvkVskOJ3Nnd0avgH4 -+Q/vZoKfH8EhNY745rI+8CE9iv6V9XiSUt4CKEWAENt4A8hq6U2vV+jZv3B6AgD7 -ZjiI59yD4YuYubu8rCnNizTgh1voVw3ietknn/x2H5yH8fByWZ5uL87C0ky/uma6 -ZGbiiAtM4kdkyDMrfRV5nlEG9EKAGPVu5mjeSCr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GAECAAkFAlXQeMMCGwwA +CgkQQsnI069epeMt0g/+JrwLhULD6NOxaLgxboh/KZkh/7ViU4cB+QPT8JIcWxkZ +zj8uk85TUitEUzKmjp/ItCrhQE5WNNWbz/FBnAuLtaQuHhcHMA3Vu95UUCGi1vyZ +ZRlS3YRM6S9BOzrjG7fGQJmO/RU3g6rb0TAwGFxDHj8t4JEDTc3zASG7wV/VTn06 +d8XIH9CZOw3kUuhkQ3OR/PEj1BCeCC+caC+tBjO0fgvDp8RV7NFQQ9kH8R3/xlWd +6KMPtILE6fUft6LubWRGd1P5JBuzXivELolASajewbYtL/s87CCji3ngq0aT9raK +m02wqFzNbX1iv+w2iqPQXq6pdRyxtJ8+Q8Z7zEBGJS5nkrYjsLTduZIjJHYHYH7f +3/ydVjQ3z12iqHKElgaRI7RUmpNiNxVIr+TtuxzeC6G+CF++XNkUtJODvCmRaoJS +waYsitz8+LSv3tawZJ0iQkKc9nerQMuBD+AzIr3i4NgXiEIN513esUtnKzeyIIsL +ntUcBjXKuLCj8OZrZtexjq7edWWbN57/3ikyS2Z7y0i3O30qk5jmccSaS6kA7xTY +WCDFzbN2v2y+vGu9KYn+2HtrP2BtNa8JTh3waNeLUTpn4GV4mMrsZjOy6vhhHb91 +1TKfI1gvjk7lE9xaWmcDjdI55dw3jIq8kK9SdgORGq9/S3g7KJNRjme+6GjqQfk= +=h7ww -----END PGP PUBLIC KEY BLOCK----- diff --git a/debian/watch b/debian/watch index 51d59f3..a45c7ba 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,3 @@ -version=3 +version=4 opts="pgpsigurlmangle=s/$/.asc/" \ - https://github.com/lxde/lxqt-qtplugin/releases .*/([\d\.]+).tar.gz + https://github.com/lxde/lxqt-qtplugin/releases .*/lxqt-qtplugin-([\d\.]+).tar.xz diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7922b83..094f9d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,6 +31,7 @@ target_link_libraries(qtlxqt Qt5::DBus dbusmenu-qt5 lxqt + Qt5XdgIconLoader ) # there is no standard way to get the plugin dir of Qt5 with cmake diff --git a/src/lxqtplatformtheme.cpp b/src/lxqtplatformtheme.cpp index 679ed2a..34d38cb 100644 --- a/src/lxqtplatformtheme.cpp +++ b/src/lxqtplatformtheme.cpp @@ -44,7 +44,7 @@ #include #include #include -#include "qiconloader_p.h" +#include LXQtPlatformTheme::LXQtPlatformTheme(): settingsWatcher_(NULL) @@ -162,7 +162,7 @@ void LXQtPlatformTheme::onSettingsChanged() { } if(iconTheme_ != oldIconTheme) { // the icon theme is changed - QIconLoader::instance()->updateSystemTheme(); // this is a private internal API of Qt5. + XdgIconLoader::instance()->updateSystemTheme(); // this is a private internal API of Qt5. } // if font is changed @@ -294,22 +294,40 @@ QVariant LXQtPlatformTheme::themeHint(ThemeHint hint) const { return QPlatformTheme::themeHint(hint); } +QIconEngine *LXQtPlatformTheme::createIconEngine(const QString &iconName) const +{ + return new XdgIconLoaderEngine(iconName); +} + // Helper to return the icon theme paths from XDG. QStringList LXQtPlatformTheme::xdgIconThemePaths() const { QStringList paths; + QStringList xdgDirs; + // Add home directory first in search path const QFileInfo homeIconDir(QDir::homePath() + QStringLiteral("/.icons")); if (homeIconDir.isDir()) paths.prepend(homeIconDir.absoluteFilePath()); - QString xdgDirString = QFile::decodeName(qgetenv("XDG_DATA_DIRS")); - if (xdgDirString.isEmpty()) - xdgDirString = QLatin1String("/usr/local/share/:/usr/share/"); - foreach (const QString &xdgDir, xdgDirString.split(QLatin1Char(':'))) { - const QFileInfo xdgIconsDir(xdgDir + QStringLiteral("/icons")); - if (xdgIconsDir.isDir()) - paths.append(xdgIconsDir.absoluteFilePath()); + QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME")); + if (xdgDataHome.isEmpty()) + xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); + xdgDirs.append(xdgDataHome); + + QString xdgDataDirs = QFile::decodeName(qgetenv("XDG_DATA_DIRS")); + if (xdgDataDirs.isEmpty()) + xdgDataDirs = QLatin1String("/usr/local/share/:/usr/share/"); + xdgDirs.append(xdgDataDirs); + + foreach (const QString &s, xdgDirs) { + const QStringList r = s.split(QLatin1Char(':'), QString::SkipEmptyParts); + foreach (const QString &xdgDir, r) { + const QFileInfo xdgIconsDir(xdgDir + QStringLiteral("/icons")); + if (xdgIconsDir.isDir()) + paths.append(xdgIconsDir.absoluteFilePath()); + } } + paths.removeDuplicates(); return paths; } diff --git a/src/lxqtplatformtheme.h b/src/lxqtplatformtheme.h index 5ad6d34..956d11c 100644 --- a/src/lxqtplatformtheme.h +++ b/src/lxqtplatformtheme.h @@ -72,7 +72,7 @@ public: // virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, // QPlatformTheme::IconOptions iconOptions = 0) const; - // virtual QIconEngine *createIconEngine(const QString &iconName) const; + virtual QIconEngine *createIconEngine(const QString &iconName) const; // virtual QList keyBindings(QKeySequence::StandardKey key) const; diff --git a/src/lxqtsystemtrayicon.cpp b/src/lxqtsystemtrayicon.cpp index 1df4dd0..fd9e5b5 100644 --- a/src/lxqtsystemtrayicon.cpp +++ b/src/lxqtsystemtrayicon.cpp @@ -286,7 +286,7 @@ void LXQtSystemTrayIcon::init() // default menu QPlatformMenu *menu = createMenu(); - menu->setParent(this); + menu->setParent(mSni); QPlatformMenuItem *menuItem = menu->createMenuItem(); menuItem->setParent(menu); menuItem->setText(tr("Quit")); diff --git a/src/qiconloader_p.h b/src/qiconloader_p.h deleted file mode 100644 index 419d93d..0000000 --- a/src/qiconloader_p.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QICONLOADER_P_H -#define QICONLOADER_P_H - -#include - -#ifndef QT_NO_ICON -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QIconLoader; - -struct QIconDirInfo -{ - enum Type { Fixed, Scalable, Threshold }; - QIconDirInfo(const QString &_path = QString()) : - path(_path), - size(0), - maxSize(0), - minSize(0), - threshold(0), - type(Threshold) {} - QString path; - short size; - short maxSize; - short minSize; - short threshold; - Type type : 4; -}; - -class QIconLoaderEngineEntry - { -public: - virtual ~QIconLoaderEngineEntry() {} - virtual QPixmap pixmap(const QSize &size, - QIcon::Mode mode, - QIcon::State state) = 0; - QString filename; - QIconDirInfo dir; - static int count; -}; - -struct ScalableEntry : public QIconLoaderEngineEntry -{ - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); - QIcon svgIcon; -}; - -struct PixmapEntry : public QIconLoaderEngineEntry -{ - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); - QPixmap basePixmap; -}; - -typedef QList QThemeIconEntries; - -class QIconLoaderEngine : public QIconEngine -{ -public: - QIconLoaderEngine(const QString& iconName = QString()); - ~QIconLoaderEngine(); - - void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); - QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); - QIconEngine *clone() const; - bool read(QDataStream &in); - bool write(QDataStream &out) const; - -private: - QString key() const; - bool hasIcon() const; - void ensureLoaded(); - void virtual_hook(int id, void *data); - QIconLoaderEngineEntry *entryForSize(const QSize &size); - QIconLoaderEngine(const QIconLoaderEngine &other); - QThemeIconEntries m_entries; - QString m_iconName; - uint m_key; - - friend class QIconLoader; -}; - -class QIconTheme -{ -public: - QIconTheme(const QString &name); - QIconTheme() : m_valid(false) {} - QStringList parents() { return m_parents; } - QList keyList() { return m_keyList; } - QString contentDir() { return m_contentDir; } - bool isValid() { return m_valid; } - -private: - QString m_contentDir; - QList m_keyList; - QStringList m_parents; - bool m_valid; -}; - -class Q_GUI_EXPORT QIconLoader : public QObject -{ -public: - QIconLoader(); - QThemeIconEntries loadIcon(const QString &iconName) const; - uint themeKey() const { return m_themeKey; } - - QString themeName() const { return m_userTheme.isEmpty() ? m_systemTheme : m_userTheme; } - void setThemeName(const QString &themeName); - QIconTheme theme() { return themeList.value(themeName()); } - void setThemeSearchPath(const QStringList &searchPaths); - QStringList themeSearchPaths() const; - QIconDirInfo dirInfo(int dirindex); - static QIconLoader *instance(); - void updateSystemTheme(); - void invalidateKey() { m_themeKey++; } - void ensureInitialized(); - -private: - QThemeIconEntries findIconHelper(const QString &themeName, - const QString &iconName, - QStringList &visited) const; - uint m_themeKey; - bool m_supportsSvg; - bool m_initialized; - - mutable QString m_userTheme; - mutable QString m_systemTheme; - mutable QStringList m_iconDirs; - mutable QHash themeList; -}; - -QT_END_NAMESPACE - -#endif // QT_NO_ICON - -#endif // QICONLOADER_P_H diff --git a/src/statusnotifieritem/statusnotifieritem.cpp b/src/statusnotifieritem/statusnotifieritem.cpp index 8d24f97..88b9d7f 100644 --- a/src/statusnotifieritem/statusnotifieritem.cpp +++ b/src/statusnotifieritem/statusnotifieritem.cpp @@ -42,7 +42,8 @@ StatusNotifierItem::StatusNotifierItem(QString id, QObject *parent) mId(id), mTitle("Test"), mStatus("Active"), - mMenu(nullptr) + mMenu(nullptr), + mMenuExporter(nullptr) { // register service QDBusConnection::sessionBus().registerService(mService); @@ -64,8 +65,6 @@ StatusNotifierItem::~StatusNotifierItem() QDBusConnection::sessionBus().unregisterObject("/StatusNotifierItem"); QDBusConnection::sessionBus().unregisterService(mService); QDBusConnection::sessionBus().disconnectFromBus(mService); - - delete mMenu; } void StatusNotifierItem::registerToHost() @@ -84,6 +83,12 @@ void StatusNotifierItem::onServiceOwnerChanged(const QString& service, const QSt registerToHost(); } +void StatusNotifierItem::onMenuDestroyed() +{ + mMenu = nullptr; + mMenuExporter = nullptr; //mMenu is a QObject parent of the mMenuExporter +} + void StatusNotifierItem::setTitle(const QString &title) { if (mTitle == title) @@ -210,12 +215,20 @@ void StatusNotifierItem::setContextMenu(QMenu* menu) if (mMenu == menu) return; - delete mMenu; + if (nullptr != mMenu) + { + disconnect(mMenu, &QObject::destroyed, this, &StatusNotifierItem::onMenuDestroyed); + } mMenu = menu; - mMenu->setParent(nullptr); setMenuPath("/MenuBar"); - new DBusMenuExporter(this->menu().path(), mMenu); + //Note: we need to destroy menu exporter before creating new one -> to free the DBus object path for new menu + delete mMenuExporter; + if (nullptr != mMenu) + { + connect(mMenu, &QObject::destroyed, this, &StatusNotifierItem::onMenuDestroyed); + mMenuExporter = new DBusMenuExporter{this->menu().path(), mMenu}; + } } void StatusNotifierItem::Activate(int x, int y) diff --git a/src/statusnotifieritem/statusnotifieritem.h b/src/statusnotifieritem/statusnotifieritem.h index e55eedd..8706c19 100644 --- a/src/statusnotifieritem/statusnotifieritem.h +++ b/src/statusnotifieritem/statusnotifieritem.h @@ -36,6 +36,7 @@ #include "dbustypes.h" class StatusNotifierItemAdaptor; +class DBusMenuExporter; class StatusNotifierItem : public QObject { @@ -126,6 +127,9 @@ public: return tt; } + /*! + * \Note: we don't take ownership for the \param menu + */ void setContextMenu(QMenu *menu); public slots: @@ -143,6 +147,7 @@ private: private slots: void onServiceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner); + void onMenuDestroyed(); signals: void activateRequested(const QPoint &pos); @@ -170,6 +175,7 @@ private: // menu QMenu *mMenu; QDBusObjectPath mMenuPath; + DBusMenuExporter *mMenuExporter; static int mServiceCounter; };