From kde-core-devel Wed Feb 16 17:44:38 2005 From: Gunnar Schmi Dt Date: Wed, 16 Feb 2005 17:44:38 +0000 To: kde-core-devel Subject: KThememanager and system-wide themes Message-Id: <200502161844.53866.gunnar () schmi-dt ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=110857606620498 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart3313391.yEA1lpxbWs" --nextPart3313391.yEA1lpxbWs Content-Type: multipart/mixed; boundary="Boundary-01=_Ia4ECACb8+oS4Up" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_Ia4ECACb8+oS4Up Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, According to bug #98006 [1] the kthememanager does not work correctly with= =20 system-wide themes. As we currently have some system-wide themes for=20 accessibility I have looked into the code for the kthememanager. Basically the code always uses saveLocation(), even for reading themes. As= =20 I do not know whether there was a reason to do so I do not want to commit=20 my fix for the bug without asking for permission to do so (it is not my=20 code). Is it OK to apply the attached bugfix? Otherwise we need to discuss what we= =20 want to do with the accessibility themes. Gunnar Schmi Dt [1] http://bugs.kde.org/show_bug.cgi?id=3D98006 =2D-=20 Co-maintainer of the KDE Accessibility Project Maintainer of the kdeaccessibility package http://accessibility.kde.org/ --Boundary-01=_Ia4ECACb8+oS4Up Content-Type: text/x-diff; charset="us-ascii"; name="ktheme.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ktheme.diff" Index: kcontrol/kthememanager/ktheme.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/kcontrol/kthememanager/ktheme.cpp,v retrieving revision 1.14 diff -u -p -r1.14 ktheme.cpp =2D-- 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; =20 =2D QString themeDir =3D m_kgd->saveLocation( "themes", m_name + "/" ); + QString themeDir =3D m_kgd->findResourceDir( "themes", m_name + "/" + = m_name + ".xml") + m_name + "/"; kdDebug() << "Theme dir: " << themeDir << endl; =20 // 2. Background theme @@ -801,7 +801,7 @@ QString KTheme::processFilePath( const Q QString KTheme::unprocessFilePath( const QString & section, QString path ) { if ( path.startsWith( "theme:/" ) ) =2D 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 + "/" ); =20 if ( QFile::exists( path ) ) return path; Index: kcontrol/kthememanager/kthememanager.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/kcontrol/kthememanager/kthememanager.cpp,v retrieving revision 1.20 diff -u -p -r1.20 kthememanager.cpp =2D-- kcontrol/kthememanager/kthememanager.cpp 17 Jan 2005 11:42:08 -0000 1= =2E20 +++ kcontrol/kthememanager/kthememanager.cpp 16 Feb 2005 17:34:47 -0000 @@ -144,8 +144,7 @@ void kthememanager::save() { QString themeName =3D cur->text( 0 ); =20 =2D m_theme =3D new KTheme( this, KGlobal::dirs()->saveLocation( "th= emes", themeName + "/" ) =2D + themeName + ".xml" ); + m_theme =3D new KTheme( this, KGlobal::dirs()->findResource( "themes", th= emeName + "/" + themeName + ".xml") ); m_theme->apply(); =20 // Save the current theme name @@ -310,7 +309,7 @@ void kthememanager::slotThemeChanged( QL QString themeName =3D item->text(0); kdDebug() << "Activated theme: " << themeName << endl; =20 =2D QString themeDir =3D KGlobal::dirs()->saveLocation( "themes", th= emeName + "/" ); + QString themeDir =3D KGlobal::dirs()->findResourceDir( "themes", themeNam= e + "/" + themeName + ".xml") + themeName + "/"; =20 QString pixFile =3D themeDir + themeName + ".preview.png"; =20 --Boundary-01=_Ia4ECACb8+oS4Up-- --nextPart3313391.yEA1lpxbWs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBCE4aVsxZ93p+gHn4RAjMlAJ0W3MbEWfzPJTNrC9Wg3geZQ+wH6ACeINND Krb/yy+DVki7kD+LAZFlNPw= =i6c4 -----END PGP SIGNATURE----- --nextPart3313391.yEA1lpxbWs--