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

List:       kde-commits
Subject:    KDE/kdebase/kioslave
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2005-10-11 13:25:28
Message-ID: 1129037128.316235.9691.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 469547 by lunakl:

Don't autoload the home/remote/system notify kded modules,
loading them on demand when a slave is launched should be enough.
Hmm, I also could not resist and made the code in ctors to be
on demand, since the DCOP calls actually can come much later.



 M  +11 -0     home/kdedmodule/homedirnotify.cpp  
 M  +0 -1      home/kdedmodule/homedirnotify.desktop  
 M  +2 -0      home/kdedmodule/homedirnotify.h  
 M  +3 -0      home/kio_home.cpp  
 M  +0 -1      remote/kdedmodule/remotedirnotify.desktop  
 M  +3 -0      remote/kio_remote.cpp  
 M  +10 -0     system/kdedmodule/systemdirnotify.cpp  
 M  +0 -1      system/kdedmodule/systemdirnotify.desktop  
 M  +2 -0      system/kdedmodule/systemdirnotify.h  
 M  +3 -0      system/kio_system.cpp  


--- trunk/KDE/kdebase/kioslave/home/kdedmodule/homedirnotify.cpp #469546:469547
@@ -29,7 +29,16 @@
 #define MINIMUM_UID 500
 
 HomeDirNotify::HomeDirNotify()
+: mInited( false )
 {
+}
+
+void HomeDirNotify::init()
+{
+	if( mInited )
+		return;
+	mInited = true;
+
 	KUser current_user;
 	Q3ValueList<KUserGroup> groups = current_user.groups();
 	Q3ValueList<int> uid_list;
@@ -65,6 +74,7 @@
 {
 	kdDebug() << "HomeDirNotify::toHomeURL(" << url << ")" << endl;
 	
+	init();
 	QMap<QString,KURL>::iterator it = m_homeFoldersMap.begin();
 	QMap<QString,KURL>::iterator end = m_homeFoldersMap.end();
 	
@@ -90,6 +100,7 @@
 
 KURL::List HomeDirNotify::toHomeURLList(const KURL::List &list)
 {
+	init();
 	KURL::List new_list;
 
 	KURL::List::const_iterator it = list.begin();
--- trunk/KDE/kdebase/kioslave/home/kdedmodule/homedirnotify.desktop #469546:469547
@@ -10,5 +10,4 @@
 X-KDE-ModuleType=Library
 X-KDE-Library=homedirnotify
 X-KDE-FactoryName=homedirnotify
-X-KDE-Kded-autoload=true
 X-KDE-Kded-load-on-demand=true
--- trunk/KDE/kdebase/kioslave/home/kdedmodule/homedirnotify.h #469546:469547
@@ -37,10 +37,12 @@
 	virtual ASYNC FilesChanged (const KURL::List &fileList);
 
 private:
+	void init();
 	KURL toHomeURL(const KURL &url);
 	KURL::List toHomeURLList(const KURL::List &list);
 	
 	QMap<QString,KURL> m_homeFoldersMap;
+	bool mInited;
 };
 
 #endif
--- trunk/KDE/kdebase/kioslave/home/kio_home.cpp #469546:469547
@@ -23,6 +23,7 @@
 #include <klocale.h>
 #include <kapplication.h>
 #include <dcopclient.h>
+#include <dcopref.h>
 #include <kcmdlineargs.h>
 #include <kglobal.h>
 
@@ -49,6 +50,8 @@
 		KApplication app( false, false );
 		// We want to be anonymous even if we use DCOP
 		app.dcopClient()->attach();
+		DCOPRef ref( "kded", "kded" );
+		ref.call( "loadModule", "homedirnotify" );
 
 		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 		HomeProtocol slave( args->arg(0), args->arg(1), args->arg(2) );
--- trunk/KDE/kdebase/kioslave/remote/kdedmodule/remotedirnotify.desktop #469546:469547
@@ -38,5 +38,4 @@
 X-KDE-ModuleType=Library
 X-KDE-Library=remotedirnotify
 X-KDE-FactoryName=remotedirnotify
-X-KDE-Kded-autoload=true
 X-KDE-Kded-load-on-demand=true
--- trunk/KDE/kdebase/kioslave/remote/kio_remote.cpp #469546:469547
@@ -23,6 +23,7 @@
 #include <klocale.h>
 #include <kapplication.h>
 #include <dcopclient.h>
+#include <dcopref.h>
 #include <kcmdlineargs.h>
 #include <kglobal.h>
 
@@ -49,6 +50,8 @@
 		KApplication app( false, false );
 		// We want to be anonymous even if we use DCOP
 		app.dcopClient()->attach();
+		DCOPRef ref( "kded", "kded" );
+		ref.call( "loadModule", "remotedirnotify" );
 
 		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 		RemoteProtocol slave( args->arg(0), args->arg(1), args->arg(2) );
--- trunk/KDE/kdebase/kioslave/system/kdedmodule/systemdirnotify.cpp #469546:469547
@@ -29,7 +29,15 @@
 #include <qdir.h>
 
 SystemDirNotify::SystemDirNotify()
+: mInited( false )
 {
+}
+
+void SystemDirNotify::init()
+{
+	if( mInited )
+		return;
+	mInited = true;
 	KGlobal::dirs()->addResourceType("system_entries",
 		KStandardDirs::kde_default("data") + "systemview");
 
@@ -81,6 +89,7 @@
 {
 	kdDebug() << "SystemDirNotify::toSystemURL(" << url << ")" << endl;
 
+	init();
 	QMap<KURL,KURL>::const_iterator it = m_urlMap.begin();
 	QMap<KURL,KURL>::const_iterator end = m_urlMap.end();
 
@@ -106,6 +115,7 @@
 
 KURL::List SystemDirNotify::toSystemURLList(const KURL::List &list)
 {
+	init();
 	KURL::List new_list;
 
 	KURL::List::const_iterator it = list.begin();
--- trunk/KDE/kdebase/kioslave/system/kdedmodule/systemdirnotify.desktop #469546:469547
@@ -38,5 +38,4 @@
 X-KDE-ModuleType=Library
 X-KDE-Library=systemdirnotify
 X-KDE-FactoryName=systemdirnotify
-X-KDE-Kded-autoload=true
 X-KDE-Kded-load-on-demand=true
--- trunk/KDE/kdebase/kioslave/system/kdedmodule/systemdirnotify.h #469546:469547
@@ -36,10 +36,12 @@
 	virtual ASYNC FilesChanged (const KURL::List &fileList);
 
 private:
+	void init();
 	KURL toSystemURL(const KURL &url);
 	KURL::List toSystemURLList(const KURL::List &list);
 
 	QMap<KURL,KURL> m_urlMap;
+	bool mInited;
 };
 
 #endif
--- trunk/KDE/kdebase/kioslave/system/kio_system.cpp #469546:469547
@@ -24,6 +24,7 @@
 #include <kapplication.h>
 #include <kcmdlineargs.h>
 #include <dcopclient.h>
+#include <dcopref.h>
 
 #include <qeventloop.h>
 //Added by qt3to4:
@@ -50,6 +51,8 @@
 		KApplication app( false, false );
 		// We want to be anonymous even if we use DCOP
 		app.dcopClient()->attach();
+		DCOPRef ref( "kded", "kded" );
+		ref.call( "loadModule", "systemdirnotify" );
 
 		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 		SystemProtocol slave( args->arg(0), args->arg(1), args->arg(2) );
[prev in list] [next in list] [prev in thread] [next in thread] 

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