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()
|
||||
{
|
||||
K_GLOBAL_STATIC(KDialogQueue, _self)
|
||||
return _self;
|
||||
K_GLOBAL_STATIC(KDialogQueue, _self)
|
||||
return _self;
|
||||
}
|
||||
|
||||
KDialogQueue::KDialogQueue()
|
||||
|
@ -1083,38 +1083,41 @@ KDialogQueue::KDialogQueue()
|
|||
|
||||
KDialogQueue::~KDialogQueue()
|
||||
{
|
||||
delete d;
|
||||
delete d;
|
||||
}
|
||||
|
||||
// static
|
||||
void KDialogQueue::queueDialog( QDialog *dialog )
|
||||
void KDialogQueue::queueDialog(QDialog *dialog)
|
||||
{
|
||||
KDialogQueue *_this = self();
|
||||
_this->d->queue.append( dialog );
|
||||
KDialogQueue *_this = self();
|
||||
_this->d->queue.append(dialog);
|
||||
|
||||
QTimer::singleShot( 0, _this, SLOT(slotShowQueuedDialog()) );
|
||||
QTimer::singleShot(0, _this, SLOT(slotShowQueuedDialog()));
|
||||
}
|
||||
|
||||
void KDialogQueue::Private::slotShowQueuedDialog()
|
||||
{
|
||||
if ( busy )
|
||||
return;
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
QDialog *dialog;
|
||||
do {
|
||||
if ( queue.isEmpty() )
|
||||
return;
|
||||
dialog = queue.first();
|
||||
queue.pop_front();
|
||||
} while( !dialog );
|
||||
QDialog *dialog = nullptr;
|
||||
do {
|
||||
if (queue.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
dialog = queue.first();
|
||||
queue.pop_front();
|
||||
} while(!dialog);
|
||||
|
||||
busy = true;
|
||||
dialog->exec();
|
||||
busy = false;
|
||||
delete dialog;
|
||||
busy = true;
|
||||
dialog->exec();
|
||||
busy = false;
|
||||
delete dialog;
|
||||
|
||||
if ( !queue.isEmpty() )
|
||||
QTimer::singleShot( 20, q, SLOT(slotShowQueuedDialog()) );
|
||||
if (!queue.isEmpty()) {
|
||||
QTimer::singleShot(20, q, SLOT(slotShowQueuedDialog()));
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_kdialog.cpp"
|
||||
|
|
Loading…
Add table
Reference in a new issue