Compare commits
2 Commits
ubuntu/plu
...
experiment
Author | SHA1 | Date | |
---|---|---|---|
|
7132ac949a | ||
|
c5df735d89 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
build
|
|
||||||
*.kdev4
|
|
3
AUTHORS
3
AUTHORS
@ -3,8 +3,7 @@ Upstream Authors:
|
|||||||
Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
|
Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
|
||||||
|
|
||||||
Copyright:
|
Copyright:
|
||||||
Copyright (c) 2013-2014 LXQt team
|
Copyright (c) 2013-2016 LXQt team
|
||||||
|
|
||||||
License: LGPL-2.1+
|
License: LGPL-2.1+
|
||||||
The full text of the licenses can be found in the 'COPYING' file.
|
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
|
|
||||||
|
@ -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.
|
|
||||||
|
|
4
debian/README.Debian
vendored
4
debian/README.Debian
vendored
@ -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.
|
|
24
debian/changelog
vendored
24
debian/changelog
vendored
@ -1,3 +1,27 @@
|
|||||||
|
lxqt-qtplugin (0.10.96~8-g411f696-1) experimental; urgency=medium
|
||||||
|
|
||||||
|
* Cherry-picking upstream version 0.10.96~8-g411f696.
|
||||||
|
* Preparing the upcoming release, switch to experimental
|
||||||
|
* Added new build dependendies:
|
||||||
|
- gcc (>= 4:6)
|
||||||
|
- g++ (>= 4:6)
|
||||||
|
- libqt5xdgiconloader-dev (>= 1.3.1~)
|
||||||
|
* Minimum versions added
|
||||||
|
* Bumped Standards to 3.9.8, no changes needed
|
||||||
|
* 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 <agaida@siduction.org> Tue, 19 Jul 2016 17:15:04 +0200
|
||||||
|
|
||||||
lxqt-qtplugin (0.10.0-3) unstable; urgency=medium
|
lxqt-qtplugin (0.10.0-3) unstable; urgency=medium
|
||||||
|
|
||||||
* Remove dbg package in favor of dbgsym.
|
* Remove dbg package in favor of dbgsym.
|
||||||
|
13
debian/control
vendored
13
debian/control
vendored
@ -7,19 +7,22 @@ Section: x11
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper (>= 9),
|
Build-Depends: debhelper (>= 9),
|
||||||
cmake (>= 3.0.2),
|
cmake (>= 3.0.2),
|
||||||
|
gcc (>= 4:6),
|
||||||
|
g++ (>= 4:6),
|
||||||
libdbusmenu-qt5-dev,
|
libdbusmenu-qt5-dev,
|
||||||
libkf5windowsystem-dev,
|
libkf5windowsystem-dev,
|
||||||
liblxqt0-dev (>= 0.10.0),
|
liblxqt0-dev (>= 0.10.96~),
|
||||||
libqt5x11extras5-dev,
|
libqt5x11extras5-dev,
|
||||||
libqt5xdg-dev (>= 1.3.0),
|
libqt5xdg-dev (>= 1.3.1~),
|
||||||
|
libqt5xdgiconloader-dev (>= 1.3.1~),
|
||||||
libx11-dev,
|
libx11-dev,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
qtbase5-private-dev,
|
qtbase5-private-dev,
|
||||||
qttools5-dev,
|
qttools5-dev,
|
||||||
qttools5-dev-tools,
|
qttools5-dev-tools,
|
||||||
Standards-Version: 3.9.6
|
Standards-Version: 3.9.8
|
||||||
Vcs-Browser: http://anonscm.debian.org/cgit/pkg-lxqt/lxqt-qtplugin.git/?h=debian/sid
|
Vcs-Browser: https://anonscm.debian.org/git/pkg-lxqt/lxqt-qtplugin.git/?h=debian/experimental
|
||||||
Vcs-Git: git://anonscm.debian.org/pkg-lxqt/lxqt-qtplugin.git -b debian/sid
|
Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-qtplugin.git -b debian/experimental
|
||||||
Homepage: https://github.com/lxde/lxqt-qtplugin
|
Homepage: https://github.com/lxde/lxqt-qtplugin
|
||||||
|
|
||||||
Package: lxqt-qtplugin
|
Package: lxqt-qtplugin
|
||||||
|
54
debian/copyright
vendored
54
debian/copyright
vendored
@ -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
|
Upstream-Name: lxqt-qtplugin
|
||||||
Source: https://github.com/lxde/lxqt-panel
|
Source: https://github.com/lxde/lxqt-qtplugin
|
||||||
|
|
||||||
Files: *
|
Files: *
|
||||||
Copyright: 2013-2015 LXQt team
|
Copyright: 2013-2016 LXQt team
|
||||||
2010-2012 Razor team
|
2010-2012 Razor team
|
||||||
License: LGPL-2.1+
|
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/*
|
Files: debian/*
|
||||||
Copyright: 2014-2015 Alf Gaida <agaida@siduction.org>
|
Copyright: 2014-2016 Alf Gaida <agaida@siduction.org>
|
||||||
2015 ChangZhuo Chen (陳昌倬) <czchen@debian.org>
|
2015 ChangZhuo Chen (陳昌倬) <czchen@debian.org>
|
||||||
2015 Yukiharu YABUKI <yyabuki@debian.org>
|
2015 Yukiharu YABUKI <yyabuki@debian.org>
|
||||||
License: LGPL-2.1+
|
License: LGPL-2.1+
|
||||||
@ -32,43 +26,3 @@ License: LGPL-2.1+
|
|||||||
.
|
.
|
||||||
On Debian systems, the complete text of the GNU Lesser General
|
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".
|
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.
|
|
||||||
|
4
debian/gbp.conf
vendored
Normal file
4
debian/gbp.conf
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
debian-branch = debian/experimental
|
||||||
|
upstream-branch = upstream/latest
|
||||||
|
pristine-tar = True
|
12
debian/rules
vendored
12
debian/rules
vendored
@ -1,8 +1,16 @@
|
|||||||
#!/usr/bin/make -f
|
#!/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_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||||
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh ${@} --buildsystem cmake \
|
dh ${@} --buildsystem cmake\
|
||||||
--parallel
|
--parallel
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
dh_auto_configure -- \
|
||||||
|
-DPULL_TRANSLATIONS=OFF\
|
||||||
|
-DUPDATE_TRANSLATIONS=OFF\
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
|
@ -31,6 +31,7 @@ target_link_libraries(qtlxqt
|
|||||||
Qt5::DBus
|
Qt5::DBus
|
||||||
dbusmenu-qt5
|
dbusmenu-qt5
|
||||||
lxqt
|
lxqt
|
||||||
|
Qt5XdgIconLoader
|
||||||
)
|
)
|
||||||
|
|
||||||
# there is no standard way to get the plugin dir of Qt5 with cmake
|
# there is no standard way to get the plugin dir of Qt5 with cmake
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include "qiconloader_p.h"
|
#include <private/xdgiconloader/xdgiconloader_p.h>
|
||||||
|
|
||||||
LXQtPlatformTheme::LXQtPlatformTheme():
|
LXQtPlatformTheme::LXQtPlatformTheme():
|
||||||
settingsWatcher_(NULL)
|
settingsWatcher_(NULL)
|
||||||
@ -162,7 +162,7 @@ void LXQtPlatformTheme::onSettingsChanged() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(iconTheme_ != oldIconTheme) { // the icon theme is changed
|
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
|
// if font is changed
|
||||||
@ -294,22 +294,40 @@ QVariant LXQtPlatformTheme::themeHint(ThemeHint hint) const {
|
|||||||
return QPlatformTheme::themeHint(hint);
|
return QPlatformTheme::themeHint(hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIconEngine *LXQtPlatformTheme::createIconEngine(const QString &iconName) const
|
||||||
|
{
|
||||||
|
return new XdgIconLoaderEngine(iconName);
|
||||||
|
}
|
||||||
|
|
||||||
// Helper to return the icon theme paths from XDG.
|
// Helper to return the icon theme paths from XDG.
|
||||||
QStringList LXQtPlatformTheme::xdgIconThemePaths() const
|
QStringList LXQtPlatformTheme::xdgIconThemePaths() const
|
||||||
{
|
{
|
||||||
QStringList paths;
|
QStringList paths;
|
||||||
|
QStringList xdgDirs;
|
||||||
|
|
||||||
// Add home directory first in search path
|
// Add home directory first in search path
|
||||||
const QFileInfo homeIconDir(QDir::homePath() + QStringLiteral("/.icons"));
|
const QFileInfo homeIconDir(QDir::homePath() + QStringLiteral("/.icons"));
|
||||||
if (homeIconDir.isDir())
|
if (homeIconDir.isDir())
|
||||||
paths.prepend(homeIconDir.absoluteFilePath());
|
paths.prepend(homeIconDir.absoluteFilePath());
|
||||||
|
|
||||||
QString xdgDirString = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
|
QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME"));
|
||||||
if (xdgDirString.isEmpty())
|
if (xdgDataHome.isEmpty())
|
||||||
xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
|
xdgDataHome = QDir::homePath() + QLatin1String("/.local/share");
|
||||||
foreach (const QString &xdgDir, xdgDirString.split(QLatin1Char(':'))) {
|
xdgDirs.append(xdgDataHome);
|
||||||
const QFileInfo xdgIconsDir(xdgDir + QStringLiteral("/icons"));
|
|
||||||
if (xdgIconsDir.isDir())
|
QString xdgDataDirs = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
|
||||||
paths.append(xdgIconsDir.absoluteFilePath());
|
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;
|
return paths;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
// virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
|
// virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
|
||||||
// QPlatformTheme::IconOptions iconOptions = 0) const;
|
// QPlatformTheme::IconOptions iconOptions = 0) const;
|
||||||
|
|
||||||
// virtual QIconEngine *createIconEngine(const QString &iconName) const;
|
virtual QIconEngine *createIconEngine(const QString &iconName) const;
|
||||||
|
|
||||||
// virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
|
// virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ void LXQtSystemTrayIcon::init()
|
|||||||
|
|
||||||
// default menu
|
// default menu
|
||||||
QPlatformMenu *menu = createMenu();
|
QPlatformMenu *menu = createMenu();
|
||||||
menu->setParent(this);
|
menu->setParent(mSni);
|
||||||
QPlatformMenuItem *menuItem = menu->createMenuItem();
|
QPlatformMenuItem *menuItem = menu->createMenuItem();
|
||||||
menuItem->setParent(menu);
|
menuItem->setParent(menu);
|
||||||
menuItem->setText(tr("Quit"));
|
menuItem->setText(tr("Quit"));
|
||||||
|
@ -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 <QtCore/qglobal.h>
|
|
||||||
|
|
||||||
#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 <QtGui/QIcon>
|
|
||||||
#include <QtGui/QIconEngine>
|
|
||||||
#include <QtGui/QPixmapCache>
|
|
||||||
#include <private/qicon_p.h>
|
|
||||||
#include <private/qfactoryloader_p.h>
|
|
||||||
#include <QtCore/QHash>
|
|
||||||
|
|
||||||
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<QIconLoaderEngineEntry*> 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 <QIconDirInfo> keyList() { return m_keyList; }
|
|
||||||
QString contentDir() { return m_contentDir; }
|
|
||||||
bool isValid() { return m_valid; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_contentDir;
|
|
||||||
QList <QIconDirInfo> 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 <QString, QIconTheme> themeList;
|
|
||||||
};
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_NO_ICON
|
|
||||||
|
|
||||||
#endif // QICONLOADER_P_H
|
|
@ -42,7 +42,8 @@ StatusNotifierItem::StatusNotifierItem(QString id, QObject *parent)
|
|||||||
mId(id),
|
mId(id),
|
||||||
mTitle("Test"),
|
mTitle("Test"),
|
||||||
mStatus("Active"),
|
mStatus("Active"),
|
||||||
mMenu(nullptr)
|
mMenu(nullptr),
|
||||||
|
mMenuExporter(nullptr)
|
||||||
{
|
{
|
||||||
// register service
|
// register service
|
||||||
QDBusConnection::sessionBus().registerService(mService);
|
QDBusConnection::sessionBus().registerService(mService);
|
||||||
@ -64,8 +65,6 @@ StatusNotifierItem::~StatusNotifierItem()
|
|||||||
QDBusConnection::sessionBus().unregisterObject("/StatusNotifierItem");
|
QDBusConnection::sessionBus().unregisterObject("/StatusNotifierItem");
|
||||||
QDBusConnection::sessionBus().unregisterService(mService);
|
QDBusConnection::sessionBus().unregisterService(mService);
|
||||||
QDBusConnection::sessionBus().disconnectFromBus(mService);
|
QDBusConnection::sessionBus().disconnectFromBus(mService);
|
||||||
|
|
||||||
delete mMenu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatusNotifierItem::registerToHost()
|
void StatusNotifierItem::registerToHost()
|
||||||
@ -84,6 +83,12 @@ void StatusNotifierItem::onServiceOwnerChanged(const QString& service, const QSt
|
|||||||
registerToHost();
|
registerToHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StatusNotifierItem::onMenuDestroyed()
|
||||||
|
{
|
||||||
|
mMenu = nullptr;
|
||||||
|
mMenuExporter = nullptr; //mMenu is a QObject parent of the mMenuExporter
|
||||||
|
}
|
||||||
|
|
||||||
void StatusNotifierItem::setTitle(const QString &title)
|
void StatusNotifierItem::setTitle(const QString &title)
|
||||||
{
|
{
|
||||||
if (mTitle == title)
|
if (mTitle == title)
|
||||||
@ -210,12 +215,20 @@ void StatusNotifierItem::setContextMenu(QMenu* menu)
|
|||||||
if (mMenu == menu)
|
if (mMenu == menu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
delete mMenu;
|
if (nullptr != mMenu)
|
||||||
|
{
|
||||||
|
disconnect(mMenu, &QObject::destroyed, this, &StatusNotifierItem::onMenuDestroyed);
|
||||||
|
}
|
||||||
mMenu = menu;
|
mMenu = menu;
|
||||||
mMenu->setParent(nullptr);
|
|
||||||
|
|
||||||
setMenuPath("/MenuBar");
|
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)
|
void StatusNotifierItem::Activate(int x, int y)
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "dbustypes.h"
|
#include "dbustypes.h"
|
||||||
|
|
||||||
class StatusNotifierItemAdaptor;
|
class StatusNotifierItemAdaptor;
|
||||||
|
class DBusMenuExporter;
|
||||||
|
|
||||||
class StatusNotifierItem : public QObject
|
class StatusNotifierItem : public QObject
|
||||||
{
|
{
|
||||||
@ -126,6 +127,9 @@ public:
|
|||||||
return tt;
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \Note: we don't take ownership for the \param menu
|
||||||
|
*/
|
||||||
void setContextMenu(QMenu *menu);
|
void setContextMenu(QMenu *menu);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -143,6 +147,7 @@ private:
|
|||||||
private slots:
|
private slots:
|
||||||
void onServiceOwnerChanged(const QString &service, const QString &oldOwner,
|
void onServiceOwnerChanged(const QString &service, const QString &oldOwner,
|
||||||
const QString &newOwner);
|
const QString &newOwner);
|
||||||
|
void onMenuDestroyed();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void activateRequested(const QPoint &pos);
|
void activateRequested(const QPoint &pos);
|
||||||
@ -170,6 +175,7 @@ private:
|
|||||||
// menu
|
// menu
|
||||||
QMenu *mMenu;
|
QMenu *mMenu;
|
||||||
QDBusObjectPath mMenuPath;
|
QDBusObjectPath mMenuPath;
|
||||||
|
DBusMenuExporter *mMenuExporter;
|
||||||
|
|
||||||
static int mServiceCounter;
|
static int mServiceCounter;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user