Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move vpn model to nemo.connectivity. JB#61656 #38

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 0 additions & 34 deletions dbus/net.connman.service.xml

This file was deleted.

26 changes: 0 additions & 26 deletions dbus/net.connman.vpn.Connection.xml

This file was deleted.

32 changes: 0 additions & 32 deletions dbus/net.connman.vpn.xml

This file was deleted.

13 changes: 5 additions & 8 deletions src/alarmtonemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include <QDir>
#include <QDebug>
#include <QQmlEngine>
#include <qqml.h>

const char * const AlarmToneDir = "/usr/share/sounds/jolla-ringtones/stereo/";

Expand Down Expand Up @@ -85,18 +83,17 @@ QVariant AlarmToneModel::data(const QModelIndex &index, int role) const
}
}

QJSValue AlarmToneModel::get(int index) const
QVariantMap AlarmToneModel::get(int index) const
{
if (index < 0 || m_fileInfoList.count() <= index) {
return QJSValue();
return QVariantMap();
}

QFileInfo info = m_fileInfoList.at(index);
QJSEngine *const engine = qmlEngine(this);
QJSValue value = engine->newObject();
QVariantMap value;

value.setProperty("filename", engine->toScriptValue(info.absoluteFilePath()));
value.setProperty("title", engine->toScriptValue(info.baseName()));
value["filename"] = info.absoluteFilePath();
value["title"] = info.baseName();

return value;
}
4 changes: 2 additions & 2 deletions src/alarmtonemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <QAbstractListModel>
#include <QFileInfo>
#include <QJSValue>
#include <QVariantMap>

#include <systemsettingsglobal.h>

Expand All @@ -55,7 +55,7 @@ class SYSTEMSETTINGS_EXPORT AlarmToneModel
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role) const;

Q_INVOKABLE QJSValue get(int index) const;
Q_INVOKABLE QVariantMap get(int index) const;

signals:
void selectedFileChanged();
Expand Down
2 changes: 0 additions & 2 deletions src/deviceinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@

#include "systemsettingsglobal.h"

class QQmlEngine;
class QJSEngine;
class DeviceInfoPrivate;

class SYSTEMSETTINGS_EXPORT DeviceInfo: public QObject
Expand Down
1 change: 0 additions & 1 deletion src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#include "logging_p.h"

Q_LOGGING_CATEGORY(lcVpnLog, "org.sailfishos.settings.vpn", QtWarningMsg)
Q_LOGGING_CATEGORY(lcDeveloperModeLog, "org.sailfishos.settings.developermode", QtWarningMsg)
Q_LOGGING_CATEGORY(lcMemoryCardLog, "org.sailfishos.settings.memorycard", QtWarningMsg)
Q_LOGGING_CATEGORY(lcMemoryCardDBusLog, "org.sailfishos.settings.memorycard.dbus", QtCriticalMsg)
Expand Down
1 change: 0 additions & 1 deletion src/logging_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include <QLoggingCategory>

Q_DECLARE_LOGGING_CATEGORY(lcVpnLog)
Q_DECLARE_LOGGING_CATEGORY(lcDeveloperModeLog)
Q_DECLARE_LOGGING_CATEGORY(lcMemoryCardLog)
Q_DECLARE_LOGGING_CATEGORY(lcMemoryCardDBusLog)
Expand Down
8 changes: 0 additions & 8 deletions src/plugin/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "diskusage.h"
#include "partitionmodel.h"
#include "certificatemodel.h"
#include "settingsvpnmodel.h"
#include "locationsettings.h"
#include "deviceinfo.h"
#include "nfcsettings.h"
Expand All @@ -73,12 +72,6 @@ class AppTranslator: public QTranslator
}
};

template<class T>
static QObject *api_factory(QQmlEngine *, QJSEngine *)
{
return new T;
}

class SystemSettingsPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Expand Down Expand Up @@ -108,7 +101,6 @@ class SystemSettingsPlugin : public QQmlExtensionPlugin
qRegisterMetaType<Partition>("Partition");
qmlRegisterType<DeveloperModeSettings>(uri, 1, 0, "DeveloperModeSettings");
qmlRegisterType<CertificateModel>(uri, 1, 0, "CertificateModel");
qmlRegisterSingletonType<SettingsVpnModel>(uri, 1, 0, "SettingsVpnModel", api_factory<SettingsVpnModel>);
qRegisterMetaType<DeveloperModeSettings::Status>("DeveloperModeSettings::Status");
qmlRegisterType<BatteryStatus>(uri, 1, 0, "BatteryStatus");
qmlRegisterType<DiskUsage>(uri, 1, 0, "DiskUsage");
Expand Down
77 changes: 0 additions & 77 deletions src/plugin/plugins.qmltypes
Original file line number Diff line number Diff line change
Expand Up @@ -722,83 +722,6 @@ Module {
Parameter { name: "mode"; type: "string" }
}
}
Component {
name: "SettingsVpnModel"
prototype: "VpnModel"
exports: ["org.nemomobile.systemsettings/SettingsVpnModel 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0]
Property { name: "bestState"; type: "VpnConnection::ConnectionState"; isReadonly: true }
Property { name: "autoConnect"; type: "bool"; isReadonly: true }
Property { name: "orderByConnected"; type: "bool" }
Signal {
name: "connectionStateChanged"
Parameter { name: "path"; type: "string" }
Parameter { name: "state"; type: "VpnConnection::ConnectionState" }
}
Method {
name: "isDefaultDomain"
type: "bool"
Parameter { name: "domain"; type: "string" }
}
Method {
name: "createConnection"
Parameter { name: "properties"; type: "QVariantMap" }
}
Method {
name: "modifyConnection"
Parameter { name: "path"; type: "string" }
Parameter { name: "properties"; type: "QVariantMap" }
}
Method {
name: "deleteConnection"
Parameter { name: "path"; type: "string" }
}
Method {
name: "activateConnection"
Parameter { name: "path"; type: "string" }
}
Method {
name: "deactivateConnection"
Parameter { name: "path"; type: "string" }
}
Method {
name: "connectionCredentials"
type: "QVariantMap"
Parameter { name: "path"; type: "string" }
}
Method {
name: "setConnectionCredentials"
Parameter { name: "path"; type: "string" }
Parameter { name: "credentials"; type: "QVariantMap" }
}
Method {
name: "connectionCredentialsEnabled"
type: "bool"
Parameter { name: "path"; type: "string" }
}
Method {
name: "disableConnectionCredentials"
Parameter { name: "path"; type: "string" }
}
Method {
name: "connectionSettings"
type: "QVariantMap"
Parameter { name: "path"; type: "string" }
}
Method {
name: "processProvisioningFile"
type: "QVariantMap"
Parameter { name: "path"; type: "string" }
Parameter { name: "type"; type: "string" }
}
Method {
name: "get"
type: "VpnConnection*"
Parameter { name: "index"; type: "int" }
}
}
Component {
name: "UserInfo"
prototype: "QObject"
Expand Down