[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 7:41:50
[Download RAW message or body]

On Friday 31 May 2002 15:20, Michael Goffioul wrote:
> > Only after the first restart :-( What I did:
> > 1) remove kickerrc and kdeglobals (while logged out)
> > 2) start KDE, set the style to Keramik and the icons theme to Crystal
> > 3) logout and login again -> Kicker has the crystal icons
> > 4) do some configuration stuff on kicker (remove some buttons, add menu
> >    extension)
> > 5) logout and login again -> kicker has the hicolor icons :-(
> 
> After someone else's suggestion, it seems to be related to the presence
> (or not) of the kdeprint menu extension. If not present, kicker uses
> the right icons at startup.
> 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).

-- 
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 07:39:24
@@ -271,21 +271,15 @@ 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)
+    KIconTheme *def = new KIconTheme(KIconTheme::current(), appname);
+    if (!def->isValid())
     {
-	node->links.append(d->mpThemeRoot);
-	d->mpThemeRoot = node;
+	delete def;
+	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