Bladeren bron

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 jaren geleden
bovenliggende
commit
ac7cf1665a
2 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  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
   // make sure it doesn't crash
   indexer.refreshDatabase(database, QDir::tempPath());
   indexer.refreshDatabase(database, QDir::tempPath());
 
 
+  // ensure all concurrent inserts are complete
+  indexer.waitForImportFinished();
+
   return EXIT_SUCCESS;
   return EXIT_SUCCESS;
 }
 }

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

@@ -82,6 +82,14 @@ public:
 
 
   Q_INVOKABLE void refreshDatabase(ctkDICOMDatabase& database, const QString& directoryName);
   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:
 Q_SIGNALS:
   void foundFilesToIndex(int);
   void foundFilesToIndex(int);
   void indexingFileNumber(int);
   void indexingFileNumber(int);