diff --git a/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp b/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp index 2b846f224..0431a3b33 100644 --- a/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp +++ b/applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp @@ -33,6 +33,7 @@ #include #include "appletquickitem.h" +#include "config-workspace.h" namespace SystemTray { @@ -54,7 +55,7 @@ PlasmoidTask::PlasmoidTask(const QString &packageName, int appletId, Plasma::Con if (m_taskGraphicsObject) { Plasma::Package package = Plasma::PluginLoader::self()->loadPackage("Plasma/Shell"); - package.setDefaultPackageRoot("plasma/plasmoids/"); + package.setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/"); package.setPath("org.kde.plasma.systemtray"); m_taskGraphicsObject->setCoronaPackage(package); diff --git a/config-workspace.h.cmake b/config-workspace.h.cmake index 66c1d6359..f1a435a6d 100644 --- a/config-workspace.h.cmake +++ b/config-workspace.h.cmake @@ -156,4 +156,7 @@ /* type to use in place of socklen_t if not defined */ #define kde_socklen_t socklen_t -#define WORKSPACE_VERSION_STRING "${KDE4WORKSPACE_VERSION}" \ No newline at end of file +#define WORKSPACE_VERSION_STRING "${KDE4WORKSPACE_VERSION}" + +/** place where plasma-frameworks things are installed */ +#define PLASMA_RELATIVE_DATA_INSTALL_DIR "@PLASMA_RELATIVE_DATA_INSTALL_DIR@" diff --git a/dataengines/share/share_package.cpp b/dataengines/share/share_package.cpp index b8b72db11..13f41def3 100644 --- a/dataengines/share/share_package.cpp +++ b/dataengines/share/share_package.cpp @@ -22,6 +22,7 @@ #include #include "share_package.h" +#include "config-workspace.h" SharePackage::SharePackage(QObject *parent, QVariantList args) { @@ -36,7 +37,7 @@ void SharePackage::initPackage(Plasma::Package* package) package->setMimeTypes( "scripts", mimetypes ); package->addFileDefinition("mainscript", "code/main.js", i18n("Main Script File")); - package->setDefaultPackageRoot("plasma/shareprovider/"); + package->setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "shareprovider/"); package->setServicePrefix("plasma-share-"); } diff --git a/dataengines/share/shareservice.cpp b/dataengines/share/shareservice.cpp index f3c2dfaaa..8442b6634 100644 --- a/dataengines/share/shareservice.cpp +++ b/dataengines/share/shareservice.cpp @@ -28,7 +28,7 @@ #include "shareservice.h" #include "shareprovider.h" - +#include "config-workspace.h" ShareService::ShareService(ShareEngine *engine) : Plasma::Service(engine) @@ -68,7 +68,7 @@ void ShareJob::start() service->property("X-KDE-PluginInfo-Name", QVariant::String).toString(); const QString path = - KStandardDirs::locate("data", "plasma/shareprovider/" + pluginName + '/' ); + KStandardDirs::locate("data", PLASMA_RELATIVE_DATA_INSTALL_DIR "/shareprovider/" + pluginName + '/' ); if (path.isEmpty()) { showError(i18n("Invalid path for the requested provider")); diff --git a/shell/containmentconfigview.cpp b/shell/containmentconfigview.cpp index 6db18e646..f489f1771 100644 --- a/shell/containmentconfigview.cpp +++ b/shell/containmentconfigview.cpp @@ -21,6 +21,7 @@ #include "containmentconfigview.h" #include "configmodel.h" #include "shellcorona.h" +#include "config-workspace.h" #include #include @@ -81,7 +82,7 @@ PlasmaQuick::ConfigModel *ContainmentConfigView::containmentActionConfigModel() Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); foreach (const KPluginInfo &info, actions) { - pkg.setDefaultPackageRoot(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/containmentactions", QStandardPaths::LocateDirectory)); + pkg.setDefaultPackageRoot(QStandardPaths::locate(QStandardPaths::GenericDataLocation, PLASMA_RELATIVE_DATA_INSTALL_DIR "/containmentactions", QStandardPaths::LocateDirectory)); m_containmentActionConfigModel->appendCategory(info.icon(), info.name(), pkg.filePath("ui", "config.qml"), info.pluginName()); } @@ -116,7 +117,7 @@ PlasmaQuick::ConfigModel *ContainmentConfigView::wallpaperConfigModel() { if (!m_wallpaperConfigModel) { m_wallpaperConfigModel = new PlasmaQuick::ConfigModel(this); - QStringList dirs(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "plasma/wallpapers", QStandardPaths::LocateDirectory)); + QStringList dirs(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, PLASMA_RELATIVE_DATA_INSTALL_DIR "/wallpapers", QStandardPaths::LocateDirectory)); Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); foreach (const QString &dirPath, dirs) { QDir dir(dirPath); @@ -182,7 +183,7 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper) //we have to construct an independent ConfigPropertyMap when we want to configure wallpapers that are not the current one Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); - pkg.setDefaultPackageRoot("plasma/wallpapers"); + pkg.setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/wallpapers"); pkg.setPath(wallpaper); QFile file(pkg.filePath("config", "main.xml")); KConfigGroup cfg = m_containment->config(); diff --git a/shell/shellmanager.cpp b/shell/shellmanager.cpp index d33f7e5a5..240aca2bb 100644 --- a/shell/shellmanager.cpp +++ b/shell/shellmanager.cpp @@ -32,11 +32,12 @@ //#include #include "shellcorona.h" +#include "config-workspace.h" #include static const QString s_shellsDir = QString(QStandardPaths::locate(QStandardPaths::QStandardPaths::GenericDataLocation, - "plasma/shells/", + PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/", QStandardPaths::LocateDirectory)); static const QString s_shellLoaderPath = QString("/contents/loader.qml"); diff --git a/shell/widgetexplorer/plasmaappletitemmodel.cpp b/shell/widgetexplorer/plasmaappletitemmodel.cpp index c6b0991a6..72f831373 100644 --- a/shell/widgetexplorer/plasmaappletitemmodel.cpp +++ b/shell/widgetexplorer/plasmaappletitemmodel.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "config-workspace.h" PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model, const KPluginInfo& info, @@ -39,7 +40,7 @@ PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model, { const QString api(m_info.property("X-Plasma-API").toString()); if (!api.isEmpty()) { - const QString _f = "plasma/plasmoids/" + info.pluginName() + '/'; + const QString _f = PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/" + info.pluginName() + '/'; QFileInfo dir(QStandardPaths::locate(QStandardPaths::QStandardPaths::GenericDataLocation, _f, QStandardPaths::LocateDirectory)); diff --git a/shell/widgetexplorer/widgetexplorer.cpp b/shell/widgetexplorer/widgetexplorer.cpp index 4c5a61463..1ba8ee6e0 100644 --- a/shell/widgetexplorer/widgetexplorer.cpp +++ b/shell/widgetexplorer/widgetexplorer.cpp @@ -42,6 +42,7 @@ #include "kcategorizeditemsviewmodels_p.h" #include "plasmaappletitemmodel_p.h" #include "openwidgetassistant_p.h" +#include "config-workspace.h" using namespace KCategorizedItemsViewModels; using namespace Plasma; @@ -353,7 +354,7 @@ Plasma::Corona *WidgetExplorer::corona() const void WidgetExplorer::addApplet(const QString &pluginName) { - const QString p = "plasma/plasmoids/"+pluginName; + const QString p = PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/"+pluginName; qWarning() << "--------> load applet: " << pluginName << " relpath: " << p; QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, p, QStandardPaths::LocateDirectory); @@ -416,7 +417,7 @@ void WidgetExplorer::openWidgetFile() void WidgetExplorer::uninstall(const QString &pluginName) { - const QString packageRoot = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/plasma/plasmoids/"; + const QString packageRoot = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + PLASMA_RELATIVE_DATA_INSTALL_DIR "/plasmoids/"; Plasma::Package pkg; pkg.setPath(packageRoot);