summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2017-06-19 18:45:17 +0200
committerAleix Pol <[email protected]>2017-06-19 18:45:17 +0200
commit562ab1d3e8d0816a9d93aa61826c3db066db9b1f (patch)
tree9bd5c65c186abea583c634fab3bfe77dcf7079dc
parent1ad1a04a51e28c88bc52d3fb49a00847f79b8273 (diff)
Remove unused code
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp30
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitUpdater.h7
-rw-r--r--libdiscover/resources/AbstractBackendUpdater.h16
-rw-r--r--libdiscover/resources/ResourcesUpdatesModel.cpp11
-rw-r--r--libdiscover/resources/ResourcesUpdatesModel.h3
-rw-r--r--libdiscover/resources/StandardBackendUpdater.cpp28
-rw-r--r--libdiscover/resources/StandardBackendUpdater.h5
7 files changed, 0 insertions, 100 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp b/libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp
index ce3c225..51d73bb 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp
@@ -35,7 +35,6 @@ PackageKitUpdater::PackageKitUpdater(PackageKitBackend * parent)
m_isCancelable(false),
m_isProgressing(false),
m_status(PackageKit::Transaction::Status::StatusUnknown),
- m_speed(0),
m_remainingTime(0),
m_percentage(0),
m_lastUpdate()
@@ -70,7 +69,6 @@ void PackageKitUpdater::setupTransaction(PackageKit::Transaction::TransactionFla
connect(m_transaction.data(), &PackageKit::Transaction::requireRestart, this, &PackageKitUpdater::requireRestart);
connect(m_transaction.data(), &PackageKit::Transaction::eulaRequired, this, &PackageKitUpdater::eulaRequired);
connect(m_transaction.data(), &PackageKit::Transaction::statusChanged, this, &PackageKitUpdater::statusChanged);
- connect(m_transaction.data(), &PackageKit::Transaction::speedChanged, this, &PackageKitUpdater::speedChanged);
connect(m_transaction.data(), &PackageKit::Transaction::allowCancelChanged, this, &PackageKitUpdater::cancellableChanged);
connect(m_transaction.data(), &PackageKit::Transaction::remainingTimeChanged, this, &PackageKitUpdater::remainingTimeChanged);
connect(m_transaction.data(), &PackageKit::Transaction::percentageChanged, this, &PackageKitUpdater::percentageChanged);
@@ -176,23 +174,10 @@ void PackageKitUpdater::remainingTimeChanged()
}
}
-void PackageKitUpdater::speedChanged()
-{
- if (m_speed != m_transaction->speed()) {
- m_speed = m_transaction->speed();
- emit downloadSpeedChanged(m_speed);
- }
-}
-
void PackageKitUpdater::statusChanged()
{
if (m_status != m_transaction->status()) {
m_status = m_transaction->status();
- m_statusMessage = PackageKitMessages::statusMessage(m_status);
- m_statusDetail = PackageKitMessages::statusDetail(m_status);
-
- emit statusMessageChanged(m_statusMessage);
- emit statusDetailChanged(m_statusDetail);
}
}
@@ -249,21 +234,6 @@ bool PackageKitUpdater::isProgressing() const
return m_isProgressing;
}
-QString PackageKitUpdater::statusMessage() const
-{
- return m_statusMessage;
-}
-
-QString PackageKitUpdater::statusDetail() const
-{
- return m_statusDetail;
-}
-
-quint64 PackageKitUpdater::downloadSpeed() const
-{
- return m_speed;
-}
-
void PackageKitUpdater::cancel()
{
if (m_transaction)
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitUpdater.h b/libdiscover/backends/PackageKitBackend/PackageKitUpdater.h
index aab4d14..eddbf2c 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitUpdater.h
+++ b/libdiscover/backends/PackageKitBackend/PackageKitUpdater.h
@@ -50,9 +50,6 @@ class PackageKitUpdater : public AbstractBackendUpdater
bool isProgressing() const override;
void fetchChangelog() const override;
- QString statusMessage() const override;
- QString statusDetail() const override;
- quint64 downloadSpeed() const override;
void proceed() override;
public Q_SLOTS:
@@ -67,7 +64,6 @@ class PackageKitUpdater : public AbstractBackendUpdater
void eulaRequired(const QString &eulaID, const QString &packageID, const QString &vendor, const QString &licenseAgreement);
void finished(PackageKit::Transaction::Exit exit, uint);
void statusChanged();
- void speedChanged();
void cancellableChanged();
void remainingTimeChanged();
void percentageChanged();
@@ -92,9 +88,6 @@ class PackageKitUpdater : public AbstractBackendUpdater
bool m_isCancelable;
bool m_isProgressing;
PackageKit::Transaction::Status m_status;
- QString m_statusMessage;
- QString m_statusDetail;
- quint64 m_speed;
long unsigned int m_remainingTime;
uint m_percentage;
QDateTime m_lastUpdate;
diff --git a/libdiscover/resources/AbstractBackendUpdater.h b/libdiscover/resources/AbstractBackendUpdater.h
index a5be591..0d14164 100644
--- a/libdiscover/resources/AbstractBackendUpdater.h
+++ b/libdiscover/resources/AbstractBackendUpdater.h
@@ -56,9 +56,6 @@ class DISCOVERCOMMON_EXPORT AbstractBackendUpdater : public QObject
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(bool isCancelable READ isCancelable NOTIFY cancelableChanged)
Q_PROPERTY(bool isProgressing READ isProgressing NOTIFY progressingChanged)
- Q_PROPERTY(QString statusMessage READ statusMessage NOTIFY statusMessageChanged)
- Q_PROPERTY(QString statusDetail READ statusDetail NOTIFY statusDetailChanged)
- Q_PROPERTY(quint64 downloadSpeed READ downloadSpeed NOTIFY downloadSpeedChanged)
public:
/**
* Constructs an AbstractBackendUpdater
@@ -118,19 +115,6 @@ class DISCOVERCOMMON_EXPORT AbstractBackendUpdater : public QObject
* @see progressingChanged
*/
virtual bool isProgressing() const = 0;
-
- /**
- * @returns the string about the current status of the update
- */
- virtual QString statusMessage() const = 0;
- /**
- * @returns a more detailled description of what is currently happening with the update
- */
- virtual QString statusDetail() const = 0;
- /**
- * @returns the overall download speed during the downloading phase of the update
- */
- virtual quint64 downloadSpeed() const = 0;
/**
* @returns whether @p res is marked for update
diff --git a/libdiscover/resources/ResourcesUpdatesModel.cpp b/libdiscover/resources/ResourcesUpdatesModel.cpp
index 3525fde..e9c9922 100644
--- a/libdiscover/resources/ResourcesUpdatesModel.cpp
+++ b/libdiscover/resources/ResourcesUpdatesModel.cpp
@@ -53,10 +53,8 @@ void ResourcesUpdatesModel::init()
if(updater && !m_updaters.contains(updater)) {
connect(updater, &AbstractBackendUpdater::progressingChanged, this, &ResourcesUpdatesModel::slotProgressingChanged);
connect(updater, &AbstractBackendUpdater::progressChanged, this, &ResourcesUpdatesModel::progressChanged);
- connect(updater, &AbstractBackendUpdater::statusMessageChanged, this, &ResourcesUpdatesModel::statusMessageChanged);
connect(updater, &AbstractBackendUpdater::statusMessageChanged, this, &ResourcesUpdatesModel::message);
connect(updater, &AbstractBackendUpdater::statusDetailChanged, this, &ResourcesUpdatesModel::message);
- connect(updater, &AbstractBackendUpdater::statusDetailChanged, this, &ResourcesUpdatesModel::statusDetailChanged);
connect(updater, &AbstractBackendUpdater::remainingTimeChanged, this, &ResourcesUpdatesModel::etaChanged);
connect(updater, &AbstractBackendUpdater::downloadSpeedChanged, this, &ResourcesUpdatesModel::downloadSpeedChanged);
connect(updater, &AbstractBackendUpdater::cancelableChanged, this, &ResourcesUpdatesModel::cancelableChanged);
@@ -196,15 +194,6 @@ QString ResourcesUpdatesModel::remainingTime() const
return i18nc("@item:intext Remaining time", "%1 remaining", KFormat().formatDuration(maxEta));
}
-quint64 ResourcesUpdatesModel::downloadSpeed() const
-{
- quint64 ret = 0;
- foreach(AbstractBackendUpdater* upd, m_updaters) {
- ret += upd->downloadSpeed();
- }
- return ret;
-}
-
bool ResourcesUpdatesModel::isCancelable() const
{
bool cancelable = false;
diff --git a/libdiscover/resources/ResourcesUpdatesModel.h b/libdiscover/resources/ResourcesUpdatesModel.h
index cbc87d5..edd1624 100644
--- a/libdiscover/resources/ResourcesUpdatesModel.h
+++ b/libdiscover/resources/ResourcesUpdatesModel.h
@@ -39,7 +39,6 @@ class DISCOVERCOMMON_EXPORT ResourcesUpdatesModel : public QStandardItemModel
Q_OBJECT
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(QString remainingTime READ remainingTime NOTIFY etaChanged)
- Q_PROPERTY(quint64 downloadSpeed READ downloadSpeed NOTIFY downloadSpeedChanged)
Q_PROPERTY(bool isCancelable READ isCancelable NOTIFY cancelableChanged)
Q_PROPERTY(bool isProgressing READ isProgressing NOTIFY progressingChanged)
Q_PROPERTY(QDateTime lastUpdate READ lastUpdate NOTIFY progressingChanged)
@@ -69,8 +68,6 @@ class DISCOVERCOMMON_EXPORT ResourcesUpdatesModel : public QStandardItemModel
void etaChanged();
void cancelableChanged();
void progressingChanged(bool progressing);
- void statusMessageChanged(const QString& message);
- void statusDetailChanged(const QString& msg);
void finished();
void resourceProgressed(AbstractResource* resource, qreal progress);
diff --git a/libdiscover/resources/StandardBackendUpdater.cpp b/libdiscover/resources/StandardBackendUpdater.cpp
index de05ed7..c5f3fe6 100644
--- a/libdiscover/resources/StandardBackendUpdater.cpp
+++ b/libdiscover/resources/StandardBackendUpdater.cpp
@@ -65,7 +65,6 @@ void StandardBackendUpdater::start()
m_backend->installApplication(res);
}
m_settingUp = false;
- emit statusMessageChanged(statusMessage());
if(m_pendingResources.isEmpty()) {
cleanup();
@@ -98,7 +97,6 @@ void StandardBackendUpdater::transactionRemoved(Transaction* t)
const bool found = fromOurBackend && m_pendingResources.remove(t->resource());
if(found && !m_settingUp) {
- setStatusDetail(i18n("%1 has been updated", t->resource()->name()));
qreal p = 1-(qreal(m_pendingResources.size())/m_toUpgrade.size());
setProgress(100*p);
if(m_pendingResources.isEmpty()) {
@@ -206,29 +204,3 @@ bool StandardBackendUpdater::isProgressing() const
{
return m_settingUp || !m_pendingResources.isEmpty();
}
-
-QString StandardBackendUpdater::statusDetail() const
-{
- return m_statusDetail;
-}
-
-void StandardBackendUpdater::setStatusDetail(const QString& msg)
-{
- if (m_statusDetail != msg) {
- m_statusDetail = msg;
- emit statusDetailChanged(msg);
- }
-}
-
-QString StandardBackendUpdater::statusMessage() const
-{
- if(m_settingUp)
- return i18n("Setting up for install...");
- else
- return i18n("Installing...");
-}
-
-quint64 StandardBackendUpdater::downloadSpeed() const
-{
- return 0;
-}
diff --git a/libdiscover/resources/StandardBackendUpdater.h b/libdiscover/resources/StandardBackendUpdater.h
index 34a5a8a..e410861 100644
--- a/libdiscover/resources/StandardBackendUpdater.h
+++ b/libdiscover/resources/StandardBackendUpdater.h
@@ -47,11 +47,7 @@ class DISCOVERCOMMON_EXPORT StandardBackendUpdater : public AbstractBackendUpdat
QDateTime lastUpdate() const override;
bool isCancelable() const override;
bool isProgressing() const override;
- QString statusDetail() const override;
- QString statusMessage() const override;
- quint64 downloadSpeed() const override;
bool isMarked(AbstractResource* res) const override;
- void setStatusDetail(const QString& message);
void setProgress(qreal p);
int updatesCount() const;
@@ -73,7 +69,6 @@ class DISCOVERCOMMON_EXPORT StandardBackendUpdater : public AbstractBackendUpdat
AbstractResourcesBackend * const m_backend;
QSet<AbstractResource*> m_pendingResources;
bool m_settingUp;
- QString m_statusDetail;
qreal m_progress;
QDateTime m_lastUpdate;
};