kicontheme.cpp
/* vi: ts=8 sts=4 sw=4
*
* $Id: kicontheme.cpp 601485 2006-11-03 12:50:30Z lunakl $
*
* This file is part of the KDE project, module kdecore.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
* Antonio Larrosa <larrosa@kde.org>
*
* This is free software; it comes under the GNU Library General
* Public License, version 2. See the file "COPYING.LIB" for the
* exact licensing terms.
*
* kicontheme.cpp: Lowlevel icon theme handling.
*/
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <config.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qvaluelist.h>
#include <qmap.h>
#include <qpixmap.h>
#include <qpixmapcache.h>
#include <qimage.h>
#include <qfileinfo.h>
#include <qdir.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kconfig.h>
#include <ksimpleconfig.h>
#include <kinstance.h>
#include "kicontheme.h"
class KIconThemePrivate
{
public:
QString example, screenshot;
QString linkOverlay, lockOverlay, zipOverlay, shareOverlay;
bool hidden;
KSharedConfig::Ptr sharedConfig;
};
class KIconThemeDir
{
public:
KIconThemeDir(const QString& dir, const KConfigBase *config);
bool isValid() const { return mbValid; }
QString iconPath(const QString& name) const;
QStringList iconList() const;
QString dir() const { return mDir; }
KIcon::Context context() const { return mContext; }
KIcon::Type type() const { return mType; }
int size() const { return mSize; }
int minSize() const { return mMinSize; }
int maxSize() const { return mMaxSize; }
int threshold() const { return mThreshold; }
private:
bool mbValid;
KIcon::Type mType;
KIcon::Context mContext;
int mSize, mMinSize, mMaxSize;
int mThreshold;
QString mDir;
};
/*** KIconTheme ***/
KIconTheme::KIconTheme(const QString& name, const QString& appName)
{
d = new KIconThemePrivate;
QStringList icnlibs;
QStringList::ConstIterator it, itDir;
QStringList themeDirs;
QString cDir;
// Applications can have local additions to the global "locolor" and
// "hicolor" icon themes. For these, the _global_ theme description
// files are used..
if (!appName.isEmpty() &&
( name == "crystalsvg" || name== "hicolor" || name == "locolor" ) )
{
icnlibs = KGlobal::dirs()->resourceDirs("data");
for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
{
cDir = *it + appName + "/icons/" + name;
if (QFile::exists( cDir ))
themeDirs += cDir + "/";
}
}
// Find the theme description file. These are always global.
icnlibs = KGlobal::dirs()->resourceDirs("icon");
icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-icon");
icnlibs += "/usr/share/pixmaps";
// These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-pixmap");
for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
{
cDir = *it + name + "/";
if (KStandardDirs::exists(cDir))
{
themeDirs += cDir;
if (mDir.isEmpty()
&& (KStandardDirs::exists( cDir + "index.desktop") || KStandardDirs::exists( cDir + "index.theme")))
mDir = cDir;
}
}
if (mDir.isEmpty())
{
kdDebug(264) << "Icon theme " << name << " not found.\n";
return;
}
QString fileName, mainSection;
if(QFile::exists(mDir + "index.desktop")) {
fileName = mDir + "index.desktop";
mainSection="KDE Icon Theme";
} else {
fileName = mDir + "index.theme";
mainSection="Icon Theme";
}
// Use KSharedConfig to avoid parsing the file many times, from each kinstance.
// Need to keep a ref to it to make this useful
d->sharedConfig = KSharedConfig::openConfig( fileName, true /*readonly*/, false /*useKDEGlobals*/ );
KConfig& cfg = *d->sharedConfig;
//was: KSimpleConfig cfg(fileName);
cfg.setGroup(mainSection);
mName = cfg.readEntry("Name");
mDesc = cfg.readEntry("Comment");
mDepth = cfg.readNumEntry("DisplayDepth", 32);
mInherits = cfg.readListEntry("Inherits");
if ( name != "crystalsvg" )
for ( QStringList::Iterator it = mInherits.begin(); it != mInherits.end(); ++it )
if ( *it == "default" || *it == "hicolor" ) *it="crystalsvg";
d->hidden = cfg.readBoolEntry("Hidden", false);
d->example = cfg.readPathEntry("Example");
d->screenshot = cfg.readPathEntry("ScreenShot");
d->linkOverlay = cfg.readEntry("LinkOverlay", "link");
d->lockOverlay = cfg.readEntry("LockOverlay", "lock");
d->zipOverlay = cfg.readEntry("ZipOverlay", "zip");
d->shareOverlay = cfg.readEntry("ShareOverlay","share");
QStringList dirs = cfg.readPathListEntry("Directories");
mDirs.setAutoDelete(true);
for (it=dirs.begin(); it!=dirs.end(); ++it)
{
cfg.setGroup(*it);
for (itDir=themeDirs.begin(); itDir!=themeDirs.end(); ++itDir)
{
if (KStandardDirs::exists(*itDir + *it + "/"))
{
KIconThemeDir *dir = new KIconThemeDir(*itDir + *it, &cfg);
if (!dir->isValid())
{
kdDebug(264) << "Icon directory " << *itDir << " group " << *it << " not valid.\n";
delete dir;
}
else
mDirs.append(dir);
}
}
}
// Expand available sizes for scalable icons to their full range
int i;
QMap<int,QValueList<int> > scIcons;
for (KIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next())
{
if ((dir->type() == KIcon::Scalable) && !scIcons.contains(dir->size()))
{
QValueList<int> lst;
for (i=dir->minSize(); i<=dir->maxSize(); i++)
lst += i;
scIcons[dir->size()] = lst;
}
}
QStringList groups;
groups += "Desktop";
groups += "Toolbar";
groups += "MainToolbar";
groups += "Small";
groups += "Panel";
const int defDefSizes[] = { 32, 22, 22, 16, 32 };
cfg.setGroup(mainSection);
for (it=groups.begin(), i=0; it!=groups.end(); ++it, i++)
{
mDefSize[i] = cfg.readNumEntry(*it + "Default", defDefSizes[i]);
QValueList<int> exp, lst = cfg.readIntListEntry(*it + "Sizes");
QValueList<int>::ConstIterator it2;
for (it2=lst.begin(); it2!=lst.end(); ++it2)
{
if (scIcons.contains(*it2))
exp += scIcons[*it2];
else
exp += *it2;
}
mSizes[i] = exp;
}
}
KIconTheme::~KIconTheme()
{
delete d;
}
bool KIconTheme::isValid() const
{
return !mDirs.isEmpty();
}
bool KIconTheme::isHidden() const
{
return d->hidden;
}
QString KIconTheme::example() const { return d->example; }
QString KIconTheme::screenshot() const { return d->screenshot; }
QString KIconTheme::linkOverlay() const { return d->linkOverlay; }
QString KIconTheme::lockOverlay() const { return d->lockOverlay; }
QString KIconTheme::zipOverlay() const { return d->zipOverlay; }
QString KIconTheme::shareOverlay() const { return d->shareOverlay; }
int KIconTheme::defaultSize(KIcon::Group group) const
{
if ((group < 0) || (group >= KIcon::LastGroup))
{
kdDebug(264) << "Illegal icon group: " << group << "\n";
return -1;
}
return mDefSize[group];
}
QValueList<int> KIconTheme::querySizes(KIcon::Group group) const
{
QValueList<int> empty;
if ((group < 0) || (group >= KIcon::LastGroup))
{
kdDebug(264) << "Illegal icon group: " << group << "\n";
return empty;
}
return mSizes[group];
}
QStringList KIconTheme::queryIcons(int size, KIcon::Context context) const
{
int delta = 1000, dw;
QPtrListIterator<KIconThemeDir> dirs(mDirs);
KIconThemeDir *dir;
// Try to find exact match
QStringList result;
for ( ; dirs.current(); ++dirs)
{
dir = dirs.current();
if ((context != KIcon::Any) && (context != dir->context()))
continue;
if ((dir->type() == KIcon::Fixed) && (dir->size() == size))
{
result += dir->iconList();
continue;
}
if ((dir->type() == KIcon::Scalable) &&
(size >= dir->minSize()) && (size <= dir->maxSize()))
{
result += dir->iconList();
continue;
}
if ((dir->type() == KIcon::Threshold) &&
(abs(size-dir->size())<dir->threshold()))
result+=dir->iconList();
}
return result;
dirs.toFirst();
// Find close match
KIconThemeDir *best = 0L;
for ( ; dirs.current(); ++dirs)
{
dir = dirs.current();
if ((context != KIcon::Any) && (context != dir->context()))
continue;
dw = dir->size() - size;
if ((dw > 6) || (abs(dw) >= abs(delta)))
continue;
delta = dw;
best = dir;
}
if (best == 0L)
return QStringList();
return best->iconList();
}
QStringList KIconTheme::queryIconsByContext(int size, KIcon::Context context) const
{
QPtrListIterator<KIconThemeDir> dirs(mDirs);
int dw;
KIconThemeDir *dir;
// We want all the icons for a given context, but we prefer icons
// of size size . Note that this may (will) include duplicate icons
//QStringList iconlist[34]; // 33 == 48-16+1
QStringList iconlist[128]; // 33 == 48-16+1
// Usually, only the 0, 6 (22-16), 10 (32-22), 16 (48-32 or 32-16),
// 26 (48-22) and 32 (48-16) will be used, but who knows if someone
// will make icon themes with different icon sizes.
for ( ; dirs.current(); ++dirs)
{
dir = dirs.current();
if ((context != KIcon::Any) && (context != dir->context()))
continue;
dw = abs(dir->size() - size);
iconlist[(dw<127)?dw:127]+=dir->iconList();
}
QStringList iconlistResult;
for (int i=0; i<128; i++) iconlistResult+=iconlist[i];
return iconlistResult;
}
bool KIconTheme::hasContext(KIcon::Context context) const
{
QPtrListIterator<KIconThemeDir> dirs(mDirs);
KIconThemeDir *dir;
for ( ; dirs.current(); ++dirs)
{
dir = dirs.current();
if ((context == KIcon::Any) || (context == dir->context()))
return true;
}
return false;
}
KIcon KIconTheme::iconPath(const QString& name, int size, KIcon::MatchType match) const
{
KIcon icon;
QString path;
int delta = -1000, dw;
KIconThemeDir *dir;
dw = 1000; // shut up, gcc
QPtrListIterator<KIconThemeDir> dirs(mDirs);
for ( ; dirs.current(); ++dirs)
{
dir = dirs.current();
if (match == KIcon::MatchExact)
{
if ((dir->type() == KIcon::Fixed) && (dir->size() != size))
continue;
if ((dir->type() == KIcon::Scalable) &&
((size < dir->minSize()) || (size > dir->maxSize())))
continue;
if ((dir->type() == KIcon::Threshold) &&
(abs(dir->size()-size) > dir->threshold()))
continue;
} else
{
// dw < 0 means need to scale up to get an icon of the requested size
if (dir->type() == KIcon::Fixed)
{
dw = dir->size() - size;
} else if (dir->type() == KIcon::Scalable)
{
if (size < dir->minSize())
dw = dir->minSize() - size;
else if (size > dir->maxSize())
dw = dir->maxSize() - size;
else
dw = 0;
} else if (dir->type() == KIcon::Threshold)
{
if (size < dir->size() - dir->threshold())
dw = dir->size() - dir->threshold() - size;
else if (size > dir->size() + dir->threshold())
dw = dir->size() + dir->threshold() - size;
else
dw = 0;
}
/* Skip this if we've found a closer one, unless
it's a downscale, and we only had upscales befores.
This is to avoid scaling up unless we have to,
since that looks very ugly */
if ((abs(dw) >= abs(delta)) ||
(delta > 0 && dw < 0))
continue;
}
path = dir->iconPath(name);
if (path.isEmpty())
continue;
icon.path = path;
icon.size = dir->size();
icon.type = dir->type();
icon.threshold = dir->threshold();
icon.context = dir->context();
// if we got in MatchExact that far, we find no better
if (match == KIcon::MatchExact)
return icon;
else
{
delta = dw;
if (delta==0) return icon; // We won't find a better match anyway
}
}
return icon;
}
// static
QString *KIconTheme::_theme = 0L;
// static
QStringList *KIconTheme::_theme_list = 0L;
// static
QString KIconTheme::current()
{
// Static pointer because of unloading problems wrt DSO's.
if (_theme != 0L)
return *_theme;
_theme = new QString();
KConfig *config = KGlobal::config();
KConfigGroupSaver saver(config, "Icons");
*_theme = config->readEntry("Theme",defaultThemeName());
if ( *_theme == QString::fromLatin1("hicolor") ) *_theme = defaultThemeName();
/* if (_theme->isEmpty())
{
if (QPixmap::defaultDepth() > 8)
*_theme = defaultThemeName();
else
*_theme = QString::fromLatin1("locolor");
}*/
return *_theme;
}
// static
QStringList KIconTheme::list()
{
// Static pointer because of unloading problems wrt DSO's.
if (_theme_list != 0L)
return *_theme_list;
_theme_list = new QStringList();
QStringList icnlibs = KGlobal::dirs()->resourceDirs("icon");
icnlibs += (KGlobal::dirs()->resourceDirs("xdgdata-icon"));
icnlibs += "/usr/share/pixmaps";
// These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-pixmap");
QStringList::ConstIterator it;
for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
{
QDir dir(*it);
if (!dir.exists())
continue;
QStringList lst = dir.entryList(QDir::Dirs);
QStringList::ConstIterator it2;
for (it2=lst.begin(); it2!=lst.end(); ++it2)
{
if ((*it2 == ".") || (*it2 == "..") || (*it2).startsWith("default.") )
continue;
if (!KStandardDirs::exists(*it + *it2 + "/index.desktop") && !KStandardDirs::exists(*it + *it2 + "/index.theme"))
continue;
KIconTheme oink(*it2);
if (!oink.isValid()) continue;
if (!_theme_list->contains(*it2))
_theme_list->append(*it2);
}
}
return *_theme_list;
}
// static
void KIconTheme::reconfigure()
{
delete _theme;
_theme=0L;
delete _theme_list;
_theme_list=0L;
}
// static
QString KIconTheme::defaultThemeName()
{
return QString::fromLatin1("crystalsvg");
}
/*** KIconThemeDir ***/
KIconThemeDir::KIconThemeDir(const QString& dir, const KConfigBase *config)
{
mbValid = false;
mDir = dir;
mSize = config->readNumEntry("Size");
mMinSize = 1; // just set the variables to something
mMaxSize = 50; // meaningful in case someone calls minSize or maxSize
mType = KIcon::Fixed;
if (mSize == 0)
return;
QString tmp = config->readEntry("Context");
if (tmp == "Devices")
mContext = KIcon::Device;
else if (tmp == "MimeTypes")
mContext = KIcon::MimeType;
else if (tmp == "FileSystems")
mContext = KIcon::FileSystem;
else if (tmp == "Applications")
mContext = KIcon::Application;
else if (tmp == "Actions")
mContext = KIcon::Action;
else if (tmp == "Animations")
mContext = KIcon::Animation;
else if (tmp == "Categories")
mContext = KIcon::Category;
else if (tmp == "Emblems")
mContext = KIcon::Emblem;
else if (tmp == "Emotes")
mContext = KIcon::Emote;
else if (tmp == "International")
mContext = KIcon::International;
else if (tmp == "Places")
mContext = KIcon::Place;
else if (tmp == "Status")
mContext = KIcon::StatusIcon;
else {
kdDebug(264) << "Invalid Context= line for icon theme: " << mDir << "\n";
return;
}
tmp = config->readEntry("Type");
if (tmp == "Fixed")
mType = KIcon::Fixed;
else if (tmp == "Scalable")
mType = KIcon::Scalable;
else if (tmp == "Threshold")
mType = KIcon::Threshold;
else {
kdDebug(264) << "Invalid Type= line for icon theme: " << mDir << "\n";
return;
}
if (mType == KIcon::Scalable)
{
mMinSize = config->readNumEntry("MinSize", mSize);
mMaxSize = config->readNumEntry("MaxSize", mSize);
} else if (mType == KIcon::Threshold)
mThreshold = config->readNumEntry("Threshold", 2);
mbValid = true;
}
QString KIconThemeDir::iconPath(const QString& name) const
{
if (!mbValid)
return QString::null;
QString file = mDir + "/" + name;
if (access(QFile::encodeName(file), R_OK) == 0)
return file;
return QString::null;
}
QStringList KIconThemeDir::iconList() const
{
QDir dir(mDir);
#ifdef HAVE_LIBART
QStringList lst = dir.entryList("*.png;*.svg;*.svgz;*.xpm", QDir::Files);
#else
QStringList lst = dir.entryList("*.png;*.xpm", QDir::Files);
#endif
QStringList result;
QStringList::ConstIterator it;
for (it=lst.begin(); it!=lst.end(); ++it)
result += mDir + "/" + *it;
return result;
}
KIconTheme::reconfigure
static void reconfigure()
Reconfigure the theme.
Definition: kicontheme.cpp:503
KIconTheme::screenshot
QString screenshot() const
Return the name of the screenshot.
Definition: kicontheme.cpp:238
KIconTheme::zipOverlay
QString zipOverlay() const
Returns the name of this theme's zip overlay.
Definition: kicontheme.cpp:241
KSharedPtr
Can be used to control the lifetime of an object that has derived KShared.
Definition: ksharedptr.h:100
KIconTheme::defaultSize
int defaultSize(KIcon::Group group) const
The default size of this theme for a certain icon group.
Definition: kicontheme.cpp:244
KIconTheme::iconPath
KIcon iconPath(const QString &name, int size, KIcon::MatchType match) const
Lookup an icon in the theme.
Definition: kicontheme.cpp:361
KConfigBase::readListEntry
int readListEntry(const QString &pKey, QStrList &list, char sep= ',') const
Reads a list of strings.
Definition: kconfigbase.cpp:435
KIconTheme::isHidden
bool isHidden() const
The icon theme should be hidden to the user?
Definition: kicontheme.cpp:232
KIcon::Any
Some icon with unknown purpose.
Definition: kicontheme.h:49
KIcon::StatusIcon
An icon that represents an event.
Definition: kicontheme.h:61
KIconTheme::isValid
bool isValid() const
The icon theme exists?
Definition: kicontheme.cpp:227
KIcon::Group
Group
The group of the icon.
Definition: kicontheme.h:87
KIconTheme::dir
QString dir() const
Returns the toplevel theme directory.
Definition: kicontheme.h:253
KIcon::Emblem
An icon that adds information to an existing icon.
Definition: kicontheme.h:57
KConfigBase::readIntListEntry
QValueList< int > readIntListEntry(const QString &pKey) const
Reads a list of Integers.
Definition: kconfigbase.cpp:535
KGlobal::kdDebug
kdbgstream kdDebug(int area=0)
Definition: kdebug.cpp:317
KIcon::size
int size
The size in pixels of the icon.
Definition: kicontheme.h:152
KIcon::path
QString path
The full path of the icon.
Definition: kicontheme.h:172
KIcon::Application
An icon that represents an application.
Definition: kicontheme.h:51
KIcon::Scalable
Scalable-size icon.
Definition: kicontheme.h:69
KIcon::Animation
An icon that is animated.
Definition: kicontheme.h:55
KStandardDirs::exists
static bool exists(const QString &fullPath)
Checks for existence and accessability of a file or directory.
Definition: kstandarddirs.cpp:451
KIconTheme::linkOverlay
QString linkOverlay() const
Returns the name of this theme's link overlay.
Definition: kicontheme.cpp:239
KConfigBase::readPathEntry
QString readPathEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads a path.
Definition: kconfigbase.cpp:553
KIcon::MatchExact
Only try to find an exact match.
Definition: kicontheme.h:77
KIconTheme::queryIcons
QStringList queryIcons(int size, KIcon::Context context=KIcon::Any) const
Query available icons for a size and context.
Definition: kicontheme.cpp:265
KIcon::LastGroup
Last group.
Definition: kicontheme.h:103
KGlobal::dirs
static KStandardDirs * dirs()
Returns the application standard dirs object.
Definition: kglobal.cpp:54
KIcon::MimeType
An icon that represents a mime type (or file type).
Definition: kicontheme.h:54
KIcon::International
An icon that represents a country's flag.
Definition: kicontheme.h:59
KIcon::context
Context context
The context of the icon.
Definition: kicontheme.h:157
KIcon
One icon as found by KIconTheme.
Definition: kicontheme.h:35
KIconTheme::lockOverlay
QString lockOverlay() const
Returns the name of this theme's lock overlay.
Definition: kicontheme.cpp:240
KIcon::type
Type type
The type of the icon: Fixed, Scalable or Threshold.
Definition: kicontheme.h:162
KIconTheme::hasContext
bool hasContext(KIcon::Context context) const
Returns true if the theme has any icons for the given context.
Definition: kicontheme.cpp:347
KConfigGroupSaver
Helper class to facilitate working with KConfig / KSimpleConfig groups.
Definition: kconfigbase.h:2057
KConfigBase
KDE Configuration Management abstract base class.
Definition: kconfigbase.h:70
KIcon::Place
An icon that represents a location (e.g. 'home', 'trash').
Definition: kicontheme.h:60
KIcon::FileSystem
An icon that represents a file system.
Definition: kicontheme.h:53
KIconTheme::example
QString example() const
Return the name of the "example" icon.
Definition: kicontheme.cpp:237
KStandardDirs::resourceDirs
QStringList resourceDirs(const char *type) const
This function is used internally by almost all other function as it serves and fills the directories ...
Definition: kstandarddirs.cpp:783
KIcon::Context
Context
Defines the context of the icon.
Definition: kicontheme.h:48
KIcon::Threshold
A threshold icon.
Definition: kicontheme.h:70
KIcon::threshold
int threshold
The threshold in case type == Threshold.
Definition: kicontheme.h:167
KIcon::Type
Type
The type of the icon.
Definition: kicontheme.h:67
KConfigBase::readPathListEntry
QStringList readPathListEntry(const QString &pKey, char sep= ',') const
Reads a list of string paths.
Definition: kconfigbase.cpp:567
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KIcon::Device
An icon that represents a device.
Definition: kicontheme.h:52
KConfigBase::readEntry
QString readEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:203
KIconTheme::queryIconsByContext
QStringList queryIconsByContext(int size, KIcon::Context context=KIcon::Any) const
Query available icons for a context and preferred size.
Definition: kicontheme.cpp:318
KIconTheme::defaultThemeName
static QString defaultThemeName()
Returns the default icon theme.
Definition: kicontheme.cpp:512
KIcon::MatchType
MatchType
The type of a match.
Definition: kicontheme.h:76
KConfigBase::readBoolEntry
bool readBoolEntry(const QString &pKey, bool bDefault=false) const
Reads a boolean entry.
Definition: kconfigbase.cpp:716
KIcon::Fixed
Fixed-size icon.
Definition: kicontheme.h:68
KIcon::Emote
An icon that expresses an emotion.
Definition: kicontheme.h:58
KIcon::Category
An icon that represents a category.
Definition: kicontheme.h:56
KConfigBase::setGroup
void setGroup(const QString &group)
Specifies the group in which keys will be read and written.
Definition: kconfigbase.cpp:79
KIconTheme::name
QString name() const
The stylized name of the icon theme.
Definition: kicontheme.h:202
KSharedConfig::openConfig
static KSharedConfig::Ptr openConfig(const QString &fileName, bool readOnly=false, bool bUseKDEGlobals=true)
Returns a ref-counted pointer to a shared read-write config object.
Definition: kconfig.cpp:334
KIconTheme
Class to use/access icon themes in KDE.
Definition: kicontheme.h:186
KGlobal::config
static KConfig * config()
Returns the general config object.
Definition: kglobal.cpp:61
KIcon::Action
An action icon (e.g. 'save', 'print').
Definition: kicontheme.h:50
KIconTheme::shareOverlay
QString shareOverlay() const
Returns the name of this theme's share overlay.
Definition: kicontheme.cpp:242
KIconTheme::KIconTheme
KIconTheme(const QString &name, const QString &appName=QString::null)
Load an icon theme by name.
Definition: kicontheme.cpp:82
KIconTheme::current
static QString current()
Returns the current icon theme.
Definition: kicontheme.cpp:444
KConfigBase::readNumEntry
int readNumEntry(const QString &pKey, int nDefault=0) const
Reads a numerical value.
Definition: kconfigbase.cpp:581
KIconTheme::querySizes
QValueList< int > querySizes(KIcon::Group group) const
Query available sizes for a group.
Definition: kicontheme.cpp:254
KIconTheme::list
static QStringList list()
List all icon themes installed on the system, global and local.
Definition: kicontheme.cpp:466

KDE Home | KDE Accessibility Home | Description of Access Keys