on xenial help sign in
Fix DownloadTracker's style.
commit2a7bec9111088759b0b5da7e13dd429a28a58538 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 9 Aug 2013, 10:50 (13 years ago) parenteb081ff
2 files changed+23−24
plugins/Ubuntu/DownloadDaemonListener/download_tracker.cpp+17−18 plugins/Ubuntu/DownloadDaemonListener/download_tracker.h+6−6
plugins/Ubuntu/DownloadDaemonListener/download_tracker.cpp+17−18
@@ -20,7 +20,6 @@
2020
2121
2222#include "download_tracker.h"
23−#include <QDebug>
2423
2524DownloadTracker::DownloadTracker(QObject *parent) :
2625 QObject(parent)
@@ -30,8 +29,8 @@ DownloadTracker::DownloadTracker(QObject *parent) :
3029bool DownloadTracker::isServiceReady()
3130{
3231 bool ready = false;
33− if(this->adaptor != nullptr) {
34− ready = this->adaptor->isValid();
32+ if(m_adaptor != nullptr) {
33+ ready = m_adaptor->isValid();
3534 }
3635
3736 return ready;
@@ -45,9 +44,9 @@ QString DownloadTracker::dbusPath() const
4544void DownloadTracker::setDbusPath(QString& path)
4645{
4746 if(path != "" && m_dbusPath != path){
48− this->m_dbusPath = path;
49− this->startService();
50− Q_EMIT dbusPathChanged(this->m_dbusPath);
47+ m_dbusPath = path;
48+ startService();
49+ Q_EMIT dbusPathChanged(m_dbusPath);
5150 }
5251}
5352
@@ -59,23 +58,23 @@ QString DownloadTracker::service() const
5958void DownloadTracker::setService(QString& service)
6059{
6160 if(service != "" && m_service != service){
62− this->m_service = service;
63− this->startService();
64− Q_EMIT serviceChanged(this->m_service);
61+ m_service = service;
62+ startService();
63+ Q_EMIT serviceChanged(m_service);
6564 }
6665}
6766
6867void DownloadTracker::startService()
6968{
70− if(!this->m_service.isEmpty() && !this->m_dbusPath.isEmpty()) {
71− this->adaptor = new DownloadTrackerAdaptor(this->m_service, this->m_dbusPath, QDBusConnection::sessionBus(), 0);
69+ if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
70+ m_adaptor = new DownloadTrackerAdaptor(m_service, m_dbusPath, QDBusConnection::sessionBus(), 0);
7271
73− this->connect(this->adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
74− this->connect(this->adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
75− this->connect(this->adaptor, SIGNAL(finished(const QString &)), this, SIGNAL(finished(const QString &)));
76− this->connect(this->adaptor, SIGNAL(paused(bool)), this, SIGNAL(paused(bool)));
77− this->connect(this->adaptor, SIGNAL(progress(qulonglong, qulonglong)), this, SIGNAL(progress(qulonglong, qulonglong)));
78− this->connect(this->adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
79− this->connect(this->adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
72+ connect(m_adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
73+ connect(m_adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
74+ connect(m_adaptor, SIGNAL(finished(const QString &)), this, SIGNAL(finished(const QString &)));
75+ connect(m_adaptor, SIGNAL(paused(bool)), this, SIGNAL(paused(bool)));
76+ connect(m_adaptor, SIGNAL(progress(qulonglong, qulonglong)), this, SIGNAL(progress(qulonglong, qulonglong)));
77+ connect(m_adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
78+ connect(m_adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
8079 }
8180}
plugins/Ubuntu/DownloadDaemonListener/download_tracker.h+6−6
@@ -19,13 +19,13 @@
1919 */
2020
2121
22−#ifndef MYTYPE_H
23−#define MYTYPE_H
22+#ifndef DOWNLOADTRACKER_H
23+#define DOWNLOADTRACKER_H
24+
25+#include <interface/downloadtrackeradaptor.h>
2426
2527#include <QObject>
26−#include <QList>
2728#include <QDBusObjectPath>
28−#include <interface/downloadtrackeradaptor.h>
2929
3030class DownloadTracker : public QObject
3131{
@@ -60,9 +60,9 @@ Q_SIGNALS:
6060private:
6161 QString m_dbusPath;
6262 QString m_service;
63− DownloadTrackerAdaptor* adaptor;
63+ DownloadTrackerAdaptor* m_adaptor;
6464
6565 void startService();
6666};
6767
68−#endif // MYTYPE_H
68+#endif // DOWNLOADTRACKER_H