KIconThemes
kicontheme.cpp
17#include <KLocalizedString> // KLocalizedString::localizedFilePath. Need such functionality in, hmm, QLocale? QStandardPaths?
51 const QString iconThemeRcc = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("icontheme.rcc"));
58 // Note that since qtbase commit a8621a3f8, this means the QPA (i.e. KIconLoader) will NOT be used.
130 QString iconPath(const QList<KIconThemeDir *> &dirs, const QString &name, int size, qreal scale, KIconLoader::MatchType match) const;
197QString KIconThemePrivate::iconPath(const QList<KIconThemeDir *> &dirs, const QString &name, int size, qreal scale, KIconLoader::MatchType match) const
305 const QString suffix = QLatin1Char('/') + appName + QLatin1String("/icons/") + name + QLatin1Char('/');
320 // Find the theme description file. These are either locally in the :/icons resource path or global.
327 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
330 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
386 cfg.readEntry("KDE-Extensions", QStringList{QStringLiteral(".png"), QStringLiteral(".svgz"), QStringLiteral(".svg"), QStringLiteral(".xpm")});
389 const QStringList dirs = cfg.readPathEntry("Directories", QStringList()) + cfg.readPathEntry("ScaledDirectories", QStringList());
412 iconGroup.defaultSize = cg.readEntry(iconGroup.name + QLatin1String("Default"), iconGroup.defaultSize);
556QString KIconTheme::iconPathByName(const QString &iconName, int size, KIconLoader::MatchType match) const
561QString KIconTheme::iconPathByName(const QString &iconName, int size, KIconLoader::MatchType match, qreal scale) const
582QString KIconTheme::iconPath(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const
641 // Find the theme description file. These are either locally in the :/icons resource path or global.
648 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
651 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
694KIconThemeDir::KIconThemeDir(const QString &basedir, const QString &themedir, const KConfigGroup &config)
729 } else if (tmp == QLatin1String("FileSystems")) { // invalid, but present context for hicolor, skip warning
731 } else if (tmp == QLatin1String("Legacy")) { // invalid, but often present context for Adwaita, skip warning
733 } else if (tmp == QLatin1String("UI")) { // invalid, but often present context for Adwaita, skip warning
738 qCDebug(KICONTHEMES) << "Invalid Context=" << tmp << "line for icon theme: " << constructFileName(QString());
749 qCDebug(KICONTHEMES) << "Invalid Type=" << tmp << "line for icon theme: " << constructFileName(QString());
779 const QStringList formats = QStringList() << QStringLiteral("*.png") << QStringLiteral("*.svg") << QStringLiteral("*.svgz") << QStringLiteral("*.xpm");
QString readPathEntry(const char *key, const QString &aDefault) const
QString readEntry(const char *key, const char *aDefault=nullptr) const
SimpleConfig
NoGlobals
@ MatchBestOrGreaterSize
Take the best match or the match with a greater size if there is no exact match.
Definition kiconloader.h:110
static QStringList list()
List all icon themes installed on the system, global and local.
Definition kicontheme.cpp:634
QList< int > querySizes(KIconLoader::Group group) const
Query available sizes for a group.
Definition kicontheme.cpp:482
QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match) const
Lookup an icon in the theme.
Definition kicontheme.cpp:556
QString internalName() const
The internal name of the icon theme (same as the name argument passed to the constructor).
Definition kicontheme.cpp:428
static void forceThemeForTests(const QString &themeName)
Force a current theme and disable automatic resolution of the current theme in favor of the forced th...
Definition kicontheme.cpp:627
KIconTheme(const QString &name, const QString &appName=QString(), const QString &basePathHint=QString())
Load an icon theme by name.
Definition kicontheme.cpp:289
QStringList queryIconsByContext(int size, KIconLoader::Context context=KIconLoader::Any) const
Query available icons for a context and preferred size.
Definition kicontheme.cpp:517
bool followsColorScheme() const
If true, this theme is made of SVG icons that will be colorized following the system color scheme.
Definition kicontheme.cpp:572
bool hasContext(KIconLoader::Context context) const
Returns true if the theme has any icons for the given context.
Definition kicontheme.cpp:545
QString iconPath(const QString &name, int size, KIconLoader::MatchType match) const
Lookup an icon in the theme.
Definition kicontheme.cpp:577
QStringList queryIcons(int size, KIconLoader::Context context=KIconLoader::Any) const
Query available icons for a size and context.
Definition kicontheme.cpp:496
int defaultSize(KIconLoader::Group group) const
The default size of this theme for a certain icon group.
Definition kicontheme.cpp:473
static QString localizedFilePath(const QString &filePath)
void initIcons()
QString path(const QString &relativePath)
KIOCORE_EXPORT QString dir(const QString &fileClass)
Dirs
QStringList entryList(Filters filters, SortFlags sort) const const
bool exists() const const
bool exists(const QString &path)
bool isDir() const const
void setFallbackThemeName(const QString &name)
void setThemeName(const QString &name)
QString themeName()
void append(QList< T > &&value)
void reserve(qsizetype size)
qsizetype size() const const
bool registerResource(const QString &rccFileName, const QString &mapRoot)
bool unregisterResource(const QString &rccFileName, const QString &mapRoot)
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
LocateDirectory
AppDataLocation
QString locate(StandardLocation type, const QString &fileName, LocateOptions options)
QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
QStringList standardLocations(StandardLocation type)
void clear()
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
qsizetype size() const const
CaseInsensitive
bool isValid() const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.