Cherry-picked new upstream release 2.0.0.

Added current signing key
Bumped compat to 10
Bumped debhelper to (>=10)
Added build dependency libqt5svg5-dev
Renamed package libqt5xdg1 -> libqt5xdg2 (soname bump)
Renamed package libqt5xdgiconloader1 -> libqt5xdgiconloader2 (soname bump)
Added dependency gtk-update-icon-cache to libqt5xdgiconloader2
Renamed install and symbols files
Fixed symbols
Fixed .gitignore
ubuntu/cosmic debian/2.0.0-1
Alf Gaida 8 years ago
parent 09d221d744
commit 02ce779589

8
.gitignore vendored

@ -0,0 +1,8 @@
build*
*.qm
*~
*.autosave
*-swp
*.swp
CMakeLists.txt.user*
nbproject/

@ -0,0 +1,361 @@
libqtxdg-2.0.0 / 2016-09-17
===========================
* Bump version to 2.0.0
* Extend README.md
* Updates dependencies
* Fixes QIcon::hasThemeIcon() behavior with our Icon Loader Engine
* Adds Qt5Svg explicitly to the required packages
* QIconLoader: Use the GTK+ icon caches
* QIcon: add a hook in the engine so a non null QIconEngine can still be a null icon
* QIconLoader: don't make QIconDirInfo::type a bit-field
* Do not support static QIcon instances
* Respect manual set icon themes.
* Remove <qhash.h> where it's not used
* Make it more obvious that Q_WS_ is dead code, and should perhaps be ported
* XdgDesktopFileData: Explicitly initialize members (#91)
* build: Create separate Qt5XdgIconLoader target
* XdgDesktopFile: Adds tests
* xdgdesktopfile: Removes an not needed debug info
* xdgdesktopfile: Removes double QLatin1String's contruction
* XdgDesktopFileCache: Check if a file isValid() only when needed
* XdgDesktopFile: Reworks XdgDesktopFileCache::getFile()
* XdgDesktopFileCache: Check new acquired objects before using it
* XdgDesktopFile: Removes unneeded assignment
* XdgDesktopFile: Add break to switch case
* qtxdg: Get the HOME environment variable just one time
* Replace the QString % operator by the + operator
* No more implicit string conversions
* Moves QT_USE_QSTRINGBUILDER to the compiler_settings CMake module
* XdgDesktopFileCache: Fixes an coding typing error
* xdgiconloader: Fix typo in directoryMatchesSize
* Xdgiconloader (#84)
* Improve foreach iteraror performance
* XdgDesktopFile: Improve the performance of the foreach loop
* XdgDesktopFile: Use XdgDirs::userDir(), drop QStandardPaths()
* XdgDesktopFile: Standardize text strings scope
* XdgDesktopFile: Adds a Desktop File ID calculator method
* XdgDesktopFile: Document Exec fallback when DBusActivatable fails
* Adds QT_USE_QSTRINGBUILDER to the compile definitions
* Adds the BUILD_DEV_UTILS to README.md
* Makes the development utils build/install optional
* XdgDesktopFile: Adds Exec fallback when DBusActivatable fails
* Adds an .desktop file start tester
* XdgDirs: Use Q_ASSERT to check for XdgDirs::userDirectory invalid values
* XdgDirs: Use XdgDirs::UserDirectory enum instead of int
* XdgDirs: Makes XdgDirs::userDir use userDirectoryFallback()
* XdgDirs: Adds userDirDefault() method.
* Adds XdgDesktopFile::mimeTypes() member
* build: Enable C++11 usage
* iconloader: Fix actualSize() for non-themed icons
* desktopfile: Change validity check
* Added Digia-Qt-LGPL-Exception-1.1
* Update years and Licenses
* desktopfile: Check validity of DBus object path
* desktopfile: Don't invoke DBus call on invalid interface
* XdgUserDirs: Return a fallback when the path is empty
* README.md: Fix grammatical error, adjust wording
* Update and rename README to README.md
* xdgdesktopfile: handle 'Path' entry for application's working directory
* Fix possible use of cachedIcon after free
* Update release.sh server url
1.3.0 / 2015-10-27
==================
* Release 1.3.0
* desktopfile: Remove support for $XDG_MOVIES_DIR (which doesn't exist)
* Assorted style cleanups
* Adds XdgDesktopFile != operator
* Fixes the XdgMimeType == operator
* Handles CMake policy CMP0063
* Adds an compiler_settings CMake "module"
* CMake: Adds Runtime install COMPONENT
* Drops find_package(), use find_dependency()
* Marks link libraries as PUBLIC
* Handles in-tree builds headers the right way.
* Narrows the scope of compile definitions
* Improves create_pkgconfig_file.cmake
* Use the Targets CMake stuff
* Adds package version config info file
* Code reordering
* Use Qt5 style library names
* Remove unneeded add_definitions()
* Simplifies version variables a little bit
* Removes unneeded include_directories()
* Uses standard GNUInstallDirs instead of FindLibSuffix
* Remove trailing whitespaces
* added missing licensing headers
* Backports Fixed icons lookup in QIcon::fromTheme
* Adds XdgDirs tests
* Adds XdgDirs::configHome() fallback default locations
* XdgDesktopFile: Handles NotShowIn correctly
* Fixes XdgDirs::dataHome() regression
* QIconLoader: Change the order fallback icon lookup order
* Gets rid of translations stuff
* Cleans up empty comment lines
* Remove Qt4 stuff from the documentation
* Remove Qt4 stuff from the example and tests
* Remove Qt4 stuff from the source files
* Get rid of Qt4 stuff in the build system
1.2.0 / 2015-03-29
==================
* Release 1.2.0
* Fixes XdgDesktop::isShow() caching mechanism
* Add QtDBus/Qt5DBus dependency
* Adds support for X-Categories
* Adds support for X-OnlyShowIn and X-NotShowIn
* Fixes an Qt4 FTBFS
* Use QLatin1Char()
* Adds platform-data handling
* Make DBusActivatable work for Qt4 too
* desktopfile: support for DBusActivatable applications
* Adds a list of special non detachable execs
* desktopfile: run new process as a direct child
* Qt5: Use QStandardPaths() where possible
* XdgDirs: Updates documentation.
* String manipulation enhancements
* Make sure returned directories don't have an trailing '/'
* XdgDirs: postfix should always start with an /
* XdgDirs::configHome() handle postfix slash
* Fix XdgDirs::dataDirs() postfix handling
* Replace empty quotes by QString()
* XdgDesktopFileCache: Retrieve apps of a category
* Quote all paths in the CMake stuff
* Qt5: Use Qt5 private headers
* Ignore empty dirs in xdgDirList()
* Makes needed helper functions available to tests
* - Fix compilation when using internal mime
* Release with a proper versioned prefix
* Avoid adding empty parent icon theme
* Update license headers and add new license files
* Use QPlatformTheme::SystemIconFallbackThemeName in static QString fallbackTheme()
* QIconLoader: enable an easy case of transactional processing
* QIconLoader: don't inherit QObject
* QIconLoader: replace an inefficient QList with a QVector
* QIconLoader: mark virtual overrides
* QIconLoader: mark a helper type as movable
* QIconLoader: replace while(!empty()) delete takeLast() with qDeleteAll()
* QIconLoader: don't re-evaluate container.size() all the time (II)
* QIconLoader: don't re-evaluate container.size() all the time
* QIconLoader: remove another unused variable
* QIconLoader: remove an unused variable
1.1.0 / 2015-02-07
==================
* Update the release script to sign packages
* Sets visibility to hidden symbols for Clang
* Move static const variable from a public .h file to the .cpp
* Use gcc visibility attribute and Q_DECL_EXPORT macro to avoid exporting private symbols in the lib. This greatly reduced the size of dynamic symbol table and might potentially speed up loading. Also, turn off exception handling to save more since we don't use it. For non-gcc compilers, this change does nothing.
* Makes the Qt5 build the default
* Qt5: Updates CMake minimum required version
* Qt4: Backport add fallback for unthemed app icons
* add fallback for unthemed app icons
* XdgDesktopFileCache::getFile(): Don't insert/removes non existent files
* Enhance the loading of a .desktop file.
* Adds helper functions prototypes
* Fixes issue #7
* Updates .gitignore
* Removes i18n/i10n
* Updates translations
* Updates the translation infrastructure
* Update Russian translation
* Qt4: Fixes an FTBFS on Gentoo x86_64 when USE_QTMIMETYPES=On
* Add a release script
1.0.0 / 2014-09-06
==================
* Release 1.0.0
* Replaces XdgMimeInfo with XdgMimeType
* Updates the cmake_minimum_required() version
* Build system maintenance
* if QT_VERSION < 5 load the qt4 header
* Allows QIconLoader to search in multiple theme directories.
* Fixes an FTBFS in the Qt4 build
* Merge branch 'use-qt5-qiconloader'
* Revert "Merge branch 'use-qt5-qiconloader'"
* Revert "Fixes an FTBFS in the Qt4 build"
* Fixes an FTBFS in the Qt4 build
* Get and set XDG user dirs variables in config file
* Honors /usr/share/pixmaps when searching for icons.
* Adds xpm icon support
* Adds Qt5 QIconLoader for the Qt5 build
* Ports Qt5 commit: Make sure QIconLoader is always initialized
* Use environment to trigger Qt5 builds
* Fixes an XdgMimeInfo memory leak
* Use case insensitive comparisons with desktop environment names
* Updates some XdgDesktopFile methods documentation
* Make desktop enviroment names comparisons case insensitive
* solve failed comp LXQT with LXQt (OnlyShowIn=LXQt;) in desktop files
* Re-adds Support XDG_CURRENT_DESKTOP in autostart handling
* Deprecates non desktop environment neutral XdgDesktopFile methods
* Revert "Support XDG_CURRENT_DESKTOP in autostart handling."
* Adds QTXDG_DEPRECATED macro
* Install pkgconfig files to /usr/local/libdata/pkgconfig in FreeBSD.
* Set library dirs properly in qtxdg-config and use files.
0.5.3 / 2014-05-08
==================
* Release 0.5.3
* Update some comments
0.5.1 / 2014-05-05
==================
* libqtxdg 0.5.1
* Revert "Change default environment to LXQt"
* Revert "Check for lxqt-applications instead of razor-applications"
* Support XDG_CURRENT_DESKTOP in autostart handling.
* Update .gitignore
* Check for lxqt-applications instead of razor-applications
* Change default environment to LXQt
* Avoid XdgAction mnemonics caused by '&' symbol in the name of desktop app.
0.1.0 / 2014-04-29
==================
* Update AUTHORS and COPYING
* Add CPack rules for creating tarball
* Put iconloaderfix into own namespace
* Adds an uninstall target
* Fixes an FTBFS on the test target
* Fixes an FTBFS when a mix of PIC and PIE compiler flags are used
* Updates CMake's minimum required version
* Adds Qt5Widgets to the required pkg-config required packages
* test: Removes meaningless add_dependencies(..... razorqt)
* Don't use STREQUAL to test the BUILD_TESTS option
* Removed CMAKE_SOURCE_DIR usage from test/CMakeLists.txt
* Adds missing ${CMAKE_INSTALL_PREFIX}
* Fixes bugs in create_pkgconfig_file cmake macro
* Use GNU installation directories
* prefix parameter for autostartDirs, configDirs and dataDirs. (part2)
* prefix parameter for autostartDirs, configDirs and dataDirs.
* Updates buildsystem typical use documentation
* Reformatting for an easy reading in a 80x24 terminal
* Documents the QTXDG_QT_LIBRARIES variable
* Adds an tiny example on how to use the lib
* RazorLibSuffix.cmake -> ../cmake/FindLibSuffix.cmake and QUIET mode for find_package
* Adds ${CMAKE_CURRENT_BINARY_DIR} to the include_directories list
* Fix qtxdg_use.cmake and qtxdg-config.cmake generation location
* Replace QDomNodeList::length() by QDomNodeList::size()
* Portable headers
* Adds pkg-config to Qt5Xdg
* Renames the Qt5 build
* Packs Qt version specific stuff
* Removes unneeded set(QT_USE_QTXML TRUE)
* qtxdg/test: Adapts the build system to support Qt4 and Qt5
* qtxdg/test: Removes Qt4 CMake stuff
* Adds missing library (Qt5Xml) to qtxdg target
* qtxdg/test: Removes the project command and cmake_minimum_required()
* Explicitly requires QtTest module
* Make BUILD_TESTS an option
* Replace Q_GLOBAL_STATIC_WITH_INITIALIZER
* Replaces QIconEngineV2 with QIconEngine
* Adds QMimeData include file
* Port QString::toAscii()
* Port QDesktopServices
* Ran fixqt4headers
* Adds support to Qt5 in the buildsystem
* Adds test target to CMake
* Use the QtTestLib facilities
* Cmake find_package files for the QtXdg
* Revert "Cmake find_package files"
* Cmake find_package files
* Add COPYING and AUTHORS files
* X-RAZOR changed to Razor in desktop files
* config-file-associations, mimetypeviewer: Replaced QTreeWidget with QTreeView and new class MimetypeItemModel as model
* Improved (hopefuly) layout and look of config-fileassociations, application chooser
* Clang complained about type mismatch
* application-x-executable now fallback icon for desktopfiles of type Application
* Added XdgMimeInfoCache
* Added more info to XdgMime
* XdgDesktopFileCache now holds list of all apps that can handle a given mimetype
* Make QtXdg build by itself again
* libraries: Removes unneeded include(RazorLibSuffix)
* libraries: Removes unneeded cmake_minimum_required(VERSION 2.6)
* libraries: Removes unneeded find_package(Qt4)
* xdgdesktopfilecache now looks in <datadir or datahome>/applications/defaults.list for default app
* Add getApps method to XdgDesktopFileCache - returns all applications that can handle a mimetype
* Fix building with C++11
* XdgDesktopFile: Don't strip quotes
* initial fix for #520 XdgDesktopFileCache::getDefaultApp cache wrong behavior
* Closes Issue #487
* Set minimum percent to 1% for transifex in cmake
* Translations updated
* Translations updated
* Soname was changed
* Update translations
* Translations updated
* Removed line num from TS files.
* Fix autostart dir detection when the env var is set
* Updated .tx file
* version bump to 0.4.99 (public "release candiates") for qtxdg
* Translation for razor-sesion
* Fixes in the qtxdg translations
* Transifex resource renamed qtxdg->libqtxdg
* Fix for Issue #290 Fails to build on BSD
* New translations for libqtxdg
* Starting the razor-confupdate from the razor-session.
* Razor-confupdate: fixes and .upd file for 0.4.1-0.5
* Language name zh_CN.GB2312 braked cmake process.
* Translations updated
* Add operator== for XdgDesktopFile
* Don't replace space with \s
* Fixed for Preloading menu
* Cleaning the code.
* Move autostart directory code to XdgDirs
* Improvements to the XdgMenu. Added changed signal.
* Small speed opetimistaion in the qiconloader
* Add function to remove entries from desktop files
* Transifex desktop: sr_BA.ts should be a local
* Transifex desktop: local translations
* Transifex desktop: Translations pulled
* Icons for the desktop menu
* Add Traditional Chinese Translations
* Translations update
* Added support for the online translation service. www.transifex.net
* Serbian translation files
* Class documentation for XdgMimeInfo
* Greek translation by iosifidis
* Fix for issue #170. Escaping.
* Fix for issue #170. Escaping.
* Fix for issue #170
* Fix for issue #170
* Added danish translations
* X-RAZOR -> Razor for autostart
* Russian translation
* RAZOR -> X-RAZOR
* MINOR_VERSION & PATCH_VERSION for libraries
* fix #169: italian translation
* XdgAutoStart rewriten (lgpl2+)
* Closes #158
* Support icons with absolute path file names
* LGPL2+ for qtxdg
* Escape &'s to prevent Qt from using them for mnemonics
* Revert "XdgDesktopFile: Display an actual ampersand character"
* Update german [de] translation
* Add setLocalizedValue() function
* fixed qtxdg/translations/translate.sh
* Add a constructor to generate basic XdgDesktopFiles
* Correct the XdgAutoStart behavior
* SVK translation finalized
* Replaces return"" by return QString()
* License audit
* implemented #70: pkg-config for libs
* Add Chinese(simplified) translation files.
* fix #119 qtxdg bug and patch
* License audit
* Add Slovak (sk) translation
* Czech translations (cs_CZ)
* Fix doxygen documentation in xdgdesktopfile
* New doxygen ifrastructure
* devel-docs generated in CMAKE_BINARY_DIR/docs includig dummy index.html
* missing translations in CMakeLists
* XdgDesktopFile is implicitly shared
* huge refactoring of the libraries build organization

@ -25,8 +25,8 @@ else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(QTXDG_MAJOR_VERSION 1)
set(QTXDG_MINOR_VERSION 3)
set(QTXDG_MAJOR_VERSION 2)
set(QTXDG_MINOR_VERSION 0)
set(QTXDG_PATCH_VERSION 0)
set(QTXDG_VERSION_STRING ${QTXDG_MAJOR_VERSION}.${QTXDG_MINOR_VERSION}.${QTXDG_PATCH_VERSION})
@ -38,6 +38,7 @@ include(create_pkgconfig_file)
include(compiler_settings NO_POLICY_SCOPE)
find_package(Qt5Widgets REQUIRED QUIET)
find_package(Qt5Svg REQUIRED QUIET)
find_package(Qt5Xml REQUIRED QUIET)
find_package(Qt5DBus REQUIRED QUIET)
@ -56,7 +57,7 @@ set(QTXDGX_PKG_CONFIG_DESCRIPTION "Qt5Xdg, a Qt5 implementation of XDG standards
set(QTXDGX_PKG_CONFIG_REQUIRES "Qt5Core, Qt5Xml, Qt5Widgets, Qt5DBus, Qt5XdgIconLoader")
set(QTXDGX_ICONLOADER_PKG_CONFIG_DESCRIPTION "Qt5XdgIconLader, a Qt5 XDG Icon Loader")
set(QTXDGX_ICONLOADER_PKG_CONFIG_REQUIRES "Qt5Gui")
set(QTXDGX_ICONLOADER_PKG_CONFIG_REQUIRES "Qt5Gui, Qt5Svg")
set(QTXDGX_INTREE_INCLUDEDIR "${CMAKE_CURRENT_BINARY_DIR}/InTreeBuild/include")

@ -1,21 +1,27 @@
##Overview
# libqtxdg
```libqtxdg``` is a Qt implementation of freedesktop.org XDG specifications which is built with Qt5.
## Overview
##Dependencies
`libqtxdg` is a Qt 5 implementation of freedesktop.org XDG specifications.
- Qt5
It is maintained by the LXQt project and nearly all LXQt components are depending on it. Yet it can be used independently from this desktop environment, too.
##Configuration
The library is able to use GTK+ icon theme caches for faster icon lookup. The cache file can be generated with utility `gtk-update-icon-cache` on a theme directory. If the cache is not present, corrupted, or outdated, the normal slow lookup is still run.
```libqtxdg``` uses the CMake build system. Everything that applies to CMake also
applies here.
## Installation
###Configuration options:
BUILD_TESTS Builds tests, defaults to OFF
BUILD_DEV_UTILS Builds and install development utils, defaults to OFF
### Sources
###Configuration Examples:
Build library and build self tests: ```cmake -DBUILD_TESTS=ON ..```
At runtime qtbase is needed. gtk-update-icon-cache represents an optional runtime dependency for the reasons stated above.
Additional build dependencies are CMake, qtsvg, qttools and optionally Git to pull latest VCS checkouts.
Build the library without building self tests : ```cmake ..```
The code configuration is handled by CMake so all corresponding generic instructions apply. Specific CMake variables are
* BUILD_TESTS to build tests. Disabled by default (`OFF`).
* BUILD_DEV_UTILS which builds and installs development utils. Disabled by default as well.
To build and install run `make` and `make install`respectively.
### Binary packages
The library is provided by all major Linux distributions like Arch Linux, Debian, Fedora and openSUSE.
Just use the distributions' package managers to search for string `libqtxdg`.

@ -3,6 +3,7 @@
include(CMakeFindDependencyMacro)
find_dependency(Qt5Gui)
find_dependency(Qt5Svg)
if (CMAKE_VERSION VERSION_GREATER 2.8.12)
cmake_policy(SET CMP0024 OLD)

5
debian/.gitignore vendored

@ -5,9 +5,8 @@
/files
/libqt5xdg1/
/libqt5xdg1-dbg/
/libqt5xdg2/
/libqt5xdg-dev/
/libqt5xdgiconloader-dev/
/libqt5xdgiconloader1/
/libqt5xdgiconloader2/
/tmp

16
debian/changelog vendored

@ -1,3 +1,19 @@
libqtxdg (2.0.0-1) experimental; urgency=medium
* Cherry-picked new upstream release 2.0.0.
* Added current signing key
* Bumped compat to 10
* Bumped debhelper to (>=10)
* Added build dependency libqt5svg5-dev
* Renamed package libqt5xdg1 -> libqt5xdg2 (soname bump)
* Renamed package libqt5xdgiconloader1 -> libqt5xdgiconloader2 (soname bump)
* Added dependency gtk-update-icon-cache to libqt5xdgiconloader2
* Renamed install and symbols files
* Fixed symbols
* Fixed .gitignore
-- Alf Gaida <agaida@siduction.org> Sun, 18 Sep 2016 02:28:47 +0200
libqtxdg (1.3.1~50-g4fde773-4) experimental; urgency=medium
* Added libfile-mimeinfo-perl as dependency, we really need this, a

2
debian/compat vendored

@ -1 +1 @@
9
10

18
debian/control vendored

@ -5,21 +5,20 @@ Uploaders: Alf Gaida <agaida@siduction.org>,
Andrew Lee (李健秋) <ajqlee@debian.org>
Section: libs
Priority: optional
Build-Depends: debhelper (>= 9),
Build-Depends: debhelper (>= 10),
cmake (>= 3.0.2),
gcc (>= 4:6),
g++ (>= 4:6),
libmagic-dev,
libqt5svg5-dev,
pkg-config,
qtbase5-private-dev,
qttools5-dev,
qttools5-dev-tools
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/git/pkg-lxqt/libqtxdg.git/?h=debian/experimental
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/libqtxdg.git/?h=debian/experimental
Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/libqtxdg.git -b debian/experimental
Homepage: https://github.com/lxde/libqtxdg
Package: libqt5xdg1
Package: libqt5xdg2
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
@ -33,11 +32,12 @@ Description: Implementation of the XDG Specifications for Qt (shared lib)
.
This package provides the shared library.
Package: libqt5xdgiconloader1
Package: libqt5xdgiconloader2
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends}
${misc:Depends},
gtk-update-icon-cache
Pre-Depends: ${misc:Pre-Depends}
Provides: libqt5xdgiconloader
Description: Implementation of the XDG Iconloader for Qt (shared lib)
@ -50,7 +50,7 @@ Package: libqt5xdg-dev
Architecture: any
Section: libdevel
Depends: ${misc:Depends},
libqt5xdg1 (= ${binary:Version}),
libqt5xdg2 (= ${binary:Version}),
libqt5xdgiconloader-dev (= ${binary:Version})
Description: Development files for libqtxdg
This library implements functions of the XDG Specifications in Qt. It is part
@ -62,7 +62,7 @@ Package: libqt5xdgiconloader-dev
Architecture: any
Section: libdevel
Depends: ${misc:Depends},
libqt5xdgiconloader1 (= ${binary:Version})
libqt5xdgiconloader2 (= ${binary:Version})
Description: Development files for libqtxdgiconloader
This library implements the backend to load icons which are handled according
to the XDG Icon Theme Specification in Qt. It is part of LXQt.

@ -1,4 +1,4 @@
libQt5Xdg.so.1 libqt5xdg1 #MINVER#
libQt5Xdg.so.2 libqt5xdg2 #MINVER#
(c++)"XdgAction::XdgAction(QObject*)@Base" 1.0.0
(c++)"XdgAction::XdgAction(QString const&, QObject*)@Base" 1.0.0
(c++)"XdgAction::XdgAction(XdgAction const&, QObject*)@Base" 1.0.0
@ -26,7 +26,7 @@ libQt5Xdg.so.1 libqt5xdg1 #MINVER#
(c++)"XdgDesktopFile::fileName() const@Base" 1.0.0
(c++)"XdgDesktopFile::icon(QIcon const&) const@Base" 1.0.0
(c++)"XdgDesktopFile::iconName() const@Base" 1.0.0
(c++)"XdgDesktopFile::id(QString const&, bool)@Base" 1.3.1~
(c++)"XdgDesktopFile::id(QString const&, bool)@Base" 2.0.0
(c++)"XdgDesktopFile::isShown(QString const&) const@Base" 1.0.0
(c++)"XdgDesktopFile::isSuitable(bool, QString const&) const@Base" 1.0.0
(c++)"XdgDesktopFile::isValid() const@Base" 1.0.0

@ -1,27 +0,0 @@
libQt5XdgIconLoader.so.1 libqt5xdgiconloader1 #MINVER#
(c++)"XdgIconLoader::XdgIconLoader()@Base" 1.3.1~
(c++)"XdgIconLoader::ensureInitialized()@Base" 1.3.1~
(c++)"XdgIconLoader::findIconHelper(QString const&, QString const&, QStringList&) const@Base" 1.3.1~
(c++)"XdgIconLoader::instance()@Base" 1.3.1~
(c++)"XdgIconLoader::loadIcon(QString const&) const@Base" 1.3.1~
(c++)"XdgIconLoader::setThemeName(QString const&)@Base" 1.3.1~
(c++)"XdgIconLoader::setThemeSearchPath(QStringList const&)@Base" 1.3.1~
(c++)"XdgIconLoader::themeSearchPaths() const@Base" 1.3.1~
(c++)"XdgIconLoader::updateSystemTheme()@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::XdgIconLoaderEngine(QString const&)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::XdgIconLoaderEngine(XdgIconLoaderEngine const&)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::actualSize(QSize const&, QIcon::Mode, QIcon::State)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::clone() const@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::ensureLoaded()@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::entryForSize(QSize const&)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::hasIcon() const@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::key() const@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::paint(QPainter*, QRect const&, QIcon::Mode, QIcon::State)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::pixmap(QSize const&, QIcon::Mode, QIcon::State)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::read(QDataStream&)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::virtual_hook(int, void*)@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::write(QDataStream&) const@Base" 1.3.1~
(c++)"XdgIconLoaderEngine::~XdgIconLoaderEngine()@Base" 1.3.1~
(c++)"typeinfo for XdgIconLoaderEngine@Base" 1.3.1~
(c++)"typeinfo name for XdgIconLoaderEngine@Base" 1.3.1~
(c++)"vtable for XdgIconLoaderEngine@Base" 1.3.1~

@ -0,0 +1,27 @@
libQt5XdgIconLoader.so.2 libqt5xdgiconloader2 #MINVER#
(c++)"XdgIconLoader::XdgIconLoader()@Base" 2.0.0
(c++)"XdgIconLoader::ensureInitialized()@Base" 2.0.0
(c++)"XdgIconLoader::findIconHelper(QString const&, QString const&, QStringList&) const@Base" 2.0.0
(c++)"XdgIconLoader::instance()@Base" 2.0.0
(c++)"XdgIconLoader::loadIcon(QString const&) const@Base" 2.0.0
(c++)"XdgIconLoader::setThemeName(QString const&)@Base" 2.0.0
(c++)"XdgIconLoader::setThemeSearchPath(QStringList const&)@Base" 2.0.0
(c++)"XdgIconLoader::themeSearchPaths() const@Base" 2.0.0
(c++)"XdgIconLoader::updateSystemTheme()@Base" 2.0.0
(c++)"XdgIconLoaderEngine::XdgIconLoaderEngine(QString const&)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::XdgIconLoaderEngine(XdgIconLoaderEngine const&)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::actualSize(QSize const&, QIcon::Mode, QIcon::State)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::clone() const@Base" 2.0.0
(c++)"XdgIconLoaderEngine::ensureLoaded()@Base" 2.0.0
(c++)"XdgIconLoaderEngine::entryForSize(QSize const&)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::hasIcon() const@Base" 2.0.0
(c++)"XdgIconLoaderEngine::key() const@Base" 2.0.0
(c++)"XdgIconLoaderEngine::paint(QPainter*, QRect const&, QIcon::Mode, QIcon::State)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::pixmap(QSize const&, QIcon::Mode, QIcon::State)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::read(QDataStream&)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::virtual_hook(int, void*)@Base" 2.0.0
(c++)"XdgIconLoaderEngine::write(QDataStream&) const@Base" 2.0.0
(c++)"XdgIconLoaderEngine::~XdgIconLoaderEngine()@Base" 2.0.0
(c++)"typeinfo for XdgIconLoaderEngine@Base" 2.0.0
(c++)"typeinfo name for XdgIconLoaderEngine@Base" 2.0.0
(c++)"vtable for XdgIconLoaderEngine@Base" 2.0.0

@ -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
ZGbiiAtM4kdkyDMrfRV5nlEG9EKAGPVu5mjeSCrfkETwZ9OFPz1AuDye4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g/+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-----

2
debian/watch vendored

@ -1,3 +1,3 @@
version=3
version=4
opts="pgpsigurlmangle=s/$/.asc/" \
https://github.com/lxde/libqtxdg/releases .*/libqtxdg-([\d\.]+)\.tar\.xz

@ -54,6 +54,7 @@ target_include_directories(${QTXDGX_ICONLOADER_LIBRARY_NAME}
target_link_libraries(${QTXDGX_ICONLOADER_LIBRARY_NAME}
PUBLIC
Qt5::Gui
Qt5::Svg
)
set_target_properties(${QTXDGX_ICONLOADER_LIBRARY_NAME}

@ -42,12 +42,11 @@
#include <QtGui/QIconEngine>
#include <QtGui/QPalette>
#include <QtCore/QList>
#include <QtCore/QHash>
#include <QtCore/QDir>
#include <QtCore/QSettings>
#include <QtGui/QPainter>
#ifdef Q_WS_MAC
#ifdef Q_DEAD_CODE_FROM_QT4_MAC
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
@ -74,9 +73,6 @@ XdgIconLoader::XdgIconLoader() :
{
}
// We lazily initialize the loader to make static icons
// work. Though we do not officially support this.
static inline QString systemThemeName()
{
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
@ -164,6 +160,141 @@ QStringList XdgIconLoader::themeSearchPaths() const
return m_iconDirs;
}
/*!
\class QIconCacheGtkReader
\internal
Helper class that reads and looks up into the icon-theme.cache generated with
gtk-update-icon-cache. If at any point we detect a corruption in the file
(because the offsets point at wrong locations for example), the reader
is marked as invalid.
*/
class QIconCacheGtkReader
{
public:
explicit QIconCacheGtkReader(const QString &themeDir);
QVector<const char *> lookup(const QString &);
bool isValid() const { return m_isValid; }
private:
QFile m_file;
const unsigned char *m_data;
quint64 m_size;
bool m_isValid;
quint16 read16(uint offset)
{
if (offset > m_size - 2 || (offset & 0x1)) {
m_isValid = false;
return 0;
}
return m_data[offset+1] | m_data[offset] << 8;
}
quint32 read32(uint offset)
{
if (offset > m_size - 4 || (offset & 0x3)) {
m_isValid = false;
return 0;
}
return m_data[offset+3] | m_data[offset+2] << 8
| m_data[offset+1] << 16 | m_data[offset] << 24;
}
};
QIconCacheGtkReader::QIconCacheGtkReader(const QString &dirName)
: m_isValid(false)
{
QFileInfo info(dirName + QLatin1Literal("/icon-theme.cache"));
if (!info.exists() || info.lastModified() < QFileInfo(dirName).lastModified())
return;
m_file.setFileName(info.absoluteFilePath());
if (!m_file.open(QFile::ReadOnly))
return;
m_size = m_file.size();
m_data = m_file.map(0, m_size);
if (!m_data)
return;
if (read16(0) != 1) // VERSION_MAJOR
return;
m_isValid = true;
// Check that all the directories are older than the cache
auto lastModified = info.lastModified();
quint32 dirListOffset = read32(8);
quint32 dirListLen = read32(dirListOffset);
for (uint i = 0; i < dirListLen; ++i) {
quint32 offset = read32(dirListOffset + 4 + 4 * i);
if (!m_isValid || offset >= m_size || lastModified < QFileInfo(dirName + QLatin1Char('/')
+ QString::fromUtf8(reinterpret_cast<const char*>(m_data + offset))).lastModified()) {
m_isValid = false;
return;
}
}
}
static quint32 icon_name_hash(const char *p)
{
quint32 h = static_cast<signed char>(*p);
for (p += 1; *p != '\0'; p++)
h = (h << 5) - h + *p;
return h;
}
/*! \internal
lookup the icon name and return the list of subdirectories in which an icon
with this name is present. The char* are pointers to the mapped data.
For example, this would return { "32x32/apps", "24x24/apps" , ... }
*/
QVector<const char *> QIconCacheGtkReader::lookup(const QString &name)
{
QVector<const char *> ret;
if (!isValid())
return ret;
QByteArray nameUtf8 = name.toUtf8();
quint32 hash = icon_name_hash(nameUtf8.data());
quint32 hashOffset = read32(4);
quint32 hashBucketCount = read32(hashOffset);
if (!isValid() || hashBucketCount == 0) {
m_isValid = false;
return ret;
}
quint32 bucketIndex = hash % hashBucketCount;
quint32 bucketOffset = read32(hashOffset + 4 + bucketIndex * 4);
while (bucketOffset > 0 && bucketOffset <= m_size - 12) {
quint32 nameOff = read32(bucketOffset + 4);
if (nameOff < m_size && strcmp(reinterpret_cast<const char*>(m_data + nameOff), nameUtf8.constData()) == 0) {
quint32 dirListOffset = read32(8);
quint32 dirListLen = read32(dirListOffset);
quint32 listOffset = read32(bucketOffset+8);
quint32 listLen = read32(listOffset);
if (!m_isValid || listOffset + 4 + 8 * listLen > m_size) {
m_isValid = false;
return ret;
}
ret.reserve(listLen);
for (uint j = 0; j < listLen && m_isValid; ++j) {
quint32 dirIndex = read16(listOffset + 4 + 8 * j);
quint32 o = read32(dirListOffset + 4 + dirIndex*4);
if (!m_isValid || dirIndex >= dirListLen || o >= m_size) {
m_isValid = false;
return ret;
}
ret.append(reinterpret_cast<const char*>(m_data) + o);
}
return ret;
}
bucketOffset = read32(bucketOffset);
}
return ret;
}
QIconTheme::QIconTheme(const QString &themeName)
: m_valid(false)
{
@ -173,19 +304,17 @@ QIconTheme::QIconTheme(const QString &themeName)
for ( int i = 0 ; i < iconDirs.size() ; ++i) {
QDir iconDir(iconDirs[i]);
QString themeDir = iconDir.path() + QLatin1Char('/') + themeName;
themeIndex.setFileName(themeDir + QLatin1String("/index.theme"));
if (themeIndex.exists()) {
m_contentDirs << themeDir;
m_valid = true;
QFileInfo themeDirInfo(themeDir);
QStringList themeSearchPaths = QIcon::themeSearchPaths();
foreach (QString path, themeSearchPaths)
{
if (!path.startsWith(QLatin1Char(':')) && QFileInfo(path).isDir())
m_contentDirs.append(path + QLatin1Char('/') + themeName);
}
if (themeDirInfo.isDir()) {
m_contentDirs << themeDir;
m_gtkCaches << QSharedPointer<QIconCacheGtkReader>::create(themeDir);
}
break;
if (!m_valid) {
themeIndex.setFileName(themeDir + QLatin1String("/index.theme"));
if (themeIndex.exists())
m_valid = true;
}
}
#ifndef QT_NO_SETTINGS
@ -270,7 +399,6 @@ QThemeIconInfo XdgIconLoader::findIconHelper(const QString &themeName,
}
const QStringList contentDirs = theme.contentDirs();
const QVector<XdgIconDirInfo> subDirs = theme.keyList();
const QString svgext(QLatin1String(".svg"));
const QString pngext(QLatin1String(".png"));
@ -287,6 +415,29 @@ QThemeIconInfo XdgIconLoader::findIconHelper(const QString &themeName,
// Add all relevant files
for (int i = 0; i < contentDirs.size(); ++i) {
QVector<XdgIconDirInfo> subDirs = theme.keyList();
// Try to reduce the amount of subDirs by looking in the GTK+ cache in order to save
// a massive amount of file stat (especially if the icon is not there)
auto cache = theme.m_gtkCaches.at(i);
if (cache->isValid()) {
auto result = cache->lookup(iconNameFallback);
if (cache->isValid()) {
const QVector<XdgIconDirInfo> subDirsCopy = subDirs;
subDirs.clear();
subDirs.reserve(result.count());
foreach (const char *s, result) {
QString path = QString::fromUtf8(s);
auto it = std::find_if(subDirsCopy.cbegin(), subDirsCopy.cend(),
[&](const XdgIconDirInfo &info) {
return info.path == path; } );
if (it != subDirsCopy.cend()) {
subDirs.append(*it);
}
}
}
}
QString contentDir = contentDirs.at(i) + QLatin1Char('/');
for (int j = 0; j < subDirs.size() ; ++j) {
const XdgIconDirInfo &dirInfo = subDirs.at(j);
@ -487,7 +638,7 @@ void XdgIconLoaderEngine::paint(QPainter *painter, const QRect &rect,
QIcon::Mode mode, QIcon::State state)
{
QSize pixmapSize = rect.size();
#if defined(Q_WS_MAC)
#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
pixmapSize *= qt_mac_get_scalefactor();
#endif
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
@ -693,9 +844,16 @@ void XdgIconLoaderEngine::virtual_hook(int id, void *data)
case QIconEngine::IconNameHook:
{
QString &name = *reinterpret_cast<QString*>(data);
name = m_iconName;
name = m_info.iconName;
}
break;
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
case QIconEngine::IsNullHook:
{
*reinterpret_cast<bool*>(data) = m_info.entries.isEmpty();
}
break;
#endif
default:
QIconEngine::virtual_hook(id, data);
}

@ -78,7 +78,7 @@ struct XdgIconDirInfo
short maxSize;
short minSize;
short threshold;
Type type : 4;
Type type;
};
class XdgIconLoaderEngineEntry
@ -141,6 +141,8 @@ private:
friend class XdgIconLoader;
};
class QIconCacheGtkReader;
class QIconTheme
{
public:
@ -150,12 +152,13 @@ public:
QVector <XdgIconDirInfo> keyList() { return m_keyList; }
QStringList contentDirs() { return m_contentDirs; }
bool isValid() { return m_valid; }
private:
QStringList m_contentDirs;
QVector <XdgIconDirInfo> m_keyList;
QStringList m_parents;
bool m_valid;
public:
QVector<QSharedPointer<QIconCacheGtkReader>> m_gtkCaches;
};
class XDGICONLOADER_EXPORT XdgIconLoader
@ -175,6 +178,7 @@ public:
void updateSystemTheme();
void invalidateKey() { m_themeKey++; }
void ensureInitialized();
bool hasUserTheme() const { return !m_userTheme.isEmpty(); }
private:
QThemeIconInfo findIconHelper(const QString &themeName,

Loading…
Cancel
Save