--- /dev/null
+#ifndef ONLINEPOLLERTHREAD_H
+#define ONLINEPOLLERTHREAD_H
+
+#include <QThread>
+
+class OnlinePollerThread : public QThread
+{
+ Q_OBJECT
+public:
+ //overrides QThread::run()
+ void run();
+
+signals:
+ void online();
+
+public:
+ void stop();
+
+private:
+ bool running;
+};
+
+#endif //ONLINEPOLLERTHREAD_H
#include "remote.h"
#include "remotelistwidgetitem.h"
+#include "onlinepollerthread.h"
#include <QHBoxLayout>
#include <QLabel>
SelectRemoteDlg::SelectRemoteDlg(QWidget *parent)
: QDialog(parent)
{
+ onlinePollerThread = NULL;
this->setWindowTitle(tr("Select remote"));
this->setMinimumHeight(320);
SelectRemoteDlg::~SelectRemoteDlg()
{
delete layout;
+ if (onlinePollerThread != NULL) {
+ onlinePollerThread->stop();
+ onlinePollerThread->wait();
+ delete onlinePollerThread;
+ onlinePollerThread = NULL;
+ }
}
void SelectRemoteDlg::setDB(RemoteDB *db)
}
}
+void SelectRemoteDlg::getDB()
+{
+ if (onlinePollerThread != NULL) {
+ onlinePollerThread->stop();
+ onlinePollerThread->wait();
+ delete onlinePollerThread;
+ onlinePollerThread = NULL;
+ }
+ remoteDBMgr.getDBAsync();
+}
+
void SelectRemoteDlg::refreshDB()
{
setBusy(true);
if (onlinePollerThread != NULL) {
+ onlinePollerThread->stop();
+ onlinePollerThread->wait();
delete onlinePollerThread;
+ onlinePollerThread = NULL;
}
onlinePollerThread = new OnlinePollerThread();
connect(onlinePollerThread, SIGNAL(online()),
SOURCES += settingstable.cpp
SOURCES += aboutdlg.cpp
SOURCES += remotelistwidgetitem.cpp
+SOURCES += onlinepollerthread.cpp
HEADERS += rating.h
HEADERS += settingsdlg.h
HEADERS += settingstable.h
HEADERS += aboutdlg.h
HEADERS += remotelistwidgetitem.h
+HEADERS += onlinepollerthread.h
include(qmaemo5homescreenadaptor/qmaemo5homescreenadaptor.pri)
QT += network
QT += xml
+QT += dbus
CONFIG += mobility
MOBILITY += bearer