@@ -60,8 +60,8 @@ NotifyClient::NotifyClient(QObject* parent)
6060 if (! QDBusConnection::sessionBus ().isConnected () )
6161 qCritical (" CMST - Cannot connect to the session bus." );
6262
63- // Signals and slots
64- connect (qApp, SIGNAL (aboutToQuit ()), this , SLOT (cleanUp ()));
63+ // Signals and slots
64+ connect (qApp, SIGNAL (aboutToQuit ()), this , SLOT (cleanUp ()));
6565
6666 return ;
6767}
@@ -82,7 +82,7 @@ void NotifyClient::connectToServer()
8282 getCapabilities ();
8383 QDBusConnection::sessionBus ().connect (DBUS_NOTIFY_SERVICE, DBUS_NOTIFY_PATH, DBUS_NOTIFY_INTERFACE, " NotificationClosed" , this , SLOT (notificationClosed (quint32, quint32)));
8484 QDBusConnection::sessionBus ().connect (DBUS_NOTIFY_SERVICE, DBUS_NOTIFY_PATH, DBUS_NOTIFY_INTERFACE, " ActionInvoked" , this , SLOT (actionInvoked (quint32, QString)));
85- } // if connection is valid
85+ } // if connection is valid
8686 else {
8787 notifyclient->deleteLater ();
8888 b_validconnection = false ;
@@ -174,46 +174,46 @@ void NotifyClient::sendNotification ()
174174 QTemporaryFile* tempfileicon = NULL ;
175175 if (! s_icon.isEmpty () ) {
176176 if (QFile::exists (s_icon) ) {
177- tempfileicon = new QTemporaryFile (this );
178- tempfileicon->setAutoRemove (false );
179- if (tempfileicon->open () ) {
180- QPixmap px = QPixmap (s_icon);
181- px.save (tempfileicon->fileName ()," PNG" );
182- app_icon = tempfileicon->fileName ().prepend (" file://" );
183- } // if tempfileicon could be opened
177+ tempfileicon = new QTemporaryFile (this );
178+ tempfileicon->setAutoRemove (false );
179+ if (tempfileicon->open () ) {
180+ QPixmap px = QPixmap (s_icon);
181+ px.save (tempfileicon->fileName ()," PNG" );
182+ app_icon = tempfileicon->fileName ().prepend (" file://" );
183+ } // if tempfileicon could be opened
184184 } // if s_icon exists as a disk file
185185
186186 // assume s_icon exists as a theme icon, don't check it here. That
187187 // check needs to be done in the calling program.
188188 else app_icon = s_icon;
189189 } // if s_icon is not empty
190-
191- QDBusReply<quint32> reply = notifyclient->call (QLatin1String (" Notify" ), app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout);
192190
191+ QDBusReply<quint32> reply = notifyclient->call (QLatin1String (" Notify" ), app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout);
193192 if (reply.isValid () ) {
194- current_id = reply.value ();
193+ current_id = reply.value ();
195194 if (file_map.contains (current_id) && tempfileicon != NULL ) {
196- if (b_overwrite) {
197- file_map.value (current_id)->remove ();
198- delete file_map.value (current_id);
199- file_map.remove (current_id);
200- } // if
201- else {
202- tempfileicon->remove ();
203- delete tempfileicon;
204- tempfileicon = NULL ;
205- } // else
206- } // if contains current_id and not NULL
207- if (tempfileicon != NULL ) file_map[current_id] = tempfileicon;
208- } // if reply is valid
195+ if (b_overwrite) {
196+ file_map.value (current_id)->remove ();
197+ delete file_map.value (current_id);
198+ file_map.remove (current_id);
199+ } // if
200+ else {
201+ tempfileicon->remove ();
202+ delete tempfileicon;
203+ tempfileicon = NULL ;
204+ } // else
205+ } // if contains current_id and not NULL
206+ if (tempfileicon != NULL ) file_map[current_id] = tempfileicon;
207+ } // if reply is valid
209208
210- else
211- #if QT_VERSION >= 0x050400
212- qCritical (" CMST - Error reply received to the Notify method: %s" , qUtf8Printable (reply.error ().message ()) );
209+ else {
210+ #if QT_VERSION >= 0x050400
211+ qCritical (" CMST - Error reply received to the Notify method: %s" , qUtf8Printable (reply.error ().message ()) );
213212 #else
214213 qCritical (" CMST - Error reply received to the Notify method: %s" , qPrintable (reply.error ().message ()) );
215214 #endif
216-
215+ }
216+
217217 return ;
218218}
219219
0 commit comments