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

List:       kde-core-devel
Subject:    [Fwd: PATCH: kcontrol/display]
From:       Stephan Kulow <coolo () kde ! org>
Date:       2000-09-28 20:19:44
[Download RAW message or body]

-------- Original Message --------
Subject: PATCH: kcontrol/display
Date: Thu, 28 Sep 2000 21:48:53 +0200
From: Marco Zuehlke <marco.zuehlke@gmx.de>
To: coolo@kde.org



Hello Stephan,

can you forward this Mail to kde-core-devel  list.


While testing KDE 2 I found that the kcontrol module 
for switching the kstyle themes did not work as expected.
When you reopen the module the selected module is not the one
that is active at the moment.

I hope my patch fixes this problem.

regards
Marco
["display.diff" (text/plain)]

--- kdebase/kcontrol/display/general.cpp.orig	Thu Sep 28 16:34:48 2000
+++ kdebase/kcontrol/display/general.cpp	Thu Sep 28 18:36:22 2000
@@ -85,17 +85,17 @@
     addColumn(i18n("Name:"));
     addColumn(i18n("Description:"));
     setAllColumnsShowFocus(true);
     KGlobal::dirs()->addResourceType("themes",
KStandardDirs::kde_default("data") + "kstyle/themes");
     QStringList list = KGlobal::dirs()->resourceDirs("themes");
     for (QStringList::ConstIterator it = list.begin(); it !=
list.end(); it++)
         readThemeDir(*it);
 
-    setFixedHeight(120);
+    setMinimumHeight(120);
 
     if (!currentItem() )
         setSelected(firstChild(), true);
 
     ensureItemVisible(currentItem());
 }
 
 
@@ -105,43 +105,41 @@
 }
 
 
 void KThemeListBox::readThemeDir(const QString &directory)
 {
     qDebug("Reading theme dir: %s", directory.latin1());
     QString name, desc;
 
-    kconfig->setGroup("KDE");
+    kconfig->setGroup("Misc");
     QString defName = "KDE default";
-    QString curName = kconfig->readEntry("widgetStyle", defName);
+    QString curName = kconfig->readEntry("Name", defName);
 
     QDir dir(directory, "*.themerc");
     if (!dir.exists())
-    return;
+        return;
 
     const QFileInfoList *list = dir.entryInfoList();
     QFileInfoListIterator it(*list);
     QFileInfo *fi;
     while ((fi = it.current())){
-    KSimpleConfig config(fi->absFilePath(), true);
-    config.setGroup("Misc");
-    name = config.readEntry("Name", fi->baseName());
-    desc = config.readEntry("Comment", i18n("No description
available."));
-    config.setGroup( "KDE" );
-    QString style = config.readEntry( "widgetStyle" );
-    QListViewItem *item = new QListViewItem(this, name, desc,
fi->absFilePath());
-    if (style == curName) {
-        curItem = item;
-        setSelected(item, true);
-        ensureItemVisible(item);
-    }
-    if (name == defName)
-        defItem = item;
-    ++it;
+        KSimpleConfig config(fi->absFilePath(), true);
+        config.setGroup("Misc");
+        name = config.readEntry("Name", fi->baseName());
+        desc = config.readEntry("Comment", i18n("No description
available."));
+        QListViewItem *item = new QListViewItem(this, name, desc,
fi->absFilePath());
+        if (name == curName) {
+            curItem = item;
+            setSelected(item, true);
+            ensureItemVisible(item);
+        }
+        if (name == defName)
+            defItem = item;
+        ++it;
     }
 }
 
 
 void KThemeListBox::defaults()
 {
     setSelected(defItem, true);
     ensureItemVisible( defItem );
@@ -344,23 +342,16 @@
     m_bChanged = true;
     emit changed(true);
 }
 
 
 void KGeneral::readSettings()
 {
     config->setGroup("KDE");
-    QString str = config->readEntry( "widgetStyle", "Platinum" );
-    if ( str == "Platinum" )
-    applicationStyle = WindowsStyle;
-    else if ( str == "Windows 95" )
-    applicationStyle = WindowsStyle;
-    else
-    applicationStyle = MotifStyle;
     macStyle = config->readBoolEntry( "macStyle", false);
 
     config->setGroup( "Toolbar style" );
     tbUseText = config->readNumEntry( "IconText", 0);
     int val = config->readNumEntry( "Highlighting", 1);
     tbUseHilite = val? true : false;
     tbMoveTransparent = config->readBoolEntry( "TransparentMoving",
true);
 
--- kdebase/kcontrol/display/general.h.orig	Thu Sep 28 16:48:42 2000
+++ kdebase/kcontrol/display/general.h	Thu Sep 28 16:59:23 2000
@@ -84,16 +84,14 @@
     int tbUseText;
 
     QGroupBox *styles, *tbStyle;
     QRadioButton *tbIcon, *tbText, *tbAside, *tbUnder;
     QCheckBox *tbHilite, *tbTransp;
     QCheckBox *cbRes;
     QCheckBox *cbMac;
 
-    GUIStyle applicationStyle;
-
     KThemeListBox *themeList;
     KConfig *config;
 };
 
 
 #endif


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

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