Skip to content

Commit

Permalink
Use GetServerInformation signature from version 1.2 of the spec
Browse files Browse the repository at this point in the history
Spec_version was still missing from 0.9 from 2006, but even that
had no empty string. No idea what the earlier signature was really
supposed to be.

Didn't find anything actually using this, but still nicer complying
with the standard.
  • Loading branch information
pvuorela committed Dec 12, 2017
1 parent e9c1cf3 commit e115bf3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/notifications/notificationmanager.cpp
Expand Up @@ -442,12 +442,13 @@ void NotificationManager::markNotificationDisplayed(uint id)
}
}

QString NotificationManager::GetServerInformation(QString &name, QString &vendor, QString &version)
QString NotificationManager::GetServerInformation(QString &vendor, QString &version, QString &spec_version)
{
name = qApp->applicationName();
QString name = qApp->applicationName();
vendor = "Nemo Mobile";
version = qApp->applicationVersion();
return QString();
spec_version = "1.2";
return name;
}

NotificationList NotificationManager::GetNotifications(const QString &owner)
Expand Down
6 changes: 3 additions & 3 deletions src/notifications/notificationmanager.h
Expand Up @@ -121,12 +121,12 @@ class LIPSTICK_EXPORT NotificationManager : public QObject, public QDBusContext
* This message returns the information on the server. Specifically, the server name, vendor,
* and version number.
*
* \param name The product name of the server.
* \param vendor The vendor name. For example, "KDE," "GNOME," "freedesktop.org," or "Microsoft."
* \param version The server's version number.
* \return an empty string
* \param spec_version The specification version the server is compliant with.
* \return The product name of the server
*/
QString GetServerInformation(QString &name, QString &vendor, QString &version);
QString GetServerInformation(QString &vendor, QString &version, QString &spec_version);

/*!
* Returns the notifications sent by a specified application.
Expand Down
2 changes: 1 addition & 1 deletion src/notifications/notificationmanager.xml
Expand Up @@ -21,10 +21,10 @@
<arg name="id" type="u" direction="in"/>
</method>
<method name="GetServerInformation">
<arg type="s" direction="out"/>
<arg name="name" type="s" direction="out"/>
<arg name="vendor" type="s" direction="out"/>
<arg name="version" type="s" direction="out"/>
<arg name="spec_version" type="s" direction="out"/>
</method>
<signal name="NotificationClosed">
<arg name="id" type="u"/>
Expand Down
5 changes: 3 additions & 2 deletions tests/ut_notificationmanager/ut_notificationmanager.cpp
Expand Up @@ -87,13 +87,14 @@ void Ut_NotificationManager::testRemovingInexistingNotification()
void Ut_NotificationManager::testServerInformation()
{
// Check that the server information uses application information from qApp
QString name, vendor, version;
QString name, vendor, version, spec_version;
qApp->setApplicationName("testApp");
qApp->setApplicationVersion("1.2.3");
NotificationManager::instance()->GetServerInformation(name, vendor, version);
name = NotificationManager::instance()->GetServerInformation(vendor, version, spec_version);
QCOMPARE(name, qApp->applicationName());
QCOMPARE(vendor, QString("Nemo Mobile"));
QCOMPARE(version, qApp->applicationVersion());
QCOMPARE(spec_version, QString("1.2"));
}

void Ut_NotificationManager::testModifyingCategoryDefinitionUpdatesNotifications()
Expand Down

0 comments on commit e115bf3

Please sign in to comment.