[plasma-framework] /: Install all plasma files in a prefix/share/plasma directory
Aleix Pol
aleixpol at kde.org
Sun Apr 27 15:30:11 UTC 2014
Git commit e6f1fec0c77ef2bf692fbc382001a9d90971a4d6 by Aleix Pol.
Committed on 27/04/2014 at 15:14.
Pushed by apol into branch 'master'.
Install all plasma files in a prefix/share/plasma directory
At the moment, we could say that plasma is co-installable by chance,
it's only working because KF5 dropped the apps relative directory.
This change introduces a PLASMA_RELATIVE_DATA_INSTALL_DIR that will
be available to know where in share the components are and
PLASMA_DATA_INSTALL_DIR to know where data has to be installed to.
Reviewed by David Edmundson
CCMAIL: plasma-devel at kde.org
M +6 -5 KF5PlasmaMacros.cmake
M +1 -1 examples/containments/CMakeLists.txt
M +1 -1 examples/kpart/CMakeLists.txt
M +1 -1 examples/wallpapers/CMakeLists.txt
M +1 -3 src/declarativeimports/plasmaextracomponents/appbackgroundprovider.cpp
M +8 -8 src/desktoptheme/air/CMakeLists.txt
M +1 -1 src/desktoptheme/breeze-dark/CMakeLists.txt
M +8 -8 src/desktoptheme/breeze/CMakeLists.txt
M +6 -6 src/desktoptheme/oxygen/CMakeLists.txt
M +3 -3 src/plasma/CMakeLists.txt
M +2 -0 src/plasma/config-plasma.h.cmake
M +2 -1 src/plasma/dataengine.cpp
M +5 -5 src/plasma/private/packages.cpp
M +23 -20 src/plasma/private/theme_p.cpp
M +1 -0 src/plasma/private/theme_p.h
M +1 -1 src/plasma/service.cpp
M +5 -0 src/plasma/theme.cpp
M +2 -0 src/plasma/theme.h
M +23 -21 src/plasmapkg/plasmapkg.cpp
M +4 -3 src/plasmaquick/private/packages.cpp
M +2 -1 src/platformstatus/platformstatus.cpp
M +2 -2 src/scriptengines/python/CMakeLists.txt
M +1 -1 src/scriptengines/ruby/CMakeLists.txt
http://commits.kde.org/plasma-framework/e6f1fec0c77ef2bf692fbc382001a9d90971a4d6
diff --git a/KF5PlasmaMacros.cmake b/KF5PlasmaMacros.cmake
index 8a2c36a..fddd8d6 100644
--- a/KF5PlasmaMacros.cmake
+++ b/KF5PlasmaMacros.cmake
@@ -2,6 +2,8 @@
find_package(ECM 0.0.9 CONFIG REQUIRED)
include(KDEInstallDirs)
+set(PLASMA_RELATIVE_DATA_INSTALL_DIR "plasma")
+set(PLASMA_DATA_INSTALL_DIR "${DATA_INSTALL_DIR}/${PLASMA_RELATIVE_DATA_INSTALL_DIR}")
# plasma_install_package(path componentname [root] [type])
#
@@ -9,26 +11,25 @@ include(KDEInstallDirs)
# @arg path The source path to install from, location of metadata.desktop
# @arg componentname The plugin name of the component, corresponding to the
# X-KDE-PluginInfo-Name key in metadata.desktop
-# @arg root The subdirectory to install to, default: plasma/plasmoids
-# @arg root The subdirectory to install to, default: plasma/plasmoids
+# @arg root The subdirectory to install to, default: plasmoids
# @arg type The type, default to applet, or applet, package, containment,
# wallpaper, shell, lookandfeel, etc.
# @see Types column in plasmapkg --list-types
#
# Examples:
# plasma_install_package(mywidget org.kde.plasma.mywidget) # installs an applet
-# plasma_install_package(declarativetoolbox org.kde.toolbox plasma/packages package) # installs a generic package
+# plasma_install_package(declarativetoolbox org.kde.toolbox packages package) # installs a generic package
#
macro(plasma_install_package dir component)
set(root ${ARGV2})
set(type ${ARGV3})
if(NOT root)
- set(root plasma/plasmoids)
+ set(root plasmoids)
endif()
if(NOT type)
set(type applet)
endif()
- install(DIRECTORY ${dir}/ DESTINATION ${DATA_INSTALL_DIR}/${root}/${component} PATTERN .svn EXCLUDE PATTERN CMakeLists.txt EXCLUDE PATTERN Messages.sh EXCLUDE)
+ install(DIRECTORY ${dir}/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/${root}/${component} PATTERN .svn EXCLUDE PATTERN CMakeLists.txt EXCLUDE PATTERN Messages.sh EXCLUDE)
install(FILES ${dir}/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-${type}-${component}.desktop)
endmacro()
diff --git a/examples/containments/CMakeLists.txt b/examples/containments/CMakeLists.txt
index c456fcc..aa52568 100644
--- a/examples/containments/CMakeLists.txt
+++ b/examples/containments/CMakeLists.txt
@@ -1,2 +1,2 @@
-plasma_install_package(testcontainment org.kde.example.testcontainment plasma/plasmoids containment)
\ No newline at end of file
+plasma_install_package(testcontainment org.kde.example.testcontainment plasmoids containment)
diff --git a/examples/kpart/CMakeLists.txt b/examples/kpart/CMakeLists.txt
index eb01a94..ff62817 100644
--- a/examples/kpart/CMakeLists.txt
+++ b/examples/kpart/CMakeLists.txt
@@ -12,6 +12,6 @@ target_link_libraries(plasma-example-kpart-shell KF5::Plasma KF5::Parts)
########### install files ###############
install(TARGETS plasma-example-kpart-shell ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} )
-install( PROGRAMS plasma-example-kpart-shell.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+install( PROGRAMS plasma-example-kpart-shell.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install(FILES plasma-default-layoutrc DESTINATION ${DATA_INSTALL_DIR}/plasma-example-kpart-shell/)
install( FILES plasma-kpart-shellui.rc DESTINATION ${DATA_INSTALL_DIR}/plasma-example-kpart-shell/ )
diff --git a/examples/wallpapers/CMakeLists.txt b/examples/wallpapers/CMakeLists.txt
index 132ee61..1eb8318 100644
--- a/examples/wallpapers/CMakeLists.txt
+++ b/examples/wallpapers/CMakeLists.txt
@@ -1,2 +1,2 @@
-plasma_install_package(autumn org.kde.autumn plasma/wallpapers wallpaper)
\ No newline at end of file
+plasma_install_package(autumn org.kde.autumn wallpapers wallpaper)
diff --git a/src/declarativeimports/plasmaextracomponents/appbackgroundprovider.cpp b/src/declarativeimports/plasmaextracomponents/appbackgroundprovider.cpp
index d807009..ea3e2e0 100644
--- a/src/declarativeimports/plasmaextracomponents/appbackgroundprovider.cpp
+++ b/src/declarativeimports/plasmaextracomponents/appbackgroundprovider.cpp
@@ -41,8 +41,6 @@ QImage AppBackgroundProvider::requestImage(const QString &id, QSize *size, const
{
Q_UNUSED(size)
Q_UNUSED(requestedSize)
- QString search = QLatin1Literal("desktoptheme/") % m_theme->themeName() % QLatin1Literal("/appbackgrounds/") % id % ".png";
- search = QStandardPaths::locate(QStandardPaths::GenericDataLocation, search);
- return QImage(search);
+ return QImage(m_theme->backgroundPath(id % ".png"));
}
diff --git a/src/desktoptheme/air/CMakeLists.txt b/src/desktoptheme/air/CMakeLists.txt
index 1128dd7..40ea382 100644
--- a/src/desktoptheme/air/CMakeLists.txt
+++ b/src/desktoptheme/air/CMakeLists.txt
@@ -1,24 +1,24 @@
-install(FILES colors metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/)
+install(FILES colors metadata.desktop DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/)
FILE(GLOB widgets widgets/*.svgz)
-install( FILES ${widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/widgets/ )
+install( FILES ${widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/widgets/ )
FILE(GLOB dialogs dialogs/*.svgz)
-install( FILES ${dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/dialogs/ )
+install( FILES ${dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/dialogs/ )
FILE(GLOB opaque_dialogs opaque/dialogs/*.svgz)
-install( FILES ${opaque_dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/opaque/dialogs/ )
+install( FILES ${opaque_dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/opaque/dialogs/ )
FILE(GLOB opaque_widgets opaque/widgets/*.svgz)
-install( FILES ${opaque_widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/opaque/widgets/ )
+install( FILES ${opaque_widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/opaque/widgets/ )
FILE(GLOB translucent_widgets translucent/widgets/*.svgz)
-install( FILES ${translucent_widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/translucent/widgets/ )
+install( FILES ${translucent_widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/translucent/widgets/ )
FILE(GLOB translucent_dialogs translucent/dialogs/*.svgz)
-install( FILES ${translucent_dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/translucent/dialogs/ )
+install( FILES ${translucent_dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/translucent/dialogs/ )
FILE(GLOB icons icons/*.svgz)
-install( FILES ${icons} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/air/icons/ )
+install( FILES ${icons} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/air/icons/ )
diff --git a/src/desktoptheme/breeze-dark/CMakeLists.txt b/src/desktoptheme/breeze-dark/CMakeLists.txt
index 7f63739..be08cd2 100644
--- a/src/desktoptheme/breeze-dark/CMakeLists.txt
+++ b/src/desktoptheme/breeze-dark/CMakeLists.txt
@@ -1,2 +1,2 @@
-install(FILES colors metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/breeze-dark/)
+install(FILES colors metadata.desktop DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/breeze-dark/)
diff --git a/src/desktoptheme/breeze/CMakeLists.txt b/src/desktoptheme/breeze/CMakeLists.txt
index 8f2f22f..2e28287 100644
--- a/src/desktoptheme/breeze/CMakeLists.txt
+++ b/src/desktoptheme/breeze/CMakeLists.txt
@@ -1,24 +1,24 @@
-install(FILES colors metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/)
+install(FILES colors metadata.desktop DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/)
FILE(GLOB widgets widgets/*.svgz)
-install( FILES ${widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/widgets/ )
+install( FILES ${widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/widgets/ )
FILE(GLOB dialogs dialogs/*.svgz)
-install( FILES ${dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/dialogs/ )
+install( FILES ${dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/dialogs/ )
FILE(GLOB opaque_dialogs opaque/dialogs/*.svgz)
-install( FILES ${opaque_dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/opaque/dialogs/ )
+install( FILES ${opaque_dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/opaque/dialogs/ )
FILE(GLOB opaque_widgets opaque/widgets/*.svgz)
-install( FILES ${opaque_widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/opaque/widgets/ )
+install( FILES ${opaque_widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/opaque/widgets/ )
FILE(GLOB translucent_widgets translucent/widgets/*.svgz)
-install( FILES ${translucent_widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/translucent/widgets/ )
+install( FILES ${translucent_widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/translucent/widgets/ )
FILE(GLOB translucent_dialogs translucent/dialogs/*.svgz)
-install( FILES ${translucent_dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/translucent/dialogs/ )
+install( FILES ${translucent_dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/translucent/dialogs/ )
FILE(GLOB icons icons/*.svgz)
-install( FILES ${icons} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/icons/ )
+install( FILES ${icons} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/default/icons/ )
diff --git a/src/desktoptheme/oxygen/CMakeLists.txt b/src/desktoptheme/oxygen/CMakeLists.txt
index 548ce20..7854234 100644
--- a/src/desktoptheme/oxygen/CMakeLists.txt
+++ b/src/desktoptheme/oxygen/CMakeLists.txt
@@ -1,18 +1,18 @@
-install(FILES colors metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/oxygen/)
+install(FILES colors metadata.desktop DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/oxygen/)
FILE(GLOB widgets widgets/*.svgz)
-install( FILES ${widgets} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/oxygen/widgets/ )
+install( FILES ${widgets} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/oxygen/widgets/ )
FILE(GLOB dialogs dialogs/*.svgz)
-install( FILES ${dialogs} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/oxygen/dialogs/ )
+install( FILES ${dialogs} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/oxygen/dialogs/ )
FILE(GLOB opaque opaque/widgets/*.svgz)
-install( FILES ${opaque} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/oxygen/opaque/widgets/ )
+install( FILES ${opaque} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/oxygen/opaque/widgets/ )
FILE(GLOB opaque opaque/dialogs/*.svgz)
-install( FILES ${opaque} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/oxygen/opaque/dialogs/ )
+install( FILES ${opaque} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/oxygen/opaque/dialogs/ )
FILE(GLOB icons ../air/icons/*.svgz)
-install( FILES ${icons} DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/oxygen/icons/ )
+install( FILES ${icons} DESTINATION ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/oxygen/icons/ )
diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt
index bfcb598..a027a34 100644
--- a/src/plasma/CMakeLists.txt
+++ b/src/plasma/CMakeLists.txt
@@ -200,9 +200,9 @@ install(FILES
data/servicetypes/plasma-lookandfeel.desktop
DESTINATION ${SERVICETYPES_INSTALL_DIR})
-install(FILES data/operations/dataengineservice.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services)
-install(FILES data/operations/plasmoidservice.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services)
-install(FILES data/operations/storage.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services)
+install(FILES data/operations/dataengineservice.operations DESTINATION ${PLASMA_DATA_INSTALL_DIR}/services)
+install(FILES data/operations/plasmoidservice.operations DESTINATION ${PLASMA_DATA_INSTALL_DIR}/services)
+install(FILES data/operations/storage.operations DESTINATION ${PLASMA_DATA_INSTALL_DIR}/services)
install(TARGETS KF5Plasma EXPORT KF5PlasmaTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/plasma/config-plasma.h.cmake b/src/plasma/config-plasma.h.cmake
index 1d59ae3..ed14e7a 100644
--- a/src/plasma/config-plasma.h.cmake
+++ b/src/plasma/config-plasma.h.cmake
@@ -4,3 +4,5 @@
#cmakedefine01 HAVE_X11
#cmakedefine01 HAVE_GLX
#cmakedefine01 HAVE_EGL
+
+#define PLASMA_RELATIVE_DATA_INSTALL_DIR "@PLASMA_RELATIVE_DATA_INSTALL_DIR@"
diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp
index a4bfdda..8969ff8 100644
--- a/src/plasma/dataengine.cpp
+++ b/src/plasma/dataengine.cpp
@@ -45,6 +45,7 @@
#include "private/datacontainer_p.h"
#include "private/service_p.h"
#include "private/storage_p.h"
+#include "config-plasma.h"
namespace Plasma
{
@@ -430,7 +431,7 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info)
if (!api.isEmpty()) {
const QString path =
QStandardPaths::locate(QStandardPaths::GenericDataLocation,
- "plasma/dataengines/" + dataEngineDescription.pluginName() + '/',
+ PLASMA_RELATIVE_DATA_INSTALL_DIR "/dataengines/" + dataEngineDescription.pluginName() + '/',
QStandardPaths::LocateDirectory);
package = new Package(PluginLoader::self()->loadPackage("Plasma/DataEngine", api));
package->setPath(path);
diff --git a/src/plasma/private/packages.cpp b/src/plasma/private/packages.cpp
index d2ead64..fa0fc6a 100644
--- a/src/plasma/private/packages.cpp
+++ b/src/plasma/private/packages.cpp
@@ -79,7 +79,7 @@ void GenericPackage::initPackage(Package *package)
package->setContentsPrefixPaths(platform);
}
- package->setDefaultPackageRoot("plasma/packages/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/packages/");
package->addDirectoryDefinition("images", "images", i18n("Images"));
package->addDirectoryDefinition("theme", "theme", i18n("Themed Images"));
@@ -109,7 +109,7 @@ void PlasmoidPackage::initPackage(Package *package)
{
GenericPackage::initPackage(package);
package->setServicePrefix("plasma-applet-");
- package->setDefaultPackageRoot("plasma/plasmoids/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/");
package->addFileDefinition("configmodel", "config/config.qml", i18n("Configuration UI pages model"));
package->addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
@@ -124,7 +124,7 @@ void DataEnginePackage::initPackage(Package *package)
{
ChangeableMainScriptPackage::initPackage(package);
package->setServicePrefix("plasma-dataengine-");
- package->setDefaultPackageRoot("plasma/dataengines/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/dataengines/");
package->addDirectoryDefinition("data", "data", i18n("Data Files"));
@@ -238,12 +238,12 @@ void ThemePackage::initPackage(Package *package)
void ContainmentActionsPackage::initPackage(Package *package)
{
ChangeableMainScriptPackage::initPackage(package);
- package->setDefaultPackageRoot("plasma/containmentactions/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/containmentactions/");
}
void ShellPackage::initPackage(Plasma::Package *package)
{
- package->setDefaultPackageRoot("plasma/shells/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/");
//Directories
package->addDirectoryDefinition("applet", "applet", i18n("Applets furniture"));
diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp
index 6fd7382..640318f 100644
--- a/src/plasma/private/theme_p.cpp
+++ b/src/plasma/private/theme_p.cpp
@@ -146,9 +146,10 @@ bool ThemePrivate::useCache()
if (!themeMetadataPath.isEmpty()) {
KDirWatch::self()->removeFile(themeMetadataPath);
}
- themeMetadataPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % themeName % QLatin1Literal("/metadata.desktop"));
-
if (isRegularTheme) {
+ themeMetadataPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % themeName % QLatin1Literal("/metadata.desktop"));
+
+ Q_ASSERT(!themeMetadataPath.isEmpty() || themeName.isEmpty());
const QString cacheFileBase = cacheFile + QStringLiteral("*.kcache");
QString currentCacheFileName;
@@ -236,6 +237,12 @@ void ThemePrivate::onAppExitCleanup()
cacheTheme = false;
}
+QString ThemePrivate::imagePath(const QString& theme, const QString& type, const QString& image)
+{
+ QString subdir = QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % type % image;
+ return QStandardPaths::locate(QStandardPaths::GenericDataLocation, subdir);
+}
+
QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bool cache)
{
if (cache) {
@@ -245,23 +252,20 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo
}
}
- QString search;
-
+ QString type;
if (locolor) {
- search = QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/locolor/") % image;
- search = QStandardPaths::locate(QStandardPaths::GenericDataLocation, search);
+ type = QStringLiteral("/locolor/");
} else if (!compositingActive) {
- search = QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/opaque/") % image;
- search = QStandardPaths::locate(QStandardPaths::GenericDataLocation, search);
+ type = QStringLiteral("/opaque/");
} else if (KWindowEffects::isEffectAvailable(KWindowEffects::BlurBehind)) {
- search = QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/translucent/") % image;
- search = QStandardPaths::locate(QStandardPaths::GenericDataLocation, search);
+ type = QStringLiteral("/translucent/");
}
+ QString search = imagePath(theme, type, image);
+
//not found or compositing enabled
if (search.isEmpty()) {
- search = QLatin1Literal("desktoptheme/") % theme % QLatin1Char('/') % image;
- search = QStandardPaths::locate(QStandardPaths::GenericDataLocation, search);
+ search = imagePath(theme, QStringLiteral("/"), image);
}
if (cache && !search.isEmpty()) {
@@ -567,15 +571,14 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
return;
}
}
- qDebug() << tempThemeName;
// we have one special theme: essentially a dummy theme used to cache things with
// the system colors.
bool realTheme = theme != systemColorsTheme;
if (realTheme) {
- QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Char('/'));
+ QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Char('/'));
if (themePath.isEmpty() && themeName.isEmpty()) {
- themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("desktoptheme/default"), QStandardPaths::LocateDirectory);
+ themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/default"), QStandardPaths::LocateDirectory);
if (themePath.isEmpty()) {
return;
@@ -593,7 +596,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
themeName = theme;
// load the color scheme config
- const QString colorsFile = realTheme ? QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/colors"))
+ const QString colorsFile = realTheme ? QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/colors"))
: QString();
//qDebug() << "we're going for..." << colorsFile << "*******************";
@@ -613,12 +616,12 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window, colors);
buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button, colors);
viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View, colors);
- const QString wallpaperPath = QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/wallpapers/");
+ const QString wallpaperPath = QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/wallpapers/");
hasWallpapers = !QStandardPaths::locate(QStandardPaths::GenericDataLocation, wallpaperPath, QStandardPaths::LocateDirectory).isEmpty();
// load the wallpaper settings, if any
if (realTheme) {
- const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
+ const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
KConfig metadata(metadataPath);
pluginInfo = KPluginInfo(metadataPath);
@@ -633,7 +636,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
while (!fallback.isEmpty() && !fallbackThemes.contains(fallback)) {
fallbackThemes.append(fallback);
- QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
+ QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
KConfig metadata(metadataPath);
KConfigGroup cg(&metadata, "Settings");
fallback = cg.readEntry("FallbackTheme", QString());
@@ -644,7 +647,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
}
foreach (const QString &theme, fallbackThemes) {
- QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
+ QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
KConfig metadata(metadataPath);
processWallpaperSettings(&metadata);
}
diff --git a/src/plasma/private/theme_p.h b/src/plasma/private/theme_p.h
index d0335d5..488c762 100644
--- a/src/plasma/private/theme_p.h
+++ b/src/plasma/private/theme_p.h
@@ -72,6 +72,7 @@ public:
KConfigGroup &config();
+ QString imagePath(const QString &theme, const QString &type, const QString &image);
QString findInTheme(const QString &image, const QString &theme, bool cache = true);
void discardCache(CacheTypes caches);
void scheduleThemeChangeNotification(CacheTypes caches);
diff --git a/src/plasma/service.cpp b/src/plasma/service.cpp
index 31502ec..5616904 100644
--- a/src/plasma/service.cpp
+++ b/src/plasma/service.cpp
@@ -199,7 +199,7 @@ void Service::registerOperationsScheme()
return;
}
- const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/services/" + d->name + ".operations");
+ const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, PLASMA_RELATIVE_DATA_INSTALL_DIR "/services/" + d->name + ".operations");
if (path.isEmpty()) {
#ifndef NDEBUG
diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp
index a3c27b9..a2b5713 100644
--- a/src/plasma/theme.cpp
+++ b/src/plasma/theme.cpp
@@ -199,6 +199,11 @@ QString Theme::imagePath(const QString &name) const
return path;
}
+QString Theme::backgroundPath(const QString& image) const
+{
+ return d->imagePath(themeName(), QLatin1Literal("/appbackgrounds/"), image);
+}
+
QString Theme::styleSheet(const QString &css) const
{
return d->processStyleSheet(css);
diff --git a/src/plasma/theme.h b/src/plasma/theme.h
index 0bf8898..2635b8b 100644
--- a/src/plasma/theme.h
+++ b/src/plasma/theme.h
@@ -487,6 +487,8 @@ public:
*/
Q_INVOKABLE QSizeF mSize(const QFont &font = QApplication::font()) const;
+ QString backgroundPath(const QString &image) const;
+
Q_SIGNALS:
/**
* Emitted when the user changes the theme. Stylesheet usage, colors, etc. should
diff --git a/src/plasmapkg/plasmapkg.cpp b/src/plasmapkg/plasmapkg.cpp
index 870420c..f21d461 100644
--- a/src/plasmapkg/plasmapkg.cpp
+++ b/src/plasmapkg/plasmapkg.cpp
@@ -45,6 +45,8 @@
#include <iostream>
#include <iomanip>
+#include "config-plasma.h"
+
static QTextStream cout(stdout);
namespace Plasma
@@ -189,18 +191,18 @@ void PlasmaPkg::runMain()
if (type.compare(i18nc("package type", "plasmoid"), Qt::CaseInsensitive) == 0 ||
type.compare("plasmoid", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/plasmoids/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/";
d->servicePrefix = "plasma-applet-";
d->pluginTypes << "Plasma/Applet";
d->pluginTypes << "Plasma/Containment";
} else if (type.compare(i18nc("package type", "package"), Qt::CaseInsensitive) == 0 /*||
type.compare("theme", Qt::CaseInsensitive) == 0*/) {
- d->packageRoot = "plasma/packages/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/packages/";
d->servicePrefix = "plasma-package-";
d->pluginTypes << "Plasma/Generic";
} else if (type.compare(i18nc("package type", "theme"), Qt::CaseInsensitive) == 0 ||
type.compare("theme", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "desktoptheme/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/";
d->pluginTypes << "Plasma/Theme";
} else if (type.compare(i18nc("package type", "wallpaper"), Qt::CaseInsensitive) == 0 ||
type.compare("wallpaper", Qt::CaseInsensitive) == 0) {
@@ -209,32 +211,32 @@ void PlasmaPkg::runMain()
d->servicePrefix = "plasma-wallpaper-";
} else if (type.compare(i18nc("package type", "dataengine"), Qt::CaseInsensitive) == 0 ||
type.compare("dataengine", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/dataengines/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/dataengines/";
d->servicePrefix = "plasma-dataengine-";
d->pluginTypes << "Plasma/DataEngine";
} else if (type.compare(i18nc("package type", "runner"), Qt::CaseInsensitive) == 0 ||
type.compare("runner", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/runners/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/runners/";
d->servicePrefix = "plasma-runner-";
d->pluginTypes << "Plasma/Runner";
} else if (type.compare(i18nc("package type", "wallpaperplugin"), Qt::CaseInsensitive) == 0 ||
type.compare("wallpaperplugin", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/wallpapers/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/wallpapers/";
d->servicePrefix = "plasma-wallpaper-";
d->pluginTypes << "Plasma/Wallpaper";
} else if (type.compare(i18nc("package type", "lookandfeel"), Qt::CaseInsensitive) == 0 ||
type.compare("lookandfeel", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/look-and-feel/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/look-and-feel/";
d->servicePrefix = "plasma-lookandfeel-";
d->pluginTypes << "Plasma/LookAndFeel";
} else if (type.compare(i18nc("package type", "shell"), Qt::CaseInsensitive) == 0 ||
type.compare("shell", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/shells/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/";
d->servicePrefix = "plasma-shell-";
d->pluginTypes << "Plasma/Shell";
} else if (type.compare(i18nc("package type", "layout-template"), Qt::CaseInsensitive) == 0 ||
type.compare("layout-template", Qt::CaseInsensitive) == 0) {
- d->packageRoot = "plasma/layout-templates/";
+ d->packageRoot = PLASMA_RELATIVE_DATA_INSTALL_DIR "/layout-templates/";
d->servicePrefix = "plasma-layout-";
d->pluginTypes << "Plasma/LayoutTemplate";
} else if (type.compare(i18nc("package type", "kwineffect"), Qt::CaseInsensitive) == 0 ||
@@ -396,7 +398,7 @@ QStringList PlasmaPkgPrivate::packages(const QStringList &types)
foreach (const QString &type, types) {
if (type.compare("Plasma/Generic", Qt::CaseInsensitive) == 0) {
- const QStringList &packs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "plasma/packages/", QStandardPaths::LocateDirectory);
+ const QStringList &packs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, PLASMA_RELATIVE_DATA_INSTALL_DIR "/packages/", QStandardPaths::LocateDirectory);
foreach (const QString &ppath, packs) {
const QDir cd(ppath);
const QStringList &entries = cd.entryList(QDir::Dirs);
@@ -426,7 +428,7 @@ QStringList PlasmaPkgPrivate::packages(const QStringList &types)
}
if (type.compare("Plasma/Theme", Qt::CaseInsensitive) == 0) {
- const QStringList &packs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "desktoptheme/", QStandardPaths::LocateDirectory);
+ const QStringList &packs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/", QStandardPaths::LocateDirectory);
foreach (const QString &ppath, packs) {
const QDir cd(ppath);
const QStringList &entries = cd.entryList(QDir::Dirs);
@@ -567,16 +569,16 @@ void PlasmaPkgPrivate::listTypes()
coutput(i18n("Built in:"));
QMap<QString, QStringList> builtIns;
- builtIns.insert(i18n("DataEngine"), QStringList() << "Plasma/DataEngine" << "plasma/dataengines/" << "dataengine");
- builtIns.insert(i18n("Layout Template"), QStringList() << "Plasma/LayoutTemplate" << "plasma/layout-templates/" << "layout-template");
- builtIns.insert(i18n("Look and Feel"), QStringList() << "Plasma/LookAndFeel" << "plasma/look-and-feel/" << "lookandfeel");
- builtIns.insert(i18n("Package"), QStringList() << "Plasma/Generic" << "plasma/packages/" << "package");
- builtIns.insert(i18n("Plasmoid"), QStringList() << "Plasma/Applet" << "plasma/plasmoids/" << "plasmoid");
- builtIns.insert(i18n("Runner"), QStringList() << "Plasma/Runner" << "plasma/runners/" << "runner");
- builtIns.insert(i18n("Shell"), QStringList() << "Plasma/Shell" << "plasma/shells/" << "shell");
- builtIns.insert(i18n("Theme"), QStringList() << "" << "desktoptheme/" << "theme");
+ builtIns.insert(i18n("DataEngine"), QStringList() << "Plasma/DataEngine" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/dataengines/" << "dataengine");
+ builtIns.insert(i18n("Layout Template"), QStringList() << "Plasma/LayoutTemplate" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/layout-templates/" << "layout-template");
+ builtIns.insert(i18n("Look and Feel"), QStringList() << "Plasma/LookAndFeel" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/look-and-feel/" << "lookandfeel");
+ builtIns.insert(i18n("Package"), QStringList() << "Plasma/Generic" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/packages/" << "package");
+ builtIns.insert(i18n("Plasmoid"), QStringList() << "Plasma/Applet" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/" << "plasmoid");
+ builtIns.insert(i18n("Runner"), QStringList() << "Plasma/Runner" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/runners/" << "runner");
+ builtIns.insert(i18n("Shell"), QStringList() << "Plasma/Shell" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/" << "shell");
+ builtIns.insert(i18n("Theme"), QStringList() << "" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/" << "theme");
builtIns.insert(i18n("Wallpaper Images"), QStringList() << "" << "wallpapers/" << "wallpaper");
- builtIns.insert(i18n("Animated Wallpaper"), QStringList() << "Plasma/Wallpaper" << "plasma/wallpapers/" << "wallpaperplugin");
+ builtIns.insert(i18n("Animated Wallpaper"), QStringList() << "Plasma/Wallpaper" << PLASMA_RELATIVE_DATA_INSTALL_DIR "/wallpapers/" << "wallpaperplugin");
builtIns.insert(i18n("KWin Effect"), QStringList() << "KWin/Effect" << "kwin/effects/" << "kwineffect");
builtIns.insert(i18n("KWin Window Switcher"), QStringList() << "KWin/WindowSwitcher" << "kwin/tabbox/" << "windowswitcher");
builtIns.insert(i18n("KWin Script"), QStringList() << "KWin/Script" << "kwin/scripts/" << "kwinscript");
@@ -607,7 +609,7 @@ void PlasmaPkgPrivate::listTypes()
renderTypeTable(plugins);
}
- QStringList desktopFiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "plasma/packageformats/*rc", QStandardPaths::LocateFile);
+ QStringList desktopFiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, PLASMA_RELATIVE_DATA_INSTALL_DIR "/packageformats/*rc", QStandardPaths::LocateFile);
if (!desktopFiles.isEmpty()) {
coutput(i18n("Provided by .desktop files:"));
diff --git a/src/plasmaquick/private/packages.cpp b/src/plasmaquick/private/packages.cpp
index 92216ff..0519584 100644
--- a/src/plasmaquick/private/packages.cpp
+++ b/src/plasmaquick/private/packages.cpp
@@ -26,12 +26,13 @@
#include <kdeclarative/kdeclarative.h>
#include <Plasma/Package>
+#include "../plasma/config-plasma.h"
void LookAndFeelPackage::initPackage(Plasma::Package *package)
{
// http://community.kde.org/Plasma/lookAndFeelPackage#
- package->setDefaultPackageRoot("plasma/look-and-feel/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/look-and-feel/");
//Defaults
package->addFileDefinition("defaults", "defaults", i18n("Default settings for theme, etc."));
@@ -97,7 +98,7 @@ void QmlWallpaperPackage::initPackage(Plasma::Package *package)
package->setContentsPrefixPaths(platform);
}
- package->setDefaultPackageRoot("plasma/wallpapers/");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/wallpapers/");
package->addDirectoryDefinition("images", "images", i18n("Images"));
package->addDirectoryDefinition("theme", "theme", i18n("Themed Images"));
@@ -126,7 +127,7 @@ void QmlWallpaperPackage::initPackage(Plasma::Package *package)
void LayoutTemplatePackage::initPackage(Plasma::Package *package)
{
package->setServicePrefix("plasma-layout-template");
- package->setDefaultPackageRoot("plasma/layout-templates");
+ package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/layout-templates");
package->addFileDefinition("mainscript", "layout.js", i18n("Main Script File"));
package->setRequired("mainscript", true);
}
diff --git a/src/platformstatus/platformstatus.cpp b/src/platformstatus/platformstatus.cpp
index 6c3e025..a605695 100644
--- a/src/platformstatus/platformstatus.cpp
+++ b/src/platformstatus/platformstatus.cpp
@@ -11,6 +11,7 @@
#include <qstandardpaths.h>
#include "platformstatusadaptor.h"
+#include "../plasma/config-plasma.h"
const char *defaultPackage = "org.kde.desktop";
@@ -35,7 +36,7 @@ void PlatformStatus::findShellPackage(bool sendSignal)
const QString package = group.readEntry("shellPackage", defaultPackage);
const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
- "plasma/shells/" + package + '/',
+ PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/" + package + '/',
QStandardPaths::LocateDirectory);
if (path.isEmpty()) {
if (package != defaultPackage) {
diff --git a/src/scriptengines/python/CMakeLists.txt b/src/scriptengines/python/CMakeLists.txt
index d9eef3d..b832005 100644
--- a/src/scriptengines/python/CMakeLists.txt
+++ b/src/scriptengines/python/CMakeLists.txt
@@ -3,8 +3,8 @@ project(plasma-python)
include(PythonMacros)
# install the library, .desktop, and plasma.py
-python_install(plasma_importer.py ${DATA_INSTALL_DIR}/plasma_scriptengine_python)
-python_install(pydataengine.py ${DATA_INSTALL_DIR}/plasma_scriptengine_python)
+python_install(plasma_importer.py ${PLASMA_DATA_INSTALL_DIR}/plasma_scriptengine_python)
+python_install(pydataengine.py ${PLASMA_DATA_INSTALL_DIR}/plasma_scriptengine_python)
# remove the following three lines once we branch 4.5, they are only necessary as long
# as people update kdebase but not yet kdelibs (PYTHON_SITE_PACKAGES_INSTALL_DIR has just
diff --git a/src/scriptengines/ruby/CMakeLists.txt b/src/scriptengines/ruby/CMakeLists.txt
index f040afc..9c36ceb 100644
--- a/src/scriptengines/ruby/CMakeLists.txt
+++ b/src/scriptengines/ruby/CMakeLists.txt
@@ -1,4 +1,4 @@
-install(FILES data_engine.rb DESTINATION ${DATA_INSTALL_DIR}/plasma_scriptengine_ruby)
+install(FILES data_engine.rb DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasma_scriptengine_ruby)
install(FILES plasma-scriptengine-ruby-dataengine.desktop DESTINATION ${SERVICES_INSTALL_DIR})
More information about the Plasma-devel
mailing list