mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-17 15:49:59 +00:00
add ability to build kde4 and kf5 packages
This commit is contained in:
@ -23,11 +23,19 @@
|
||||
#include <QFile>
|
||||
#include <QNetworkInterface>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QStandardPaths>
|
||||
#include <QTextCodec>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
#include <task/taskadds.h>
|
||||
#include <version.h>
|
||||
|
||||
// KF5-KDE4 compability
|
||||
#ifdef BUILD_KDE4
|
||||
#include <KGlobal>
|
||||
#include <KStandardDirs>
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
#endif /* BUILD_KDE4 */
|
||||
|
||||
|
||||
Netctl::Netctl(QObject *parent, const QVariantList &args)
|
||||
@ -88,7 +96,12 @@ void Netctl::readConfiguration()
|
||||
rawConfig[QString("NETCTLCMD")] = QString("/usr/bin/netctl");
|
||||
rawConfig[QString("NETCTLAUTOCMD")] = QString("/usr/bin/netctl-auto");
|
||||
|
||||
QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("netctl.conf"));
|
||||
QString fileName;
|
||||
#ifdef BUILD_KDE4
|
||||
fileName = KGlobal::dirs()->findResource("config", "netctl.conf");
|
||||
#else
|
||||
fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("netctl.conf"));
|
||||
#endif /* BUILD_KDE4 */
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
|
||||
QFile configFile(fileName);
|
||||
if (!configFile.open(QIODevice::ReadOnly)) {
|
||||
@ -387,7 +400,10 @@ bool Netctl::updateSourceEvent(const QString &source)
|
||||
}
|
||||
|
||||
|
||||
// K_EXPORT_PLASMA_DATAENGINE(netctl, Netctl)
|
||||
#ifdef BUILD_KDE4
|
||||
K_EXPORT_PLASMA_DATAENGINE(netctl, Netctl)
|
||||
#else
|
||||
K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(netctl, Netctl, "plasma-dataengine-netctl.json")
|
||||
#endif /* BUILD_KDE4 */
|
||||
|
||||
#include "netctl.moc"
|
||||
|
Reference in New Issue
Block a user