Hello community, here is the log from the commit of package lxqt-qtplugin for openSUSE:Factory checked in at 2017-10-24 22:23:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lxqt-qtplugin (Old) and /work/SRC/openSUSE:Factory/.lxqt-qtplugin.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxqt-qtplugin" Tue Oct 24 22:23:13 2017 rev:9 rq:535980 version:0.12.0 Changes: -------- --- /work/SRC/openSUSE:Factory/lxqt-qtplugin/lxqt-qtplugin.changes 2017-03-13 15:33:43.892173117 +0100 +++ /work/SRC/openSUSE:Factory/.lxqt-qtplugin.new/lxqt-qtplugin.changes 2017-10-24 22:23:14.288805887 +0200 @@ -1,0 +2,29 @@ +Mon Oct 23 11:27:07 UTC 2017 - [email protected] + +- Update to 0.12.0: + * Set an informal patch version + * Don't export github templates + * Flag unused vars in onServiceOwnerChanged + * Fix missing variable declaration + * Handle QML (as @PCMan suggested) + * Use mime functions added by @PCMan + * Loading and saving window/splitter size + * Central positioning with respect to parent + * Set window title correctly + * Qt version conditions + * Just made it compilable + * Handle mime-type filters for file dialog. Set custom file dialog labels. + * Update options properly. + * Implement a basic file dialog helper using libfm-qt's Fm::FileDialog. + * Avoid using Qt-specific keywords such as signal/slot and foreach. Instead, use macros. + * LXQtPlatformTheme: Make Qt use default palette (#22) + * LXQtPlatformTheme: Add icon FollowColorScheme config (#21) + * Prevent a possible C++11 range for detach (#20) + * Use the CMake MODULE library type. + * LXQtPlatformTheme: Propagate wheelScrollLines + * LXQtPlatformTheme: Do not provide own palette + * Fix multiple StatusNotifierItems. + * Bump year + * Updates lxqt-build-tools required version + +------------------------------------------------------------------- Old: ---- lxqt-qtplugin-0.11.1.tar.xz lxqt-qtplugin-0.11.1.tar.xz.asc New: ---- lxqt-qtplugin-0.12.0.tar.xz lxqt-qtplugin-0.12.0.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lxqt-qtplugin.spec ++++++ --- /var/tmp/diff_new_pack.RkS1wk/_old 2017-10-24 22:23:15.008772231 +0200 +++ /var/tmp/diff_new_pack.RkS1wk/_new 2017-10-24 22:23:15.008772231 +0200 @@ -17,14 +17,14 @@ Name: lxqt-qtplugin -Version: 0.11.1 +Version: 0.12.0 Release: 0 Summary: LXQt platform integration plugin for Qt 5 License: LGPL-2.1+ Group: System/GUI/LXQt Url: http://www.lxqt.org -Source0: http://downloads.lxqt.org/%{name}/%{version}/%{name}-%{version}.tar.xz -Source1: http://downloads.lxqt.org/%{name}/%{version}/%{name}-%{version}.tar.xz.asc +Source: https://github.com/lxde/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz +Source1: https://github.com/lxde/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz.asc Source2: %{name}.keyring BuildRequires: cmake >= 3.0.2 BuildRequires: gcc-c++ @@ -36,6 +36,9 @@ BuildRequires: pkgconfig(lxqt) >= %{version} BuildRequires: pkgconfig(dbusmenu-qt5) BuildRequires: pkgconfig(Qt5XdgIconLoader) +BuildRequires: pkgconfig(Qt5X11Extras) +BuildRequires: libfm-qt-devel +BuildRequires: libexif-devel %if 0%{?fedora_version} %requires_eq qt5-qtbase-gui %else ++++++ lxqt-qtplugin-0.11.1.tar.xz -> lxqt-qtplugin-0.12.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/AUTHORS new/lxqt-qtplugin-0.12.0/AUTHORS --- old/lxqt-qtplugin-0.11.1/AUTHORS 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/AUTHORS 2017-10-21 21:34:23.000000000 +0200 @@ -3,7 +3,7 @@ Hong Jen Yee (PCMan) <[email protected]> Copyright: - Copyright (c) 2013-2016 LXQt team + Copyright (c) 2013-2017 LXQt team License: LGPL-2.1+ The full text of the licenses can be found in the 'COPYING' file. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/CHANGELOG new/lxqt-qtplugin-0.12.0/CHANGELOG --- old/lxqt-qtplugin-0.11.1/CHANGELOG 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/CHANGELOG 2017-10-21 21:34:23.000000000 +0200 @@ -1,7 +1,36 @@ -lxqt-qtplugin-0.11.1 / 2016-12-11 +lxqt-qtplugin-0.12.0 / 2017-10-21 ================================= + * Set an informal patch version + * Don't export github templates + * Flag unused vars in onServiceOwnerChanged + * Fix missing variable declaration + * Handle QML (as @PCMan suggested) + * Use mime functions added by @PCMan + * Loading and saving window/splitter size + * Central positioning with respect to parent + * Set window title correctly + * Qt version conditions + * Just made it compilable + * Handle mime-type filters for file dialog. Set custom file dialog labels. + * Update options properly. + * Implement a basic file dialog helper using libfm-qt's Fm::FileDialog. + * Avoid using Qt-specific keywords such as signal/slot and foreach. Instead, use macros. + * LXQtPlatformTheme: Make Qt use default palette (#22) + * LXQtPlatformTheme: Add icon FollowColorScheme config (#21) + * Prevent a possible C++11 range for detach (#20) + * Use the CMake MODULE library type. + * LXQtPlatformTheme: Propagate wheelScrollLines + * LXQtPlatformTheme: Do not provide own palette + * Fix multiple StatusNotifierItems. + * Bump year + * Updates lxqt-build-tools required version + +0.11.1 / 2016-12-11 +=================== + + * Release 0.11.1: Update changelog * Use lxqt-build-tools * Use the new lxqt-build-tools package * Remove cpack (#14) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/CMakeLists.txt new/lxqt-qtplugin-0.12.0/CMakeLists.txt --- old/lxqt-qtplugin-0.11.1/CMakeLists.txt 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/CMakeLists.txt 2017-10-21 21:34:23.000000000 +0200 @@ -3,18 +3,24 @@ include(GNUInstallDirs) -set(LXQTBT_MINIMUM_VERSION "0.1.0") +set(LXQTBT_MINIMUM_VERSION "0.4.0") set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -find_package(Qt5Widgets REQUIRED QUIET) -find_package(Qt5LinguistTools REQUIRED QUIET) -find_package(Qt5DBus REQUIRED QUIET) -find_package(dbusmenu-qt5 REQUIRED QUIET) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5LinguistTools REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(dbusmenu-qt5 REQUIRED) find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) -find_package(Qt5XdgIconLoader REQUIRED QUIET) +find_package(Qt5XdgIconLoader REQUIRED) + +# Patch Version 0 + +# for file dialog support +find_package(Qt5X11Extras REQUIRED) +find_package(fm-qt REQUIRED) include(LXQtCompilerSettings NO_POLICY_SCOPE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/CMakeLists.txt new/lxqt-qtplugin-0.12.0/src/CMakeLists.txt --- old/lxqt-qtplugin-0.11.1/src/CMakeLists.txt 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/CMakeLists.txt 2017-10-21 21:34:23.000000000 +0200 @@ -6,6 +6,7 @@ set(qtlxqt_HDRS lxqtplatformtheme.h lxqtsystemtrayicon.h + lxqtfiledialoghelper.h statusnotifieritem/statusnotifieritem.h statusnotifieritem/dbustypes.h ) @@ -14,6 +15,7 @@ main.cpp lxqtplatformtheme.cpp lxqtsystemtrayicon.cpp + lxqtfiledialoghelper.cpp statusnotifieritem/statusnotifieritem.cpp statusnotifieritem/dbustypes.cpp ) @@ -24,15 +26,17 @@ StatusNotifierItem ) -add_library(qtlxqt SHARED ${qtlxqt_HDRS} ${qtlxqt_SRCS}) +add_library(qtlxqt MODULE ${qtlxqt_HDRS} ${qtlxqt_SRCS}) target_link_libraries(qtlxqt Qt5::Widgets Qt5::DBus dbusmenu-qt5 Qt5XdgIconLoader + fm-qt ) + # there is no standard way to get the plugin dir of Qt5 with cmake # The best way is get_target_property(QT_PLUGINS_DIR Qt5::QGtk2ThemePlugin LOCATION). # This directly returns the platformthemes dir. However, this does not work diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/lxqtfiledialoghelper.cpp new/lxqt-qtplugin-0.12.0/src/lxqtfiledialoghelper.cpp --- old/lxqt-qtplugin-0.11.1/src/lxqtfiledialoghelper.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/lxqtfiledialoghelper.cpp 2017-10-21 21:34:23.000000000 +0200 @@ -0,0 +1,224 @@ +#include "lxqtfiledialoghelper.h" + +#include <libfm-qt/libfmqt.h> +#include <libfm-qt/filedialog.h> + +#include <QWindow> +#include <QDebug> +#include <QTimer> +#include <QSettings> + +#include <memory> + +static std::unique_ptr<Fm::LibFmQt> libfmQtContext_; + +LXQtFileDialogHelper::LXQtFileDialogHelper() { + if(!libfmQtContext_) { + // initialize libfm-qt only once + libfmQtContext_ = std::unique_ptr<Fm::LibFmQt>{new Fm::LibFmQt()}; + } + + // can only be used after libfm-qt initialization + dlg_ = std::unique_ptr<Fm::FileDialog>(new Fm::FileDialog()); + connect(dlg_.get(), &Fm::FileDialog::accepted, [this]() { + saveSettings(); + accept(); + }); + connect(dlg_.get(), &Fm::FileDialog::rejected, [this]() { + saveSettings(); + reject(); + }); + + connect(dlg_.get(), &Fm::FileDialog::fileSelected, this, &LXQtFileDialogHelper::fileSelected); + connect(dlg_.get(), &Fm::FileDialog::filesSelected, this, &LXQtFileDialogHelper::filesSelected); + connect(dlg_.get(), &Fm::FileDialog::currentChanged, this, &LXQtFileDialogHelper::currentChanged); + connect(dlg_.get(), &Fm::FileDialog::directoryEntered, this, &LXQtFileDialogHelper::directoryEntered); + connect(dlg_.get(), &Fm::FileDialog::filterSelected, this, &LXQtFileDialogHelper::filterSelected); +} + +LXQtFileDialogHelper::~LXQtFileDialogHelper() { +} + +void LXQtFileDialogHelper::exec() { + dlg_->exec(); +} + +bool LXQtFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow* parent) { + dlg_->setAttribute(Qt::WA_NativeWindow, true); // without this, sometimes windowHandle() will return nullptr + + dlg_->setWindowFlags(windowFlags); + dlg_->setWindowModality(windowModality); + + // Reference: KDE implementation + // https://github.com/KDE/plasma-integration/blob/master/src/platformtheme/kdeplatformfiledialoghelper.cpp + dlg_->windowHandle()->setTransientParent(parent); + + loadSettings(); + // central positioning with respect to the parent window + if(parent && parent->isVisible()) { + dlg_->move(parent->x() + (parent->width() - dlg_->width()) / 2, + parent->y() + (parent->height() - dlg_->height()) / 2); + } + + applyOptions(); + + // NOTE: the timer here is required as a workaround borrowed from KDE. Without this, the dialog UI will be blocked. + // QFileDialog calls our platform plugin to show our own native file dialog instead of showing its widget. + // However, it still creates a hidden dialog internally, and then make it modal. + // So user input from all other windows that are not the children of the QFileDialog widget will be blocked. + // This includes our own dialog. After the return of this show() method, QFileDialog creates its own window and + // then make it modal, which blocks our UI. The timer schedule a delayed popup of our file dialog, so we can + // show again after QFileDialog and override the modal state. Then our UI can be unblocked. + QTimer::singleShot(0, dlg_.get(), &QDialog::show); + dlg_->setFocus(); + return true; +} + +void LXQtFileDialogHelper::hide() { + dlg_->hide(); +} + +bool LXQtFileDialogHelper::defaultNameFilterDisables() const { + return false; +} + +void LXQtFileDialogHelper::setDirectory(const QUrl& directory) { + dlg_->setDirectory(directory); +} + +QUrl LXQtFileDialogHelper::directory() const { + return dlg_->directory(); +} + +void LXQtFileDialogHelper::selectFile(const QUrl& filename) { + dlg_->selectFile(filename); +} + +QList<QUrl> LXQtFileDialogHelper::selectedFiles() const { + return dlg_->selectedFiles(); +} + +void LXQtFileDialogHelper::setFilter() { + // FIXME: what's this? + // The gtk+ 3 file dialog helper in Qt5 update options in this method. + applyOptions(); +} + +void LXQtFileDialogHelper::selectNameFilter(const QString& filter) { + dlg_->selectNameFilter(filter); +} + +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) +QString LXQtFileDialogHelper::selectedMimeTypeFilter() const { + return dlg_->selectedMimeTypeFilter(); +} + +void LXQtFileDialogHelper::selectMimeTypeFilter(const QString& filter) { + dlg_->selectMimeTypeFilter(filter); +} +#endif + +QString LXQtFileDialogHelper::selectedNameFilter() const { + return dlg_->selectedNameFilter(); +} + +bool LXQtFileDialogHelper::isSupportedUrl(const QUrl& url) const { + return dlg_->isSupportedUrl(url); +} + +void LXQtFileDialogHelper::applyOptions() { + auto& opt = options(); + + // set title + if(opt->windowTitle().isEmpty()) { + dlg_->setWindowTitle(opt->acceptMode() == QFileDialogOptions::AcceptOpen ? tr("Open File") + : tr("Save File")); + } + else { + dlg_->setWindowTitle(opt->windowTitle()); + } + + dlg_->setFilter(opt->filter()); + dlg_->setViewMode(opt->viewMode() == QFileDialogOptions::Detail ? Fm::FolderView::DetailedListMode + : Fm::FolderView::CompactMode); + dlg_->setFileMode(QFileDialog::FileMode(opt->fileMode())); + dlg_->setAcceptMode(QFileDialog::AcceptMode(opt->acceptMode())); // also sets a default label for accept button + // bool useDefaultNameFilters() const; + dlg_->setNameFilters(opt->nameFilters()); + if(!opt->mimeTypeFilters().empty()) { + dlg_->setMimeTypeFilters(opt->mimeTypeFilters()); + } + + dlg_->setDefaultSuffix(opt->defaultSuffix()); + // QStringList history() const; + + // explicitly set labels + for(int i = 0; i < QFileDialogOptions::DialogLabelCount; ++i) { + auto label = static_cast<QFileDialogOptions::DialogLabel>(i); + if(opt->isLabelExplicitlySet(label)) { + dlg_->setLabelText(static_cast<QFileDialog::DialogLabel>(label), opt->labelText(label)); + } + } + + auto url = opt->initialDirectory(); + if(url.isValid()) { + dlg_->setDirectory(url); + } + + +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) + auto filter = opt->initiallySelectedMimeTypeFilter(); + if(!filter.isEmpty()) { + selectMimeTypeFilter(filter); + } + else { + filter = opt->initiallySelectedNameFilter(); + if(!filter.isEmpty()) { + selectNameFilter(opt->initiallySelectedNameFilter()); + } + } +#else + auto filter = opt->initiallySelectedNameFilter(); + if(!filter.isEmpty()) { + selectNameFilter(filter); + } +#endif + + auto selectedFiles = opt->initiallySelectedFiles(); + for(const auto& selectedFile: selectedFiles) { + selectFile(selectedFile); + } + // QStringList supportedSchemes() const; +} + +void LXQtFileDialogHelper::loadSettings() { + QSettings settings(QSettings::UserScope, "lxqt", "filedialog"); + settings.beginGroup ("Sizes"); + dlg_->resize(settings.value("WindowSize", QSize(700, 500)).toSize()); + dlg_->setSplitterPos(settings.value("SplitterPos", 200).toInt()); + settings.endGroup(); +} + +void LXQtFileDialogHelper::saveSettings() { + QSettings settings(QSettings::UserScope, "lxqt", "filedialog"); + settings.beginGroup ("Sizes"); + QSize windowSize = dlg_->size(); + if(settings.value("WindowSize") != windowSize) { // no redundant write + settings.setValue("WindowSize", windowSize); + } + int splitterPos = dlg_->splitterPos(); + if(settings.value("SplitterPos") != splitterPos) { + settings.setValue("SplitterPos", splitterPos); + } + settings.endGroup(); +} + +/* +FileDialogPlugin::FileDialogPlugin() { + +} + +QPlatformFileDialogHelper *FileDialogPlugin::createHelper() { + return new LXQtFileDialogHelper(); +} +*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/lxqtfiledialoghelper.h new/lxqt-qtplugin-0.12.0/src/lxqtfiledialoghelper.h --- old/lxqt-qtplugin-0.11.1/src/lxqtfiledialoghelper.h 1970-01-01 01:00:00.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/lxqtfiledialoghelper.h 2017-10-21 21:34:23.000000000 +0200 @@ -0,0 +1,50 @@ +#ifndef LXQTFILEDIALOGHELPER_H +#define LXQTFILEDIALOGHELPER_H + +#include <qpa/qplatformdialoghelper.h> // this private header is subject to changes +#include <memory> + +namespace Fm { +class FileDialog; +} + +class Q_GUI_EXPORT LXQtFileDialogHelper : public QPlatformFileDialogHelper { + Q_OBJECT + +public: + LXQtFileDialogHelper(); + + virtual ~LXQtFileDialogHelper(); + + // QPlatformDialogHelper + void exec() override; + bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override; + void hide() override; + + // QPlatformFileDialogHelper + bool defaultNameFilterDisables() const override; + void setDirectory(const QUrl &directory) override; + QUrl directory() const override; + void selectFile(const QUrl &filename) override; + QList<QUrl> selectedFiles() const override; + void setFilter() override; + void selectNameFilter(const QString &filter) override; +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) + QString selectedMimeTypeFilter() const override; + void selectMimeTypeFilter(const QString &filter) override; +#endif + QString selectedNameFilter() const override; + + bool isSupportedUrl(const QUrl &url) const override; + +private: + void applyOptions(); + void loadSettings(); + void saveSettings(); + +private: + std::unique_ptr<Fm::FileDialog> dlg_; +}; + + +#endif // LXQTFILEDIALOGHELPER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/lxqtplatformtheme.cpp new/lxqt-qtplugin-0.12.0/src/lxqtplatformtheme.cpp --- old/lxqt-qtplugin-0.11.1/src/lxqtplatformtheme.cpp 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/lxqtplatformtheme.cpp 2017-10-21 21:34:23.000000000 +0200 @@ -46,8 +46,11 @@ #include <QStyle> #include <private/xdgiconloader/xdgiconloader_p.h> +#include "lxqtfiledialoghelper.h" + LXQtPlatformTheme::LXQtPlatformTheme(): - settingsWatcher_(NULL) + iconFollowColorScheme_(true) + , settingsWatcher_(NULL) { // When the plugin is loaded, it seems that the app is not yet running and // QThread environment is not completely set up. So creating filesystem watcher @@ -80,6 +83,7 @@ // icon theme iconTheme_ = settings.value("icon_theme", "oxygen").toString(); + iconFollowColorScheme_ = settings.value("icon_follow_color_scheme", iconFollowColorScheme_).toBool(); // read other widget related settings form LxQt settings. QByteArray tb_style = settings.value("tool_button_style").toByteArray(); @@ -164,6 +168,7 @@ if(iconTheme_ != oldIconTheme) { // the icon theme is changed XdgIconLoader::instance()->updateSystemTheme(); // this is a private internal API of Qt5. } + XdgIconLoader::instance()->setFollowColorScheme(iconFollowColorScheme_); // if font is changed if(oldFont != fontStr_ || oldFixedFont != fixedFontStr_){ @@ -184,6 +189,8 @@ QApplication::setFont(font_); } + QApplication::setWheelScrollLines(wheelScrollLines_.toInt()); + // emit a ThemeChange event to all widgets Q_FOREACH(QWidget* widget, QApplication::allWidgets()) { // Qt5 added a QEvent::ThemeChange event. @@ -193,21 +200,26 @@ } bool LXQtPlatformTheme::usePlatformNativeDialog(DialogType type) const { + if(type == FileDialog + && qobject_cast<QApplication *>(QCoreApplication::instance())) { // QML may not have qApp + // use our own file dialog + return true; + } return false; } -#if 0 + QPlatformDialogHelper *LXQtPlatformTheme::createPlatformDialogHelper(DialogType type) const { - return 0; + if(type == FileDialog + && qobject_cast<QApplication *>(QCoreApplication::instance())) { // QML may not have qApp + // use our own file dialog + return new LXQtFileDialogHelper(); + } + return nullptr; } -#endif const QPalette *LXQtPlatformTheme::palette(Palette type) const { - - if (type == QPlatformTheme::SystemPalette) - // the default constructor uses the default palette - return new QPalette; - return QPlatformTheme::palette(type); + return nullptr; } const QFont *LXQtPlatformTheme::font(Font type) const { @@ -288,6 +300,9 @@ break; case MouseDoubleClickDistance: break; + case WheelScrollLines: + return wheelScrollLines_; + break; default: break; } @@ -320,9 +335,9 @@ xdgDataDirs = QLatin1String("/usr/local/share/:/usr/share/"); xdgDirs.append(xdgDataDirs); - foreach (const QString &s, xdgDirs) { + for (const auto &s: xdgDirs) { const QStringList r = s.split(QLatin1Char(':'), QString::SkipEmptyParts); - foreach (const QString &xdgDir, r) { + for (const auto& xdgDir: r) { const QFileInfo xdgIconsDir(xdgDir + QStringLiteral("/icons")); if (xdgIconsDir.isDir()) paths.append(xdgIconsDir.absoluteFilePath()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/lxqtplatformtheme.h new/lxqt-qtplugin-0.12.0/src/lxqtplatformtheme.h --- old/lxqt-qtplugin-0.11.1/src/lxqtplatformtheme.h 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/lxqtplatformtheme.h 2017-10-21 21:34:23.000000000 +0200 @@ -48,7 +48,7 @@ // virtual QPlatformMenuBar* createPlatformMenuBar() const; virtual bool usePlatformNativeDialog(DialogType type) const; - // virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; + virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; virtual const QPalette *palette(Palette type = SystemPalette) const; @@ -90,6 +90,7 @@ QString iconTheme_; Qt::ToolButtonStyle toolButtonStyle_; bool singleClickActivate_; + bool iconFollowColorScheme_; // other Qt settings // widget diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/lxqtsystemtrayicon.cpp new/lxqt-qtplugin-0.12.0/src/lxqtsystemtrayicon.cpp --- old/lxqt-qtplugin-0.11.1/src/lxqtsystemtrayicon.cpp 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/lxqtsystemtrayicon.cpp 2017-10-21 21:34:23.000000000 +0200 @@ -297,12 +297,12 @@ connect(mSni, &StatusNotifierItem::activateRequested, [this](const QPoint &) { - emit activated(QPlatformSystemTrayIcon::Trigger); + Q_EMIT activated(QPlatformSystemTrayIcon::Trigger); }); connect(mSni, &StatusNotifierItem::secondaryActivateRequested, [this](const QPoint &) { - emit activated(QPlatformSystemTrayIcon::MiddleClick); + Q_EMIT activated(QPlatformSystemTrayIcon::MiddleClick); }); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/statusnotifieritem/statusnotifieritem.cpp new/lxqt-qtplugin-0.12.0/src/statusnotifieritem/statusnotifieritem.cpp --- old/lxqt-qtplugin-0.11.1/src/statusnotifieritem/statusnotifieritem.cpp 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/statusnotifieritem/statusnotifieritem.cpp 2017-10-21 21:34:23.000000000 +0200 @@ -43,17 +43,23 @@ mTitle("Test"), mStatus("Active"), mMenu(nullptr), - mMenuExporter(nullptr) + mMenuExporter(nullptr), + mSessionBus(QDBusConnection::connectToBus(QDBusConnection::SessionBus, mService)) { + // Separate DBus connection to the session bus is created, because QDbus does not provide + // a way to register different objects for different services with the same paths. + // For status notifiers we need different /StatusNotifierItem for each service. + // register service - QDBusConnection::sessionBus().registerService(mService); - QDBusConnection::sessionBus().registerObject("/StatusNotifierItem", this); + + mSessionBus.registerService(mService); + mSessionBus.registerObject(QLatin1String("/StatusNotifierItem"), this); registerToHost(); // monitor the watcher service in case the host restarts QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.kde.StatusNotifierWatcher", - QDBusConnection::sessionBus(), + mSessionBus, QDBusServiceWatcher::WatchForOwnerChange, this); connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged, @@ -62,9 +68,9 @@ StatusNotifierItem::~StatusNotifierItem() { - QDBusConnection::sessionBus().unregisterObject("/StatusNotifierItem"); - QDBusConnection::sessionBus().unregisterService(mService); - QDBusConnection::sessionBus().disconnectFromBus(mService); + mSessionBus.unregisterObject(QLatin1String("/StatusNotifierItem")); + mSessionBus.unregisterService(mService); + QDBusConnection::disconnectFromBus(mService); } void StatusNotifierItem::registerToHost() @@ -72,13 +78,16 @@ QDBusInterface interface("org.kde.StatusNotifierWatcher", "/StatusNotifierWatcher", "org.kde.StatusNotifierWatcher", - QDBusConnection::sessionBus()); + mSessionBus); interface.asyncCall("RegisterStatusNotifierItem", mService); } void StatusNotifierItem::onServiceOwnerChanged(const QString& service, const QString& oldOwner, const QString& newOwner) { + Q_UNUSED(service); + Q_UNUSED(oldOwner); + if (!newOwner.isEmpty()) registerToHost(); } @@ -95,7 +104,7 @@ return; mTitle = title; - emit mAdaptor->NewTitle(); + Q_EMIT mAdaptor->NewTitle(); } void StatusNotifierItem::setStatus(const QString &status) @@ -104,7 +113,7 @@ return; mStatus = status; - emit mAdaptor->NewStatus(mStatus); + Q_EMIT mAdaptor->NewStatus(mStatus); } void StatusNotifierItem::setMenuPath(const QString& path) @@ -118,7 +127,7 @@ return; mIconName = name; - emit mAdaptor->NewIcon(); + Q_EMIT mAdaptor->NewIcon(); } void StatusNotifierItem::setIconByPixmap(const QIcon &icon) @@ -129,7 +138,7 @@ mIconCacheKey = icon.cacheKey(); mIcon = iconToPixmapList(icon); mIconName.clear(); - emit mAdaptor->NewIcon(); + Q_EMIT mAdaptor->NewIcon(); } void StatusNotifierItem::setOverlayIconByName(const QString &name) @@ -138,7 +147,7 @@ return; mOverlayIconName = name; - emit mAdaptor->NewOverlayIcon(); + Q_EMIT mAdaptor->NewOverlayIcon(); } void StatusNotifierItem::setOverlayIconByPixmap(const QIcon &icon) @@ -149,7 +158,7 @@ mOverlayIconCacheKey = icon.cacheKey(); mOverlayIcon = iconToPixmapList(icon); mOverlayIconName.clear(); - emit mAdaptor->NewOverlayIcon(); + Q_EMIT mAdaptor->NewOverlayIcon(); } void StatusNotifierItem::setAttentionIconByName(const QString &name) @@ -158,7 +167,7 @@ return; mAttentionIconName = name; - emit mAdaptor->NewAttentionIcon(); + Q_EMIT mAdaptor->NewAttentionIcon(); } void StatusNotifierItem::setAttentionIconByPixmap(const QIcon &icon) @@ -169,7 +178,7 @@ mAttentionIconCacheKey = icon.cacheKey(); mAttentionIcon = iconToPixmapList(icon); mAttentionIconName.clear(); - emit mAdaptor->NewAttentionIcon(); + Q_EMIT mAdaptor->NewAttentionIcon(); } void StatusNotifierItem::setToolTipTitle(const QString &title) @@ -178,7 +187,7 @@ return; mTooltipTitle = title; - emit mAdaptor->NewToolTip(); + Q_EMIT mAdaptor->NewToolTip(); } void StatusNotifierItem::setToolTipSubTitle(const QString &subTitle) @@ -187,7 +196,7 @@ return; mTooltipSubtitle = subTitle; - emit mAdaptor->NewToolTip(); + Q_EMIT mAdaptor->NewToolTip(); } void StatusNotifierItem::setToolTipIconByName(const QString &name) @@ -196,7 +205,7 @@ return; mTooltipIconName = name; - emit mAdaptor->NewToolTip(); + Q_EMIT mAdaptor->NewToolTip(); } void StatusNotifierItem::setToolTipIconByPixmap(const QIcon &icon) @@ -207,7 +216,7 @@ mTooltipIconCacheKey = icon.cacheKey(); mTooltipIcon = iconToPixmapList(icon); mTooltipIconName.clear(); - emit mAdaptor->NewToolTip(); + Q_EMIT mAdaptor->NewToolTip(); } void StatusNotifierItem::setContextMenu(QMenu* menu) @@ -227,7 +236,7 @@ if (nullptr != mMenu) { connect(mMenu, &QObject::destroyed, this, &StatusNotifierItem::onMenuDestroyed); - mMenuExporter = new DBusMenuExporter{this->menu().path(), mMenu}; + mMenuExporter = new DBusMenuExporter{this->menu().path(), mMenu, mSessionBus}; } } @@ -236,7 +245,7 @@ if (mStatus == "NeedsAttention") mStatus = "Active"; - emit activateRequested(QPoint(x, y)); + Q_EMIT activateRequested(QPoint(x, y)); } void StatusNotifierItem::SecondaryActivate(int x, int y) @@ -244,7 +253,7 @@ if (mStatus == "NeedsAttention") mStatus = "Active"; - emit secondaryActivateRequested(QPoint(x, y)); + Q_EMIT secondaryActivateRequested(QPoint(x, y)); } void StatusNotifierItem::ContextMenu(int x, int y) @@ -264,14 +273,14 @@ if (orientation.toLower() == "horizontal") orient = Qt::Horizontal; - emit scrollRequested(delta, orient); + Q_EMIT scrollRequested(delta, orient); } void StatusNotifierItem::showMessage(const QString& title, const QString& msg, const QString& iconName, int secs) { QDBusInterface interface("org.freedesktop.Notifications", "/org/freedesktop/Notifications", - "org.freedesktop.Notifications", QDBusConnection::sessionBus()); + "org.freedesktop.Notifications", mSessionBus); interface.call("Notify", mTitle, (uint) 0, iconName, title, msg, QStringList(), QVariantMap(), secs); } @@ -281,7 +290,8 @@ IconPixmapList pixmapList; // long live KDE! - for (const QSize &size : icon.availableSizes()) + const QList<QSize> sizes = icon.availableSizes(); + for (const QSize &size : sizes) { QImage image = icon.pixmap(size).toImage(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.11.1/src/statusnotifieritem/statusnotifieritem.h new/lxqt-qtplugin-0.12.0/src/statusnotifieritem/statusnotifieritem.h --- old/lxqt-qtplugin-0.11.1/src/statusnotifieritem/statusnotifieritem.h 2016-12-11 01:52:27.000000000 +0100 +++ new/lxqt-qtplugin-0.12.0/src/statusnotifieritem/statusnotifieritem.h 2017-10-21 21:34:23.000000000 +0200 @@ -32,6 +32,7 @@ #include <QObject> #include <QIcon> #include <QMenu> +#include <QDBusConnection> #include "dbustypes.h" @@ -132,7 +133,7 @@ */ void setContextMenu(QMenu *menu); -public slots: +public Q_SLOTS: void Activate(int x, int y); void SecondaryActivate(int x, int y); void ContextMenu(int x, int y); @@ -144,12 +145,12 @@ void registerToHost(); IconPixmapList iconToPixmapList(const QIcon &icon); -private slots: +private Q_SLOTS: void onServiceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner); void onMenuDestroyed(); -signals: +Q_SIGNALS: void activateRequested(const QPoint &pos); void secondaryActivateRequested(const QPoint &pos); void scrollRequested(int delta, Qt::Orientation orientation); @@ -176,6 +177,7 @@ QMenu *mMenu; QDBusObjectPath mMenuPath; DBusMenuExporter *mMenuExporter; + QDBusConnection mSessionBus; static int mServiceCounter; };
