possible fix #43
This commit is contained in:
arcan1s 2015-06-21 01:13:37 +03:00
parent 69f6a3135b
commit b65ba2ebe2
7 changed files with 45 additions and 11 deletions

View File

@ -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
---------

View File

@ -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")

View File

@ -238,7 +238,6 @@ QList<netctlProfileInfo> Netctl::getProfileListFromNetctlAuto()
profileInfo.essid = profileValues[2];
profileInfo.interface = profileValues[3];
profileInfo.type = profileValues[0];
profileInfo.essid = profileValues[1];
profileInfo.netctlAuto = true;
fullProfilesInfo.append(profileInfo);
}

View File

@ -346,7 +346,13 @@ QList<netctlWifiInfo> WpaSup::scanWifi()
rawList.removeFirst();
QStringList names;
QList<netctlProfileInfo> profiles = netctlCommand->getProfileList();
// init profile list
QList<netctlProfileInfo> profiles;
if (netctlCommand->isNetctlAutoRunning())
profiles = netctlCommand->getProfileListFromNetctlAuto();
else
profiles = netctlCommand->getProfileList();
// iterate by wifi output
for (int i=0; i<rawList.count(); i++) {
QStringList line = rawList[i].split(QChar('\t'));
if (line.count() != 5) continue;

View File

@ -14,7 +14,7 @@ X-Plasma-RemoteLocation=
X-KDE-PluginInfo-Author=Evgeniy Alekseev
X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=org.kde.plasma.netctl
X-KDE-PluginInfo-Version=1.4.5
X-KDE-PluginInfo-Version=1.4.6
X-KDE-PluginInfo-Website=http://arcanis.name/projects/netctl-gui
X-KDE-PluginInfo-Category=Network
X-KDE-PluginInfo-Depends=

View File

@ -41,6 +41,8 @@ NetctlAdds::NetctlAdds(QObject *parent)
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
connect(this, SIGNAL(needToNotify(bool)), this, SLOT(notifyAboutStatusChanging(bool)));
}
@ -50,6 +52,18 @@ NetctlAdds::~NetctlAdds()
}
void NetctlAdds::notifyAboutStatusChanging(const bool currentStatus)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Status" << currentStatus;
if (currentStatus)
return NetctlAdds::sendNotification(QString("Info"), i18n("Network status has been changed to active"));
else
return NetctlAdds::sendNotification(QString("Info"), i18n("Network status has been changed to inactive"));
}
QList<QVariant> NetctlAdds::sendDBusRequest(const QString cmd, const QList<QVariant> 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();
}

View File

@ -64,6 +64,10 @@ public:
signals:
void needToBeUpdated();
void needToNotify(const bool currentStatus);
private slots:
void notifyAboutStatusChanging(const bool currentStatus);
private:
bool debug = false;