[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KThememanager and system-wide themes
From:       Gunnar Schmi Dt <gunnar () schmi-dt ! de>
Date:       2005-02-16 17:44:38
Message-ID: 200502161844.53866.gunnar () schmi-dt ! de
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hello,

According to bug #98006 [1] the kthememanager does not work correctly with 
system-wide themes. As we currently have some system-wide themes for 
accessibility I have looked into the code for the kthememanager.

Basically the code always uses saveLocation(), even for reading themes. As 
I do not know whether there was a reason to do so I do not want to commit 
my fix for the bug without asking for permission to do so (it is not my 
code).

Is it OK to apply the attached bugfix? Otherwise we need to discuss what we 
want to do with the accessibility themes.

Gunnar Schmi Dt

[1] http://bugs.kde.org/show_bug.cgi?id=98006
-- 
Co-maintainer of the KDE Accessibility Project
Maintainer of the kdeaccessibility package
http://accessibility.kde.org/

["ktheme.diff" (text/x-diff)]

Index: kcontrol/kthememanager/ktheme.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kthememanager/ktheme.cpp,v
retrieving revision 1.14
diff -u -p -r1.14 ktheme.cpp
--- kcontrol/kthememanager/ktheme.cpp	17 Jan 2005 11:42:08 -0000	1.14
+++ kcontrol/kthememanager/ktheme.cpp	16 Feb 2005 17:34:47 -0000
@@ -370,7 +370,7 @@ void KTheme::apply()
 {
     kdDebug() << "Going to apply theme: " << m_name << endl;
 
-    QString themeDir = m_kgd->saveLocation( "themes", m_name + "/" );
+    QString themeDir = m_kgd->findResourceDir( "themes", m_name + "/" + m_name + \
".xml") + m_name + "/";  kdDebug() << "Theme dir: " << themeDir << endl;
 
     // 2. Background theme
@@ -801,7 +801,7 @@ QString KTheme::processFilePath( const Q
 QString KTheme::unprocessFilePath( const QString & section, QString path )
 {
     if ( path.startsWith( "theme:/" ) )
-        return path.replace( QRegExp( "^theme:/" ), m_kgd->saveLocation( "themes", \
m_name + "/") ); +        return path.replace( QRegExp( "^theme:/" ), \
m_kgd->findResourceDir( "themes", m_name + "/" + m_name + ".xml") + m_name + "/" );  
     if ( QFile::exists( path ) )
         return path;
Index: kcontrol/kthememanager/kthememanager.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kthememanager/kthememanager.cpp,v
retrieving revision 1.20
diff -u -p -r1.20 kthememanager.cpp
--- kcontrol/kthememanager/kthememanager.cpp	17 Jan 2005 11:42:08 -0000	1.20
+++ kcontrol/kthememanager/kthememanager.cpp	16 Feb 2005 17:34:47 -0000
@@ -144,8 +144,7 @@ void kthememanager::save()
     {
         QString themeName = cur->text( 0 );
 
-        m_theme = new KTheme( this, KGlobal::dirs()->saveLocation( "themes", \
                themeName + "/" )
-                              + themeName + ".xml" );
+	m_theme = new KTheme( this, KGlobal::dirs()->findResource( "themes", themeName + \
"/" + themeName + ".xml") );  m_theme->apply();
 
         // Save the current theme name
@@ -310,7 +309,7 @@ void kthememanager::slotThemeChanged( QL
         QString themeName = item->text(0);
         kdDebug() << "Activated theme: " << themeName  << endl;
 
-        QString themeDir = KGlobal::dirs()->saveLocation( "themes", themeName + "/" \
); +	QString themeDir = KGlobal::dirs()->findResourceDir( "themes", themeName + "/" + \
themeName + ".xml") + themeName + "/";  
         QString pixFile = themeDir + themeName + ".preview.png";
 


[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic