mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-17 10:29:21 +02:00
disconnecting signal if startup dialog closes before http query completes
This commit is contained in:
@@ -103,6 +103,17 @@ StartTipDialog::~StartTipDialog()
|
||||
delete http_getter;
|
||||
};
|
||||
|
||||
/*
|
||||
* disconnect signal in case dialog is closed before http query completes.
|
||||
* This does happen in unit tests and might happen on slow machines or
|
||||
* slow internet connections
|
||||
*/
|
||||
void StartTipDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
disconnect(http_getter, SIGNAL(done(const QString&)),
|
||||
this, SLOT(downloadComplete(const QString&)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns file name for a random tip
|
||||
*/
|
||||
|
||||
@@ -51,7 +51,8 @@ class StartTipDialog : public QDialog
|
||||
void showTip(const QString &txt, bool new_tip=true);
|
||||
void showTip(int tip_idx);
|
||||
QString getRandomTip();
|
||||
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
||||
public:
|
||||
Ui::StartTipDialog_q *m_dialog;
|
||||
|
||||
@@ -67,6 +68,7 @@ public slots:
|
||||
void prevTip();
|
||||
void showGettingStartedTutorial();
|
||||
void showSummary();
|
||||
|
||||
virtual void close();
|
||||
};
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ void AddressRangeDialogTest::initTestCase()
|
||||
mw->startupLoad();
|
||||
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
||||
d->close();
|
||||
QTest::qWait(1000);
|
||||
QTest::qWait(10);
|
||||
}
|
||||
|
||||
void AddressRangeDialogTest::checkMessageBox()
|
||||
|
||||
Reference in New Issue
Block a user