diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swift/QtUI/FreeDesktopNotifier.cpp | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swift/QtUI/FreeDesktopNotifier.cpp')
-rw-r--r-- | Swift/QtUI/FreeDesktopNotifier.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/Swift/QtUI/FreeDesktopNotifier.cpp b/Swift/QtUI/FreeDesktopNotifier.cpp index 54e0ccc..16f6a11 100644 --- a/Swift/QtUI/FreeDesktopNotifier.cpp +++ b/Swift/QtUI/FreeDesktopNotifier.cpp @@ -23,37 +23,37 @@ FreeDesktopNotifier::FreeDesktopNotifier(const std::string& name) : applicationN } void FreeDesktopNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picture, boost::function<void()>) { - QDBusConnection bus = QDBusConnection::sessionBus(); - if (!bus.isConnected()) { - return; - } - std::vector<Notifier::Type> defaultTypes = getDefaultTypes(); - if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) { - return; - } - - QString body = description.c_str(); - body = body.replace("&", "&"); - body = body.replace("<", "<"); - body = body.replace(">", ">"); - - int timeout = (type == IncomingMessage || type == SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS; - - QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "", "Notify"); - - QStringList actions; - QMap<QString, QVariant> hints; - hints["x-canonical-append"] = QString("allowed"); - msg << applicationName.c_str(); - msg << quint32(0); // ID of previous notification to replace - msg << P2QSTRING(pathToString(imageScaler.getScaledImage(picture, 48))); // Icon to display - msg << subject.c_str(); // Summary / Header of the message to display - msg << body; // Body of the message to display - msg << actions; // Actions from which the user may choose - msg << hints; // Hints to the server displaying the message - msg << qint32(timeout*1000); // Timeout in milliseconds - - bus.asyncCall(msg); + QDBusConnection bus = QDBusConnection::sessionBus(); + if (!bus.isConnected()) { + return; + } + std::vector<Notifier::Type> defaultTypes = getDefaultTypes(); + if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) { + return; + } + + QString body = description.c_str(); + body = body.replace("&", "&"); + body = body.replace("<", "<"); + body = body.replace(">", ">"); + + int timeout = (type == IncomingMessage || type == SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS; + + QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "", "Notify"); + + QStringList actions; + QMap<QString, QVariant> hints; + hints["x-canonical-append"] = QString("allowed"); + msg << applicationName.c_str(); + msg << quint32(0); // ID of previous notification to replace + msg << P2QSTRING(pathToString(imageScaler.getScaledImage(picture, 48))); // Icon to display + msg << subject.c_str(); // Summary / Header of the message to display + msg << body; // Body of the message to display + msg << actions; // Actions from which the user may choose + msg << hints; // Hints to the server displaying the message + msg << qint32(timeout*1000); // Timeout in milliseconds + + bus.asyncCall(msg); } } |