From b65ba2ebe214f3892a225ec556ae67cb3357d741 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Sun, 21 Jun 2015 01:13:37 +0300 Subject: [PATCH] fix #44 possible fix #43 --- CHANGELOG | 9 ++++++ sources/CMakeLists.txt | 2 +- sources/netctlgui/src/netctlinteract.cpp | 1 - sources/netctlgui/src/wpasupinteract.cpp | 8 ++++- sources/plasmoid-kf5/package/metadata.desktop | 2 +- sources/plasmoid-kf5/plugin/netctladds.cpp | 30 ++++++++++++++----- sources/plasmoid-kf5/plugin/netctladds.h | 4 +++ 7 files changed, 45 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 71dbe2f..10f63ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,15 @@ +Ver.1.4.6 +--------- +* all + + implement time logging feature * gui + implement autoupdate feature - fix invalid profile path for the external editor +* library + + implement netctl-auto support to scanWiFi() method (#44) + - fix bug with invalid data in netctl-auto profile list output +* plasmoid + - fix plasma crash on status updates (#43) Ver.1.4.5 --------- diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index c567321..624387a 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -11,7 +11,7 @@ set (PROJECT_CONTACT "esalexeev@gmail.com") set (PROJECT_LICENSE "GPLv3") set (PROJECT_VERSION_MAJOR 1) set (PROJECT_VERSION_MINOR 4) -set (PROJECT_VERSION_PATCH 5) +set (PROJECT_VERSION_PATCH 6) set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC) string (TIMESTAMP CURRENT_YEAR "%Y") diff --git a/sources/netctlgui/src/netctlinteract.cpp b/sources/netctlgui/src/netctlinteract.cpp index 61b5583..1e36f20 100644 --- a/sources/netctlgui/src/netctlinteract.cpp +++ b/sources/netctlgui/src/netctlinteract.cpp @@ -238,7 +238,6 @@ QList Netctl::getProfileListFromNetctlAuto() profileInfo.essid = profileValues[2]; profileInfo.interface = profileValues[3]; profileInfo.type = profileValues[0]; - profileInfo.essid = profileValues[1]; profileInfo.netctlAuto = true; fullProfilesInfo.append(profileInfo); } diff --git a/sources/netctlgui/src/wpasupinteract.cpp b/sources/netctlgui/src/wpasupinteract.cpp index 0acfd2f..1bf319d 100644 --- a/sources/netctlgui/src/wpasupinteract.cpp +++ b/sources/netctlgui/src/wpasupinteract.cpp @@ -346,7 +346,13 @@ QList WpaSup::scanWifi() rawList.removeFirst(); QStringList names; - QList profiles = netctlCommand->getProfileList(); + // init profile list + QList profiles; + if (netctlCommand->isNetctlAutoRunning()) + profiles = netctlCommand->getProfileListFromNetctlAuto(); + else + profiles = netctlCommand->getProfileList(); + // iterate by wifi output for (int i=0; i NetctlAdds::sendDBusRequest(const QString cmd, const QList args) { if (debug) qDebug() << PDEBUG; @@ -158,28 +172,30 @@ void NetctlAdds::setDataBySource(const QString sourceName, const QVariantMap dat bool needUpdate = (values[sourceName] != data[QString("value")].toString()); values[sourceName] = data[QString("value")].toString(); -// if ((needUpdate) && (sourceName == QString("active"))) { -// if (values[sourceName] == QString("true")) -// sendNotification(QString("Info"), i18n("Network status has been changed to active")); -// else -// sendNotification(QString("Info"), i18n("Network status has been changed to inactive")); -// } - if (needUpdate) emit(needToBeUpdated()); + if (needUpdate) { + emit(needToBeUpdated()); +// if (sourceName == QString("active")) +// emit(needToNotify(values[QString("active")] == QString("true"))); + } } void NetctlAdds::sendNotification(const QString eventId, const QString message) { + // since it is a static method we need to identify is debug enabled again QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); QString debugEnv = environment.value(QString("DEBUG"), QString("no")); bool debugLocal = (debugEnv == QString("yes")); + if (debugLocal) qDebug() << PDEBUG; if (debugLocal) qDebug() << PDEBUG << ":" << "Event" << eventId; if (debugLocal) qDebug() << PDEBUG << ":" << "Message" << message; KNotification *notification = KNotification::event(eventId, QString("Netctl ::: %1").arg(eventId), message); notification->setComponentName(QString("plasma-applet-org.kde.plasma.netctl")); + + notification->deleteLater(); } diff --git a/sources/plasmoid-kf5/plugin/netctladds.h b/sources/plasmoid-kf5/plugin/netctladds.h index 84fd9bb..4110393 100644 --- a/sources/plasmoid-kf5/plugin/netctladds.h +++ b/sources/plasmoid-kf5/plugin/netctladds.h @@ -64,6 +64,10 @@ public: signals: void needToBeUpdated(); + void needToNotify(const bool currentStatus); + +private slots: + void notifyAboutStatusChanging(const bool currentStatus); private: bool debug = false;