Skip to content

Commit b7fa50b

Browse files
juliusknorrguruz
authored andcommittedJun 1, 2017
Set proper application name, icon name for freedesktop notifications
Use application name defined in OEM build configuration
1 parent 42751f8 commit b7fa50b

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed
 

‎CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ endif()
178178

179179
find_package(ZLIB)
180180

181+
if (NOT DEFINED APPLICATION_ICON_NAME)
182+
set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME})
183+
endif()
184+
181185
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
182186

183187
configure_file(test/test_journal.db "${CMAKE_BINARY_DIR}/test/test_journal.db" COPYONLY)

‎OWNCLOUD.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set( APPLICATION_EXECUTABLE "owncloud" )
33
set( APPLICATION_DOMAIN "owncloud.com" )
44
set( APPLICATION_VENDOR "ownCloud" )
55
set( APPLICATION_UPDATE_URL "https://updates.owncloud.com/client/" CACHE string "URL for updater" )
6+
set( APPLICATION_ICON_NAME "owncloud" )
67

78
set( THEME_CLASS "ownCloudTheme" )
89
set( APPLICATION_REV_DOMAIN "com.owncloud.desktopclient" )

‎config.h.in

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
1818
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
1919
#cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@"
20+
#cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@"
2021

2122
#cmakedefine ZLIB_FOUND @ZLIB_FOUND@
2223

‎src/gui/CMakeLists.txt

+8-10
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,13 @@ endif()
221221
include( AddAppIconMacro )
222222
set(ownCloud_old ${ownCloud})
223223

224-
# set an icon_app_name. For historical reasons we can not use the
225-
# application_shortname for ownCloud but must rather set it manually.
226-
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
227-
set(ICON_APP_NAME ${APPLICATION_SHORTNAME})
228-
else()
229-
set(ICON_APP_NAME "owncloud")
224+
# For historical reasons we can not use the application_shortname
225+
# for ownCloud but must rather set it manually.
226+
if (NOT DEFINED APPLICATION_ICON_NAME)
227+
set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME})
230228
endif()
231229

232-
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${ICON_APP_NAME}-icon*.png")
230+
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon*.png")
233231
list(APPEND final_src ${ownCloud})
234232
set(ownCloud ${ownCloud_old})
235233

@@ -243,11 +241,11 @@ endif()
243241
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
244242

245243
if(NOT WIN32)
246-
file( GLOB _icons "${theme_dir}/colored/${ICON_APP_NAME}-icon-*.png" )
244+
file( GLOB _icons "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon-*.png" )
247245
foreach( _file ${_icons} )
248-
string( REPLACE "${theme_dir}/colored/${ICON_APP_NAME}-icon-" "" _res ${_file} )
246+
string( REPLACE "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon-" "" _res ${_file} )
249247
string( REPLACE ".png" "" _res ${_res} )
250-
install( FILES ${_file} RENAME ${ICON_APP_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps )
248+
install( FILES ${_file} RENAME ${APPLICATION_ICON_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps )
251249
endforeach( _file )
252250
endif(NOT WIN32)
253251

‎src/gui/systray.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "systray.h"
1616
#include "theme.h"
17+
#include "config.h"
1718

1819
#ifdef USE_FDO_NOTIFICATIONS
1920
#include <QDBusConnection>
@@ -30,8 +31,8 @@ namespace OCC {
3031
void Systray::showMessage(const QString &title, const QString &message, MessageIcon icon, int millisecondsTimeoutHint)
3132
{
3233
#ifdef USE_FDO_NOTIFICATIONS
33-
if (QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) {
34-
QList<QVariant> args = QList<QVariant>() << "owncloud" << quint32(0) << "owncloud"
34+
if(QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) {
35+
QList<QVariant> args = QList<QVariant>() << APPLICATION_NAME << quint32(0) << APPLICATION_ICON_NAME
3536
<< title << message << QStringList() << QVariantMap() << qint32(-1);
3637
QDBusMessage method = QDBusMessage::createMethodCall(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE, "Notify");
3738
method.setArguments(args);

0 commit comments

Comments
 (0)
Please sign in to comment.