diff --git a/CMakeLists.txt b/CMakeLists.txt index 22ea9a0..be3800a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ if(Boost_USE_STATIC_RUNTIME) endif(Boost_USE_STATIC_RUNTIME) set(PLUGIN_INSTALL_PATH LIBRARY DESTINATION bin/snoreplugins) +add_definitions(-DLIBSNORE_PLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/bin/snoreplugins") add_subdirectory(data) add_subdirectory(share) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 68b639c..be1e80a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -15,8 +15,7 @@ add_subdirectory(notification) set ( SnoreNotify_SRCS ${SnoreNotify_SRCS} snoreserver.cpp application.cpp - interface.cpp - trayiconnotifer.cpp + interface.cpp ${CMAKE_CURRENT_BINARY_DIR}/version.cpp ) @@ -25,7 +24,7 @@ set ( SnoreNotify_HDR ${SnoreNotify_HDR} application.h interface.h snore_exports.h - version.h + version.h ) automoc4_add_library( snorecore SHARED ${SnoreNotify_SRCS}) diff --git a/src/core/interface.cpp b/src/core/interface.cpp index 129db73..7bc5843 100644 --- a/src/core/interface.cpp +++ b/src/core/interface.cpp @@ -22,6 +22,23 @@ namespace Snore{ +SnorePluginInfo::type SnorePluginInfo::typeFromString(const QString &t){ + if(t == QLatin1String("backend")) + return BACKEND; + if(t == QLatin1String("frontend")) + return FRONTEND; + return PLUGIN; +} + +const QStringList &SnorePluginInfo::types(){ + static QStringList *list =NULL; + if(list == NULL){ + list = new QStringList(); + *list<<"backend"<<"frontend"<<"plugin"; + } + return *list; +} + SnorePlugin::SnorePlugin ( QString name ) : m_name ( name ), m_initialized(false) @@ -99,7 +116,7 @@ bool Notification_Backend::init( SnoreServer *snore ) connect( snore,SIGNAL( applicationInitialized( Snore::Application* ) ),this,SLOT( registerApplication( Snore::Application* ) ) ); connect( snore,SIGNAL( applicationRemoved( Snore::Application* ) ),this,SLOT( unregisterApplication( Snore::Application* ) ) ); if(!isPrimaryNotificationBackend()) - connect( snore,SIGNAL( notify(Snore::Notification) ),this,SLOT( notify( Snore::Notification ) ) ); + connect( snore,SIGNAL( notify(Snore::Notification) ),this,SLOT( notify( Snore::Notification ) ) ); foreach(Application *a,snore->aplications()){ this->registerApplication(a); diff --git a/src/core/interface.h b/src/core/interface.h index 9bdd306..a6d70c4 100644 --- a/src/core/interface.h +++ b/src/core/interface.h @@ -25,6 +25,20 @@ namespace Snore{ class Application; class SnoreServer; +class SNORE_EXPORT SnorePluginInfo{ +public: + enum type{ + BACKEND, + FRONTEND, + PLUGIN + }; + QString pluginFile; + QString pluginName; + type pluginType; + static type typeFromString(const QString &t); + static const QStringList &types(); +}; + class SNORE_EXPORT SnorePlugin:public QObject { Q_OBJECT @@ -40,7 +54,7 @@ protected: QHash activeNotifications; void startTimeout(uint id,int timeout); private slots: - void notificationTimedOut(); + void notificationTimedOut(); private: SnorePlugin() {} diff --git a/src/core/snoreserver.cpp b/src/core/snoreserver.cpp index de55dd2..2f6b585 100644 --- a/src/core/snoreserver.cpp +++ b/src/core/snoreserver.cpp @@ -16,7 +16,6 @@ #include "snoreserver.h" #include "notification/notification.h" -#include "trayiconnotifer.h" #include "version.h" #include @@ -26,9 +25,12 @@ #include #include #include +#include namespace Snore{ +QMap SnoreServer::m_pluginCache = QMap() ; + QString const SnoreServer::version(){ return QString().append(Version::major()).append(".").append(Version::minor()).append(Version::suffix()); } @@ -40,8 +42,8 @@ QString const SnoreServer::snoreTMP(){ SnoreServer::SnoreServer ( QSystemTrayIcon *trayIcon ) : - m_notificationBackend ( NULL ), - m_trayIcon ( trayIcon ) + m_notificationBackend ( NULL ), + m_trayIcon ( trayIcon ) { QDir home ( snoreTMP() ); if ( !home.exists() ){ @@ -49,48 +51,108 @@ SnoreServer::SnoreServer ( QSystemTrayIcon *trayIcon ) : home.mkdir("SnoreNotify"); } - if ( trayIcon!=NULL ) - { - publicatePlugin ( new TrayIconNotifer ( trayIcon ) ); +} + +QMap SnoreServer::pluginCache(const QString &pluginPath){ + if(!m_pluginCache.isEmpty()) + return m_pluginCache; + QSettings cache(SnoreServer::pluginDir(pluginPath).absoluteFilePath("plugin.cache"),QSettings::IniFormat); + int size = cache.beginReadArray("plugins"); + if(size == 0) + return updatePluginCache(pluginPath); + + + for(int i=0;i< m_pluginCache.size();++i) { + cache.setArrayIndex(i); + SnorePluginInfo *info = new SnorePluginInfo(); + info->pluginFile = cache.value("fileName").toString(); + info->pluginName = cache.value("name").toString(); + info->pluginType = (SnorePluginInfo::type)cache.value("type").toInt(); + m_pluginCache[info->pluginName] = info; + } + cache.endArray(); + + return m_pluginCache; +} + +QMap SnoreServer::updatePluginCache(const QString &pluginPath){ + QSettings cache(SnoreServer::pluginDir(pluginPath).absoluteFilePath("plugin.cache"),QSettings::IniFormat); + qDebug()<<"Updating plugin cache"<(plugin); + if(sp == NULL){ + qDebug()<<"Error:"<deleteLater(); + continue; + } + SnorePluginInfo *info = new SnorePluginInfo(); + info->pluginFile = SnoreServer::pluginDir(pluginPath).relativeFilePath(filepath); + info->pluginName = sp->name(); + info->pluginType = SnorePluginInfo::typeFromString(type); + m_pluginCache.insert(info->pluginName,info); + sp->deleteLater(); + qDebug()<<"added "<pluginFile<<"to cache"; + } } + qDebug()< plugins = m_pluginCache.values(); + cache.beginWriteArray("plugins"); + for(int i=0;i< plugins.size();++i) { + cache.setArrayIndex(i); + cache.setValue("fileName",plugins[i]->pluginFile); + cache.setValue("name", plugins[i]->pluginName); + cache.setValue("type",plugins[i]->pluginType); + } + cache.endArray(); + return m_pluginCache; } -void SnoreServer::publicatePlugin ( const QString &fileName ) + +const QDir &SnoreServer::pluginDir(const QString &pluginPath){ + static QDir *plDir = NULL; + if(plDir == NULL){ + if(!pluginPath.isEmpty()) + plDir = new QDir(pluginPath); + if(pluginPath.isEmpty() || plDir->exists()){ + plDir = new QDir(qApp->applicationDirPath()+"/snoreplugins"); + if(!plDir->exists()) + plDir = new QDir(LIBSNORE_PLUGIN_PATH); + } + } + return *plDir; +} + +void SnoreServer::publicatePlugin ( const SnorePluginInfo *info ) { - QPluginLoader loader ( fileName ); - qDebug()<<"Trying to load"<pluginFile )); + qDebug()<<"Trying to load"<pluginFile; if ( !loader.load()) { qDebug() <<"Failed loading plugin: "< ( loader.instance()); - if ( sp == NULL ) - { - std::cerr<<"Error:"<name() ); - - qDebug() <<"Loading plugin: "< ( plugin ); - if ( nb ) - { - qDebug() <pluginType){ + case SnorePluginInfo::BACKEND:{ + Notification_Backend * nb = qobject_cast ( loader.instance() ); + qDebug() <pluginName<<"is a Notification_Backend"; if ( nb->isPrimaryNotificationBackend() ) { - m_primaryNotificationBackends.append( pluginName); + m_primaryNotificationBackends.append( info->pluginName); if ( m_notificationBackend == NULL ) { m_notificationBackend = nb; @@ -100,18 +162,30 @@ void SnoreServer::publicatePlugin ( SnorePlugin *plugin ) nb->deleteLater(); return; } - } - m_notyfier.insert ( pluginName,nb ); - }else{ - Notification_Frontend * nf = qobject_cast ( plugin ); - if(nf != NULL){ - qDebug() <init( this )) - m_frontends.insert(nf->name(),nf); - else - nf->deleteLater(); - } + m_notyfier.insert ( info->pluginName,nb ); + } + break; + } + case SnorePluginInfo::FRONTEND:{ + Notification_Frontend * nf = qobject_cast (loader.instance()); + qDebug() <pluginName<<"is a Notification_Frontend"; + if(nf->init( this )) + m_frontends.insert(nf->name(),nf); + else + nf->deleteLater(); + break; + } + case SnorePluginInfo::PLUGIN:{ + SnorePlugin *plugin = qobject_cast ( loader.instance()); + plugin->init(this); + m_plugins.insert ( info->pluginName ,plugin ); + qDebug() <pluginName<<"is a SnorePlugin"; + break; + } + default: + std::cerr<<"Plugin Cache corrupted"<name(),application ); + m_applications.insert ( application->name(),application ); } void SnoreServer::applicationIsInitialized ( Application *application ) @@ -161,13 +235,13 @@ void SnoreServer::applicationIsInitialized ( Application *application ) void SnoreServer::removeApplication ( const QString& appName ) { qDebug()<<"Remove Application"<deleteLater(); + emit applicationRemoved ( m_applications.value ( appName ) ); + m_applications.take ( appName )->deleteLater(); } const ApplicationsList &SnoreServer::aplications() const { - return _applications; + return m_applications; } @@ -190,6 +264,10 @@ const QString &SnoreServer::primaryNotificationBackend(){ return m_notificationBackend->name(); } +QSystemTrayIcon *SnoreServer::trayIcon(){ + return m_trayIcon; +} + } #include "snoreserver.moc" diff --git a/src/core/snoreserver.h b/src/core/snoreserver.h index 8e0d808..1a8e8e7 100644 --- a/src/core/snoreserver.h +++ b/src/core/snoreserver.h @@ -23,20 +23,21 @@ #include class QSystemTrayIcon; +class QDir; namespace Snore{ - class SNORE_EXPORT SnoreServer:public QObject { Q_OBJECT public: static const QString version(); static const QString snoreTMP(); + static QMap pluginCache(const QString &pluginPath = QString()); + static QMap updatePluginCache(const QString &pluginPath = QString()); public: SnoreServer (QSystemTrayIcon *trayIcon=0 ); - void publicatePlugin ( const QString &fileName ); - void publicatePlugin ( SnorePlugin *plugin ); + void publicatePlugin ( const SnorePluginInfo *info ); uint broadcastNotification ( Notification notification ); @@ -51,11 +52,16 @@ public: const QStringList &primaryNotificationBackends() const; void setPrimaryNotificationBackend ( const QString &backend ); const QString &primaryNotificationBackend(); + QSystemTrayIcon *trayIcon(); private: - ApplicationsList _applications; + static const QDir &pluginDir(const QString &pluginPath); + + + static QMap m_pluginCache; + ApplicationsList m_applications; QHash m_notyfier; @@ -64,7 +70,7 @@ private: Notification_Backend * m_notificationBackend; QHash m_plugins; - class QSystemTrayIcon *m_trayIcon; + QSystemTrayIcon *m_trayIcon; signals: diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 089750c..af0ea37 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,6 +1,11 @@ set(CMAKE_SHARED_MODULE_PREFIX) +set(SNORE_BACKEND_INSTALL_PATH ${PLUGIN_INSTALL_PATH}/backend) +set(SNORE_FRONTEND_INSTALL_PATH ${PLUGIN_INSTALL_PATH}/frontend) +set(SNORE_PLUGINS_INSTALL_PATH ${PLUGIN_INSTALL_PATH}/plugin) + add_subdirectory(freedesktopnotification) add_subdirectory(freedesktopfrontend) add_subdirectory(snarlnetwork) add_subdirectory(snarl) add_subdirectory(growl) +add_subdirectory(trayicon) diff --git a/src/plugins/freedesktopfrontend/CMakeLists.txt b/src/plugins/freedesktopfrontend/CMakeLists.txt index 858ea8d..78c132e 100644 --- a/src/plugins/freedesktopfrontend/CMakeLists.txt +++ b/src/plugins/freedesktopfrontend/CMakeLists.txt @@ -27,7 +27,8 @@ if(QT_QTDBUS_FOUND AND WITH_FREEDESKTOP_FRONTEND) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Notifications.service DESTINATION share/dbus-1/services/) - install(TARGETS freedesktop_frontend ${PLUGIN_INSTALL_PATH}) + install(TARGETS freedesktop_frontend ${SNORE_FRONTEND_INSTALL_PATH}) + endif(QT_QTDBUS_FOUND AND WITH_FREEDESKTOP_FRONTEND) diff --git a/src/plugins/freedesktopnotification/CMakeLists.txt b/src/plugins/freedesktopnotification/CMakeLists.txt index 985ff2a..82e7b8c 100644 --- a/src/plugins/freedesktopnotification/CMakeLists.txt +++ b/src/plugins/freedesktopnotification/CMakeLists.txt @@ -7,6 +7,6 @@ if(QT_QTDBUS_FOUND AND NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE) automoc4_add_library(freedesktop_backend MODULE ${FREEDESKTOP_NOTIFICATION_SRC} ) target_link_libraries(freedesktop_backend snorecore ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} ) - install(TARGETS freedesktop_backend ${PLUGIN_INSTALL_PATH}) + install(TARGETS freedesktop_backend ${SNORE_BACKEND_INSTALL_PATH}) endif(QT_QTDBUS_FOUND AND NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE) diff --git a/src/plugins/growl/CMakeLists.txt b/src/plugins/growl/CMakeLists.txt index db1299b..d5f049d 100644 --- a/src/plugins/growl/CMakeLists.txt +++ b/src/plugins/growl/CMakeLists.txt @@ -24,7 +24,7 @@ if( WITH_GROWL_BACKEND ) target_link_libraries(growl_backend pthread) endif(UNIX) - install(TARGETS growl_backend ${PLUGIN_INSTALL_PATH}) + install(TARGETS growl_backend ${SNORE_BACKEND_INSTALL_PATH}) else(CRYPTOPP_LIBRARIES AND Boost_SYSTEM_LIBRARY) if(NOT CRYPTOPP_LIBRARIES) message(STATUS "Cant build the growl backend because the dependency Cryptopp is missing") diff --git a/src/plugins/snarl/CMakeLists.txt b/src/plugins/snarl/CMakeLists.txt index 78b59e7..019d2ab 100644 --- a/src/plugins/snarl/CMakeLists.txt +++ b/src/plugins/snarl/CMakeLists.txt @@ -7,6 +7,6 @@ if(WIN32) automoc4_add_library(snarln_backend MODULE ${SNARL__SRC} ) target_link_libraries(snarln_backend snorecore ${QT_QTCORE_LIBRARY} ) - install(TARGETS snarln_backend ${PLUGIN_INSTALL_PATH}) + install(TARGETS snarln_backend ${SNORE_BACKEND_INSTALL_PATH}) endif(WIN32) diff --git a/src/plugins/snarlnetwork/CMakeLists.txt b/src/plugins/snarlnetwork/CMakeLists.txt index db64a7a..3bd39f1 100644 --- a/src/plugins/snarlnetwork/CMakeLists.txt +++ b/src/plugins/snarlnetwork/CMakeLists.txt @@ -6,4 +6,4 @@ set( SNARL_NETWORK_SRC automoc4_add_library(snarlnetwork MODULE ${SNARL_NETWORK_SRC} ) target_link_libraries(snarlnetwork snorecore ${QT_QTNETWORK_LIBRARY} ) -install(TARGETS snarlnetwork ${PLUGIN_INSTALL_PATH}) +install(TARGETS snarlnetwork ${SNORE_FRONTEND_INSTALL_PATH}) diff --git a/src/plugins/trayicon/CMakeLists.txt b/src/plugins/trayicon/CMakeLists.txt new file mode 100644 index 0000000..1a83101 --- /dev/null +++ b/src/plugins/trayicon/CMakeLists.txt @@ -0,0 +1,7 @@ +set( trayicon_SRC + trayiconnotifer.cpp + ) +automoc4_add_library(trayicon_backend MODULE ${trayicon_SRC} ) +target_link_libraries(trayicon_backend snorecore ${QT_QTCORE_LIBRARY} ) + +install(TARGETS trayicon_backend ${SNORE_BACKEND_INSTALL_PATH}) diff --git a/src/plugins/trayicon/CMakeLists.txt~ b/src/plugins/trayicon/CMakeLists.txt~ new file mode 100644 index 0000000..d890594 --- /dev/null +++ b/src/plugins/trayicon/CMakeLists.txt~ @@ -0,0 +1,10 @@ + + set( trayicon_SRC + trayiconnotifer.cpp + ) + automoc4_add_library(trayicon_backend MODULE ${trayicon_SRC} ) + target_link_libraries(trayicon_backend snorecore ${QT_QTCORE_LIBRARY} ) + + install(TARGETS snarln_backend ${SNORE_BACKEND_INSTALL_PATH}) + +endif(WIN32) diff --git a/src/core/trayiconnotifer.cpp b/src/plugins/trayicon/trayiconnotifer.cpp similarity index 51% rename from src/core/trayiconnotifer.cpp rename to src/plugins/trayicon/trayiconnotifer.cpp index 3584839..f96e495 100644 --- a/src/core/trayiconnotifer.cpp +++ b/src/plugins/trayicon/trayiconnotifer.cpp @@ -1,20 +1,29 @@ #include "trayiconnotifer.h" -#include "snoreserver.h" +#include "core/snoreserver.h" +#include #include #include #include #include using namespace Snore; +Q_EXPORT_PLUGIN2(trayicon_backend,TrayIconNotifer) -TrayIconNotifer::TrayIconNotifer ( QSystemTrayIcon *icon ) : +TrayIconNotifer::TrayIconNotifer () : Notification_Backend ( "SystemTray" ), - _trayIcon ( icon ), - _id ( 0 ), - _displayed(-1) + m_id ( 0 ), + m_displayed(-1) { - connect(_trayIcon,SIGNAL(messageClicked()),this,SLOT(actionInvoked())); + +} + +bool TrayIconNotifer::init(SnoreServer *snore){ + connect(m_trayIcon,SIGNAL(messageClicked()),this,SLOT(actionInvoked())); + m_trayIcon = snore->trayIcon(); + if(m_trayIcon == NULL) + return false; + return Notification_Backend::init(snore); } void TrayIconNotifer::registerApplication ( Application *application ) @@ -28,11 +37,11 @@ void TrayIconNotifer::unregisterApplication ( Application *application ) uint TrayIconNotifer::notify ( Notification notification ) { - _notificationQue.append(notification); - if(_lastNotify.elapsed()> Notification::DefaultTimeout * 1000){ + m_notificationQue.append(notification); + if(m_lastNotify.elapsed()> Notification::DefaultTimeout * 1000){ displayNotification(); } - return _id++; + return m_id++; } void TrayIconNotifer::closeNotification ( Notification notification ) @@ -46,31 +55,31 @@ bool TrayIconNotifer::isPrimaryNotificationBackend() } void TrayIconNotifer::displayNotification(){ - qDebug()<<"Display"<<_notificationQue.size(); - Notification notification = _notificationQue.takeFirst(); - if(!_notificationQue.isEmpty()){ + qDebug()<<"Display"<showMessage ( Notification::toPlainText(notification.title()),Notification::toPlainText(notification.text()),QSystemTrayIcon::NoIcon,notification.timeout() *1000 ); - _lastNotify.restart(); + m_trayIcon->showMessage ( Notification::toPlainText(notification.title()),Notification::toPlainText(notification.text()),QSystemTrayIcon::NoIcon,notification.timeout() *1000 ); + m_lastNotify.restart(); } void TrayIconNotifer::closeNotification(){ - if(activeNotifications.contains(_displayed)){ - Notification noti = activeNotifications.take(_displayed); + if(activeNotifications.contains(m_displayed)){ + Notification noti = activeNotifications.take(m_displayed); snore()->closeNotification(noti,NotificationEnums::CloseReasons::TIMED_OUT); } displayNotification(); } void TrayIconNotifer::actionInvoked(){ - qDebug()<<"Traicon invoked"<<_displayed; - if(activeNotifications.contains(_displayed)){ - Notification noti = activeNotifications.take(_displayed); + qDebug()<<"Traicon invoked"<notificationActionInvoked(noti); diff --git a/src/core/trayiconnotifer.h b/src/plugins/trayicon/trayiconnotifer.h similarity index 64% rename from src/core/trayiconnotifer.h rename to src/plugins/trayicon/trayiconnotifer.h index 65a275b..d1cc97e 100644 --- a/src/core/trayiconnotifer.h +++ b/src/plugins/trayicon/trayiconnotifer.h @@ -1,17 +1,23 @@ #ifndef TRAYICONNOTIFER_H #define TRAYICONNOTIFER_H -#include "interface.h" -#include "notification/notification.h" +#include "core/interface.h" #include +namespace Snore{ + class SnoreServer; +} + +class QSystemTrayIcon; + class TrayIconNotifer:public Snore::Notification_Backend { Q_OBJECT Q_INTERFACES(Snore::Notification_Backend) public: - TrayIconNotifer (class QSystemTrayIcon *icon=0 ); + TrayIconNotifer (); + virtual bool init(Snore::SnoreServer *snore); bool isPrimaryNotificationBackend(); public slots: @@ -21,11 +27,11 @@ public slots: void closeNotification ( Snore::Notification notification ); private: - class QSystemTrayIcon *_trayIcon; - QList _notificationQue; - QTime _lastNotify; - uint _id; - uint _displayed; + QSystemTrayIcon *m_trayIcon; + QList m_notificationQue; + QTime m_lastNotify; + uint m_id; + uint m_displayed; private slots: void displayNotification(); diff --git a/src/snorenotify.cpp b/src/snorenotify.cpp index 9efd4a3..a45e7de 100644 --- a/src/snorenotify.cpp +++ b/src/snorenotify.cpp @@ -27,49 +27,49 @@ #include #include +#include using namespace Snore; SnoreNotify::SnoreNotify(): - _settings("TheOneRing","SnoreNotify") + m_settings("TheOneRing","SnoreNotify") { - _trayIcon = new TrayIcon(); - _snore = new Snore::SnoreServer(_trayIcon->trayIcon()); + m_trayIcon = new TrayIcon(); + m_snore = new Snore::SnoreServer(m_trayIcon->trayIcon()); - QDir pluginsDir ( qApp->applicationDirPath() +"/snoreplugins" ); - foreach ( QString fileName, pluginsDir.entryList ( QDir::Files ) ) + QMap plugins = SnoreServer::pluginCache(); + foreach ( SnorePluginInfo *info, plugins.values()) { - _snore->publicatePlugin ( pluginsDir.absoluteFilePath ( fileName ) ); + m_snore->publicatePlugin ( info ); } load(); - - _trayIcon->initConextMenu(_snore); + m_trayIcon->initConextMenu(m_snore); connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(exit())); } SnoreNotify::~SnoreNotify(){ - delete _snore; - delete _trayIcon; + delete m_snore; + delete m_trayIcon; } void SnoreNotify::load(){ - _snore->setPrimaryNotificationBackend(_settings.value("notificationBackend").toString()); + m_snore->setPrimaryNotificationBackend(m_settings.value("notificationBackend").toString()); } void SnoreNotify::save(){ - _settings.setValue("notificationBackend",_snore->primaryNotificationBackend()); + m_settings.setValue("notificationBackend",m_snore->primaryNotificationBackend()); } void SnoreNotify::exit(){ qDebug()<<"Saving snore settings"; - foreach(Application *a,_snore->aplications()){ - _snore->removeApplication(a->name()); + foreach(Application *a,m_snore->aplications()){ + m_snore->removeApplication(a->name()); } save(); - _trayIcon->hide(); + m_trayIcon->hide(); } diff --git a/src/snorenotify.h b/src/snorenotify.h index 695fa17..1adb479 100644 --- a/src/snorenotify.h +++ b/src/snorenotify.h @@ -20,7 +20,7 @@ #include namespace Snore{ - class SnoreServer; +class SnoreServer; } class SnoreNotify:public QObject @@ -28,14 +28,14 @@ class SnoreNotify:public QObject Q_OBJECT public: SnoreNotify(); - ~SnoreNotify(); - void load(); - void save(); + ~SnoreNotify(); + void load(); + void save(); private: - class TrayIcon *_trayIcon; - Snore::SnoreServer *_snore; - class QSettings _settings; + class TrayIcon *m_trayIcon; + Snore::SnoreServer *m_snore; + class QSettings m_settings; private slots: void exit();