aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/General/kdenotify/CMakeLists.txt3
-rw-r--r--src/plugins/General/kdenotify/kdenotify.cpp2
-rw-r--r--src/plugins/General/kdenotify/kdenotify.pro2
-rw-r--r--src/plugins/Ui/skinned/CMakeLists.txt3
-rw-r--r--src/plugins/Ui/skinned/skinned.pro1
-rw-r--r--src/plugins/Ui/skinned/skinnedfactory.cpp2
-rw-r--r--src/plugins/Ui/skinned/skinnedsettings.cpp2
-rw-r--r--src/plugins/Ui/skinned/skinreader.cpp2
-rw-r--r--src/qmmp/CMakeLists.txt1
-rw-r--r--src/qmmp/qmmp.cpp11
-rw-r--r--src/qmmp/qmmp.h6
-rw-r--r--src/qmmp/qmmp.pro1
12 files changed, 21 insertions, 15 deletions
diff --git a/src/plugins/General/kdenotify/CMakeLists.txt b/src/plugins/General/kdenotify/CMakeLists.txt
index 7aa9e20df..173abdda7 100644
--- a/src/plugins/General/kdenotify/CMakeLists.txt
+++ b/src/plugins/General/kdenotify/CMakeLists.txt
@@ -7,8 +7,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp)
-SET(libkdenotify_DEFINES APP_NAME_SUFFIX="${APP_NAME_SUFFIX}")
-
SET(libkdenotify_SRCS
kdenotify.cpp
kdenotifyfactory.cpp
@@ -32,7 +30,6 @@ QT5_WRAP_UI(libkdenotify_UIS_H ${libkdenotify_UIS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
ADD_LIBRARY(kdenotify MODULE ${libkdenotify_SRCS} ${libkdenotify_RCC_SRCS} ${libkdenotify_UIS_H})
-SET_TARGET_PROPERTIES(kdenotify PROPERTIES COMPILE_DEFINITIONS "${libkdenotify_DEFINES}")
add_dependencies(kdenotify libqmmpui)
target_link_libraries(kdenotify Qt5::Widgets Qt5::DBus libqmmpui libqmmp)
install(TARGETS kdenotify DESTINATION ${PLUGIN_DIR}/General)
diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp
index bbd384ff7..782a0dce3 100644
--- a/src/plugins/General/kdenotify/kdenotify.cpp
+++ b/src/plugins/General/kdenotify/kdenotify.cpp
@@ -60,7 +60,7 @@ KdeNotify::KdeNotify(QObject *parent) : QObject(parent),m_useFreedesktopSpec(fal
dir.mkdir("kdenotifycache");
dir.cd("kdenotifycache");
m_coverPath = dir.absolutePath() + "/cover.jpg";
- m_imagesDir = QDir(qApp->applicationDirPath () + "/../share/qmmp" APP_NAME_SUFFIX "/images").absolutePath();
+ m_imagesDir = Qmmp::dataPath() + "/images";
QSettings settings(Qmmp::configFile(),QSettings::IniFormat);
settings.beginGroup("Kde_Notifier");
diff --git a/src/plugins/General/kdenotify/kdenotify.pro b/src/plugins/General/kdenotify/kdenotify.pro
index 1e8261633..9dcc165d9 100644
--- a/src/plugins/General/kdenotify/kdenotify.pro
+++ b/src/plugins/General/kdenotify/kdenotify.pro
@@ -7,8 +7,6 @@ TARGET = $$PLUGINS_PREFIX/General/kdenotify
QT += dbus
-DEFINES += APP_NAME_SUFFIX=\\\"$$APP_NAME_SUFFIX\\\"
-
SOURCES += kdenotifyfactory.cpp \
kdenotify.cpp \
settingsdialog.cpp
diff --git a/src/plugins/Ui/skinned/CMakeLists.txt b/src/plugins/Ui/skinned/CMakeLists.txt
index fe0756103..6e2e14da7 100644
--- a/src/plugins/Ui/skinned/CMakeLists.txt
+++ b/src/plugins/Ui/skinned/CMakeLists.txt
@@ -5,8 +5,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp)
-SET(libskinned_DEFINES APP_NAME_SUFFIX="${APP_NAME_SUFFIX}")
-
# X11
include_directories(${X11_INCLUDE_DIRS})
link_directories(${X11_LIBRARY_DIRS})
@@ -99,7 +97,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
IF(X11_FOUND)
ADD_LIBRARY(skinned MODULE ${skinned_SRCS} ${skinned_UIS_H} ${skinned_RCC_SRCS} ${skinned_HDRS})
-SET_TARGET_PROPERTIES(skinned PROPERTIES COMPILE_DEFINITIONS "${libskinned_DEFINES}")
add_dependencies(skinned libqmmpui libqmmp)
target_link_libraries(skinned Qt5::Widgets Qt5::X11Extras libqmmpui libqmmp ${X11_LDFLAGS})
install(TARGETS skinned DESTINATION ${PLUGIN_DIR}/Ui)
diff --git a/src/plugins/Ui/skinned/skinned.pro b/src/plugins/Ui/skinned/skinned.pro
index ce56009aa..9c0d0e354 100644
--- a/src/plugins/Ui/skinned/skinned.pro
+++ b/src/plugins/Ui/skinned/skinned.pro
@@ -122,7 +122,6 @@ RESOURCES = resources/resources.qrc \
LIBS += $$QMMPUI_LIB
unix {
- DEFINES += APP_NAME_SUFFIX=\\\"$$APP_NAME_SUFFIX\\\"
target.path = $$PLUGIN_DIR/Ui
scripts.files = scripts/kwin.sh
scripts.path = $$DATA_DIR/qmmp$${APP_NAME_SUFFIX}/scripts
diff --git a/src/plugins/Ui/skinned/skinnedfactory.cpp b/src/plugins/Ui/skinned/skinnedfactory.cpp
index 0b75008c0..e56500772 100644
--- a/src/plugins/Ui/skinned/skinnedfactory.cpp
+++ b/src/plugins/Ui/skinned/skinnedfactory.cpp
@@ -42,7 +42,7 @@ QObject *SkinnedFactory::SkinnedFactory::create()
#ifdef QMMP_WS_X11
if(qgetenv("XDG_CURRENT_DESKTOP") == "KDE")
{
- QString kwinScript = qApp->applicationDirPath () + "/../share/qmmp" APP_NAME_SUFFIX "/scripts/kwin.sh";
+ QString kwinScript = Qmmp::dataPath() + "/scripts/kwin.sh";
if(!QFile::exists(kwinScript))
kwinScript = qApp->applicationDirPath() + "/../src/plugins/Ui/skinned/kwin.sh";
if(QFile::exists(kwinScript))
diff --git a/src/plugins/Ui/skinned/skinnedsettings.cpp b/src/plugins/Ui/skinned/skinnedsettings.cpp
index 9be3671d4..953205680 100644
--- a/src/plugins/Ui/skinned/skinnedsettings.cpp
+++ b/src/plugins/Ui/skinned/skinnedsettings.cpp
@@ -201,7 +201,7 @@ void SkinnedSettings::loadSkins()
#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
findSkins(qApp->applicationDirPath()+"/skins");
#else
- findSkins(qApp->applicationDirPath()+"/../share/qmmp" APP_NAME_SUFFIX "/skins");
+ findSkins(Qmmp::dataPath());
#endif
foreach(QString path, m_reader->skins())
{
diff --git a/src/plugins/Ui/skinned/skinreader.cpp b/src/plugins/Ui/skinned/skinreader.cpp
index 011aae155..0494af7ea 100644
--- a/src/plugins/Ui/skinned/skinreader.cpp
+++ b/src/plugins/Ui/skinned/skinreader.cpp
@@ -52,7 +52,7 @@ void SkinReader::generateThumbs()
#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
dir.setPath(qApp->applicationDirPath()+"/skins");
#else
- dir.setPath(qApp->applicationDirPath()+"/../share/qmmp" APP_NAME_SUFFIX "/skins");
+ dir.setPath(Qmmp::dataPath());
#endif
dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
f << dir.entryInfoList();
diff --git a/src/qmmp/CMakeLists.txt b/src/qmmp/CMakeLists.txt
index 0c5fb1cc6..4a595f27d 100644
--- a/src/qmmp/CMakeLists.txt
+++ b/src/qmmp/CMakeLists.txt
@@ -4,6 +4,7 @@ ADD_DEFINITIONS(-DQMMP_LIBRARY)
SET(libqmmp_DEFINES
LIB_DIR="/${LIB_DIR}"
QMMP_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
+ APP_NAME_SUFFIX="${APP_NAME_SUFFIX}"
)
IF(NOT QMMP_VERSION_STABLE) #add svn revision
diff --git a/src/qmmp/qmmp.cpp b/src/qmmp/qmmp.cpp
index 5b0cabbf5..337936bed 100644
--- a/src/qmmp/qmmp.cpp
+++ b/src/qmmp/qmmp.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2018 by Ilya Kotov *
+ * Copyright (C) 2008-2019 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -145,6 +145,15 @@ void Qmmp::setUiLanguageID(const QString &code)
m_langID.clear();
}
+QString Qmmp::dataPath()
+{
+#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
+ return qApp->applicationDirPath();
+#else
+ return QDir(qApp->applicationDirPath() + "/../share/qmmp" APP_NAME_SUFFIX).absolutePath();
+#endif
+}
+
#ifdef Q_OS_WIN
bool Qmmp::isPortable()
{
diff --git a/src/qmmp/qmmp.h b/src/qmmp/qmmp.h
index 9567ee457..c9bd11159 100644
--- a/src/qmmp/qmmp.h
+++ b/src/qmmp/qmmp.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2018 by Ilya Kotov *
+ * Copyright (C) 2008-2019 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -177,6 +177,10 @@ public:
* @param code Language code; code "auto" means autodetection.
*/
static void setUiLanguageID(const QString &code);
+ /*!
+ * Returns a directory location where persistent application data can be stored.
+ */
+ static QString dataPath();
#ifdef Q_OS_WIN
/*!
* Returns \b true if portable mode is enabled. Otherwise returns \b false.
diff --git a/src/qmmp/qmmp.pro b/src/qmmp/qmmp.pro
index 040044131..1a3c55f15 100644
--- a/src/qmmp/qmmp.pro
+++ b/src/qmmp/qmmp.pro
@@ -108,6 +108,7 @@ win32 {
}
unix {
+ DEFINES += APP_NAME_SUFFIX=\\\"$$APP_NAME_SUFFIX\\\"
target.path = $$LIB_DIR
devel.files += \
abstractengine.h \