Skip to content

Commit

Permalink
COMP: Rename ctkAbstractJob "generateCopy()" to "clone()"
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Jan 17, 2024
1 parent 6848c92 commit 40f093e
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Libs/Core/ctkAbstractJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject
/// Generate worker for job
Q_INVOKABLE virtual ctkAbstractWorker* createWorker() = 0;

/// Create a copy of this object
Q_INVOKABLE virtual ctkAbstractJob* generateCopy() const = 0;
/// Create a copy of this job
Q_INVOKABLE virtual ctkAbstractJob* clone() const = 0;

/// Logger report string formatting for specific job
Q_INVOKABLE virtual QString loggerReport(const QString& status) const = 0;
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMInserterJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ QStringList ctkDICOMInserterJob::tagsToExcludeFromStorage() const
}

//------------------------------------------------------------------------------
ctkAbstractJob* ctkDICOMInserterJob::generateCopy() const
ctkAbstractJob* ctkDICOMInserterJob::clone() const
{
ctkDICOMInserterJob* newInserterJob = new ctkDICOMInserterJob;
newInserterJob->setDICOMLevel(this->dicomLevel());
Expand Down
4 changes: 2 additions & 2 deletions Libs/DICOM/Core/ctkDICOMInserterJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMInserterJob : public ctkDICOMJob
QStringList tagsToExcludeFromStorage() const;
///}@

/// Create a copy of this object
Q_INVOKABLE ctkAbstractJob* generateCopy() const override;
/// \see ctkAbstractJob::clone()
Q_INVOKABLE ctkAbstractJob* clone() const override;

/// Generate worker for job
Q_INVOKABLE ctkDICOMWorker* createWorker() override;
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMQueryJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ QString ctkDICOMQueryJob::loggerReport(const QString &status) const
}
}
//------------------------------------------------------------------------------
ctkAbstractJob* ctkDICOMQueryJob::generateCopy() const
ctkAbstractJob* ctkDICOMQueryJob::clone() const
{
ctkDICOMQueryJob* newQueryJob = new ctkDICOMQueryJob;
newQueryJob->setMaximumPatientsQuery(this->maximumConcurrentJobsPerType());
Expand Down
4 changes: 2 additions & 2 deletions Libs/DICOM/Core/ctkDICOMQueryJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMQueryJob : public ctkDICOMJob
/// Logger report string formatting for specific task
Q_INVOKABLE QString loggerReport(const QString& status) const override;

/// Create a copy of the object
Q_INVOKABLE ctkAbstractJob* generateCopy() const override;
/// \see ctkAbstractJob::clone()
Q_INVOKABLE ctkAbstractJob* clone() const override;

/// Generate worker for job
Q_INVOKABLE ctkDICOMWorker* createWorker() override;
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMRetrieveJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ QString ctkDICOMRetrieveJob::loggerReport(const QString &status) const
}
}
//------------------------------------------------------------------------------
ctkAbstractJob* ctkDICOMRetrieveJob::generateCopy() const
ctkAbstractJob* ctkDICOMRetrieveJob::clone() const
{
ctkDICOMRetrieveJob* newRetrieveJob = new ctkDICOMRetrieveJob;
newRetrieveJob->setServer(this->serverShared());
Expand Down
4 changes: 2 additions & 2 deletions Libs/DICOM/Core/ctkDICOMRetrieveJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMRetrieveJob : public ctkDICOMJob
/// Logger report string formatting for specific task
Q_INVOKABLE QString loggerReport(const QString& status) const override;

/// Create a copy of the object
Q_INVOKABLE ctkAbstractJob* generateCopy() const override;
/// \see ctkAbstractJob::clone()
Q_INVOKABLE ctkAbstractJob* clone() const override;

/// Generate worker for job
Q_INVOKABLE ctkDICOMWorker* createWorker() override;
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMRetrieveWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void ctkDICOMRetrieveWorker::run()
ctkDICOMServer* proxyServer = server->proxyServer();
if (proxyServer && proxyServer->queryRetrieveEnabled())
{
ctkDICOMRetrieveJob* newJob = qobject_cast<ctkDICOMRetrieveJob*>(retrieveJob->generateCopy());
ctkDICOMRetrieveJob* newJob = qobject_cast<ctkDICOMRetrieveJob*>(retrieveJob->clone());
newJob->setRetryCounter(0);
newJob->setServer(*proxyServer);
scheduler->addJob(newJob);
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMStorageListenerJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ QString ctkDICOMStorageListenerJob::loggerReport(const QString &status) const
.arg(this->jobUID());
}
//------------------------------------------------------------------------------
ctkAbstractJob* ctkDICOMStorageListenerJob::generateCopy() const
ctkAbstractJob* ctkDICOMStorageListenerJob::clone() const
{
ctkDICOMStorageListenerJob* newListenerJob = new ctkDICOMStorageListenerJob;
newListenerJob->setAETitle(this->AETitle());
Expand Down
4 changes: 2 additions & 2 deletions Libs/DICOM/Core/ctkDICOMStorageListenerJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMStorageListenerJob : public ctkDICOMJob
/// Logger report string formatting for specific task
Q_INVOKABLE QString loggerReport(const QString& status) const override;

/// Create a copy of the object
Q_INVOKABLE ctkAbstractJob* generateCopy() const override;
/// \see ctkAbstractJob::clone()
Q_INVOKABLE ctkAbstractJob* clone() const override;

/// Generate worker for job
Q_INVOKABLE ctkDICOMWorker* createWorker() override;
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ctkDICOMWorker::startNextJob()
return;
}

ctkDICOMJob* newJob = job->generateCopy();
ctkDICOMJob* newJob = job->clone();
newJob->setRetryCounter(newJob->retryCounter() + 1);
scheduler->addJob(newJob);
}
Expand Down

0 comments on commit 40f093e

Please sign in to comment.