Use QMetaObject::invokeMethod instead of signal-slot hack.

This commit is contained in:
con
2009-06-19 13:49:52 +02:00
parent 2508fa03a0
commit 75709964ab
6 changed files with 4 additions and 19 deletions

View File

@@ -71,8 +71,5 @@ void AllProjectsFilter::updateFiles()
void AllProjectsFilter::refresh(QFutureInterface<void> &future) void AllProjectsFilter::refresh(QFutureInterface<void> &future)
{ {
Q_UNUSED(future); Q_UNUSED(future);
// invokeAsyncronouslyOnGuiThread QMetaObject::invokeMethod(this, "markFilesAsOutOfDate", Qt::BlockingQueuedConnection);
connect(this, SIGNAL(invokeRefresh()), this, SLOT(markFilesAsOutOfDate()));
emit invokeRefresh();
disconnect(this, SIGNAL(invokeRefresh()), this, SLOT(markFilesAsOutOfDate()));
} }

View File

@@ -58,8 +58,6 @@ protected:
private slots: private slots:
void markFilesAsOutOfDate(); void markFilesAsOutOfDate();
signals:
void invokeRefresh();
private: private:
ProjectExplorerPlugin *m_projectExplorer; ProjectExplorerPlugin *m_projectExplorer;
bool m_filesUpToDate; bool m_filesUpToDate;

View File

@@ -88,8 +88,5 @@ void CurrentProjectFilter::currentProjectChanged(ProjectExplorer::Project *proje
void CurrentProjectFilter::refresh(QFutureInterface<void> &future) void CurrentProjectFilter::refresh(QFutureInterface<void> &future)
{ {
Q_UNUSED(future); Q_UNUSED(future);
// invokeAsyncronouslyOnGuiThread QMetaObject::invokeMethod(this, "markFilesAsOutOfDate", Qt::BlockingQueuedConnection);
connect(this, SIGNAL(invokeRefresh()), this, SLOT(markFilesAsOutOfDate()));
emit invokeRefresh();
disconnect(this, SIGNAL(invokeRefresh()), this, SLOT(markFilesAsOutOfDate()));
} }

View File

@@ -63,9 +63,6 @@ private slots:
void currentProjectChanged(ProjectExplorer::Project *project); void currentProjectChanged(ProjectExplorer::Project *project);
void markFilesAsOutOfDate(); void markFilesAsOutOfDate();
signals:
void invokeRefresh();
private: private:
ProjectExplorerPlugin *m_projectExplorer; ProjectExplorerPlugin *m_projectExplorer;

View File

@@ -83,10 +83,7 @@ void OpenDocumentsFilter::refreshInternally()
void OpenDocumentsFilter::refresh(QFutureInterface<void> &future) void OpenDocumentsFilter::refresh(QFutureInterface<void> &future)
{ {
Q_UNUSED(future); Q_UNUSED(future);
// invokeAsyncronouslyOnGuiThread QMetaObject::invokeMethod(this, "refreshInternally", Qt::BlockingQueuedConnection);
connect(this, SIGNAL(invokeRefresh()), this, SLOT(refreshInternally()));
emit invokeRefresh();
disconnect(this, SIGNAL(invokeRefresh()), this, SLOT(refreshInternally()));
} }
void OpenDocumentsFilter::accept(FilterEntry selection) const void OpenDocumentsFilter::accept(FilterEntry selection) const

View File

@@ -59,8 +59,7 @@ public:
public slots: public slots:
void refreshInternally(); void refreshInternally();
signals:
void invokeRefresh();
private: private:
Core::EditorManager *m_editorManager; Core::EditorManager *m_editorManager;