Selaa lähdekoodia

Removed modulesChanged signal, and filenameToReferenceMap from ctkCmdLineModuleDirectoryWatcher

MattClarkson 13 vuotta sitten
vanhempi
commit
78344ec368

+ 0 - 24
Libs/CommandLineModules/Core/ctkCmdLineModuleDirectoryWatcher.cpp

@@ -36,7 +36,6 @@
 ctkCmdLineModuleDirectoryWatcher::ctkCmdLineModuleDirectoryWatcher(ctkCmdLineModuleManager* moduleManager)
   : d(new ctkCmdLineModuleDirectoryWatcherPrivate(moduleManager))
 {
-  connect(d.data(), SIGNAL(modulesChanged()), this, SLOT(onModulesChanged()));
 }
 
 
@@ -76,19 +75,6 @@ QStringList ctkCmdLineModuleDirectoryWatcher::files()
 
 
 //-----------------------------------------------------------------------------
-QHash<QString, ctkCmdLineModuleReference> ctkCmdLineModuleDirectoryWatcher::filenameToReferenceMap() const
-{
-  return d->filenameToReferenceMap();
-}
-
-
-//-----------------------------------------------------------------------------
-void ctkCmdLineModuleDirectoryWatcher::onModulesChanged()
-{
-  emit modulesChanged();
-}
-
-//-----------------------------------------------------------------------------
 // ctkCmdLineModuleDirectoryWatcherPrivate methods
 
 
@@ -120,13 +106,6 @@ void ctkCmdLineModuleDirectoryWatcherPrivate::setDebug(const bool& debug)
 
 
 //-----------------------------------------------------------------------------
-QHash<QString, ctkCmdLineModuleReference> ctkCmdLineModuleDirectoryWatcherPrivate::filenameToReferenceMap() const
-{
-  return this->MapFileNameToReference;
-}
-
-
-//-----------------------------------------------------------------------------
 QStringList ctkCmdLineModuleDirectoryWatcherPrivate::directories()
 {
   return this->FileSystemWatcher->directories();
@@ -146,7 +125,6 @@ void ctkCmdLineModuleDirectoryWatcherPrivate::setDirectories(const QStringList&
   QStringList validDirectories = this->filterInvalidDirectories(directories);
   this->setModuleReferences(validDirectories);
   this->updateWatchedPaths(validDirectories, this->MapFileNameToReference.keys());
-  emit modulesChanged();
 }
 
 
@@ -359,7 +337,6 @@ void ctkCmdLineModuleDirectoryWatcherPrivate::onFileChanged(const QString& path)
   if (ref)
   {
     if (this->Debug) qDebug() << "Reloaded " << path;
-    emit modulesChanged();
   }
   else
   {
@@ -381,7 +358,6 @@ void ctkCmdLineModuleDirectoryWatcherPrivate::onDirectoryChanged(const QString &
     updateModuleReferences(path);
 
     if (this->Debug) qDebug() << "Reloaded modules in" << path;
-    emit modulesChanged();
   }
   else
   {

+ 0 - 19
Libs/CommandLineModules/Core/ctkCmdLineModuleDirectoryWatcher.h

@@ -72,25 +72,6 @@ public:
    */
   QStringList files();
 
-  /**
-   * \brief Retrieves a map of filenames (command line apps) and their command line module reference.
-   */
-  QHash<QString, ctkCmdLineModuleReference> filenameToReferenceMap() const;
-
-Q_SIGNALS:
-
-  /**
-   * \brief Signals that the modules have changed, so GUI's can re-build their menus.
-   */
-  void modulesChanged();
-
-private Q_SLOTS:
-
-  /**
-   * \brief Private slot, so we can connect to the ctkCmdLineModuleDirectoryWatcherPrivate::modulesChanged signal.
-   */
-  void onModulesChanged();
-
 private:
 
   QScopedPointer<ctkCmdLineModuleDirectoryWatcherPrivate> d;

+ 6 - 11
Libs/CommandLineModules/Core/ctkCmdLineModuleDirectoryWatcherPrivate.h

@@ -67,17 +67,6 @@ public:
    */
   QStringList files();
 
-  /**
-   * \see ctkCmdLineModuleDirectoryWatcher::filenameToReferenceMap
-   */
-  QHash<QString, ctkCmdLineModuleReference> filenameToReferenceMap() const;
-
-Q_SIGNALS:
-
-  /**
-   * \brief Used to signal to ctkCmdLineModuleDirectoryWatcher public class.
-   */
-  void modulesChanged();
 
 public Q_SLOTS:
 
@@ -114,6 +103,12 @@ private:
    * \return a list of executables, denoted by their absolute path.
    */
   QStringList extractCurrentlyWatchedFilenamesInDirectory(const QString& directory);
+
+  /**
+   * \brief Returns a list of executable files (not necessarily valid command line clients) in a directory.
+   * \param directory A directory
+   * \return QStringList a list of absolute path names to executable files
+   */
   QStringList getExecutablesInDirectory(const QString& directory);
 
   /**