Compare commits

...

2 Commits

Author SHA1 Message Date
Alf Gaida
7132ac949a 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
2016-07-19 17:15:25 +02:00
Alf Gaida
c5df735d89 Cherry-picking upstream version 0.10.96~8-g411f696. 2016-07-19 15:57:37 +02:00
16 changed files with 106 additions and 301 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
build
*.kdev4

View File

@ -3,8 +3,7 @@ Upstream Authors:
Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
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

View File

@ -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.

View File

@ -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
View File

@ -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
* Remove dbg package in favor of dbgsym.

13
debian/control vendored
View File

@ -7,19 +7,22 @@ Section: x11
Priority: optional
Build-Depends: debhelper (>= 9),
cmake (>= 3.0.2),
gcc (>= 4:6),
g++ (>= 4:6),
libdbusmenu-qt5-dev,
libkf5windowsystem-dev,
liblxqt0-dev (>= 0.10.0),
liblxqt0-dev (>= 0.10.96~),
libqt5x11extras5-dev,
libqt5xdg-dev (>= 1.3.0),
libqt5xdg-dev (>= 1.3.1~),
libqt5xdgiconloader-dev (>= 1.3.1~),
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
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/git/pkg-lxqt/lxqt-qtplugin.git/?h=debian/experimental
Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-qtplugin.git -b debian/experimental
Homepage: https://github.com/lxde/lxqt-qtplugin
Package: lxqt-qtplugin

54
debian/copyright vendored
View File

@ -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 <agaida@siduction.org>
Copyright: 2014-2016 Alf Gaida <agaida@siduction.org>
2015 ChangZhuo Chen (陳昌倬) <czchen@debian.org>
2015 Yukiharu YABUKI <yyabuki@debian.org>
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.

4
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
debian-branch = debian/experimental
upstream-branch = upstream/latest
pristine-tar = True

12
debian/rules vendored
View File

@ -1,8 +1,16 @@
#!/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 \
dh ${@} --buildsystem cmake\
--parallel
override_dh_auto_configure:
dh_auto_configure -- \
-DPULL_TRANSLATIONS=OFF\
-DUPDATE_TRANSLATIONS=OFF\
-DCMAKE_BUILD_TYPE=RelWithDebInfo

View File

@ -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

View File

@ -44,7 +44,7 @@
#include <QFileInfo>
#include <QFileSystemWatcher>
#include <QStyle>
#include "qiconloader_p.h"
#include <private/xdgiconloader/xdgiconloader_p.h>
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;
}

View File

@ -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<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;

View File

@ -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"));

View File

@ -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

View File

@ -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)

View File

@ -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;
};