aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbAndroid/dbandroidpathdialog.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-07-27 23:54:15 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2018-07-27 23:54:15 -0400
commit6d3d39356473078c6b47e03b8a7616e4b34de928 (patch)
treefe5be2e6a08e4cfc73207746aba4c9fccfecfa10 /Plugins/DbAndroid/dbandroidpathdialog.cpp
parentf98e49169a40876bcf1df832de6e908d1b350193 (diff)
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
Update upstream source from tag 'upstream/3.2.1+dfsg1'
Update to upstream version '3.2.1+dfsg1' with Debian dir 5ea0333565de4dc898c062cc0ff4ba1153e2c1e4
Diffstat (limited to 'Plugins/DbAndroid/dbandroidpathdialog.cpp')
-rw-r--r--Plugins/DbAndroid/dbandroidpathdialog.cpp38
1 files changed, 9 insertions, 29 deletions
diff --git a/Plugins/DbAndroid/dbandroidpathdialog.cpp b/Plugins/DbAndroid/dbandroidpathdialog.cpp
index 10a6fb8..66a021b 100644
--- a/Plugins/DbAndroid/dbandroidpathdialog.cpp
+++ b/Plugins/DbAndroid/dbandroidpathdialog.cpp
@@ -8,13 +8,13 @@
#include "iconmanager.h"
#include "dbandroidconnection.h"
#include "dbandroidconnectionfactory.h"
+#include "common/lazytrigger.h"
+#include "common/userinputfilter.h"
#include <QDebug>
-#include <QTimer>
#include <QPushButton>
#include <QInputDialog>
#include <QMessageBox>
#include <QtConcurrent/QtConcurrent>
-#include <common/userinputfilter.h>
DbAndroidPathDialog::DbAndroidPathDialog(const DbAndroid* plugin, QWidget *parent) :
QDialog(parent),
@@ -57,15 +57,9 @@ void DbAndroidPathDialog::init()
ui->createDatabaseButton->setIcon(ICONS.PLUS);
ui->deleteDatabaseButton->setIcon(ICONS.DELETE);
- dbListUpdateTimer = new QTimer(this);
- dbListUpdateTimer->setSingleShot(true);
- dbListUpdateTimer->setInterval(500);
- connect(dbListUpdateTimer, SIGNAL(timeout()), this, SLOT(refreshDbList()));
- appListUpdateTimer = new QTimer(this);
- appListUpdateTimer->setSingleShot(true);
- appListUpdateTimer->setInterval(500);
- connect(appListUpdateTimer, SIGNAL(timeout()), this, SLOT(refreshAppList()));
+ dbListUpdateTrigger = new LazyTrigger(500, this, SLOT(refreshDbList()));
+ appListUpdateTrigger = new LazyTrigger(500, this, SLOT(refreshAppList()));
connect(ui->deviceCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(scheduleAppListUpdate()));
connect(ui->databaseCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateState()));
@@ -185,15 +179,8 @@ void DbAndroidPathDialog::scheduleDbListUpdate()
if (suspendDbListUpdates)
return;
- bool startCover = true;
- if (dbListUpdateTimer->isActive())
- {
- dbListUpdateTimer->stop();
- startCover = false;
- }
-
- dbListUpdateTimer->start();
- if (startCover)
+ dbListUpdateTrigger->schedule();
+ if (!dbListCover->isVisible())
dbListCover->show();
handleDbCreationUpdate(false);
@@ -208,15 +195,8 @@ void DbAndroidPathDialog::scheduleAppListUpdate()
if (suspendAppListUpdates)
return;
- bool startCover = true;
- if (appListUpdateTimer->isActive())
- {
- appListUpdateTimer->stop();
- startCover = false;
- }
-
- appListUpdateTimer->start();
- if (startCover)
+ appListUpdateTrigger->schedule();
+ if (!appListCover->isVisible())
appListCover->show();
updateValidations();
@@ -373,7 +353,7 @@ void DbAndroidPathDialog::updateDeviceList()
void DbAndroidPathDialog::updateValidations()
{
- bool isUpdating = dbListUpdateTimer->isActive();
+ bool isUpdating = dbListCover->isVisible();
bool ipOk = true;
bool deviceOk = true;
if (ui->ipRadio->isChecked())