Commit f87ef524 authored by blam's avatar blam

Merge branch 'jb39097-dev-account-provider' into 'master'

[developermode] Remove AccountManager references. Contributes to JB#39097

See merge request !45
parents b9ad8ee9 23c035b7
......@@ -26,7 +26,6 @@ BuildRequires: pkgconfig(nemomodels-qt5)
BuildRequires: pkgconfig(libsailfishkeyprovider) >= 0.0.14
BuildRequires: pkgconfig(connman-qt5)
BuildRequires: pkgconfig(ssu-sysinfo) >= 1.1.0
#BuildRequires: pkgconfig(sailfishaccounts)
%description
%{summary}.
......
......@@ -32,13 +32,6 @@
#include "developermodesettings.h"
#if 0
/* libsailfishaccounts */
#include <accountmanager.h>
#include <provider.h>
#include <service.h>
#endif
#include <QDebug>
#include <QFile>
#include <QDir>
......@@ -162,7 +155,6 @@ DeveloperModeSettings::DeveloperModeSettings(QObject *parent)
: QObject(parent)
, m_usbModeDaemon(USB_MODED_SERVICE, USB_MODED_PATH, USB_MODED_INTERFACE,
QDBusConnection::systemBus())
// , m_accountManager(new AccountManager(this))
, m_pendingPackageKitCall(nullptr)
, m_packageKitCommand(nullptr)
, m_wlanIpAddress("-")
......@@ -184,12 +176,6 @@ DeveloperModeSettings::DeveloperModeSettings(QObject *parent)
qWarning() << "Failed to return username using getpwuid()";
}
#if 0
updateAccountProvider();
connect(m_accountManager, &AccountManager::providerNamesChanged,
this, &DeveloperModeSettings::updateAccountProvider);
#endif
if (!m_developerModeEnabled) {
m_workerStatus = CheckingStatus;
executePackageKitCommand(&DeveloperModeSettings::resolvePackageId, DEVELOPER_MODE_PACKAGE);
......@@ -224,11 +210,6 @@ DeveloperModeSettings::username() const
return m_username;
}
QString DeveloperModeSettings::developerModeAccountProvider() const
{
return m_developerModeAccountProvider;
}
bool DeveloperModeSettings::developerModeAvailable() const
{
return m_developerModeEnabled || !m_developerModePackageId.isEmpty();
......@@ -655,36 +636,3 @@ void DeveloperModeSettings::transactionFinished(uint, uint)
emit workerStatusChanged();
emit workerProgressChanged();
}
#if 0
void DeveloperModeSettings::updateAccountProvider()
{
// Find all account providers with the developer-mode service. If m_developerModeAccountProvider
// is already set to the name of one of these providers, just return. Otherwise, set it to the
// first provider found with a matching service.
QList<Provider *> accountProviders;
for (const QString &providerName : m_accountManager->providerNames()) {
if (Provider *accountProvider = m_accountManager->provider(providerName)) {
for (const QString &serviceName : accountProvider->serviceNames()) {
if (Service *accountService = m_accountManager->service(serviceName)) {
if (accountService->serviceType() == DEVELOPER_MODE_ACCOUNT_SERVICE) {
if (m_developerModeAccountProvider == providerName) {
return;
} else {
accountProviders.append(accountProvider);
break;
}
}
}
}
}
}
if (!accountProviders.isEmpty()) {
if (m_developerModeAccountProvider != accountProviders.first()->name()) {
m_developerModeAccountProvider = accountProviders.first()->name();
emit developerModeAccountProviderChanged();
}
}
}
#endif
......@@ -41,7 +41,6 @@
QT_BEGIN_NAMESPACE
class QDBusPendingCallWatcher;
class AccountManager;
QT_END_NAMESPACE
class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
......@@ -65,10 +64,6 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
READ developerModeAvailable
NOTIFY developerModeAvailableChanged)
Q_PROPERTY(QString developerModeAccountProvider
READ developerModeAccountProvider
NOTIFY developerModeAccountProviderChanged)
Q_PROPERTY(bool developerModeEnabled
READ developerModeEnabled
NOTIFY developerModeEnabledChanged)
......@@ -103,7 +98,6 @@ public:
QString username() const;
bool developerModeAvailable() const;
bool developerModeEnabled() const;
QString developerModeAccountProvider() const;
bool remoteLoginEnabled() const;
enum DeveloperModeSettings::Status workerStatus() const;
int workerProgress() const;
......@@ -117,7 +111,6 @@ signals:
void wlanIpAddressChanged();
void usbIpAddressChanged();
void developerModeAvailableChanged();
void developerModeAccountProviderChanged();
void developerModeEnabledChanged();
void remoteLoginEnabledChanged();
void workerWorkingChanged();
......@@ -141,12 +134,9 @@ private:
void executePackageKitCommand(
QDBusPendingCallWatcher *(DeveloperModeSettings::*command)(const QString &),
const QString &argument);
//
// void updateAccountProvider();
QDBusInterface m_usbModeDaemon;
QDBusObjectPath m_packageKitTransaction;
AccountManager *m_accountManager;
QDBusPendingCallWatcher *m_pendingPackageKitCall;
QDBusPendingCallWatcher *(DeveloperModeSettings::*m_packageKitCommand)(const QString &packageId);
......@@ -156,7 +146,6 @@ private:
QString m_usbIpAddress;
QString m_username;
QString m_developerModePackageId;
QString m_developerModeAccountProvider;
bool m_developerModeEnabled;
bool m_remoteLoginEnabled;
DeveloperModeSettings::Status m_workerStatus;
......
......@@ -6,7 +6,7 @@ QT += qml dbus systeminfo
QT -= gui
CONFIG += c++11 hide_symbols link_pkgconfig
PKGCONFIG += profile mlite5 mce timed-qt5 libshadowutils blkid libcrypto nemomodels-qt5 libsailfishkeyprovider connman-qt5 # sailfishaccounts
PKGCONFIG += profile mlite5 mce timed-qt5 libshadowutils blkid libcrypto nemomodels-qt5 libsailfishkeyprovider connman-qt5
PKGCONFIG += ssu-sysinfo
system(qdbusxml2cpp -p mceiface.h:mceiface.cpp mce.xml)
......
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