瀏覽代碼

Merge branch 'restore-waitForFinished'

* restore-waitForFinished:
  Restore API for waitForImportFinished but mark as deprecated
Steve Pieper 12 年之前
父節點
當前提交
aa23a97247
共有 2 個文件被更改,包括 11 次插入0 次删除
  1. 3 0
      Libs/DICOM/Core/Testing/Cpp/ctkDICOMIndexerTest1.cpp
  2. 8 0
      Libs/DICOM/Core/ctkDICOMIndexer.h

+ 3 - 0
Libs/DICOM/Core/Testing/Cpp/ctkDICOMIndexerTest1.cpp

@@ -54,5 +54,8 @@ int ctkDICOMIndexerTest1( int argc, char * argv [] )
   // make sure it doesn't crash
   indexer.refreshDatabase(database, QDir::tempPath());
 
+  // ensure all concurrent inserts are complete
+  indexer.waitForImportFinished();
+
   return EXIT_SUCCESS;
 }

+ 8 - 0
Libs/DICOM/Core/ctkDICOMIndexer.h

@@ -82,6 +82,14 @@ public:
 
   Q_INVOKABLE void refreshDatabase(ctkDICOMDatabase& database, const QString& directoryName);
 
+  ///
+  /// \brief Deprecated - no op.
+  /// \deprecated
+  /// Previously ensured that the QFuture threads have all finished indexing
+  /// before returning control.
+  ///
+  Q_INVOKABLE void waitForImportFinished();
+
 Q_SIGNALS:
   void foundFilesToIndex(int);
   void indexingFileNumber(int);