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

List:       kde-windows
Subject:    [patch] add option for disabling kwinstartmenu
From:       Jarosław Staniek <js () iidea ! pl>
Date:       2008-04-15 22:26:17
Message-ID: 48052B89.1050404 () iidea ! pl
[Download RAW message or body]

for review,

We sometimes need to disable creation and automatic maintenance of the KDE 
menu entry in the Start Menu. To do this, we can add these lines to the 
share/config/kwinstartmenurc file on deployment:

[General]
Enabled=false


-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)

["kwinstartmenu.patch" (text/plain)]

Index: runtime/platforms/win/kwinstartmenu/winstartmenu.cpp
===================================================================
--- runtime/platforms/win/kwinstartmenu/winstartmenu.cpp	(wersja 797447)
+++ runtime/platforms/win/kwinstartmenu/winstartmenu.cpp	(kopia robocza)
@@ -24,6 +24,7 @@
 #include "misc.h"
 
 #include <kconfig.h>
+#include <kconfiggroup.h>
 #include <kdebug.h>
 #include <kpluginfactory.h>
 #include <kpluginloader.h>
@@ -38,22 +39,30 @@
 
 struct WinStartMenuModulePrivate
 {
+    WinStartMenuModulePrivate()
+     : config("kwinstartmenurc")
+     , ksycoca(0)
+    {
+    }
     virtual ~WinStartMenuModulePrivate() 
     { 
-        delete config; 
         delete ksycoca;
     }
 
-    KConfig *config;
+    KConfig config;
     KSycoca *ksycoca;
 };
 
 WinStartMenuModule::WinStartMenuModule(QObject* parent, const QList<QVariant>&)
     : KDEDModule(parent)
+    , d( new WinStartMenuModulePrivate )
 {
-    QString profile = qgetenv("ALLUSERSPROFILE");
+    KConfigGroup group( &d->config, "General" );
+    if (!group.readEntry("Enabled", true))
+      return;
+
+    //QString profile = qgetenv("ALLUSERSPROFILE");
     
-    d = new WinStartMenuModulePrivate;
     // not used yet
     //d->config = new KConfig(KStandardDirs::locateLocal("data", "winstartrc"));
     d->ksycoca = new KSycoca();
@@ -64,7 +73,8 @@
 
 WinStartMenuModule::~WinStartMenuModule()
 {
-    disconnect(d->ksycoca, SIGNAL(databaseChanged()), this, SLOT(databaseChanged()));
+    if (d->ksycoca)
+      disconnect(d->ksycoca, SIGNAL(databaseChanged()), this, SLOT(databaseChanged()));
     delete d;
 }
 


_______________________________________________
Kde-windows mailing list
Kde-windows@kde.org
https://mail.kde.org/mailman/listinfo/kde-windows


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

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