Port plasma code to PLASMA_RELATIVE_DATA_INSTALL_DIR

wilder-5.14
Aleix Pol 12 years ago
parent 0054ac7f20
commit b0068a09cf
  1. 3
      applets/systemtray/plugin/protocols/plasmoid/plasmoidtask.cpp
  2. 5
      config-workspace.h.cmake
  3. 3
      dataengines/share/share_package.cpp
  4. 4
      dataengines/share/shareservice.cpp
  5. 7
      shell/containmentconfigview.cpp
  6. 3
      shell/shellmanager.cpp
  7. 3
      shell/widgetexplorer/plasmaappletitemmodel.cpp
  8. 5
      shell/widgetexplorer/widgetexplorer.cpp

@ -33,6 +33,7 @@
#include <Plasma/PluginLoader> #include <Plasma/PluginLoader>
#include "appletquickitem.h" #include "appletquickitem.h"
#include "config-workspace.h"
namespace SystemTray namespace SystemTray
{ {
@ -54,7 +55,7 @@ PlasmoidTask::PlasmoidTask(const QString &packageName, int appletId, Plasma::Con
if (m_taskGraphicsObject) { if (m_taskGraphicsObject) {
Plasma::Package package = Plasma::PluginLoader::self()->loadPackage("Plasma/Shell"); 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"); package.setPath("org.kde.plasma.systemtray");
m_taskGraphicsObject->setCoronaPackage(package); m_taskGraphicsObject->setCoronaPackage(package);

@ -156,4 +156,7 @@
/* type to use in place of socklen_t if not defined */ /* type to use in place of socklen_t if not defined */
#define kde_socklen_t socklen_t #define kde_socklen_t socklen_t
#define WORKSPACE_VERSION_STRING "${KDE4WORKSPACE_VERSION}" #define WORKSPACE_VERSION_STRING "${KDE4WORKSPACE_VERSION}"
/** place where plasma-frameworks things are installed */
#define PLASMA_RELATIVE_DATA_INSTALL_DIR "@PLASMA_RELATIVE_DATA_INSTALL_DIR@"

@ -22,6 +22,7 @@
#include <Plasma/Package> #include <Plasma/Package>
#include "share_package.h" #include "share_package.h"
#include "config-workspace.h"
SharePackage::SharePackage(QObject *parent, QVariantList args) SharePackage::SharePackage(QObject *parent, QVariantList args)
{ {
@ -36,7 +37,7 @@ void SharePackage::initPackage(Plasma::Package* package)
package->setMimeTypes( "scripts", mimetypes ); package->setMimeTypes( "scripts", mimetypes );
package->addFileDefinition("mainscript", "code/main.js", i18n("Main Script File")); 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-"); package->setServicePrefix("plasma-share-");
} }

@ -28,7 +28,7 @@
#include "shareservice.h" #include "shareservice.h"
#include "shareprovider.h" #include "shareprovider.h"
#include "config-workspace.h"
ShareService::ShareService(ShareEngine *engine) ShareService::ShareService(ShareEngine *engine)
: Plasma::Service(engine) : Plasma::Service(engine)
@ -68,7 +68,7 @@ void ShareJob::start()
service->property("X-KDE-PluginInfo-Name", QVariant::String).toString(); service->property("X-KDE-PluginInfo-Name", QVariant::String).toString();
const QString path = const QString path =
KStandardDirs::locate("data", "plasma/shareprovider/" + pluginName + '/' ); KStandardDirs::locate("data", PLASMA_RELATIVE_DATA_INSTALL_DIR "/shareprovider/" + pluginName + '/' );
if (path.isEmpty()) { if (path.isEmpty()) {
showError(i18n("Invalid path for the requested provider")); showError(i18n("Invalid path for the requested provider"));

@ -21,6 +21,7 @@
#include "containmentconfigview.h" #include "containmentconfigview.h"
#include "configmodel.h" #include "configmodel.h"
#include "shellcorona.h" #include "shellcorona.h"
#include "config-workspace.h"
#include <kdeclarative/configpropertymap.h> #include <kdeclarative/configpropertymap.h>
#include <kconfigloader.h> #include <kconfigloader.h>
@ -81,7 +82,7 @@ PlasmaQuick::ConfigModel *ContainmentConfigView::containmentActionConfigModel()
Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
foreach (const KPluginInfo &info, actions) { 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()); 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) { if (!m_wallpaperConfigModel) {
m_wallpaperConfigModel = new PlasmaQuick::ConfigModel(this); 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"); Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
foreach (const QString &dirPath, dirs) { foreach (const QString &dirPath, dirs) {
QDir dir(dirPath); 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 //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"); Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
pkg.setDefaultPackageRoot("plasma/wallpapers"); pkg.setDefaultPackageRoot(PLASMA_RELATIVE_DATA_INSTALL_DIR "/wallpapers");
pkg.setPath(wallpaper); pkg.setPath(wallpaper);
QFile file(pkg.filePath("config", "main.xml")); QFile file(pkg.filePath("config", "main.xml"));
KConfigGroup cfg = m_containment->config(); KConfigGroup cfg = m_containment->config();

@ -32,11 +32,12 @@
//#include <config-prefix.h> //#include <config-prefix.h>
#include "shellcorona.h" #include "shellcorona.h"
#include "config-workspace.h"
#include <kcrash.h> #include <kcrash.h>
static const QString s_shellsDir = QString(QStandardPaths::locate(QStandardPaths::QStandardPaths::GenericDataLocation, static const QString s_shellsDir = QString(QStandardPaths::locate(QStandardPaths::QStandardPaths::GenericDataLocation,
"plasma/shells/", PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/",
QStandardPaths::LocateDirectory)); QStandardPaths::LocateDirectory));
static const QString s_shellLoaderPath = QString("/contents/loader.qml"); static const QString s_shellLoaderPath = QString("/contents/loader.qml");

@ -26,6 +26,7 @@
#include <kservicetypetrader.h> #include <kservicetypetrader.h>
#include <ksycoca.h> #include <ksycoca.h>
#include <kconfig.h> #include <kconfig.h>
#include "config-workspace.h"
PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model, PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
const KPluginInfo& info, const KPluginInfo& info,
@ -39,7 +40,7 @@ PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
{ {
const QString api(m_info.property("X-Plasma-API").toString()); const QString api(m_info.property("X-Plasma-API").toString());
if (!api.isEmpty()) { 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, QFileInfo dir(QStandardPaths::locate(QStandardPaths::QStandardPaths::GenericDataLocation,
_f, _f,
QStandardPaths::LocateDirectory)); QStandardPaths::LocateDirectory));

@ -42,6 +42,7 @@
#include "kcategorizeditemsviewmodels_p.h" #include "kcategorizeditemsviewmodels_p.h"
#include "plasmaappletitemmodel_p.h" #include "plasmaappletitemmodel_p.h"
#include "openwidgetassistant_p.h" #include "openwidgetassistant_p.h"
#include "config-workspace.h"
using namespace KCategorizedItemsViewModels; using namespace KCategorizedItemsViewModels;
using namespace Plasma; using namespace Plasma;
@ -353,7 +354,7 @@ Plasma::Corona *WidgetExplorer::corona() const
void WidgetExplorer::addApplet(const QString &pluginName) 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; qWarning() << "--------> load applet: " << pluginName << " relpath: " << p;
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, p, QStandardPaths::LocateDirectory); QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, p, QStandardPaths::LocateDirectory);
@ -416,7 +417,7 @@ void WidgetExplorer::openWidgetFile()
void WidgetExplorer::uninstall(const QString &pluginName) 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; Plasma::Package pkg;
pkg.setPath(packageRoot); pkg.setPath(packageRoot);

Loading…
Cancel
Save