Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 022854a2 authored by Martin Kacej's avatar Martin Kacej

saving manual settnigs fix

parent e5bfd8ec
......@@ -539,7 +539,7 @@ void Handler::addConnectionFromQML(const QVariantMap &QMLmap)
{
if(!QMLmap.isEmpty()){
NMVariantMapMap map;
QString id;
QString id; // add UUID
for (QVariantMap::const_iterator iter = QMLmap.begin(); iter != QMLmap.end(); ++iter) {
if (iter.key() == QLatin1String("connection")) {
QVariantMap connectionMap = iter.value().toMap();
......@@ -552,7 +552,7 @@ void Handler::addConnectionFromQML(const QVariantMap &QMLmap)
map.insert(iter.key(), iter.value().toMap());
}
}
// add SSID
for (QVariantMap::const_iterator iter = QMLmap.begin(); iter != QMLmap.end(); ++iter) {
if (iter.key() == QLatin1String("802-11-wireless")) {
QVariantMap wirelessnMap = iter.value().toMap();
......@@ -562,11 +562,30 @@ void Handler::addConnectionFromQML(const QVariantMap &QMLmap)
map.insert(QLatin1String("802-11-wireless"), wirelessnMap);
}
}
// if settings are manual, convert dns to uint32
/* for (QVariantMap::const_iterator iter = QMLmap.begin(); iter != QMLmap.end(); ++iter) {
if (iter.key() == QLatin1String("ipv4")) {
QVariantMap ipv4Map = iter.value().toMap();
if (ipv4Map.value("method").toString() == QLatin1String("manual")) {
QString dns = ipv4Map.value("dns").toString();
UIntList list;
list.append(QHostAddress(dns).toIPv4Address());
qWarning() << dns << list;
ipv4Map.insert("dns",list);
}
map.insert(QLatin1String("ipv4"), ipv4Map);
}
}*/
//qWarning() << map;
qWarning() << map;
this->addConnection(map);
}
}
quint32 Handler::convertIPtoUINT(const QString str)
{
return QHostAddress(str).toIPv4Address();
}
#if WITH_MODEMMANAGER_SUPPORT
void Handler::unlockRequiredChanged(MMModemLock modemLock)
{
......
......@@ -90,6 +90,7 @@ public Q_SLOTS:
QVariantMap getConnectionSettings(const QString &connection, const QString &type);
QVariantMap getActiveConnectionInfo(const QString &connection);
void addConnectionFromQML(const QVariantMap &map);
quint32 convertIPtoUINT(const QString str);
void enableWwan(bool enable);
......@@ -125,6 +126,7 @@ private:
QMap<QString, bool> m_bluetoothAdapters;
void enableBluetooth(bool enable);
};
#endif // PLASMA_NM_HANDLER_H
......@@ -117,7 +117,7 @@ ColumnLayout {
"method" : "manual",
"address-data" : [{"address":address, "prefix":prefix}],
"gateway" : gateway,
"dns" : dns
"dns" : [handler.convertIPtoUINT(dns)]
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment