From: Peter Penz Date: Fri, 31 Aug 2007 05:16:04 +0000 (+0000) Subject: as David pointed out: Qt4 has a nicer approach for asynchronous events than using... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/5e27ba1de2155585c7141cc9e0a6540945c5ca24 as David pointed out: Qt4 has a nicer approach for asynchronous events than using QTimer svn path=/trunk/KDE/kdebase/apps/; revision=706669 --- diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp index b2c621dbd..a6bc03224 100644 --- a/src/dolphinstatusbar.cpp +++ b/src/dolphinstatusbar.cpp @@ -144,7 +144,7 @@ const QString& DolphinStatusBar::defaultText() const void DolphinStatusBar::resizeEvent(QResizeEvent* event) { QWidget::resizeEvent(event); - QTimer::singleShot(0, this, SLOT(showSpaceInfo())); + QMetaObject::invokeMethod(this, "showSpaceInfo", Qt::QueuedConnection); } void DolphinStatusBar::updateProgressInfo() diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp index ef65149bd..117d63f16 100644 --- a/src/statusbarspaceinfo.cpp +++ b/src/statusbarspaceinfo.cpp @@ -99,7 +99,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) text = i18nc("@info:status", "Getting size..."); } else { text = QString(); - QTimer::singleShot(0, this, SLOT(hide())); + QMetaObject::invokeMethod(this, "hide", Qt::QueuedConnection); } } diff --git a/src/treeviewsidebarpage.cpp b/src/treeviewsidebarpage.cpp index 3793d1da8..1bcee405d 100644 --- a/src/treeviewsidebarpage.cpp +++ b/src/treeviewsidebarpage.cpp @@ -35,7 +35,6 @@ #include #include #include -#include TreeViewSidebarPage::TreeViewSidebarPage(QWidget* parent) : SidebarPage(parent), @@ -194,7 +193,7 @@ void TreeViewSidebarPage::triggerExpanding(const QModelIndex& index) Q_UNUSED(index); // the expanding of the folders may not be done in the context // of this slot - QTimer::singleShot(0, this, SLOT(expandToLeafDir())); + QMetaObject::invokeMethod(this, "expandToLeafDir", Qt::QueuedConnection); } void TreeViewSidebarPage::expandToLeafDir()