浏览代码

Restore API for waitForImportFinished but mark as deprecated

Since the threaded indexing implementation was removed, this is
no longer needed.  However removing it changes the API and this
can break code that depends on the method being available.
Steve Pieper 12 年之前
父节点
当前提交
ac7cf1665a
共有 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);