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

List:       kde-commits
Subject:    KDE/kdebase/runtime/nepomuk/server
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2008-04-08 13:16:57
Message-ID: 1207660617.592848.32483.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 794733 by trueg:

Added methods to get and enable/disable autostart values of services. This will be \
important for a service management GUI.

 M  +7 -0      servicecontroller.cpp  
 M  +2 -0      servicecontroller.h  
 M  +19 -0     servicemanager.cpp  
 M  +11 -0     servicemanager.h  


--- trunk/KDE/kdebase/runtime/nepomuk/server/servicecontroller.cpp #794732:794733
@@ -117,6 +117,13 @@
 }
 
 
+void Nepomuk::ServiceController::setAutostart( bool enable )
+{
+    KConfigGroup cg( Server::self()->config(), QString("Service-%1").arg(name()) );
+    cg.writeEntry( "autostart", enable );
+}
+
+
 bool Nepomuk::ServiceController::autostart() const
 {
     return d->autostart;
--- trunk/KDE/kdebase/runtime/nepomuk/server/servicecontroller.h #794732:794733
@@ -48,6 +48,8 @@
         bool startOnDemand() const;
         bool runOnce() const;
 
+        void setAutostart( bool enable );
+
         bool start();
         void stop();
 
--- trunk/KDE/kdebase/runtime/nepomuk/server/servicemanager.cpp #794732:794733
@@ -412,6 +412,25 @@
 }
 
 
+bool Nepomuk::ServiceManager::isServiceAutostarted( const QString& name )
+{
+    if ( ServiceController* sc = d->findService( name ) ) {
+        return sc->autostart();
+    }
+    else {
+        return false;
+    }
+}
+
+
+void Nepomuk::ServiceManager::setServiceAutostarted( const QString& name, bool \
autostart ) +{
+    if ( ServiceController* sc = d->findService( name ) ) {
+        sc->setAutostart( autostart );
+    }
+}
+
+
 //#define MODULES_PATH "/modules/"
 
 // FIXME: Use our own system and dbus path
--- trunk/KDE/kdebase/runtime/nepomuk/server/servicemanager.h #794732:794733
@@ -94,6 +94,17 @@
          */
         bool stopService( const QString& name );
 
+        /**
+         * \return \p true if the service indicated by \a name
+         * is started automatically.
+         */
+        bool isServiceAutostarted( const QString& name );
+
+        /**
+         * Set the service indicated by \a name to be autostarted.
+         */
+        void setServiceAutostarted( const QString& name, bool autostart );
+
     private:
         static ServiceManager* s_self;
 


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

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