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

List:       kde-games-devel
Subject:    [Kde-games-devel]  bug in kgamethemeselector
From:       Mathias Kraus <k.hias () gmx ! de>
Date:       2009-09-11 22:01:02
Message-ID: 200909120001.02676.k.hias () gmx ! de
[Download RAW message or body]

hi,

there is a bug in kgamethemeselector. when pressing the default button, the theme \
list is not updated. the attached patch fixes the bug.

regards,
mathias


["kgamethemeselector.patch" (text/x-patch)]

Index: kgamethemeselector.cpp
===================================================================
--- kgamethemeselector.cpp	(Revision 1022502)
+++ kgamethemeselector.cpp	(Arbeitskopie)
@@ -46,6 +46,7 @@
 
         // private slots
         void _k_updatePreview();
+        void _k_updateThemeList(const QString& strTheme);
         void _k_openKNewStuffDialog();
 };
 
@@ -70,6 +71,7 @@
     //The lineEdit widget holds our theme path for automatic connection via \
KConfigXT.  //But the user should not manipulate it directly, so we hide it.
     ui.kcfg_Theme->hide();
+    connect(ui.kcfg_Theme, SIGNAL(textChanged(const QString&)), q, \
SLOT(_k_updateThemeList(const QString&)));  
     //Disable KNS button?
     if (knsflags==KGameThemeSelector::NewStuffDisableDownload) {
@@ -175,6 +177,22 @@
     ui.themePreview->setPixmap(pix.scaled(ui.themePreview->size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));
  }
 
+void KGameThemeSelector::KGameThemeSelectorPrivate::_k_updateThemeList(const \
QString& strTheme) +{
+    //find theme and set selection to the current theme; happens when pressing \
"Default" +    if(themeMap.value(ui.themeList->currentItem()->text())->fileName() != \
strTheme) +    {
+        for(int i = 0; i < ui.themeList->count(); i++)
+        {
+            if(themeMap.value(ui.themeList->item(i)->text())->fileName() == \
strTheme) +            {
+                ui.themeList->setCurrentItem(ui.themeList->item(i));
+                break;
+            }
+        }
+    }
+}
+
 void KGameThemeSelector::KGameThemeSelectorPrivate::_k_openKNewStuffDialog()
 {
     KNS::Entry::List entries = KNS::Engine::download();
Index: kgamethemeselector.h
===================================================================
--- kgamethemeselector.h	(Revision 1022502)
+++ kgamethemeselector.h	(Arbeitskopie)
@@ -69,6 +69,7 @@
         Q_DISABLE_COPY(KGameThemeSelector)
 
         Q_PRIVATE_SLOT(d, void _k_updatePreview())
+        Q_PRIVATE_SLOT(d, void _k_updateThemeList(const QString&))
         Q_PRIVATE_SLOT(d, void _k_openKNewStuffDialog())
 };
 



_______________________________________________
kde-games-devel mailing list
kde-games-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel


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

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