KIconThemes
kicontheme.cpp
18#include <KLocalizedString> // KLocalizedString::localizedFilePath. Need such functionality in, hmm, QLocale? QStandardPaths?
72 // do that similar to QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() with minimal extra API use
96 if (QGuiApplicationPrivate::platformTheme() && QGuiApplicationPrivate::platformTheme()->name() == QLatin1String("kde")) {
108 QString themeToUse = KConfigGroup(config, "Icons").readEntry("Theme", QStringLiteral("breeze"));
136 // initThemeHelper will do the remaining work via Q_COREAPP_STARTUP_FUNCTION(initThemeHelper) above
176 QString iconPath(const QList<KIconThemeDir *> &dirs, const QString &name, int size, qreal scale, KIconLoader::MatchType match) const;
243QString KIconThemePrivate::iconPath(const QList<KIconThemeDir *> &dirs, const QString &name, int size, qreal scale, KIconLoader::MatchType match) const
351 const QString suffix = QLatin1Char('/') + appName + QLatin1String("/icons/") + name + QLatin1Char('/');
366 // Find the theme description file. These are either locally in the :/icons resource path or global.
378 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
381 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
437 cfg.readEntry("KDE-Extensions", QStringList{QStringLiteral(".png"), QStringLiteral(".svgz"), QStringLiteral(".svg"), QStringLiteral(".xpm")});
440 const QStringList dirs = cfg.readPathEntry("Directories", QStringList()) + cfg.readPathEntry("ScaledDirectories", QStringList());
463 iconGroup.defaultSize = cg.readEntry(iconGroup.name + QLatin1String("Default"), iconGroup.defaultSize);
607QString KIconTheme::iconPathByName(const QString &iconName, int size, KIconLoader::MatchType match) const
612QString KIconTheme::iconPathByName(const QString &iconName, int size, KIconLoader::MatchType match, qreal scale) const
633QString KIconTheme::iconPath(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const
692 // Find the theme description file. These are either locally in the :/icons resource path or global.
699 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
702 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
745KIconThemeDir::KIconThemeDir(const QString &basedir, const QString &themedir, const KConfigGroup &config)
780 } else if (tmp == QLatin1String("FileSystems")) { // invalid, but present context for hicolor, skip warning
782 } else if (tmp == QLatin1String("Legacy")) { // invalid, but often present context for Adwaita, skip warning
784 } else if (tmp == QLatin1String("UI")) { // invalid, but often present context for Adwaita, skip warning
789 qCDebug(KICONTHEMES) << "Invalid Context=" << tmp << "line for icon theme: " << constructFileName(QString());
800 qCDebug(KICONTHEMES) << "Invalid Type=" << tmp << "line for icon theme: " << constructFileName(QString());
830 const QStringList formats = QStringList() << QStringLiteral("*.png") << QStringLiteral("*.svg") << QStringLiteral("*.svgz") << QStringLiteral("*.xpm");
static KColorSchemeManager * instance()
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:112
static QStringList list()
List all icon themes installed on the system, global and local.
Definition kicontheme.cpp:685
QList< int > querySizes(KIconLoader::Group group) const
Query available sizes for a group.
Definition kicontheme.cpp:533
QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match) const
Lookup an icon in the theme.
Definition kicontheme.cpp:607
QString internalName() const
The internal name of the icon theme (same as the name argument passed to the constructor).
Definition kicontheme.cpp:479
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:678
KIconTheme(const QString &name, const QString &appName=QString(), const QString &basePathHint=QString())
Load an icon theme by name.
Definition kicontheme.cpp:335
QStringList queryIconsByContext(int size, KIconLoader::Context context=KIconLoader::Any) const
Query available icons for a context and preferred size.
Definition kicontheme.cpp:568
bool followsColorScheme() const
If true, this theme is made of SVG icons that will be colorized following the system color scheme.
Definition kicontheme.cpp:623
bool hasContext(KIconLoader::Context context) const
Returns true if the theme has any icons for the given context.
Definition kicontheme.cpp:596
QString iconPath(const QString &name, int size, KIconLoader::MatchType match) const
Lookup an icon in the theme.
Definition kicontheme.cpp:628
static void initTheme()
Enforces the Breeze icon theme (including our KIconEngine for re-coloring).
Definition kicontheme.cpp:56
QStringList queryIcons(int size, KIconLoader::Context context=KIconLoader::Any) const
Query available icons for a size and context.
Definition kicontheme.cpp:547
int defaultSize(KIconLoader::Group group) const
The default size of this theme for a certain icon group.
Definition kicontheme.cpp:524
static QString localizedFilePath(const QString &filePath)
void initIcons()
QString name(GameStandardAction id)
QString path(const QString &relativePath)
KIOCORE_EXPORT QString dir(const QString &fileClass)
void addLibraryPath(const QString &path)
QString applicationFilePath()
QStringList libraryPaths()
Dirs
QStringList entryList(Filters filters, SortFlags sort) const const
bool exists() const const
bool exists() const const
bool exists(const QString &path)
bool isDir() const const
QString fallbackThemeName()
void setThemeName(const QString &name)
QString themeName()
void append(QList< T > &&value)
void reserve(qsizetype size)
qsizetype size() const const
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
LocateDirectory
GenericDataLocation
QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
QStringList standardLocations(StandardLocation type)
void clear()
bool isEmpty() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
qsizetype size() const const
void truncate(qsizetype position)
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:05:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:05:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.