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

List:       kde-core-devel
Subject:    disabling loading of kded autoload modules if KDE desktop is not
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2004-05-13 11:31:02
Message-ID: 200405131331.02365.l.lunak () suse ! cz
[Download RAW message or body]

From kde-cvs:
=====
On Friday 23 of April 2004 10:49, David Faure wrote:
> On Tuesday 20 April 2004 17:13, Luboš Luňák wrote:
> > CVS commit by lunakl:
> >
> > Convert kwrited to a kded module. There's no point in having an extra
> > application just for one read-only QTextEdit widget which is usually
> > seen once a millenium or so. Should save both memory and startup time.
>
> Hihi, this has a funny side effect:
>
> ssh to another machine, with X forwarded
> run a kde app -> this starts kdeinit in the background
> type su -c "shutdown -h 0"
> => the kwrited window appears :)
>
> No bug, it's just a funny side effect due to the fact that kded is started
> even for standalone kde apps, whereas startkde is only for a full kde
> session.
>
> I guess this means we have to keep in mind that the more stuff we put
> in kded, the more stuff is started behind a standalone application's back;
> so it's ok for services available to apps, but not necessarily for
> desktop-wide services. Just a thought.
=====

 The attached patch changes kded so that autoload modules are loaded on kded 
startup only if that's also KDE startup. Can anybody see a problem with that? 
I do't think there's any reason why just starting e.g. KWrite outside of KDE 
should also load kwrited, klaptopdaemon, kmilo and what not. In case some of 
the explicitly CC-ed people (that's people responsible for various 
autoload=true according to cvs annotate) have a good reason why not to apply 
this patch, please speak up.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak@suse.cz , l.lunak@kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/

["kded.patch" (text/x-diff)]

--- kded/README.kded.sav	2003-08-18 20:50:00.000000000 +0200
+++ kded/README.kded	2004-05-13 00:17:33.339513736 +0200
@@ -105,9 +105,12 @@ on fire)
 A KDED module should install a .desktop file with
 	ServicesTypes=KDEDModule
 
-A KDED module will be loaded on startup if it has a line
+A KDED module will be loaded on KDE startup if it has a line
 	X-KDE-Kded-autoload=true
 
+Note that this flag doesn't cause the module to be loaded if the KDE desktop
+is not running (i.e. when running a KDE application in another environment).
+
 Normally KDED modules are loaded whenever they are accessed, so you don't
 need autoloading enabled. On demand loading can be disabled by putting
 the following line in the .desktop file:
--- kded/kded.cpp.sav	2003-11-18 19:50:57.000000000 +0100
+++ kded/kded.cpp	2004-05-13 00:16:57.626942872 +0200
@@ -142,6 +142,7 @@ void Kded::initModules()
 {
      m_dontLoad.clear();
      KConfig *config = kapp->config();
+     bool kde_running = !( getenv( "KDE_FULL_SESSION" ) == NULL || getenv( \
"KDE_FULL_SESSION" )[ 0 ] == '\0' );  
      // Preload kded modules.
      KService::List kdedModules = KServiceType::offers("KDEDModule");
@@ -151,7 +152,7 @@ void Kded::initModules()
          bool autoload = service->property("X-KDE-Kded-autoload").toBool();
          config->setGroup(QString("Module-%1").arg(service->desktopEntryName()));
          autoload = config->readBoolEntry("autoload", autoload);
-         if (autoload)
+         if (autoload && kde_running)
             loadModule(service, false);
 
          bool dontLoad = false;



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

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