[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Kicker doesn't use the selected icon theme at startup
From: David Faure <david () mandrakesoft ! com>
Date: 2002-06-03 8:59:57
[Download RAW message or body]
On Monday 03 June 2002 10:20, Michael Goffioul wrote:
> > > I don't really understand why this happens. When kdeprint is loaded, it
> > > calls:
> > >
> > > KGlobal::iconLoader()->addAppDir("kdeprint");
> > >
> > > Can this have an influence on the way icons will be loaded in kicker?
> >
> > Indeed it did, apparently.
> > Please test this patch (this isn't my code, I hope I got it right).
> >
> > (It seems it created a theme node "hicolor" in _front_ of the current theme
> > nodes, instead of at the back).
>
> It solves the problem for kicker. However, all KDEPrint icons are lost.
> They are located in $KDEDIR/share/apps/kdeprint/icons/hicolor. This looks
> "normal" if I'm using the crystal icon theme, however it would be nice
> if the icon loaded could fall back to hicolor if there's no icon in the
> theme used.
Ok, next try ;)
(I added the current theme _and_ hicolor as fallback (if theme!=hicolor)).
--
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KDE, Making The Future of Computing Available Today
["kic.diff" (text/x-diff)]
Index: kiconloader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kiconloader.cpp,v
retrieving revision 1.191
diff -u -p -b -r1.191 kiconloader.cpp
--- kiconloader.cpp 2002/05/14 19:19:43 1.191
+++ kiconloader.cpp 2002/06/03 08:58:53
@@ -271,21 +271,23 @@ void KIconLoader::addAppDir(const QStrin
void KIconLoader::addAppThemes(const QString& appname)
{
- KIconThemeNode *node = 0L;
- KIconTheme *theme = 0L;
-
- theme = new KIconTheme("hicolor", appname);
- if (theme->isValid())
- node = new KIconThemeNode(theme);
- else
- delete theme;
-
- if (node)
+ if ( KIconTheme::current() != "hicolor" )
{
- node->links.append(d->mpThemeRoot);
- d->mpThemeRoot = node;
+ KIconTheme *def = new KIconTheme(KIconTheme::current(), appname);
+ if (def->isValid())
+ {
+ KIconThemeNode* node = new KIconThemeNode(def);
+ d->mpThemeRoot->links.append(node);
+ addBaseThemes(node, appname);
+ }
+ else
+ delete def;
}
+ KIconTheme *def = new KIconTheme(QString::fromLatin1("hicolor"), appname);
+ KIconThemeNode* node = new KIconThemeNode(def);
+ d->mpThemeRoot->links.append(node);
+ addBaseThemes(node, appname);
}
void KIconLoader::addBaseThemes(KIconThemeNode *node, const QString &appname)
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic