on xenial help sign in
Fix DownloadTracker's style.
2a7bec9Michał Sawicz
plugins/Ubuntu/DownloadDaemonListener/download_tracker.cpp+17−18
@@ -20,7 +20,6 @@
20
20
21
21
22#include "download_tracker.h"
22#include "download_tracker.h"
23−#include <QDebug>
24
23
25DownloadTracker::DownloadTracker(QObject *parent) :
24DownloadTracker::DownloadTracker(QObject *parent) :
26 QObject(parent)
25 QObject(parent)
@@ -30,8 +29,8 @@ DownloadTracker::DownloadTracker(QObject *parent) :
30bool DownloadTracker::isServiceReady()
29bool DownloadTracker::isServiceReady()
31{
30{
32 bool ready = false;
31 bool ready = false;
33− if(this->adaptor != nullptr) {
32+ if(m_adaptor != nullptr) {
34− ready = this->adaptor->isValid();
33+ ready = m_adaptor->isValid();
35 }
34 }
36
35
37 return ready;
36 return ready;
@@ -45,9 +44,9 @@ QString DownloadTracker::dbusPath() const
45void DownloadTracker::setDbusPath(QString& path)
44void DownloadTracker::setDbusPath(QString& path)
46{
45{
47 if(path != "" && m_dbusPath != path){
46 if(path != "" && m_dbusPath != path){
48− this->m_dbusPath = path;
47+ m_dbusPath = path;
49− this->startService();
48+ startService();
50− Q_EMIT dbusPathChanged(this->m_dbusPath);
49+ Q_EMIT dbusPathChanged(m_dbusPath);
51 }
50 }
52}
51}
53
52
@@ -59,23 +58,23 @@ QString DownloadTracker::service() const
59void DownloadTracker::setService(QString& service)
58void DownloadTracker::setService(QString& service)
60{
59{
61 if(service != "" && m_service != service){
60 if(service != "" && m_service != service){
62− this->m_service = service;
61+ m_service = service;
63− this->startService();
62+ startService();
64− Q_EMIT serviceChanged(this->m_service);
63+ Q_EMIT serviceChanged(m_service);
65 }
64 }
66}
65}
67
66
68void DownloadTracker::startService()
67void DownloadTracker::startService()
69{
68{
70− if(!this->m_service.isEmpty() && !this->m_dbusPath.isEmpty()) {
69+ if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
71− this->adaptor = new DownloadTrackerAdaptor(this->m_service, this->m_dbusPath, QDBusConnection::sessionBus(), 0);
70+ m_adaptor = new DownloadTrackerAdaptor(m_service, m_dbusPath, QDBusConnection::sessionBus(), 0);
72
71
73− this->connect(this->adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
72+ connect(m_adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
74− this->connect(this->adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
73+ connect(m_adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
75− this->connect(this->adaptor, SIGNAL(finished(const QString &)), this, SIGNAL(finished(const QString &)));
74+ connect(m_adaptor, SIGNAL(finished(const QString &)), this, SIGNAL(finished(const QString &)));
76− this->connect(this->adaptor, SIGNAL(paused(bool)), this, SIGNAL(paused(bool)));
75+ connect(m_adaptor, SIGNAL(paused(bool)), this, SIGNAL(paused(bool)));
77− this->connect(this->adaptor, SIGNAL(progress(qulonglong, qulonglong)), this, SIGNAL(progress(qulonglong, qulonglong)));
76+ connect(m_adaptor, SIGNAL(progress(qulonglong, qulonglong)), this, SIGNAL(progress(qulonglong, qulonglong)));
78− this->connect(this->adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
77+ connect(m_adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
79− this->connect(this->adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
78+ connect(m_adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
80 }
79 }
81}
80}
plugins/Ubuntu/DownloadDaemonListener/download_tracker.h+6−6
@@ -19,13 +19,13 @@
19 */
19 */
20
20
21
21
22−#ifndef MYTYPE_H
22+#ifndef DOWNLOADTRACKER_H
23−#define MYTYPE_H
23+#define DOWNLOADTRACKER_H
24+
25+#include <interface/downloadtrackeradaptor.h>
24
26
25#include <QObject>
27#include <QObject>
26−#include <QList>
27#include <QDBusObjectPath>
28#include <QDBusObjectPath>
28−#include <interface/downloadtrackeradaptor.h>
29
29
30class DownloadTracker : public QObject
30class DownloadTracker : public QObject
31{
31{
@@ -60,9 +60,9 @@ Q_SIGNALS:
60private:
60private:
61 QString m_dbusPath;
61 QString m_dbusPath;
62 QString m_service;
62 QString m_service;
63− DownloadTrackerAdaptor* adaptor;
63+ DownloadTrackerAdaptor* m_adaptor;
64
64
65 void startService();
65 void startService();
66};
66};
67
67
68−#endif // MYTYPE_H
68+#endif // DOWNLOADTRACKER_H