diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-03-27 12:12:28 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2017-06-01 11:01:05 +0300 |
commit | b7fa50be4c8f84f78bd9c3e6912df91897fc9442 (patch) | |
tree | 5ea3f7f66c68b9ac612ec3380fa545bb7b6a7d09 | |
parent | 42751f87d922939f7ebf502b25d6ca70dd814f35 (diff) |
Set proper application name, icon name for freedesktop notifications
Use application name defined in OEM build configuration
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | OWNCLOUD.cmake | 1 | ||||
-rw-r--r-- | config.h.in | 1 | ||||
-rw-r--r-- | src/gui/CMakeLists.txt | 18 | ||||
-rw-r--r-- | src/gui/systray.cpp | 5 |
5 files changed, 17 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 20a0de8be..978b35347 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,10 @@ endif() find_package(ZLIB) +if (NOT DEFINED APPLICATION_ICON_NAME) + set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME}) +endif() + configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) configure_file(test/test_journal.db "${CMAKE_BINARY_DIR}/test/test_journal.db" COPYONLY) diff --git a/OWNCLOUD.cmake b/OWNCLOUD.cmake index 4022212e6..1a818a4d0 100644 --- a/OWNCLOUD.cmake +++ b/OWNCLOUD.cmake @@ -3,6 +3,7 @@ set( APPLICATION_EXECUTABLE "owncloud" ) set( APPLICATION_DOMAIN "owncloud.com" ) set( APPLICATION_VENDOR "ownCloud" ) set( APPLICATION_UPDATE_URL "https://updates.owncloud.com/client/" CACHE string "URL for updater" ) +set( APPLICATION_ICON_NAME "owncloud" ) set( THEME_CLASS "ownCloudTheme" ) set( APPLICATION_REV_DOMAIN "com.owncloud.desktopclient" ) diff --git a/config.h.in b/config.h.in index 1e8f8ecdc..0cc0ab9cd 100644 --- a/config.h.in +++ b/config.h.in @@ -17,6 +17,7 @@ #cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@" #cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@" #cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@" +#cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@" #cmakedefine ZLIB_FOUND @ZLIB_FOUND@ diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 5ebf0effc..603abea7a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -221,15 +221,13 @@ endif() include( AddAppIconMacro ) set(ownCloud_old ${ownCloud}) -# set an icon_app_name. For historical reasons we can not use the -# application_shortname for ownCloud but must rather set it manually. -if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake ) - set(ICON_APP_NAME ${APPLICATION_SHORTNAME}) -else() - set(ICON_APP_NAME "owncloud") +# For historical reasons we can not use the application_shortname +# for ownCloud but must rather set it manually. +if (NOT DEFINED APPLICATION_ICON_NAME) + set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME}) endif() -kde4_add_app_icon( ownCloud "${theme_dir}/colored/${ICON_APP_NAME}-icon*.png") +kde4_add_app_icon( ownCloud "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon*.png") list(APPEND final_src ${ownCloud}) set(ownCloud ${ownCloud_old}) @@ -243,11 +241,11 @@ endif() if(NOT BUILD_OWNCLOUD_OSX_BUNDLE) if(NOT WIN32) - file( GLOB _icons "${theme_dir}/colored/${ICON_APP_NAME}-icon-*.png" ) + file( GLOB _icons "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon-*.png" ) foreach( _file ${_icons} ) - string( REPLACE "${theme_dir}/colored/${ICON_APP_NAME}-icon-" "" _res ${_file} ) + string( REPLACE "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon-" "" _res ${_file} ) string( REPLACE ".png" "" _res ${_res} ) - install( FILES ${_file} RENAME ${ICON_APP_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps ) + install( FILES ${_file} RENAME ${APPLICATION_ICON_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps ) endforeach( _file ) endif(NOT WIN32) diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index af6e933cc..a380be35d 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -14,6 +14,7 @@ #include "systray.h" #include "theme.h" +#include "config.h" #ifdef USE_FDO_NOTIFICATIONS #include <QDBusConnection> @@ -30,8 +31,8 @@ namespace OCC { void Systray::showMessage(const QString &title, const QString &message, MessageIcon icon, int millisecondsTimeoutHint) { #ifdef USE_FDO_NOTIFICATIONS - if (QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) { - QList<QVariant> args = QList<QVariant>() << "owncloud" << quint32(0) << "owncloud" + if(QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) { + QList<QVariant> args = QList<QVariant>() << APPLICATION_NAME << quint32(0) << APPLICATION_ICON_NAME << title << message << QStringList() << QVariantMap() << qint32(-1); QDBusMessage method = QDBusMessage::createMethodCall(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE, "Notify"); method.setArguments(args); |