diff --git a/src/launcher/boosterkiller.cpp b/src/launcher/boosterkiller.cpp index 625798d..cf99c7b 100644 --- a/src/launcher/boosterkiller.cpp +++ b/src/launcher/boosterkiller.cpp @@ -17,36 +17,35 @@ ** ****************************************************************************/ -#include #include #include -#include -#include "boosterkiller.h" - #include +#include "boosterkiller.h" + void BoosterKiller::addKey(const QString & key) { - MGConfItem *item = new MGConfItem(key, 0); + MGConfItem * item = new MGConfItem(key, 0); + m_gConfItems << QSharedPointer(item); + QObject::connect(item, SIGNAL(valueChanged()), this, SLOT(killProcesses())); } void BoosterKiller::addProcessName(const QString & processName) { - processNames << processName; + m_processNames << processName; } void BoosterKiller::start() { int argc = 0; - //char **argv = 0; QCoreApplication(argc, 0).exec(); } void BoosterKiller::killProcesses() { - Q_FOREACH(QString processName, processNames) { + Q_FOREACH(QString processName, m_processNames) { system( (QString("pkill ") + processName).toStdString().c_str() ); } } diff --git a/src/launcher/boosterkiller.h b/src/launcher/boosterkiller.h index b1a961f..7c369aa 100644 --- a/src/launcher/boosterkiller.h +++ b/src/launcher/boosterkiller.h @@ -22,33 +22,42 @@ #include #include +#include +#include class QString; -class MGConfItem; -class BoosterKiller: public QObject +/*! \class BoosterKiller + * + * BoosterKiller kills certain boosters e.g. when themeing or language changes. + * Daemon will then restart the boosters. + */ +class BoosterKiller : public QObject { Q_OBJECT public: - /* Add a GConf key and the name of the process that should be - killed in case the value associated to the key is changed. - */ + + //! Add a GConf key to trigger booster process termination void addKey(const QString & key); + + //! Add a booster process name to be killed void addProcessName(const QString & processName); - /* Starts the killer. This will initialize qcoreapplication, does - not return. + /*! Starts the killer. This will initialize a QCoreApplication, does + * not return. */ void start(); - private slots: + private Q_SLOTS: + + //! Kill all added processes void killProcesses(); private: - QList gconfItems; - QStringList processNames; - + + QStringList m_processNames; + QList > m_gConfItems; }; -#endif +#endif // BOOSTERKILLER_H