Procházet zdrojové kódy

Improved code style for consistency.

Sascha Zelzer před 12 roky
rodič
revize
6def9e93c2
22 změnil soubory, kde provedl 176 přidání a 3 odebrání
  1. 1 0
      Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFPDescriptionPrivate.cpp
  2. 6 1
      Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFPUtil.cpp
  3. 27 0
      Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFunctionPointer.cpp
  4. 3 0
      Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleFunctionPointerTask.cpp
  5. 9 0
      Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleBackendLocalProcess.cpp
  6. 13 0
      Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleProcessTask.cpp
  7. 1 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleBackend.cpp
  8. 1 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleDefaultPathBuilder.cpp
  9. 11 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleFrontend.cpp
  10. 1 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleFrontendFactory.cpp
  11. 9 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleManager.cpp
  12. 1 0
      Libs/CommandLineModules/Core/ctkCmdLineModulePathBuilder.cpp
  13. 12 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleReference.cpp
  14. 12 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleRunException.cpp
  15. 4 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleXmlMsgHandler.cpp
  16. 4 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleXmlProgressWatcher.cpp
  17. 10 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleXmlValidator.cpp
  18. 17 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleXslTransform.cpp
  19. 3 1
      Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleFrontendFactoryQtGui.cpp
  20. 24 0
      Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleObjectTreeWalker.cpp
  21. 3 1
      Libs/CommandLineModules/Frontend/QtWebKit/ctkCmdLineModuleFrontendFactoryQtWebKit.cpp
  22. 4 0
      Libs/CommandLineModules/Frontend/QtWebKit/ctkCmdLineModuleFrontendQtWebKit.cpp

+ 1 - 0
Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFPDescriptionPrivate.cpp

@@ -21,6 +21,7 @@
 
 #include "ctkCmdLineModuleBackendFPDescriptionPrivate.h"
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::DescriptionPrivate::xmlDescription() const
 {
   QString xml;

+ 6 - 1
Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFPUtil.cpp

@@ -25,25 +25,29 @@
 namespace ctk {
 namespace CmdLineModuleBackendFunctionPointer {
 
+//----------------------------------------------------------------------------
 FunctionPointerHolderBase::~FunctionPointerHolderBase()
 {
 }
 
-
+//----------------------------------------------------------------------------
 FunctionPointerProxy::FunctionPointerProxy()
   : FpHolder(NULL)
 {}
 
+//----------------------------------------------------------------------------
 FunctionPointerProxy::~FunctionPointerProxy()
 {
   delete FpHolder;
 }
 
+//----------------------------------------------------------------------------
 FunctionPointerProxy::FunctionPointerProxy(const FunctionPointerProxy& other)
   : FpHolder(other.FpHolder->clone())
 {
 }
 
+//----------------------------------------------------------------------------
 FunctionPointerProxy& FunctionPointerProxy::operator=(const FunctionPointerProxy& other)
 {
   delete this->FpHolder;
@@ -51,6 +55,7 @@ FunctionPointerProxy& FunctionPointerProxy::operator=(const FunctionPointerProxy
   return *this;
 }
 
+//----------------------------------------------------------------------------
 void FunctionPointerProxy::call(const QList<QVariant> &args)
 {
   FpHolder->call(args);

+ 27 - 0
Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFunctionPointer.cpp

@@ -37,12 +37,14 @@
 namespace ctk {
 namespace CmdLineModuleBackendFunctionPointer {
 
+//----------------------------------------------------------------------------
 template<>
 CTK_CMDLINEMODULEBACKENDFP_EXPORT QString GetParameterTypeName<int>()
 {
   return "integer";
 }
 
+//----------------------------------------------------------------------------
 template<>
 CTK_CMDLINEMODULEBACKENDFP_EXPORT QString GetParameterTypeName<QList<int> >()
 {
@@ -52,6 +54,7 @@ CTK_CMDLINEMODULEBACKENDFP_EXPORT QString GetParameterTypeName<QList<int> >()
 }
 }
 
+//----------------------------------------------------------------------------
 void CalculateFibonacciNumbers(int level) //, QList<int>* result)
 {
   qDebug() << "Number: 0";
@@ -74,70 +77,84 @@ void CalculateFibonacciNumbers(int level) //, QList<int>* result)
   }
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendFunctionPointer::Description::Description()
   : d(new ctkCmdLineModuleBackendFunctionPointer::DescriptionPrivate)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendFunctionPointer::Description::~Description()
 {
 }
 
+//----------------------------------------------------------------------------
 QUrl ctkCmdLineModuleBackendFunctionPointer::Description::moduleLocation() const
 {
   return d->ModuleLocation;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::Description::moduleCategory() const
 {
   return d->ModuleCategory;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleBackendFunctionPointer::Description::setModuleCategory(const QString& category)
 {
   d->ModuleCategory = category;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::Description::moduleTitle() const
 {
   return d->ModuleTitle;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleBackendFunctionPointer::Description::setModuleTitle(const QString &title)
 {
   d->ModuleTitle = title;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::Description::moduleDescription() const
 {
   return d->ModuleDescription;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleBackendFunctionPointer::Description::setModuleDescription(const QString &description)
 {
   d->ModuleDescription = description;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::Description::moduleVersion() const
 {
   return d->ModuleVersion;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleBackendFunctionPointer::Description::setModuleVersion(const QString &version)
 {
   d->ModuleVersion = version;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::Description::moduleContributor() const
 {
   return d->ModuleContributor;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleBackendFunctionPointer::Description::setModuleContributor(const QString &contributor)
 {
   d->ModuleContributor = contributor;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendFunctionPointer::Description::Description(const QUrl &location,
                                                                  const ctk::CmdLineModuleBackendFunctionPointer::FunctionPointerProxy &fpProxy)
   : d(new ctkCmdLineModuleBackendFunctionPointer::DescriptionPrivate)
@@ -146,45 +163,53 @@ ctkCmdLineModuleBackendFunctionPointer::Description::Description(const QUrl &loc
   d->FpProxy = fpProxy;
 }
 
+//----------------------------------------------------------------------------
 struct ctkCmdLineModuleBackendFunctionPointerPrivate
 {
   QHash<QUrl, ctkCmdLineModuleBackendFunctionPointer::Description> UrlToFpDescription;
 };
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendFunctionPointer::ctkCmdLineModuleBackendFunctionPointer()
   : d(new ctkCmdLineModuleBackendFunctionPointerPrivate)
 {
   this->registerFunctionPointer("Fibonacci Number", CalculateFibonacciNumbers, "Count");
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::name() const
 {
   return "Function Pointer (experimental)";
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendFunctionPointer::description() const
 {
   return "Calls a previously registered function pointer.";
 }
 
+//----------------------------------------------------------------------------
 QList<QString> ctkCmdLineModuleBackendFunctionPointer::schemes() const
 {
   static QList<QString> supportedSchemes = QList<QString>() << "fp";
   return supportedSchemes;
 }
 
+//----------------------------------------------------------------------------
 qint64 ctkCmdLineModuleBackendFunctionPointer::timeStamp(const QUrl &location) const
 {
   Q_UNUSED(location)
   return 0;
 }
 
+//----------------------------------------------------------------------------
 QByteArray ctkCmdLineModuleBackendFunctionPointer::rawXmlDescription(const QUrl& location)
 {
   if (!d->UrlToFpDescription.contains(location)) return QByteArray();
   return QByteArray(qPrintable(d->UrlToFpDescription[location].d->xmlDescription()));
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFuture ctkCmdLineModuleBackendFunctionPointer::run(ctkCmdLineModuleFrontend *frontend)
 {
   QUrl url = frontend->location();
@@ -198,11 +223,13 @@ ctkCmdLineModuleFuture ctkCmdLineModuleBackendFunctionPointer::run(ctkCmdLineMod
   return fpTask->start();
 }
 
+//----------------------------------------------------------------------------
 QList<QUrl> ctkCmdLineModuleBackendFunctionPointer::registeredFunctionPointers() const
 {
   return d->UrlToFpDescription.keys();
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendFunctionPointer::Description*
 ctkCmdLineModuleBackendFunctionPointer::registerFunctionPointerProxy(const QString& title,
                                                                      const ctk::CmdLineModuleBackendFunctionPointer::FunctionPointerProxy& proxy,

+ 3 - 0
Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleFunctionPointerTask.cpp

@@ -26,12 +26,14 @@
 #include "ctkCmdLineModuleFuture.h"
 #include "ctkCmdLineModuleRunException.h"
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFunctionPointerTask::ctkCmdLineModuleFunctionPointerTask(const ctkCmdLineModuleBackendFunctionPointer::Description &fpDescr, const QList<QVariant> &paramValues)
   : FpDescription(fpDescr)
   , ParamValues(paramValues)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFuture ctkCmdLineModuleFunctionPointerTask::start()
 {
   this->setRunnable(this);
@@ -42,6 +44,7 @@ ctkCmdLineModuleFuture ctkCmdLineModuleFunctionPointerTask::start()
   return future;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleFunctionPointerTask::run()
 {
   if (this->isCanceled())

+ 9 - 0
Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleBackendLocalProcess.cpp

@@ -35,6 +35,7 @@
 #include <QProcess>
 #include <QUrl>
 
+//----------------------------------------------------------------------------
 struct ctkCmdLineModuleBackendLocalProcessPrivate
 {
 
@@ -119,30 +120,36 @@ struct ctkCmdLineModuleBackendLocalProcessPrivate
   }
 };
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendLocalProcess::ctkCmdLineModuleBackendLocalProcess()
   : d(new ctkCmdLineModuleBackendLocalProcessPrivate){
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackendLocalProcess::~ctkCmdLineModuleBackendLocalProcess()
 {
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendLocalProcess::name() const
 {
   return "Local Process";
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleBackendLocalProcess::description() const
 {
   return "Runs an executable command line module using a local process.";
 }
 
+//----------------------------------------------------------------------------
 QList<QString> ctkCmdLineModuleBackendLocalProcess::schemes() const
 {
   static QList<QString> supportedSchemes = QList<QString>() << "file";
   return supportedSchemes;
 }
 
+//----------------------------------------------------------------------------
 qint64 ctkCmdLineModuleBackendLocalProcess::timeStamp(const QUrl &location) const
 {
   QFileInfo fileInfo(location.toLocalFile());
@@ -154,6 +161,7 @@ qint64 ctkCmdLineModuleBackendLocalProcess::timeStamp(const QUrl &location) cons
   return 0;
 }
 
+//----------------------------------------------------------------------------
 QByteArray ctkCmdLineModuleBackendLocalProcess::rawXmlDescription(const QUrl &location)
 {
   QProcess process;
@@ -170,6 +178,7 @@ QByteArray ctkCmdLineModuleBackendLocalProcess::rawXmlDescription(const QUrl &lo
   return process.readAllStandardOutput();
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFuture ctkCmdLineModuleBackendLocalProcess::run(ctkCmdLineModuleFrontend* frontend)
 {
   QStringList args = d->commandLineArguments(frontend->values(), frontend->moduleReference().description());

+ 13 - 0
Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleProcessTask.cpp

@@ -33,6 +33,7 @@
 #include <signal.h>
 #endif
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleProcessWatcher::ctkCmdLineModuleProcessWatcher(QProcess& process, const QString& location,
                                                                ctkCmdLineModuleFutureInterface &futureInterface)
   : process(process), location(location), futureInterface(futureInterface), processXmlWatcher(&process),
@@ -58,27 +59,32 @@ ctkCmdLineModuleProcessWatcher::ctkCmdLineModuleProcessWatcher(QProcess& process
   futureWatcher.setFuture(futureInterface.future());
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::filterStarted(const QString& name, const QString& comment)
 {
   Q_UNUSED(comment)
   futureInterface.setProgressValueAndText(incrementProgress(), name);
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::filterProgress(float progress)
 {
   futureInterface.setProgressValue(updateProgress(progress));
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::filterFinished(const QString& name)
 {
   futureInterface.setProgressValueAndText(incrementProgress(), "Finished: " + name);
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::filterXmlError(const QString &error)
 {
   qDebug().nospace() << "[Module " << location << "]: " << error;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::pauseProcess()
 {
   if (processPaused || !futureInterface.isPaused()) return;
@@ -96,6 +102,7 @@ void ctkCmdLineModuleProcessWatcher::pauseProcess()
 #endif
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::resumeProcess()
 {
   if (!processPaused) return;
@@ -113,6 +120,7 @@ void ctkCmdLineModuleProcessWatcher::resumeProcess()
 #endif
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessWatcher::cancelProcess()
 {
   process.terminate();
@@ -129,12 +137,14 @@ int ctkCmdLineModuleProcessWatcher::updateProgress(float progress)
   return progressValue;
 }
 
+//----------------------------------------------------------------------------
 int ctkCmdLineModuleProcessWatcher::incrementProgress()
 {
   if (++progressValue > 999) progressValue = 999;
   return progressValue;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleProcessTask::ctkCmdLineModuleProcessTask(const QString& location, const QStringList& args)
   : location(location), args(args)
 {
@@ -144,10 +154,12 @@ ctkCmdLineModuleProcessTask::ctkCmdLineModuleProcessTask(const QString& location
 #endif
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleProcessTask::~ctkCmdLineModuleProcessTask()
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFuture ctkCmdLineModuleProcessTask::start()
 {
   this->setRunnable(this);
@@ -157,6 +169,7 @@ ctkCmdLineModuleFuture ctkCmdLineModuleProcessTask::start()
   return future;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleProcessTask::run()
 {
   if (this->isCanceled())

+ 1 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleBackend.cpp

@@ -21,6 +21,7 @@
 
 #include "ctkCmdLineModuleBackend.h"
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackend::~ctkCmdLineModuleBackend()
 {
 }

+ 1 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleDefaultPathBuilder.cpp

@@ -25,6 +25,7 @@
 #include <QCoreApplication>
 #include <cstdlib>
 
+//----------------------------------------------------------------------------
 struct ctkCmdLineModuleDefaultPathBuilderPrivate
 {
 public:

+ 11 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleFrontend.cpp

@@ -29,6 +29,7 @@
 
 #include <QUrl>
 
+//----------------------------------------------------------------------------
 struct ctkCmdLineModuleFrontendPrivate
 {
   ctkCmdLineModuleFrontendPrivate(const ctkCmdLineModuleReference& moduleRef)
@@ -44,16 +45,19 @@ struct ctkCmdLineModuleFrontendPrivate
 };
 
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFrontend::ctkCmdLineModuleFrontend(const ctkCmdLineModuleReference& moduleRef)
   : d(new ctkCmdLineModuleFrontendPrivate(moduleRef))
 {
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleFrontend::setFuture(const ctkCmdLineModuleFuture &future)
 {
   d->Future = future;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFrontend::~ctkCmdLineModuleFrontend()
 {
 }
@@ -73,31 +77,37 @@ QList<QString> ctkCmdLineModuleFrontend::parameterNames() const
   return d->ParameterNames;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference ctkCmdLineModuleFrontend::moduleReference() const
 {
   return d->ModuleReference;
 }
 
+//----------------------------------------------------------------------------
 QUrl ctkCmdLineModuleFrontend::location() const
 {
   return d->ModuleReference.location();
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFuture ctkCmdLineModuleFrontend::future() const
 {
   return d->Future;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleFrontend::isRunning() const
 {
   return d->Future.isRunning();
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleFrontend::isPaused() const
 {
   return d->Future.isPaused();
 }
 
+//----------------------------------------------------------------------------
 QHash<QString, QVariant> ctkCmdLineModuleFrontend::values() const
 {
   QHash<QString,QVariant> result;
@@ -108,6 +118,7 @@ QHash<QString, QVariant> ctkCmdLineModuleFrontend::values() const
   return result;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleFrontend::setValues(const QHash<QString, QVariant> &values)
 {
   QHashIterator<QString,QVariant> iter(values);

+ 1 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleFrontendFactory.cpp

@@ -22,6 +22,7 @@
 #include "ctkCmdLineModuleFrontendFactory.h"
 
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFrontendFactory::~ctkCmdLineModuleFrontendFactory()
 {
 }

+ 9 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleManager.cpp

@@ -42,6 +42,7 @@
 
 #include <QFuture>
 
+//----------------------------------------------------------------------------
 struct ctkCmdLineModuleManagerPrivate
 {
   ctkCmdLineModuleManagerPrivate(ctkCmdLineModuleManager::ValidationMode mode, const QString& cacheDir)
@@ -83,15 +84,18 @@ struct ctkCmdLineModuleManagerPrivate
   const ctkCmdLineModuleManager::ValidationMode ValidationMode;
 };
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleManager::ctkCmdLineModuleManager(ValidationMode validationMode, const QString& cacheDir)
   : d(new ctkCmdLineModuleManagerPrivate(validationMode, cacheDir))
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleManager::~ctkCmdLineModuleManager()
 {
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleManager::registerBackend(ctkCmdLineModuleBackend *backend)
 {
   QMutexLocker lock(&d->Mutex);
@@ -115,6 +119,7 @@ void ctkCmdLineModuleManager::registerBackend(ctkCmdLineModuleBackend *backend)
   }
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference
 ctkCmdLineModuleManager::registerModule(const QUrl &location)
 {
@@ -237,6 +242,7 @@ ctkCmdLineModuleManager::registerModule(const QUrl &location)
   return ref;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleManager::unregisterModule(const ctkCmdLineModuleReference& ref)
 {
   {
@@ -254,18 +260,21 @@ void ctkCmdLineModuleManager::unregisterModule(const ctkCmdLineModuleReference&
   emit moduleUnregistered(ref);
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference ctkCmdLineModuleManager::moduleReference(const QUrl &location) const
 {
   QMutexLocker lock(&d->Mutex);
   return d->LocationToRef[location];
 }
 
+//----------------------------------------------------------------------------
 QList<ctkCmdLineModuleReference> ctkCmdLineModuleManager::moduleReferences() const
 {
   QMutexLocker lock(&d->Mutex);
   return d->LocationToRef.values();
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFuture ctkCmdLineModuleManager::run(ctkCmdLineModuleFrontend *frontend)
 {
   QMutexLocker lock(&d->Mutex);

+ 1 - 0
Libs/CommandLineModules/Core/ctkCmdLineModulePathBuilder.cpp

@@ -21,6 +21,7 @@
 
 #include "ctkCmdLineModulePathBuilder.h"
 
+//----------------------------------------------------------------------------
 ctkCmdLineModulePathBuilder::~ctkCmdLineModulePathBuilder()
 {
 }

+ 12 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleReference.cpp

@@ -26,11 +26,13 @@
 #include <QBuffer>
 
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReferencePrivate::ctkCmdLineModuleReferencePrivate()
   : Backend(NULL)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleDescription ctkCmdLineModuleReferencePrivate::description() const
 {
   // Lazy creation. The title is a required XML element.
@@ -44,50 +46,60 @@ ctkCmdLineModuleDescription ctkCmdLineModuleReferencePrivate::description() cons
   return Description;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference::ctkCmdLineModuleReference()
   : d(new ctkCmdLineModuleReferencePrivate())
 {}
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference::~ctkCmdLineModuleReference()
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference::ctkCmdLineModuleReference(const ctkCmdLineModuleReference &ref)
   : d(ref.d)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference &ctkCmdLineModuleReference::operator =(const ctkCmdLineModuleReference &ref)
 {
   d = ref.d;
   return *this;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleReference::operator bool()
 {
   return !d->RawXmlDescription.isEmpty();
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleDescription ctkCmdLineModuleReference::description() const
 {
   return d->description();
 }
 
+//----------------------------------------------------------------------------
 QByteArray ctkCmdLineModuleReference::rawXmlDescription() const
 {
   return d->RawXmlDescription;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleReference::xmlValidationErrorString() const
 {
   return d->XmlValidationErrorString;
 }
 
+//----------------------------------------------------------------------------
 QUrl ctkCmdLineModuleReference::location() const
 {
   return d->Location;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleBackend *ctkCmdLineModuleReference::backend() const
 {
   return d->Backend;

+ 12 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleRunException.cpp

@@ -23,6 +23,7 @@
 
 #include <QUrl>
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(const QUrl &location, int errorCode, const QString &errorString)
   : QtConcurrent::Exception(),
     ctkException(QString("Running module \"%1\" failed with code %2: %3").arg(location.toString()).arg(errorCode).arg(errorString)),
@@ -30,6 +31,7 @@ ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(const QUrl &location,
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(const QUrl &location, int errorCode, const QString &errorString,
     const ctkCmdLineModuleRunException& cause)
   : QtConcurrent::Exception(), ctkException(location.toString(), cause),
@@ -37,51 +39,61 @@ ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(const QUrl &location,
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleRunException::ctkCmdLineModuleRunException(const ctkCmdLineModuleRunException& o)
   : QtConcurrent::Exception(o), ctkException(o),
     Location(o.Location), ErrorCode(o.ErrorCode), ErrorString(o.ErrorString)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleRunException::~ctkCmdLineModuleRunException() throw()
 {
 }
 
+//----------------------------------------------------------------------------
 QUrl ctkCmdLineModuleRunException::location() const throw()
 {
   return Location;
 }
 
+//----------------------------------------------------------------------------
 int ctkCmdLineModuleRunException::errorCode() const throw()
 {
   return ErrorCode;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleRunException::errorString() const throw()
 {
   return ErrorString;
 }
 
+//----------------------------------------------------------------------------
 const char* ctkCmdLineModuleRunException::name() const throw()
 {
   return "CTK CommandLineModule Run Exception";
 }
 
+//----------------------------------------------------------------------------
 const char* ctkCmdLineModuleRunException::className() const throw()
 {
   return "ctkCmdLineModuleRunException";
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleRunException* ctkCmdLineModuleRunException::clone() const
 {
   return new ctkCmdLineModuleRunException(*this);
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleRunException::rethrow() const
 {
   throw *this;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleRunException::raise() const
 {
   throw *this;

+ 4 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleXmlMsgHandler.cpp

@@ -23,21 +23,25 @@
 
 #include <QXmlStreamReader>
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleXmlMsgHandler::statusMessage() const
 {
   return Description;
 }
 
+//----------------------------------------------------------------------------
 int ctkCmdLineModuleXmlMsgHandler::line() const
 {
   return SourceLocation.line();
 }
 
+//----------------------------------------------------------------------------
 int ctkCmdLineModuleXmlMsgHandler::column() const
 {
   return SourceLocation.column();
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXmlMsgHandler::handleMessage(QtMsgType type, const QString& description,
                                                   const QUrl& identifier, const QSourceLocation& sourceLocation)
 {

+ 4 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleXmlProgressWatcher.cpp

@@ -36,6 +36,7 @@ static QString FILTER_END = "filter-end";
 
 }
 
+//----------------------------------------------------------------------------
 class ctkCmdLineModuleXmlProgressWatcherPrivate
 {
 public:
@@ -182,6 +183,8 @@ public:
   float currentProgress;
 };
 
+
+//----------------------------------------------------------------------------
 ctkCmdLineModuleXmlProgressWatcher::ctkCmdLineModuleXmlProgressWatcher(QIODevice* input)
   : d(new ctkCmdLineModuleXmlProgressWatcherPrivate(input, this))
 {
@@ -194,6 +197,7 @@ ctkCmdLineModuleXmlProgressWatcher::ctkCmdLineModuleXmlProgressWatcher(QIODevice
   connect(d->input, SIGNAL(readyRead()), SLOT(_q_readyRead()));
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleXmlProgressWatcher::~ctkCmdLineModuleXmlProgressWatcher()
 {
 }

+ 10 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleXmlValidator.cpp

@@ -30,6 +30,7 @@
 
 #include <QDebug>
 
+//----------------------------------------------------------------------------
 class ctkCmdLineModuleXmlValidatorPrivate
 {
 public:
@@ -44,31 +45,38 @@ public:
   QString ErrorStr;
 };
 
+
+//----------------------------------------------------------------------------
 ctkCmdLineModuleXmlValidator::ctkCmdLineModuleXmlValidator(QIODevice *input)
   : d(new ctkCmdLineModuleXmlValidatorPrivate)
 {
   d->Input = input;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleXmlValidator::~ctkCmdLineModuleXmlValidator()
 {
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXmlValidator::setInput(QIODevice *input)
 {
   d->Input = input;
 }
 
+//----------------------------------------------------------------------------
 QIODevice* ctkCmdLineModuleXmlValidator::input() const
 {
   return d->Input;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXmlValidator::setInputSchema(QIODevice *input)
 {
   d->InputSchema = input;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleXmlValidator::validateInput()
 {
   d->ErrorStr.clear();
@@ -112,11 +120,13 @@ bool ctkCmdLineModuleXmlValidator::validateInput()
   return true;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleXmlValidator::error() const
 {
   return !d->ErrorStr.isEmpty();
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleXmlValidator::errorString() const
 {
   return d->ErrorStr;

+ 17 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleXslTransform.cpp

@@ -32,6 +32,7 @@
 #include "ctkCmdLineModuleXslTransform.h"
 #include "ctkCmdLineModuleXmlMsgHandler_p.h"
 
+//----------------------------------------------------------------------------
 class ctkCmdLineModuleXslTransformPrivate
 {
 public:
@@ -63,6 +64,7 @@ public:
   QString ErrorStr;
 };
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleXslTransformPrivate::validateOutput()
 {
   this->ErrorStr.clear();
@@ -108,6 +110,7 @@ bool ctkCmdLineModuleXslTransformPrivate::validateOutput()
   return true;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleXslTransform::ctkCmdLineModuleXslTransform(QIODevice *input, QIODevice *output)
   : ctkCmdLineModuleXmlValidator(input)
   , d(new ctkCmdLineModuleXslTransformPrivate(output))
@@ -128,35 +131,42 @@ ctkCmdLineModuleXslTransform::ctkCmdLineModuleXslTransform(QIODevice *input, QIO
   this->bindVariable("unsupportedWidget", QVariant(QString("QLabel")));
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleXslTransform::~ctkCmdLineModuleXslTransform()
 {
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setOutput(QIODevice* output)
 {
   d->Output = output;
 }
 
+//----------------------------------------------------------------------------
 QIODevice* ctkCmdLineModuleXslTransform::output() const
 {
   return d->Output;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setOutputSchema(QIODevice *output)
 {
   d->OutputSchema = output;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleXslTransform::formatXmlOutput() const
 {
   return d->Format;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setFormatXmlOutput(bool format)
 {
   d->Format = format;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleXslTransform::transform()
 {
   d->ErrorStr.clear();
@@ -251,16 +261,19 @@ bool ctkCmdLineModuleXslTransform::transform()
   return true;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setXslTransformation(QIODevice *transformation)
 {
   d->Transformation = transformation;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::bindVariable(const QString& name, const QVariant& value)
 {
   d->XslTransform.bindVariable(name, value);
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setXslExtraTransformation(QIODevice* transformation)
 {
   QList<QIODevice*> transformations;
@@ -268,21 +281,25 @@ void ctkCmdLineModuleXslTransform::setXslExtraTransformation(QIODevice* transfor
   this->setXslExtraTransformations(transformations);
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setXslExtraTransformations(const QList<QIODevice *>& transformations)
 {
   d->ExtraTransformations = transformations;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleXslTransform::setValidateOutput(bool validate)
 {
   d->Validate = validate;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleXslTransform::error() const
 {
   return ctkCmdLineModuleXmlValidator::error() || !d->ErrorStr.isEmpty();
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleXslTransform::errorString() const
 {
   QString errStr = this->ctkCmdLineModuleXmlValidator::errorString();

+ 3 - 1
Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleFrontendFactoryQtGui.cpp

@@ -23,17 +23,19 @@
 
 #include "ctkCmdLineModuleFrontendQtGui.h"
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFrontendQtGui *ctkCmdLineModuleFrontendFactoryQtGui::create(const ctkCmdLineModuleReference &moduleRef)
 {
   return new ctkCmdLineModuleFrontendQtGui(moduleRef);
 }
 
-
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleFrontendFactoryQtGui::name() const
 {
   return "Qt Gui";
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleFrontendFactoryQtGui::description() const
 {
   return "A frontend using the QtGui library.";

+ 24 - 0
Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleObjectTreeWalker.cpp

@@ -33,22 +33,26 @@ static QString PREFIX_PARAMETER = "parameter:";
 
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleObjectTreeWalker::ctkCmdLineModuleObjectTreeWalker(QObject *root)
   : RootObject(root), CurrentObject(0), CurrentToken(NoToken),
     AtEnd(false)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleObjectTreeWalker::~ctkCmdLineModuleObjectTreeWalker()
 {
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleObjectTreeWalker::setRootObject(QObject* root)
 {
   RootObject = root;
   clear();
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleObjectTreeWalker::clear()
 {
   CurrentToken = NoToken;
@@ -56,21 +60,25 @@ void ctkCmdLineModuleObjectTreeWalker::clear()
   ObjectStack.clear();
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::atEnd() const
 {
   return AtEnd || RootObject == 0;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::isParameterGroup() const
 {
   return CurrentToken == ParameterGroup;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::isParameter() const
 {
   return CurrentToken == Parameter;
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleObjectTreeWalker::name() const
 {
   if (CurrentObject == 0) return QString();
@@ -83,6 +91,7 @@ QString ctkCmdLineModuleObjectTreeWalker::name() const
   }
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleObjectTreeWalker::label() const
 {
   if (CurrentObject == 0) return QString();
@@ -95,12 +104,14 @@ QString ctkCmdLineModuleObjectTreeWalker::label() const
   }
 }
 
+//----------------------------------------------------------------------------
 QVariant ctkCmdLineModuleObjectTreeWalker::value() const
 {
   QString valProp = property("valueProperty").toString();
   return property(valProp);
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleObjectTreeWalker::setValue(const QVariant& value)
 {
   QVariant valProp = property("valueProperty");
@@ -110,30 +121,35 @@ void ctkCmdLineModuleObjectTreeWalker::setValue(const QVariant& value)
   }
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleObjectTreeWalker::flag() const
 {
   QVariant v = property("flag");
   return v.isValid() ? v.toString() : QString();
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleObjectTreeWalker::longFlag() const
 {
   QVariant v = property("longflag");
   return v.isValid() ? v.toString() : QString();
 }
 
+//----------------------------------------------------------------------------
 int ctkCmdLineModuleObjectTreeWalker::index() const
 {
   QVariant v = property("index");
   return v.isValid() ? v.toInt() : -1;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::isMultiple() const
 {
   QVariant v = property("multiple");
   return v.isValid() ? v.toBool() : false;
 }
 
+//----------------------------------------------------------------------------
 QVariant ctkCmdLineModuleObjectTreeWalker::property(const QString &propName) const
 {
   if (CurrentObject == 0) return QVariant();
@@ -145,6 +161,7 @@ QVariant ctkCmdLineModuleObjectTreeWalker::property(const QString &propName) con
   return res;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleObjectTreeWalker::TokenType ctkCmdLineModuleObjectTreeWalker::readNext()
 {
   if (AtEnd) return NoToken;
@@ -195,29 +212,34 @@ ctkCmdLineModuleObjectTreeWalker::TokenType ctkCmdLineModuleObjectTreeWalker::re
   return NoToken;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::readNextExecutable()
 {
   while (!(readNext() == Executable || AtEnd));
   return !AtEnd;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::readNextParameterGroup()
 {
   while (!(readNext() == ParameterGroup || AtEnd));
   return !AtEnd;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::readNextParameter()
 {
   while (!(readNext() == Parameter || AtEnd));
   return !AtEnd;
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleObjectTreeWalker::TokenType ctkCmdLineModuleObjectTreeWalker::tokenType() const
 {
   return CurrentToken;
 }
 
+//----------------------------------------------------------------------------
 QVariant ctkCmdLineModuleObjectTreeWalker::prefixedProperty(const QString& propName) const
 {
   if (CurrentObject == 0) return QString();
@@ -234,6 +256,7 @@ QVariant ctkCmdLineModuleObjectTreeWalker::prefixedProperty(const QString& propN
   return CurrentObject->property(qPrintable(prefixedName));
 }
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleObjectTreeWalker::TokenType
 ctkCmdLineModuleObjectTreeWalker::token(QObject* obj)
 {
@@ -245,6 +268,7 @@ ctkCmdLineModuleObjectTreeWalker::token(QObject* obj)
   return ctkCmdLineModuleObjectTreeWalker::NoToken;
 }
 
+//----------------------------------------------------------------------------
 bool ctkCmdLineModuleObjectTreeWalker::setCurrent(QObject* obj)
 {
   ctkCmdLineModuleObjectTreeWalker::TokenType t = token(obj);

+ 3 - 1
Libs/CommandLineModules/Frontend/QtWebKit/ctkCmdLineModuleFrontendFactoryQtWebKit.cpp

@@ -22,17 +22,19 @@
 #include "ctkCmdLineModuleFrontendFactoryQtWebKit.h"
 
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFrontendQtWebKit *ctkCmdLineModuleFrontendFactoryQtWebKit::create(const ctkCmdLineModuleReference &moduleRef)
 {
   return new ctkCmdLineModuleFrontendQtWebKit(moduleRef);
 }
 
-
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleFrontendFactoryQtWebKit::name() const
 {
   return "Qt WebKit (experimental)";
 }
 
+//----------------------------------------------------------------------------
 QString ctkCmdLineModuleFrontendFactoryQtWebKit::description() const
 {
   return "An experimental frontend using the QtWebKit library.";

+ 4 - 0
Libs/CommandLineModules/Frontend/QtWebKit/ctkCmdLineModuleFrontendQtWebKit.cpp

@@ -32,6 +32,7 @@
 
 #include <QDebug>
 
+//----------------------------------------------------------------------------
 ctkCmdLineModuleFrontendQtWebKit::ctkCmdLineModuleFrontendQtWebKit(const ctkCmdLineModuleReference& moduleRef)
   : ctkCmdLineModuleFrontend(moduleRef)
   , WebView(NULL)
@@ -39,6 +40,7 @@ ctkCmdLineModuleFrontendQtWebKit::ctkCmdLineModuleFrontendQtWebKit(const ctkCmdL
 
 }
 
+//----------------------------------------------------------------------------
 QObject* ctkCmdLineModuleFrontendQtWebKit::guiHandle() const
 {
   if (WebView) return WebView;
@@ -65,6 +67,7 @@ QObject* ctkCmdLineModuleFrontendQtWebKit::guiHandle() const
   return this->WebView;
 }
 
+//----------------------------------------------------------------------------
 QVariant ctkCmdLineModuleFrontendQtWebKit::value(const QString &parameter) const
 {
   QWebElement webElement = this->WebView->page()->currentFrame()->findFirstElement("input[name=" + parameter + "]");
@@ -75,6 +78,7 @@ QVariant ctkCmdLineModuleFrontendQtWebKit::value(const QString &parameter) const
   return value;
 }
 
+//----------------------------------------------------------------------------
 void ctkCmdLineModuleFrontendQtWebKit::setValue(const QString &parameter, const QVariant &value)
 {
   if (!this->WebView) return;