mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kdeui: initialize variable in KDialogQueue::Private::slotShowQueuedDialog()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e555f8ce9b
commit
1f67d424e7
1 changed files with 25 additions and 22 deletions
|
@ -1072,8 +1072,8 @@ public:
|
||||||
|
|
||||||
KDialogQueue* KDialogQueue::self()
|
KDialogQueue* KDialogQueue::self()
|
||||||
{
|
{
|
||||||
K_GLOBAL_STATIC(KDialogQueue, _self)
|
K_GLOBAL_STATIC(KDialogQueue, _self)
|
||||||
return _self;
|
return _self;
|
||||||
}
|
}
|
||||||
|
|
||||||
KDialogQueue::KDialogQueue()
|
KDialogQueue::KDialogQueue()
|
||||||
|
@ -1083,38 +1083,41 @@ KDialogQueue::KDialogQueue()
|
||||||
|
|
||||||
KDialogQueue::~KDialogQueue()
|
KDialogQueue::~KDialogQueue()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void KDialogQueue::queueDialog( QDialog *dialog )
|
void KDialogQueue::queueDialog(QDialog *dialog)
|
||||||
{
|
{
|
||||||
KDialogQueue *_this = self();
|
KDialogQueue *_this = self();
|
||||||
_this->d->queue.append( dialog );
|
_this->d->queue.append(dialog);
|
||||||
|
|
||||||
QTimer::singleShot( 0, _this, SLOT(slotShowQueuedDialog()) );
|
QTimer::singleShot(0, _this, SLOT(slotShowQueuedDialog()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KDialogQueue::Private::slotShowQueuedDialog()
|
void KDialogQueue::Private::slotShowQueuedDialog()
|
||||||
{
|
{
|
||||||
if ( busy )
|
if (busy) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QDialog *dialog;
|
QDialog *dialog = nullptr;
|
||||||
do {
|
do {
|
||||||
if ( queue.isEmpty() )
|
if (queue.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
dialog = queue.first();
|
}
|
||||||
queue.pop_front();
|
dialog = queue.first();
|
||||||
} while( !dialog );
|
queue.pop_front();
|
||||||
|
} while(!dialog);
|
||||||
|
|
||||||
busy = true;
|
busy = true;
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
busy = false;
|
busy = false;
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
|
||||||
if ( !queue.isEmpty() )
|
if (!queue.isEmpty()) {
|
||||||
QTimer::singleShot( 20, q, SLOT(slotShowQueuedDialog()) );
|
QTimer::singleShot(20, q, SLOT(slotShowQueuedDialog()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_kdialog.cpp"
|
#include "moc_kdialog.cpp"
|
||||||
|
|
Loading…
Add table
Reference in a new issue