From 39e70977cfd107ad8dbe7af1d65bef5bf9309db9 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Tue, 14 Jan 2014 12:51:46 +0100 Subject: [PATCH] const fix --- src/core/notification/notification.cpp | 4 ++-- src/core/notification/notification.h | 4 ++-- src/plugins/frontends/snarlnetwork/parser.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/notification/notification.cpp b/src/core/notification/notification.cpp index 6509042..1b88eb5 100644 --- a/src/core/notification/notification.cpp +++ b/src/core/notification/notification.cpp @@ -88,7 +88,7 @@ const Action &Notification::actionInvoked() const return d->m_actionInvoked; } -Application Notification::application() const +const Application &Notification::application() const { return d->m_application; } @@ -103,7 +103,7 @@ QString Notification::text() const return d->m_text; } -Alert Notification::alert() const +const Alert &Notification::alert() const { return d->m_alert; } diff --git a/src/core/notification/notification.h b/src/core/notification/notification.h index 1ffe821..265aee4 100644 --- a/src/core/notification/notification.h +++ b/src/core/notification/notification.h @@ -54,11 +54,11 @@ public: const uint &updateID() const; const Action &actionInvoked() const; - Application application() const; + const Application &application() const; QString title() const; QString text() const; const Icon &icon() const; - Alert alert() const; + const Alert &alert() const; void setSticky(); bool sticky() const; const NotificationEnums::Prioritys::prioritys &priority() const; diff --git a/src/plugins/frontends/snarlnetwork/parser.cpp b/src/plugins/frontends/snarlnetwork/parser.cpp index 7683e2f..58c7a59 100644 --- a/src/plugins/frontends/snarlnetwork/parser.cpp +++ b/src/plugins/frontends/snarlnetwork/parser.cpp @@ -115,13 +115,13 @@ SnarlNotification Parser::parse(QString &msg,QTcpSocket* client){ Application app; Alert alert; - if(snarl->m_applications.contains(value)) + if(snarl->m_applications.contains(appName)) { - app = snarl->m_applications[value]; + app = snarl->m_applications[appName]; } else { - app = Application(value, icon); + app = Application(appName, icon); } if(app.alerts().contains(alertName)) @@ -169,7 +169,7 @@ SnarlNotification Parser::parse(QString &msg,QTcpSocket* client){ qDebug()<<"Error registering alert with empty name"; break; } - sNotification.notification.application().addAlert(sNotification.notification.alert()); + snarl->m_applications[appName].addAlert(sNotification.notification.alert()); break; case REGISTER: if(sNotification.notification.application().isValid() && !snarl->m_applications.contains(sNotification.notification.application().name()))