Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[developermode] Remove developerModeAccountProvider property. Contrib…
…utes to JB#39097

Remove references to AccountManager as it is not accessible from
this library. This code was already ifdef'd out; the functionality has
moved elsewhere.
  • Loading branch information
blammit committed Mar 19, 2018
1 parent b9ad8ee commit 23c035b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 65 deletions.
1 change: 0 additions & 1 deletion rpm/nemo-qml-plugin-systemsettings.spec
Expand Up @@ -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}.
Expand Down
52 changes: 0 additions & 52 deletions src/developermodesettings.cpp
Expand Up @@ -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>
Expand Down Expand Up @@ -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("-")
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
11 changes: 0 additions & 11 deletions src/developermodesettings.h
Expand Up @@ -41,7 +41,6 @@

QT_BEGIN_NAMESPACE
class QDBusPendingCallWatcher;
class AccountManager;
QT_END_NAMESPACE

class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
Expand All @@ -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)
Expand Down Expand Up @@ -103,7 +98,6 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
QString username() const;
bool developerModeAvailable() const;
bool developerModeEnabled() const;
QString developerModeAccountProvider() const;
bool remoteLoginEnabled() const;
enum DeveloperModeSettings::Status workerStatus() const;
int workerProgress() const;
Expand All @@ -117,7 +111,6 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
void wlanIpAddressChanged();
void usbIpAddressChanged();
void developerModeAvailableChanged();
void developerModeAccountProviderChanged();
void developerModeEnabledChanged();
void remoteLoginEnabledChanged();
void workerWorkingChanged();
Expand All @@ -141,12 +134,9 @@ private slots:
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);

Expand All @@ -156,7 +146,6 @@ private slots:
QString m_usbIpAddress;
QString m_username;
QString m_developerModePackageId;
QString m_developerModeAccountProvider;
bool m_developerModeEnabled;
bool m_remoteLoginEnabled;
DeveloperModeSettings::Status m_workerStatus;
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Expand Up @@ -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)
Expand Down

0 comments on commit 23c035b

Please sign in to comment.