Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove the workerWorking property.
  • Loading branch information
denexter authored and blammit committed Feb 5, 2018
1 parent e1e8189 commit b33dd4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 38 deletions.
32 changes: 3 additions & 29 deletions src/developermodesettings.cpp
Expand Up @@ -198,12 +198,6 @@ DeveloperModeSettings::remoteLoginEnabled() const
return m_remoteLoginEnabled;
}

bool
DeveloperModeSettings::workerWorking() const
{
return m_workerStatus == Installing || m_workerStatus == Removing;
}

enum DeveloperModeSettings::Status
DeveloperModeSettings::workerStatus() const
{
Expand Down Expand Up @@ -237,7 +231,6 @@ DeveloperModeSettings::setDeveloperMode(bool enabled)
m_packageKitCommand = nullptr;
}
emit workerStatusChanged();
emit workerWorkingChanged();
}
}

Expand Down Expand Up @@ -428,17 +421,15 @@ void DeveloperModeSettings::executePackageKitCommand(
if (!reply.isValid()) {
qWarning() << "Failed to call PackageKit method" << reply.error().message();

m_workerStatus = Failure;
m_workerStatus = Idle;
emit workerStatusChanged();
emit workerWorkingChanged();
}
});
} else {
qWarning() << "Failed to create PackageKit transaction" << reply.error().message();

m_workerStatus = Failure;
m_workerStatus = Idle;
emit workerStatusChanged();
emit workerWorkingChanged();
}
});
}
Expand All @@ -460,22 +451,6 @@ void DeveloperModeSettings::transactionPackage(uint, const QString &packageId)
}
}

void DeveloperModeSettings::transactionResolveFinished(uint exit, uint)
{
if (exit != 1) {
m_packageKitTransaction = QDBusObjectPath();

m_workerStatus = m_packageKitCommand ? Failure : Idle;
m_workerProgress = PROGRESS_INDETERMINATE;
m_packageKitCommand = nullptr;

emit workerStatusChanged();
emit workerWorkingChanged();
emit workerProgressChanged();
}
}


void DeveloperModeSettings::transactionItemProgress(const QString &, uint, uint progress)
{
// Ignore package and status. Progress will proceed from 0 to 100 multiple times.
Expand Down Expand Up @@ -503,13 +478,12 @@ void DeveloperModeSettings::transactionFinished(uint exit, uint)
const bool enabled = m_developerModeEnabled;
m_developerModeEnabled = QFile::exists(DEVELOPER_MODE_PROVIDED_FILE);

m_workerStatus = exit == 1 ? Success : Failure;
m_workerStatus = Idle;
m_workerProgress = PROGRESS_INDETERMINATE;

if (m_developerModeEnabled != enabled) {
emit developerModeEnabledChanged();
}
emit workerStatusChanged();
emit workerWorkingChanged();
emit workerProgressChanged();
}
10 changes: 1 addition & 9 deletions src/developermodesettings.h
Expand Up @@ -72,10 +72,6 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
READ remoteLoginEnabled
NOTIFY remoteLoginEnabledChanged)

Q_PROPERTY(bool workerWorking
READ workerWorking
NOTIFY workerWorkingChanged)

Q_PROPERTY(enum DeveloperModeSettings::Status workerStatus
READ workerStatus
NOTIFY workerStatusChanged)
Expand All @@ -92,9 +88,7 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
Idle = 0,
CheckingStatus,
Installing,
Removing,
Success,
Failure,
Removing
};

QString wlanIpAddress() const;
Expand All @@ -103,7 +97,6 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
bool developerModeAvailable() const;
bool developerModeEnabled() const;
bool remoteLoginEnabled() const;
bool workerWorking() const;
enum DeveloperModeSettings::Status workerStatus() const;
int workerProgress() const;

Expand All @@ -124,7 +117,6 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject

private slots:
void transactionPackage(uint info, const QString &packageId);
void transactionResolveFinished(uint exit, uint runtime);
void transactionItemProgress(const QString &package, uint status, uint progress);
void transactionErrorCode(uint code, const QString &message);
void transactionFinished(uint exit, uint runtime);
Expand Down

0 comments on commit b33dd4a

Please sign in to comment.