mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-06 18:35:52 +00:00
drop kde4 from master
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include <QRegExp>
|
||||
#include <QTextCodec>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
#include <task/taskadds.h>
|
||||
@ -42,14 +43,6 @@
|
||||
#include "extupgrade.h"
|
||||
#include "version.h"
|
||||
|
||||
// KF5-KDE4 compability
|
||||
#ifdef BUILD_KDE4
|
||||
#include <KGlobal>
|
||||
#include <KStandardDirs>
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
#endif /* BUILD_KDE4 */
|
||||
|
||||
|
||||
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList &args)
|
||||
: Plasma::DataEngine(parent, args)
|
||||
@ -137,25 +130,15 @@ void ExtendedSysMon::initQuotes()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
// create directory at $HOME and create dirs list
|
||||
QString localDir;
|
||||
QStringList dirs;
|
||||
#ifdef BUILD_KDE4
|
||||
localDir = KStandardDirs::locateLocal("data", "awesomewidgets/quotes");
|
||||
if (KStandardDirs::makeDir(localDir))
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
|
||||
|
||||
dirs = KGlobal::dirs()->findDirs("data", "awesomewidgets/quotes");
|
||||
#else
|
||||
localDir = QString("%1/awesomewidgets/quotes")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
QString localDir = QString("%1/awesomewidgets/quotes")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
QDir localDirectory;
|
||||
if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir)))
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
|
||||
|
||||
dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/quotes"),
|
||||
QStandardPaths::LocateDirectory);
|
||||
#endif /* BUILD_KDE4 */
|
||||
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/quotes"),
|
||||
QStandardPaths::LocateDirectory);
|
||||
|
||||
QStringList names;
|
||||
for (int i=0; i<dirs.count(); i++) {
|
||||
@ -176,25 +159,15 @@ void ExtendedSysMon::initScripts()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
// create directory at $HOME and create dirs list
|
||||
QString localDir;
|
||||
QStringList dirs;
|
||||
#ifdef BUILD_KDE4
|
||||
localDir = KStandardDirs::locateLocal("data", "awesomewidgets/scripts");
|
||||
if (KStandardDirs::makeDir(localDir))
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
|
||||
|
||||
dirs = KGlobal::dirs()->findDirs("data", "awesomewidgets/scripts");
|
||||
#else
|
||||
localDir = QString("%1/awesomewidgets/scripts")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
QString localDir = QString("%1/awesomewidgets/scripts")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
QDir localDirectory;
|
||||
if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir)))
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
|
||||
|
||||
dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/scripts"),
|
||||
QStandardPaths::LocateDirectory);
|
||||
#endif /* BUILD_KDE4 */
|
||||
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/scripts"),
|
||||
QStandardPaths::LocateDirectory);
|
||||
|
||||
QStringList names;
|
||||
for (int i=0; i<dirs.count(); i++) {
|
||||
@ -215,25 +188,15 @@ void ExtendedSysMon::initUpgrade()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
// create directory at $HOME and create dirs list
|
||||
QString localDir;
|
||||
QStringList dirs;
|
||||
#ifdef BUILD_KDE4
|
||||
localDir = KStandardDirs::locateLocal("data", "awesomewidgets/upgrade");
|
||||
if (KStandardDirs::makeDir(localDir))
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
|
||||
|
||||
dirs = KGlobal::dirs()->findDirs("data", "awesomewidgets/upgrade");
|
||||
#else
|
||||
localDir = QString("%1/awesomewidgets/upgrade")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
QString localDir = QString("%1/awesomewidgets/upgrade")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
QDir localDirectory;
|
||||
if ((!localDirectory.exists(localDir)) && (localDirectory.mkpath(localDir)))
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
|
||||
|
||||
dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/upgrade"),
|
||||
QStandardPaths::LocateDirectory);
|
||||
#endif /* BUILD_KDE4 */
|
||||
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/upgrade"),
|
||||
QStandardPaths::LocateDirectory);
|
||||
|
||||
QStringList names;
|
||||
for (int i=0; i<dirs.count(); i++) {
|
||||
@ -276,12 +239,8 @@ void ExtendedSysMon::readConfiguration()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
QString fileName;
|
||||
#ifdef BUILD_KDE4
|
||||
fileName = KGlobal::dirs()->findResource("config", "plasma-dataengine-extsysmon.conf");
|
||||
#else
|
||||
fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("plasma-dataengine-extsysmon.conf"));
|
||||
#endif /* BUILD_KDE4 */
|
||||
QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation,
|
||||
QString("plasma-dataengine-extsysmon.conf"));
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
|
||||
QSettings settings(fileName, QSettings::IniFormat);
|
||||
QMap<QString, QString> rawConfig;
|
||||
@ -763,10 +722,6 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
||||
}
|
||||
|
||||
|
||||
#ifdef BUILD_KDE4
|
||||
K_EXPORT_PLASMA_DATAENGINE(extsysmon, ExtendedSysMon)
|
||||
#else
|
||||
K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(extsysmon, ExtendedSysMon, "plasma-dataengine-extsysmon.json")
|
||||
#endif /* BUILD_KDE4 */
|
||||
|
||||
#include "extsysmon.moc"
|
||||
|
Reference in New Issue
Block a user