@@ -26,7 +26,7 @@ DownloadTracker::DownloadTracker(QObject *parent) :
29−bool DownloadTracker::isServiceReady()
29+bool DownloadTracker::isServiceReady() const
31 bool ready = false;
31 bool ready = false;
32 if(m_adaptor != nullptr) {
32 if(m_adaptor != nullptr) {
@@ -41,9 +41,9 @@ QString DownloadTracker::dbusPath() const
41 return m_dbusPath;
41 return m_dbusPath;
44−void DownloadTracker::setDbusPath(QString& path)
44+void DownloadTracker::setDbusPath(const QString& path)
46− if(path != "" && m_dbusPath != path){
46+ if(!path.isEmpty() && m_dbusPath != path){
47 m_dbusPath = path;
47 m_dbusPath = path;
48 startService();
48 startService();
49 Q_EMIT dbusPathChanged(m_dbusPath);
49 Q_EMIT dbusPathChanged(m_dbusPath);
@@ -55,9 +55,9 @@ QString DownloadTracker::service() const
55 return m_service;
55 return m_service;
58−void DownloadTracker::setService(QString& service)
58+void DownloadTracker::setService(const QString& service)
60− if(service != "" && m_service != service){
60+ if(!service.isEmpty() && m_service != service){
61 m_service = service;
61 m_service = service;
62 startService();
62 startService();
63 Q_EMIT serviceChanged(m_service);
63 Q_EMIT serviceChanged(m_service);
@@ -68,7 +68,7 @@ void DownloadTracker::startService()
69 // FIXME update dbus path and service on changes
69 // FIXME update dbus path and service on changes
70 if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
70 if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
71− m_adaptor = new DownloadTrackerAdaptor(m_service, m_dbusPath, QDBusConnection::sessionBus(), 0);
71+ m_adaptor = new DownloadTrackerAdaptor(m_service, m_dbusPath, QDBusConnection::sessionBus(), this);
73 connect(m_adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
73 connect(m_adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
74 connect(m_adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
74 connect(m_adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
@@ -78,4 +78,6 @@ void DownloadTracker::startService()
78 connect(m_adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
78 connect(m_adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
79 connect(m_adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
79 connect(m_adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
81+ // FIXME find a better way of determining if the service is ready
82+ Q_EMIT serviceReadyChanged(m_adaptor->isValid());