remove the now unised platformstatus kded

BUG:348840
This commit is contained in:
Marco Martin 2015-11-19 17:09:33 +01:00
parent 93ade11acc
commit 71999d4aac
6 changed files with 0 additions and 314 deletions

View File

@ -3,6 +3,5 @@ add_subdirectory(plasma)
add_subdirectory(declarativeimports)
#add_subdirectory(kpart)
add_subdirectory(plasmapkg)
add_subdirectory(platformstatus)
add_subdirectory(scriptengines)
add_subdirectory(plasmaquick)

View File

@ -1,31 +0,0 @@
set(
kded_platformstatus_SRCS
platformstatus.cpp
)
qt5_add_dbus_adaptor (
kded_platformstatus_SRCS
org.kde.platformstatus.xml
platformstatus.h PlatformStatus
)
add_library(kded_platformstatus MODULE ${kded_platformstatus_SRCS} )
set_target_properties(kded_platformstatus PROPERTIES
OUTPUT_NAME platformstatus
)
kcoreaddons_desktop_to_json(kded_platformstatus platformstatus.desktop)
target_link_libraries(
kded_platformstatus
KF5::Service
KF5::CoreAddons
KF5::DBusAddons
KF5::I18n
KF5::KIOCore KF5::KIOWidgets
Qt5::DBus
Qt5::Quick
)
install( TARGETS kded_platformstatus DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded )
install( FILES org.kde.platformstatus.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} )

View File

@ -1,26 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.kde.PlatformStatus">
<property name="shellPackage" type="s" access="read"/>
<property name="lookAndFeelPackage" type="s" access="read"/>
<property name="runtimePlatform" type="as" access="read"/>
<signal name="shellPackageChanged">
<arg name="package" type="s" direction="out"/>
</signal>
<signal name="lookAndFeelPackageChanged">
<arg name="package" type="s" direction="out"/>
</signal>
<signal name="runtimePlatformChanged">
<arg name="runtimePlatform" type="as" direction="out"/>
</signal>
<method name="shellPackage">
<arg type="s" direction="out"/>
</method>
<method name="lookAndFeelPackage">
<arg type="s" direction="out"/>
</method>
<method name="runtimePlatform">
<arg type="as" direction="out"/>
</method>
</interface>
</node>

View File

@ -1,132 +0,0 @@
#include <platformstatus.h>
#include <QDBusConnection>
#include <QStandardPaths>
#include <kconfiggroup.h>
#include <ksharedconfig.h>
#include <QDebug>
#include <kdirwatch.h>
#include <kpluginfactory.h>
#include <qstandardpaths.h>
#include "platformstatusadaptor.h"
#include "../plasma/config-plasma.h"
const char defaultPackage[] = "org.kde.plasma.desktop";
const char defaultLnFPackage[] = "org.kde.breeze.desktop";
K_PLUGIN_FACTORY_WITH_JSON(PlatformStatusFactory,
"platformstatus.json",
registerPlugin<PlatformStatus>();)
PlatformStatus::PlatformStatus(QObject *parent, const QVariantList &)
: KDEDModule(parent)
{
new PlatformStatusAdaptor(this);
QDBusConnection::sessionBus().registerObject("/PlatformStatus", this);
findShellPackage(false);
findLookAndFeelPackage(false);
const QString globalrcPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, "kdeglobals");
connect(KDirWatch::self(), SIGNAL(dirty(QString)), this, SLOT(fileDirtied(QString)));
connect(KDirWatch::self(), SIGNAL(created(QString)), this, SLOT(fileDirtied(QString)));
KDirWatch::self()->addFile(globalrcPath);
}
void PlatformStatus::findShellPackage(bool sendSignal)
{
KConfigGroup group(KSharedConfig::openConfig("kdeglobals"), "DesktopShell");
const QString package = group.readEntry("shellPackage", defaultPackage);
const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/" + package + '/',
QStandardPaths::LocateDirectory);
if (path.isEmpty()) {
if (package != defaultPackage) {
group.deleteEntry("ShellPackage");
findShellPackage(sendSignal);
}
return;
}
m_shellPackage = package;
QString runtimePlatform = group.readEntry("RuntimePlatform", QString());
KConfig packageDefaults(path + "contents/defaults", KConfig::SimpleConfig);
group = KConfigGroup(&packageDefaults, "Desktop");
runtimePlatform = group.readEntry("RuntimePlatform", runtimePlatform);
const bool runtimeChanged = runtimePlatform != m_runtimePlatform.join(',');
if (runtimeChanged) {
m_runtimePlatform = runtimePlatform.split(',');
}
if (sendSignal) {
emit shellPackageChanged(m_shellPackage);
emit runtimePlatformChanged(m_runtimePlatform);
}
}
void PlatformStatus::findLookAndFeelPackage(bool sendSignal)
{
KConfigGroup group(KSharedConfig::openConfig("kdeglobals"), "KDE");
QString package = group.readEntry("LookAndFeelPackage", QString());
if (package.isEmpty()) {
const QString shellPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
PLASMA_RELATIVE_DATA_INSTALL_DIR "/shells/" + m_shellPackage + '/',
QStandardPaths::LocateDirectory);
KConfig packageDefaults(shellPath + "contents/defaults", KConfig::SimpleConfig);
group = KConfigGroup(&packageDefaults, "Desktop");
package = group.readEntry("LookAndFeel", defaultLnFPackage);
} else {
const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
PLASMA_RELATIVE_DATA_INSTALL_DIR "/look-and-feel/" + package + '/',
QStandardPaths::LocateDirectory);
if (path.isEmpty()) {
if (package != defaultPackage) {
group.deleteEntry("LookAndFeelPackage");
findLookAndFeelPackage(sendSignal);
}
return;
}
}
const bool lnfChanged = (m_lookAndFeelPackage != package);
m_lookAndFeelPackage = package;
if (sendSignal && lnfChanged) {
emit lookAndFeelPackageChanged(m_lookAndFeelPackage);
}
}
QString PlatformStatus::shellPackage() const
{
return m_shellPackage;
}
QString PlatformStatus::lookAndFeelPackage() const
{
return m_lookAndFeelPackage;
}
QStringList PlatformStatus::runtimePlatform() const
{
return m_runtimePlatform;
}
void PlatformStatus::fileDirtied(const QString &path)
{
if (path.endsWith("kdeglobals")) {
findShellPackage(true);
findLookAndFeelPackage(true);
}
}
#include "platformstatus.moc"

View File

@ -1,81 +0,0 @@
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KDEDModule
X-KDE-Library=kf5/kded/platformstatus
X-KDE-DBus-ModuleName=platformstatus
X-KDE-Kded-autoload=true
X-KDE-Kded-load-on-demand=false
Name=Platform Status
Name[ar]=حالة المنصّة
Name[bs]=Status platforme
Name[ca]=Estat de la plataforma
Name[ca@valencia]=Estat de la plataforma
Name[cs]=Stav platformy
Name[da]=Platformstatus
Name[de]=Plattform-Status
Name[en_GB]=Platform Status
Name[es]=Estado de la plataforma
Name[fi]=Alustan tila
Name[fr]=État de la plate-forme
Name[gd]=Staid an ùrlair
Name[gl]=Estado da plataforma
Name[hu]=Platform állapot
Name[ia]=Stato de platteforma
Name[it]=Stato della piattaforma
Name[ko]=
Name[nb]=Plattform-status
Name[nds]=Ünnerbuu-Status
Name[nl]=Status van platform
Name[nn]=Plattformstatus
Name[pa]= ਿ
Name[pl]=Stan Platformy
Name[pt]=Estado da Plataforma
Name[pt_BR]=Status da plataforma
Name[ru]=Состояние платформы
Name[sk]=Stav platformy
Name[sl]=Stanje okolja
Name[sr]=Стање платформе
Name[sr@ijekavian]=Стање платформе
Name[sr@ijekavianlatin]=Stanje platforme
Name[sr@latin]=Stanje platforme
Name[sv]=Plattformstatus
Name[tr]=Platform Durumu
Name[uk]=Стан платформи
Name[x-test]=xxPlatform Statusxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Tracks the current shell package and the platform definition strings.
Comment[bs]=Prati trenutni paket školjke i definicijone nizove platforme
Comment[ca]=Segueix el paquet d'intèrpret d'ordres actual i les cadenes de definició de la plataforma.
Comment[ca@valencia]=Segueix el paquet d'intèrpret d'ordes actual i les cadenes de definició de la plataforma.
Comment[da]=Holder styr på den aktuelle skal-pakke og platformsdefinition-strengene.
Comment[de]=Überwacht das aktuelle Shell-Paket und die Plattformdefinitionen.
Comment[en_GB]=Tracks the current shell package and the platform definition strings.
Comment[es]=Rastrea las cadenas de definición del paquete de intérprete actual y de la plataforma.
Comment[fi]=Seuraa nykyistä kuoripakettia ja alustan määrittelyn merkkijonoja.
Comment[fr]=Suit le paquet du terminal actuel et les chaînes de définition de la plate-forme.
Comment[gd]=Nì seo tracadh air pacaid a' shell làithreach 's air na sreangan a mhìnicheas an t-ùrlar.
Comment[gl]=Fai seguimento do paquete da shell e do texto de definición da plataforma.
Comment[hu]=A jelenlegi felületcsomag és platformdefiníciós sztringek követése.
Comment[ia]=Il tracia le pacchetto de shell currente e le catenas de definition de platteforma.
Comment[it]=Traccia il pacchetto della shell attuale e le stringhe di definizione della piattaforma.
Comment[ko]= .
Comment[nb]=Sporer gjeldende skallpakke og plattformens definisjonsstrenger.
Comment[nds]=Kiekt op dat aktuelle Konsoolpaket un de Ünnerbuu-Definitschonen
Comment[nl]=Volgt het huidige shell-pakket en de definitietekenreeksen van platform.
Comment[nn]=Sporar gjeldande skalpakke og plattformdefinisjonsstrengar.
Comment[pl]=Śledzi bieżący pakiet powłoki oraz ciągi znaków określające platformę.
Comment[pt]=Segue o pacote da consola actual e a os textos de definição da plataforma.
Comment[pt_BR]=Segue o pacote do shell atual e as strings de definição da plataforma.
Comment[ru]=Отслеживает текущую оболочку и строки определения платформы
Comment[sk]=Sleduje aktuálny balík shellu a reťazce definície platformy.
Comment[sl]=Sledi trenutnemu paketu lupine in nizom določila okolja.
Comment[sr]=Прати тренутни пакет шкољке и ниске дефиниције платформе
Comment[sr@ijekavian]=Прати тренутни пакет шкољке и ниске дефиниције платформе
Comment[sr@ijekavianlatin]=Prati trenutni paket školjke i niske definicije platforme
Comment[sr@latin]=Prati trenutni paket školjke i niske definicije platforme
Comment[sv]=Följer nuvarande skalpaket och plattformens definitionssträngar
Comment[tr]=Mevcut kabuk paketini ve düzlem tanımlama dizilerini izle
Comment[uk]=Стежить за станом поточного пакунка оболонки та рядками визначення платформи.
Comment[x-test]=xxTracks the current shell package and the platform definition strings.xx
Comment[zh_TW]= shell

View File

@ -1,43 +0,0 @@
#ifndef PLATFORMSTATUS_H
#define PLATFORMSTATUS_H
#include <kdedmodule.h>
#include <QStringList>
class PlatformStatus : public KDEDModule
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.PlatformStatus")
Q_PROPERTY(QString shellPackage READ shellPackage NOTIFY shellPackageChanged)
Q_PROPERTY(QString lookAndFeelPackage READ lookAndFeelPackage NOTIFY lookAndFeelPackageChanged)
Q_PROPERTY(QStringList runtimePlatform READ runtimePlatform NOTIFY runtimePlatformChanged)
public:
PlatformStatus(QObject *parent, const QVariantList &);
public Q_SLOTS:
QString shellPackage() const;
QString lookAndFeelPackage() const;
QStringList runtimePlatform() const;
Q_SIGNALS:
void shellPackageChanged(const QString &package);
void lookAndFeelPackageChanged(const QString &package);
void runtimePlatformChanged(const QStringList &runtimePlatform);
private:
void findShellPackage(bool sendSignal);
void findLookAndFeelPackage(bool sendSignal);
private Q_SLOTS:
void fileDirtied(const QString &path);
private:
QString m_shellPackage;
QString m_lookAndFeelPackage;
QStringList m_runtimePlatform;
};
#endif