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")) {
105 const QString themeToUse = KConfigGroup(config, "Icons").readEntry("Theme", QStringLiteral("breeze"));
111 // use Qt API to really fully override the engine, if we set KIconEngine the Key in our plugin will
143 // initThemeHelper will do the remaining work via Q_COREAPP_STARTUP_FUNCTION(initThemeHelper) above
183 QString iconPath(const QList<KIconThemeDir *> &dirs, const QString &name, int size, qreal scale, KIconLoader::MatchType match) const;
250QString KIconThemePrivate::iconPath(const QList<KIconThemeDir *> &dirs, const QString &name, int size, qreal scale, KIconLoader::MatchType match) const
358 const QString suffix = QLatin1Char('/') + appName + QLatin1String("/icons/") + name + QLatin1Char('/');
373 // Find the theme description file. These are either locally in the :/icons resource path or global.
385 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
388 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
444 cfg.readEntry("KDE-Extensions", QStringList{QStringLiteral(".png"), QStringLiteral(".svgz"), QStringLiteral(".svg"), QStringLiteral(".xpm")});
447 const QStringList dirs = cfg.readPathEntry("Directories", QStringList()) + cfg.readPathEntry("ScaledDirectories", QStringList());
470 iconGroup.defaultSize = cg.readEntry(iconGroup.name + QLatin1String("Default"), iconGroup.defaultSize);
614QString KIconTheme::iconPathByName(const QString &iconName, int size, KIconLoader::MatchType match) const
619QString KIconTheme::iconPathByName(const QString &iconName, int size, KIconLoader::MatchType match, qreal scale) const
640QString KIconTheme::iconPath(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const
699 // Find the theme description file. These are either locally in the :/icons resource path or global.
706 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
709 icnlibs += QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("pixmaps"), QStandardPaths::LocateDirectory);
752KIconThemeDir::KIconThemeDir(const QString &basedir, const QString &themedir, const KConfigGroup &config)
787 } else if (tmp == QLatin1String("FileSystems")) { // invalid, but present context for hicolor, skip warning
789 } else if (tmp == QLatin1String("Legacy")) { // invalid, but often present context for Adwaita, skip warning
791 } else if (tmp == QLatin1String("UI")) { // invalid, but often present context for Adwaita, skip warning
796 qCDebug(KICONTHEMES) << "Invalid Context=" << tmp << "line for icon theme: " << constructFileName(QString());
807 qCDebug(KICONTHEMES) << "Invalid Type=" << tmp << "line for icon theme: " << constructFileName(QString());
837 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:692
QList< int > querySizes(KIconLoader::Group group) const
Query available sizes for a group.
Definition kicontheme.cpp:540
QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match) const
Lookup an icon in the theme.
Definition kicontheme.cpp:614
QString internalName() const
The internal name of the icon theme (same as the name argument passed to the constructor).
Definition kicontheme.cpp:486
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:685
KIconTheme(const QString &name, const QString &appName=QString(), const QString &basePathHint=QString())
Load an icon theme by name.
Definition kicontheme.cpp:342
QStringList queryIconsByContext(int size, KIconLoader::Context context=KIconLoader::Any) const
Query available icons for a context and preferred size.
Definition kicontheme.cpp:575
bool followsColorScheme() const
If true, this theme is made of SVG icons that will be colorized following the system color scheme.
Definition kicontheme.cpp:630
bool hasContext(KIconLoader::Context context) const
Returns true if the theme has any icons for the given context.
Definition kicontheme.cpp:603
QString iconPath(const QString &name, int size, KIconLoader::MatchType match) const
Lookup an icon in the theme.
Definition kicontheme.cpp:635
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:554
int defaultSize(KIconLoader::Group group) const
The default size of this theme for a certain icon group.
Definition kicontheme.cpp:531
static QString localizedFilePath(const QString &filePath)
void initIcons()
QString path(const QString &relativePath)
KIOCORE_EXPORT QString dir(const QString &fileClass)
QString name(StandardAction id)
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 Sat Dec 21 2024 16:57:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.