Browse Source

Fix for compiler warnings

Miklos Espak 12 years ago
parent
commit
1c33014598

+ 69 - 97
Libs/XNAT/Core/ctkXnatConnection.cpp

@@ -36,9 +36,9 @@
 #include "ctkXnatServer.h"
 #include "ctkXnatSubject.h"
 
-#include <QStringBuilder>
 #include <QDebug>
 #include <QScopedPointer>
+#include <QStringBuilder>
 
 #include <qXnatAPI.h>
 #include <qRestResult.h>
@@ -80,7 +80,7 @@ ctkXnatConnection::~ctkXnatConnection()
 
 void ctkXnatConnection::createConnections()
 {
-  Q_D(ctkXnatConnection);
+//  Q_D(ctkXnatConnection);
 //  connect(d->xnat, SIGNAL(resultReceived(QUuid,QList<QVariantMap>)),
 //           this, SLOT(processResult(QUuid,QList<QVariantMap>)));
 //  connect(d->xnat, SIGNAL(progress(QUuid,double)),
@@ -146,7 +146,7 @@ ctkXnatServer* ctkXnatConnection::server()
 void ctkXnatConnection::fetch(ctkXnatServer* server)
 {
   Q_D(ctkXnatConnection);
-  qDebug() << "ctkXnatConnection::fetch(ctkXnatServer* server)";
+//  qDebug() << "ctkXnatConnection::fetch(ctkXnatServer* server)";
 
   QString query("/REST/projects");
 
@@ -471,7 +471,7 @@ void ctkXnatConnection::create(ctkXnatSubject* subject)
 
 void ctkXnatConnection::downloadScanFiles(ctkXnatExperiment* experiment, const QString& fileName)
 {
-  qDebug() << "ctkXnatConnection::downloadScanFiles(ctkXnatExperiment* experiment, const QString& zipFilename)";
+//  qDebug() << "ctkXnatConnection::downloadScanFiles(ctkXnatExperiment* experiment, const QString& zipFilename)";
   const QString& experimentName = experiment->getName();
   ctkXnatObject* subject = experiment->getParent();
   const QString& subjectName = subject->getName();
@@ -504,19 +504,15 @@ void ctkXnatConnection::downloadReconstructionFiles(ctkXnatExperiment* experimen
   d->xnat->sync(queryId);
 }
 
-void ctkXnatConnection::addReconstruction(ctkXnatExperiment* experiment, const QString& reconstruction)
+void ctkXnatConnection::addReconstruction(ctkXnatExperiment* /*experiment*/, const QString& /*reconstruction*/)
 {
-  const QString& experimentName = experiment->getName();
-  ctkXnatObject* subject = experiment->getParent();
-  const QString& subjectName = subject->getName();
-  ctkXnatObject* project = subject->getParent();
-  const QString& projectName = project->getName();
+//  const QString& experimentName = experiment->getName();
+//  ctkXnatObject* subject = experiment->getParent();
+//  const QString& subjectName = subject->getName();
+//  ctkXnatObject* project = subject->getParent();
+//  const QString& projectName = project->getName();
 
-//  XnatRestStatus status = putXnatRestReconstruction(projectName.toStdString().c_str(), subjectName.toStdString().c_str(), experimentName.toStdString().c_str(), reconstruction.toStdString().c_str());
-//  if ( status != XNATREST_OK )
-//    {
-//    throw XnatException(status);
-//  }
+  // TODO
 }
 
 void ctkXnatConnection::downloadReconstruction(ctkXnatReconstruction* reconstruction, const QString& fileName)
@@ -538,39 +534,30 @@ void ctkXnatConnection::downloadReconstruction(ctkXnatReconstruction* reconstruc
   d->xnat->sync(queryId);
 }
 
-void ctkXnatConnection::addReconstructionResource(ctkXnatReconstruction* reconstruction, const QString& resourceName)
+void ctkXnatConnection::addReconstructionResource(ctkXnatReconstruction* /*reconstruction*/, const QString& /*resourceName*/)
 {
-  const QString& reconstructionName = reconstruction->getName();
-  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
-  const QString& experimentName = experiment->getName();
-  ctkXnatObject* subject = experiment->getParent();
-  const QString& subjectName = subject->getName();
-  ctkXnatObject* project = subject->getParent();
-  const QString& projectName = project->getName();
+//  const QString& reconstructionName = reconstruction->getName();
+//  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
+//  const QString& experimentName = experiment->getName();
+//  ctkXnatObject* subject = experiment->getParent();
+//  const QString& subjectName = subject->getName();
+//  ctkXnatObject* project = subject->getParent();
+//  const QString& projectName = project->getName();
 
-//  XnatRestStatus status = putXnatRestReconResource(projectName.toStdString().c_str(), subjectName.toStdString().c_str(), experimentName.toStdString().c_str(),
-//                                                   reconstructionName.toStdString().c_str(), resourceName.toStdString().c_str());
-//  if ( status != XNATREST_OK )
-//  {
-//    throw XnatException(status);
-//  }
+  // TODO
 }
 
-void ctkXnatConnection::removeReconstruction(ctkXnatReconstruction* reconstruction)
+void ctkXnatConnection::removeReconstruction(ctkXnatReconstruction* /*reconstruction*/)
 {
-  const QString& reconstructionName = reconstruction->getName();
-  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
-  const QString& experimentName = experiment->getName();
-  ctkXnatObject* subject = experiment->getParent();
-  const QString& subjectName = subject->getName();
-  ctkXnatObject* project = subject->getParent();
-  const QString& projectName = project->getName();
+//  const QString& reconstructionName = reconstruction->getName();
+//  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
+//  const QString& experimentName = experiment->getName();
+//  ctkXnatObject* subject = experiment->getParent();
+//  const QString& subjectName = subject->getName();
+//  ctkXnatObject* project = subject->getParent();
+//  const QString& projectName = project->getName();
 
-//  XnatRestStatus status = deleteXnatRestReconstruction(projectName.toStdString().c_str(), subjectName.toStdString().c_str(), experimentName.toStdString().c_str(), reconstructionName.toStdString().c_str());
-//  if ( status != XNATREST_OK )
-//  {
-//    throw XnatException(status);
-//  }
+  // TODO
 }
 
 void ctkXnatConnection::downloadReconstructionResourceFiles(ctkXnatReconstructionResource* reconstructionResource, const QString& fileName)
@@ -594,49 +581,39 @@ void ctkXnatConnection::downloadReconstructionResourceFiles(ctkXnatReconstructio
   d->xnat->sync(queryId);
 }
 
-void ctkXnatConnection::uploadReconstructionResourceFiles(ctkXnatReconstructionResource* reconstructionResource, const QString& zipFilename)
+void ctkXnatConnection::uploadReconstructionResourceFiles(ctkXnatReconstructionResource* /*reconstructionResource*/, const QString& /*zipFilename*/)
 {
-  const QString& resourceName = reconstructionResource->getName();
-  ctkXnatObject* reconstruction = reconstructionResource->getParent();
-  const QString& reconstructionName = reconstruction->getName();
-  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
-  const QString& experimentName = experiment->getName();
-  ctkXnatObject* subject = experiment->getParent();
-  const QString& subjectName = subject->getName();
-  ctkXnatObject* project = subject->getParent();
-  const QString& projectName = project->getName();
+//  const QString& resourceName = reconstructionResource->getName();
+//  ctkXnatObject* reconstruction = reconstructionResource->getParent();
+//  const QString& reconstructionName = reconstruction->getName();
+//  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
+//  const QString& experimentName = experiment->getName();
+//  ctkXnatObject* subject = experiment->getParent();
+//  const QString& subjectName = subject->getName();
+//  ctkXnatObject* project = subject->getParent();
+//  const QString& projectName = project->getName();
 
-//  XnatRestStatus status = putXnatRestAsynReconRsrcFiles(projectName.toStdString().c_str(), subjectName.toStdString().c_str(), experimentName.toStdString().c_str(), reconstructionName.toStdString().c_str(),
-//                                                        resourceName.toStdString().c_str(), zipFilename.toStdString().c_str());
-//  if ( status != XNATREST_OK )
-//  {
-//    throw ctkXnatException(status);
-//  }
+  // TODO
 }
 
-void ctkXnatConnection::removeReconstructionResource(ctkXnatReconstructionResource* reconstructionResource)
+void ctkXnatConnection::removeReconstructionResource(ctkXnatReconstructionResource* /*reconstructionResource*/)
 {
-  const QString& resourceName = reconstructionResource->getName();
-  ctkXnatObject* reconstruction = reconstructionResource->getParent();
-  const QString& reconstructionName = reconstruction->getName();
-  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
-  const QString& experimentName = experiment->getName();
-  ctkXnatObject* subject = experiment->getParent();
-  const QString& subjectName = subject->getName();
-  ctkXnatObject* project = subject->getParent();
-  const QString& projectName = project->getName();
+//  const QString& resourceName = reconstructionResource->getName();
+//  ctkXnatObject* reconstruction = reconstructionResource->getParent();
+//  const QString& reconstructionName = reconstruction->getName();
+//  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
+//  const QString& experimentName = experiment->getName();
+//  ctkXnatObject* subject = experiment->getParent();
+//  const QString& subjectName = subject->getName();
+//  ctkXnatObject* project = subject->getParent();
+//  const QString& projectName = project->getName();
 
-//  XnatRestStatus status = deleteXnatRestReconResource(projectName.toStdString().c_str(), subjectName.toStdString().c_str(), experimentName.toStdString().c_str(),
-//                                                      reconstructionName.toStdString().c_str(), resourceName.toStdString().c_str());
-//  if ( status != XNATREST_OK )
-//  {
-//    throw ctkXnatException(status);
-//  }
+  // TODO
 }
 
 void ctkXnatConnection::download(ctkXnatReconstructionResourceFile* reconstructionResourceFile, const QString& fileName)
 {
-  qDebug() <<  "ctkXnatConnection::download(ctkXnatReconstructionResourceFile* reconstructionResourceFile, const QString& zipFilename)";
+//  qDebug() <<  "ctkXnatConnection::download(ctkXnatReconstructionResourceFile* reconstructionResourceFile, const QString& zipFilename)";
   const QString& reconstructionResourceFileName = reconstructionResourceFile->getName();
   ctkXnatObject* reconstructionResource = reconstructionResourceFile->getParent();
   const QString& reconstructionResourceName = reconstructionResource->getName();
@@ -658,31 +635,26 @@ void ctkXnatConnection::download(ctkXnatReconstructionResourceFile* reconstructi
   d->xnat->sync(queryId);
 }
 
-void ctkXnatConnection::remove(ctkXnatReconstructionResourceFile* reconstructionResourceFile)
+void ctkXnatConnection::remove(ctkXnatReconstructionResourceFile* /*reconstructionResourceFile*/)
 {
-  const QString& filename = reconstructionResourceFile->getName();
-  ctkXnatObject* reconstructionResource = reconstructionResourceFile->getParent();
-  const QString& resourceName = reconstructionResource->getName();
-  ctkXnatObject* reconstruction = reconstructionResource->getParent();
-  const QString& reconstructionName = reconstruction->getName();
-  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
-  const QString& experimentName = experiment->getName();
-  ctkXnatObject* subject = experiment->getParent();
-  const QString& subjectName = subject->getName();
-  ctkXnatObject* project = subject->getParent();
-  const QString& projectName = project->getName();
+//  const QString& filename = reconstructionResourceFile->getName();
+//  ctkXnatObject* reconstructionResource = reconstructionResourceFile->getParent();
+//  const QString& resourceName = reconstructionResource->getName();
+//  ctkXnatObject* reconstruction = reconstructionResource->getParent();
+//  const QString& reconstructionName = reconstruction->getName();
+//  ctkXnatObject* experiment = reconstruction->getParent()->getParent();
+//  const QString& experimentName = experiment->getName();
+//  ctkXnatObject* subject = experiment->getParent();
+//  const QString& subjectName = subject->getName();
+//  ctkXnatObject* project = subject->getParent();
+//  const QString& projectName = project->getName();
 
-//  XnatRestStatus status = deleteXnatRestReconRsrcFile(projectName.toStdString().c_str(), subjectName.toStdString().c_str(), experimentName.toStdString().c_str(), reconstructionName.toStdString().c_str(),
-//                                                      resourceName.toStdString().c_str(), filename.toStdString().c_str());
-//  if ( status != XNATREST_OK )
-//  {
-//    throw ctkXnatException(status);
-//  }
+  // TODO
 }
 
 void ctkXnatConnection::download(ctkXnatScan* scan, const QString& fileName)
 {
-  qDebug() << "ctkXnatConnection::download(ctkXnatScan* scan, const QString& zipFilename)";
+//  qDebug() << "ctkXnatConnection::download(ctkXnatScan* scan, const QString& zipFilename)";
   const QString& scanName = scan->getName();
   ctkXnatObject* experiment = scan->getParent()->getParent();
   const QString& experimentName = experiment->getName();
@@ -702,7 +674,7 @@ void ctkXnatConnection::download(ctkXnatScan* scan, const QString& fileName)
 
 void ctkXnatConnection::download(ctkXnatScanResource* scanResource, const QString& fileName)
 {
-  qDebug() << "ctkXnatConnection::download(ctkXnatScanResource* scanResource, const QString& zipFilename)";
+//  qDebug() << "ctkXnatConnection::download(ctkXnatScanResource* scanResource, const QString& zipFilename)";
   const QString& scanResourceName = scanResource->getName();
   ctkXnatObject* scan = scanResource->getParent();
   const QString& scanName = scan->getName();
@@ -724,7 +696,7 @@ void ctkXnatConnection::download(ctkXnatScanResource* scanResource, const QStrin
 
 void ctkXnatConnection::download(ctkXnatScanResourceFile* scanResourceFile, const QString& fileName)
 {
-  qDebug() << "ctkXnatConnection::download(ctkXnatScanResourceFile* scanResourceFile)";
+//  qDebug() << "ctkXnatConnection::download(ctkXnatScanResourceFile* scanResourceFile)";
   const QString& scanResourceFileName = scanResourceFile->getName();
   ctkXnatObject* scanResource = scanResourceFile->getParent();
   const QString& scanResourceName = scanResource->getName();
@@ -746,6 +718,6 @@ void ctkXnatConnection::download(ctkXnatScanResourceFile* scanResourceFile, cons
   d->xnat->sync(queryId);
 }
 
-void ctkXnatConnection::processResult(QUuid queryId, QList<QVariantMap> parameters)
+void ctkXnatConnection::processResult(QUuid /*queryId*/, QList<QVariantMap> /*parameters*/)
 {
 }

+ 6 - 6
Libs/XNAT/Core/ctkXnatObject.cpp

@@ -64,7 +64,7 @@ void ctkXnatObject::setParentIndex(int parentIndex)
   d->parentIndex = parentIndex;
 }
 
-void ctkXnatObject::fetch(ctkXnatConnection* connection)
+void ctkXnatObject::fetch(ctkXnatConnection* /*connection*/)
 {
 //  connection->fetch(this);
 }
@@ -121,22 +121,22 @@ void ctkXnatObject::removeChild(int childIndex)
   }
 }
 
-void ctkXnatObject::download(ctkXnatConnection* connection, const QString& zipFilename)
+void ctkXnatObject::download(ctkXnatConnection* /*connection*/, const QString& /*zipFilename*/)
 {
   // do nothing
 }
 
-void ctkXnatObject::upload(ctkXnatConnection* connection, const QString& zipFilename)
+void ctkXnatObject::upload(ctkXnatConnection* /*connection*/, const QString& /*zipFilename*/)
 {
   // do nothing
 }
 
-void ctkXnatObject::add(ctkXnatConnection* connection, const QString& name)
+void ctkXnatObject::add(ctkXnatConnection* /*connection*/, const QString& /*name*/)
 {
   // do nothing
 }
 
-void ctkXnatObject::remove(ctkXnatConnection* connection)
+void ctkXnatObject::remove(ctkXnatConnection* /*connection*/)
 {
   // do nothing
 }
@@ -171,7 +171,7 @@ bool ctkXnatObject::receivesFiles() const
   return false;
 }
 
-bool ctkXnatObject::isModifiable(int childIndex) const
+bool ctkXnatObject::isModifiable(int /*childIndex*/) const
 {
   return false;
 }

+ 2 - 2
Libs/XNAT/Core/ctkXnatProject.cpp

@@ -144,12 +144,12 @@ QString ctkXnatProject::getKind() const
   return "subject";
 }
 
-bool ctkXnatProject::isModifiable(int parentIndex) const
+bool ctkXnatProject::isModifiable(int /*parentIndex*/) const
 {
   return true;
 }
 
-QString ctkXnatProject::getModifiableChildKind(int parentIndex) const
+QString ctkXnatProject::getModifiableChildKind(int /*parentIndex*/) const
 {
   return "project";
 }

+ 6 - 0
Libs/XNAT/Core/ctkXnatProject.h

@@ -41,6 +41,8 @@ class CTK_XNAT_CORE_EXPORT ctkXnatProject : public ctkXnatObject
   Q_PROPERTY(QString pi_lastname READ piLastName WRITE setPiLastName)
   Q_PROPERTY(QString URI READ uri WRITE setUri)
 
+  typedef ctkXnatObject Superclass;
+
 public:
   explicit ctkXnatProject(ctkXnatObject* parent = 0);
   virtual ~ctkXnatProject();
@@ -70,7 +72,11 @@ public:
   virtual void remove(ctkXnatConnection* connection);
 
   virtual QString getKind() const;
+
+  using Superclass::isModifiable;
   virtual bool isModifiable(int parentIndex) const;
+
+  using Superclass::getModifiableChildKind;
   virtual QString getModifiableChildKind(int parentIndex) const;
 
 private:

+ 2 - 0
Libs/XNAT/Core/ctkXnatReconstructionFolder.h

@@ -30,6 +30,8 @@ class ctkXnatConnection;
 
 class CTK_XNAT_CORE_EXPORT ctkXnatReconstructionFolder : public ctkXnatObject
 {
+  Q_OBJECT
+
 public:
   explicit ctkXnatReconstructionFolder(ctkXnatObject* parent = 0);
   virtual ~ctkXnatReconstructionFolder();

+ 2 - 0
Libs/XNAT/Core/ctkXnatScanFolder.h

@@ -30,6 +30,8 @@ class ctkXnatConnection;
 
 class CTK_XNAT_CORE_EXPORT ctkXnatScanFolder : public ctkXnatObject
 {
+  Q_OBJECT
+
 public:
   explicit ctkXnatScanFolder(ctkXnatObject* parent = 0);
   virtual ~ctkXnatScanFolder();

+ 2 - 0
Libs/XNAT/Core/ctkXnatServer.h

@@ -30,6 +30,8 @@ class ctkXnatConnection;
 
 class CTK_XNAT_CORE_EXPORT ctkXnatServer : public ctkXnatObject
 {
+  Q_OBJECT
+
 public:
   explicit ctkXnatServer(ctkXnatObject* parent = 0);
   virtual ~ctkXnatServer();

+ 3 - 0
Libs/XNAT/Core/ctkXnatSubject.h

@@ -41,6 +41,8 @@ class CTK_XNAT_CORE_EXPORT ctkXnatSubject : public ctkXnatObject
   Q_PROPERTY(QString insert_user READ insertUser WRITE setInsertUser)
   Q_PROPERTY(QString URI READ uri WRITE setUri)
 
+  typedef ctkXnatObject Superclass;
+
 public:
   explicit ctkXnatSubject(ctkXnatObject* parent = 0);
   virtual ~ctkXnatSubject();
@@ -67,6 +69,7 @@ public:
 
   virtual QString getKind() const;
 
+  using Superclass::isModifiable;
   virtual bool isModifiable(int parentIndex) const;
 
 private:

+ 51 - 51
Libs/XNAT/Widgets/ctkXnatLoginDialog.cpp

@@ -36,21 +36,21 @@ class ctkXnatLoginDialogPrivate
 {
 public:
   ctkXnatLoginDialogPrivate(ctkXnatConnectionFactory& f)
-  : factory(f)
+  : Factory(f)
   {
   }
 
-  ctkXnatSettings* settings;
+  ctkXnatSettings* Settings;
 
-  ctkXnatConnectionFactory& factory;
-  ctkXnatConnection* connection;
+  ctkXnatConnectionFactory& Factory;
+  ctkXnatConnection* Connection;
 
-  QMap<QString, ctkXnatLoginProfile*> profiles;
+  QMap<QString, ctkXnatLoginProfile*> Profiles;
 
-  QStringListModel model;
-  QStringList profileNames;
+  QStringListModel Model;
+  QStringList ProfileNames;
 
-  bool dirty;
+  bool Dirty;
 };
 
 ctkXnatLoginDialog::ctkXnatLoginDialog(ctkXnatConnectionFactory& f, QWidget* parent, Qt::WindowFlags flags)
@@ -61,9 +61,9 @@ ctkXnatLoginDialog::ctkXnatLoginDialog(ctkXnatConnectionFactory& f, QWidget* par
   Q_D(ctkXnatLoginDialog);
 
   // initialize data members
-  d->settings = 0;
-  d->connection = 0;
-  d->dirty = false;
+  d->Settings = 0;
+  d->Connection = 0;
+  d->Dirty = false;
 
   if (!ui)
     {
@@ -72,7 +72,7 @@ ctkXnatLoginDialog::ctkXnatLoginDialog(ctkXnatConnectionFactory& f, QWidget* par
     ui->setupUi(this);
 
     QItemSelectionModel* oldSelectionModel = ui->lstProfiles->selectionModel();
-    ui->lstProfiles->setModel(&d->model);
+    ui->lstProfiles->setModel(&d->Model);
     delete oldSelectionModel;
     ui->lstProfiles->setSelectionMode(QAbstractItemView::SingleSelection);
     ui->lstProfiles->setSelectionRectVisible(false);
@@ -88,7 +88,7 @@ ctkXnatLoginDialog::~ctkXnatLoginDialog()
 {
   Q_D(ctkXnatLoginDialog);
 
-  foreach (ctkXnatLoginProfile* profile, d->profiles)
+  foreach (ctkXnatLoginProfile* profile, d->Profiles)
     {
     delete profile;
     }
@@ -115,25 +115,25 @@ ctkXnatSettings* ctkXnatLoginDialog::settings() const
 {
   Q_D(const ctkXnatLoginDialog);
 
-  return d->settings;
+  return d->Settings;
 }
 
 void ctkXnatLoginDialog::setSettings(ctkXnatSettings* settings)
 {
   Q_D(ctkXnatLoginDialog);
-  d->settings = settings;
-  d->profiles = d->settings->getLoginProfiles();
+  d->Settings = settings;
+  d->Profiles = d->Settings->getLoginProfiles();
 
-  d->profileNames = d->profiles.keys();
-  d->profileNames.sort();
-  d->model.setStringList(d->profileNames);
+  d->ProfileNames = d->Profiles.keys();
+  d->ProfileNames.sort();
+  d->Model.setStringList(d->ProfileNames);
   
-  ctkXnatLoginProfile* defaultProfile = d->settings->getDefaultLoginProfile();
+  ctkXnatLoginProfile* defaultProfile = d->Settings->getDefaultLoginProfile();
 
   if (defaultProfile)
     {
-    int profileNumber = d->profileNames.indexOf(defaultProfile->name());
-    QModelIndex index = d->model.index(profileNumber);
+    int profileNumber = d->ProfileNames.indexOf(defaultProfile->name());
+    QModelIndex index = d->Model.index(profileNumber);
     if (index.isValid())
       {
       ui->lstProfiles->setCurrentIndex(index);
@@ -145,7 +145,7 @@ void ctkXnatLoginDialog::setSettings(ctkXnatSettings* settings)
 ctkXnatConnection* ctkXnatLoginDialog::getConnection()
 {
   Q_D(ctkXnatLoginDialog);
-  return d->connection;
+  return d->Connection;
 }
 
 void ctkXnatLoginDialog::accept()
@@ -170,7 +170,7 @@ void ctkXnatLoginDialog::accept()
     return;
     }
 
-  if (d->dirty)
+  if (d->Dirty)
     {
     const QString& profileName = ui->edtProfileName->text();
     if (askToSaveProfile(profileName))
@@ -184,7 +184,7 @@ void ctkXnatLoginDialog::accept()
   // create XNAT connection
   try
     {
-    d->connection = d->factory.makeConnection(url.toAscii().constData(), userName.toAscii().constData(),
+    d->Connection = d->Factory.makeConnection(url.toAscii().constData(), userName.toAscii().constData(),
                                         password.toAscii().constData());
     }
   catch (ctkXnatException& e)
@@ -209,11 +209,11 @@ void ctkXnatLoginDialog::onCurrentProfileChanged(const QModelIndex& currentIndex
     }
 
   int originalIndexRow = currentIndex.row();
-  QString newProfileName = d->profileNames[currentIndex.row()];
-  ctkXnatLoginProfile* profile = d->profiles[newProfileName];
+  QString newProfileName = d->ProfileNames[currentIndex.row()];
+  ctkXnatLoginProfile* profile = d->Profiles[newProfileName];
 
   bool newProfileSaved = false;
-  if (d->dirty)
+  if (d->Dirty)
     {
     QString profileName = ui->edtProfileName->text();
     if (askToSaveProfile(profileName))
@@ -225,7 +225,7 @@ void ctkXnatLoginDialog::onCurrentProfileChanged(const QModelIndex& currentIndex
 
   loadProfile(*profile);
 
-  d->dirty = false;
+  d->Dirty = false;
   ui->btnSave->setEnabled(false);
   ui->btnDelete->setEnabled(true);
 
@@ -260,23 +260,23 @@ void ctkXnatLoginDialog::saveProfile(const QString& profileName)
 {
   Q_D(ctkXnatLoginDialog);
   
-  ctkXnatLoginProfile* profile = d->profiles[profileName];
+  ctkXnatLoginProfile* profile = d->Profiles[profileName];
   bool oldProfileWasDefault = profile && profile->isDefault();
   if (!profile)
     {
     profile = new ctkXnatLoginProfile();
-    d->profiles[profileName] = profile;
-    int profileNumber = d->profileNames.size();
+    d->Profiles[profileName] = profile;
+    int profileNumber = d->ProfileNames.size();
     
     // Insertion into the profile name list and the listView (ascending order)
     int idx = 0;
-    while (idx < profileNumber && QString::localeAwareCompare(profileName, d->profileNames[idx]) > 0)
+    while (idx < profileNumber && QString::localeAwareCompare(profileName, d->ProfileNames[idx]) > 0)
       {
       ++idx;
       }
-    d->profileNames.insert(idx, profileName);
-    d->model.insertRow(idx);
-    d->model.setData(d->model.index(idx), profileName);
+    d->ProfileNames.insert(idx, profileName);
+    d->Model.insertRow(idx);
+    d->Model.setData(d->Model.index(idx), profileName);
     }
   
   storeProfile(*profile);
@@ -285,19 +285,19 @@ void ctkXnatLoginDialog::saveProfile(const QString& profileName)
   // This code assumes that the newly created profiles are not default.
   if (profile->isDefault() && !oldProfileWasDefault)
     {
-    foreach (ctkXnatLoginProfile* otherProfile, d->profiles.values())
+    foreach (ctkXnatLoginProfile* otherProfile, d->Profiles.values())
       {
       const QString& otherProfileName = otherProfile->name();
       if (otherProfileName != profileName && otherProfile->isDefault())
         {
         otherProfile->setDefault(false);
-        d->settings->setLoginProfile(otherProfileName, otherProfile);
+        d->Settings->setLoginProfile(otherProfileName, otherProfile);
         }
       }
     }
   
-  d->settings->setLoginProfile(profileName, profile);
-  d->dirty = false;
+  d->Settings->setLoginProfile(profileName, profile);
+  d->Dirty = false;
   ui->btnSave->setEnabled(false);
 }
 
@@ -311,7 +311,7 @@ void ctkXnatLoginDialog::on_btnSave_clicked()
   QModelIndex currentIndex = ui->lstProfiles->currentIndex();
   if (currentIndex.isValid())
     {
-    QString selectedProfileName = d->profileNames[currentIndex.row()];
+    QString selectedProfileName = d->ProfileNames[currentIndex.row()];
     if (editedProfileName == selectedProfileName)
       {
       selectSavedProfile = false;
@@ -322,8 +322,8 @@ void ctkXnatLoginDialog::on_btnSave_clicked()
 
   if (selectSavedProfile)
     {
-    int editedProfileNumber = d->profileNames.indexOf(editedProfileName);
-    QModelIndex editedProfileIndex = d->model.index(editedProfileNumber, 0);
+    int editedProfileNumber = d->ProfileNames.indexOf(editedProfileName);
+    QModelIndex editedProfileIndex = d->Model.index(editedProfileNumber, 0);
     ui->lstProfiles->setCurrentIndex(editedProfileIndex);
     }
 }
@@ -365,21 +365,21 @@ void ctkXnatLoginDialog::on_btnDelete_clicked()
 
   QString profileName = ui->edtProfileName->text();
 
-  int idx = d->profileNames.indexOf(profileName);
-  d->model.removeRow(idx);
-  d->profileNames.removeAt(idx);
-  delete d->profiles.take(profileName);
+  int idx = d->ProfileNames.indexOf(profileName);
+  d->Model.removeRow(idx);
+  d->ProfileNames.removeAt(idx);
+  delete d->Profiles.take(profileName);
 
-  if (d->profiles.empty())
+  if (d->Profiles.empty())
     {
     ui->btnDelete->setEnabled(false);
     ui->edtProfileName->setFocus();
     }
   
-  d->settings->removeLoginProfile(profileName);
+  d->Settings->removeLoginProfile(profileName);
 }
 
-void ctkXnatLoginDialog::on_edtProfileName_textChanged(const QString& text)
+void ctkXnatLoginDialog::on_edtProfileName_textChanged(const QString& /*text*/)
 {
   ui->lstProfiles->clearSelection();
   ui->btnDelete->setEnabled(false);
@@ -388,6 +388,6 @@ void ctkXnatLoginDialog::on_edtProfileName_textChanged(const QString& text)
 void ctkXnatLoginDialog::onFieldChanged()
 {
   Q_D(ctkXnatLoginDialog);
-  d->dirty = true;
+  d->Dirty = true;
   ui->btnSave->setEnabled(true);
 }

+ 63 - 12
Libs/XNAT/Widgets/ctkXnatLoginProfile.cpp

@@ -21,9 +21,40 @@
 
 #include "ctkXnatLoginProfile.h"
 
+class ctkXnatLoginProfilePrivate
+{
+public:
+  ctkXnatLoginProfilePrivate();
+
+  QString Name;
+  QString ServerUri;
+  QString UserName;
+  QString Password;
+  bool Default;
+};
+
+ctkXnatLoginProfilePrivate::ctkXnatLoginProfilePrivate()
+{
+}
+
 ctkXnatLoginProfile::ctkXnatLoginProfile()
+  : d_ptr(new ctkXnatLoginProfilePrivate())
 {
-  m_default = false;
+  Q_D(ctkXnatLoginProfile);
+
+  d->Default = false;
+}
+
+ctkXnatLoginProfile::ctkXnatLoginProfile(const ctkXnatLoginProfile& otherLoginProfile)
+  : d_ptr(new ctkXnatLoginProfilePrivate())
+{
+  Q_D(ctkXnatLoginProfile);
+
+  d->Name = otherLoginProfile.name();
+  d->ServerUri = otherLoginProfile.serverUri();
+  d->UserName = otherLoginProfile.userName();
+  d->Password = otherLoginProfile.password();
+  d->Default = false;
 }
 
 ctkXnatLoginProfile::~ctkXnatLoginProfile()
@@ -32,50 +63,70 @@ ctkXnatLoginProfile::~ctkXnatLoginProfile()
 
 QString ctkXnatLoginProfile::name() const
 {
-  return m_name;
+  Q_D(const ctkXnatLoginProfile);
+
+  return d->Name;
 }
 
 void ctkXnatLoginProfile::setName(const QString& name)
 {
-  m_name = name;
+  Q_D(ctkXnatLoginProfile);
+
+  d->Name = name;
 }
 
 QString ctkXnatLoginProfile::serverUri() const
 {
-  return m_serverUri;
+  Q_D(const ctkXnatLoginProfile);
+
+  return d->ServerUri;
 }
 
 void ctkXnatLoginProfile::setServerUri(const QString& serverUri)
 {
-  m_serverUri = serverUri;
+  Q_D(ctkXnatLoginProfile);
+
+  d->ServerUri = serverUri;
 }
 
 QString ctkXnatLoginProfile::userName() const
 {
-  return m_userName;
+  Q_D(const ctkXnatLoginProfile);
+
+  return d->UserName;
 }
 
 void ctkXnatLoginProfile::setUserName(const QString& userName)
 {
-  m_userName = userName;
+  Q_D(ctkXnatLoginProfile);
+
+  d->UserName = userName;
 }
 
 QString ctkXnatLoginProfile::password() const
 {
-  return m_password;
+  Q_D(const ctkXnatLoginProfile);
+
+  return d->Password;
 }
 
 void ctkXnatLoginProfile::setPassword(const QString& password)
 {
-  m_password = password;
+  Q_D(ctkXnatLoginProfile);
+
+  d->Password = password;
 }
 
 bool ctkXnatLoginProfile::isDefault() const
 {
-  return m_default;
+  Q_D(const ctkXnatLoginProfile);
+
+  return d->Default;
 }
 
-void ctkXnatLoginProfile::setDefault(const bool& default_)
+void ctkXnatLoginProfile::setDefault(bool default_)
 {
-  m_default = default_;
+  Q_D(ctkXnatLoginProfile);
+
+  d->Default = default_;
 }

+ 10 - 7
Libs/XNAT/Widgets/ctkXnatLoginProfile.h

@@ -24,12 +24,16 @@
 
 #include "ctkXNATWidgetsExport.h"
 
+#include <QScopedPointer>
 #include <QString>
 
+class ctkXnatLoginProfilePrivate;
+
 class CTK_XNAT_WIDGETS_EXPORT ctkXnatLoginProfile
 {
 public:
-  explicit ctkXnatLoginProfile();
+  ctkXnatLoginProfile();
+  ctkXnatLoginProfile(const ctkXnatLoginProfile& otherLoginProfile);
   virtual ~ctkXnatLoginProfile();
 
   QString name() const;
@@ -45,14 +49,13 @@ public:
   void setPassword(const QString& password);
 
   bool isDefault() const;
-  void setDefault(const bool& default_);
+  void setDefault(bool default_);
 
 private:
-  QString m_name;
-  QString m_serverUri;
-  QString m_userName;
-  QString m_password;
-  bool m_default;
+  /// \brief d pointer of the pimpl pattern
+  QScopedPointer<ctkXnatLoginProfilePrivate> d_ptr;
+
+  Q_DECLARE_PRIVATE(ctkXnatLoginProfile);
 };
 
 #endif

+ 2 - 0
Libs/XNAT/Widgets/ctkXnatProjectListModel.h

@@ -28,6 +28,8 @@
 
 class CTK_XNAT_WIDGETS_EXPORT ctkXnatProjectListModel : public QAbstractListModel
 {
+  Q_OBJECT
+
 public:
   ctkXnatProjectListModel();