Commit 1dc122a8 authored by Raine Makelainen's avatar Raine Makelainen

[settings-vpn] Remove hardcoded user and move under privileged system data. Contributes to JB#39282

parent 3fa10cf5
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "connmanvpnconnectionproxy.h" #include "connmanvpnconnectionproxy.h"
#include "connmanserviceproxy.h" #include "connmanserviceproxy.h"
#include <QStandardPaths>
#include <QCryptographicHash> #include <QCryptographicHash>
#include <QDBusPendingCallWatcher> #include <QDBusPendingCallWatcher>
#include <QDBusServiceWatcher> #include <QDBusServiceWatcher>
...@@ -315,7 +316,7 @@ QVariantMap VpnModel::CredentialsRepository::decodeCredentials(const QByteArray ...@@ -315,7 +316,7 @@ QVariantMap VpnModel::CredentialsRepository::decodeCredentials(const QByteArray
VpnModel::VpnModel(QObject *parent) VpnModel::VpnModel(QObject *parent)
: ObjectListModel(parent, true, false) : ObjectListModel(parent, true, false)
, connmanVpn_(connmanVpnService, "/", QDBusConnection::systemBus(), this) , connmanVpn_(connmanVpnService, "/", QDBusConnection::systemBus(), this)
, credentials_("/home/nemo/.local/share/system/vpn-data") , credentials_(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/system/privileged/vpn-data"))
, bestState_(VpnModel::Idle) , bestState_(VpnModel::Idle)
{ {
qDBusRegisterMetaType<PathProperties>(); qDBusRegisterMetaType<PathProperties>();
...@@ -897,8 +898,7 @@ QVariantMap VpnModel::processOpenVpnProvisioningFile(QFile &provisioningFile) ...@@ -897,8 +898,7 @@ QVariantMap VpnModel::processOpenVpnProvisioningFile(QFile &provisioningFile)
const QRegularExpression embeddedLeader(QStringLiteral("^\\s*<([^\\/>]+)>")); const QRegularExpression embeddedLeader(QStringLiteral("^\\s*<([^\\/>]+)>"));
const QRegularExpression embeddedTrailer(QStringLiteral("^\\s*<\\/([^\\/>]+)>")); const QRegularExpression embeddedTrailer(QStringLiteral("^\\s*<\\/([^\\/>]+)>"));
const QRegularExpression whitespace(QStringLiteral("\\s")); const QRegularExpression whitespace(QStringLiteral("\\s"));
const QString outputPath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/system/privileged/vpn-provisioning"));
const QString outputPath("/home/nemo/.local/share/system/vpn-provisioning");
auto normaliseProtocol = [](const QString &proto) { auto normaliseProtocol = [](const QString &proto) {
if (proto == QStringLiteral("tcp")) { if (proto == QStringLiteral("tcp")) {
......
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