Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings in ctk dicom classes #906

Merged
merged 3 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Libs/DICOM/Core/ctkDICOMDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ bool ctkDICOMDatabase::updateSchemaIfNeeded(
const char* schemaFile/* = ":/dicom/dicom-schema.sql" */,
const char* newDatabaseDir/* = nullptr*/)
{
Q_UNUSED(newDatabaseDir);
if ( schemaVersionLoaded() != schemaVersion() )
{
return this->updateSchema(schemaFile);
Expand Down Expand Up @@ -3324,7 +3325,7 @@ void ctkDICOMDatabase::setVisibilityForField(QString table, QString field, bool

QSqlQuery query(d->Database);
query.prepare("UPDATE ColumnDisplayProperties SET Visibility = ? WHERE TableName = ? AND FieldName = ? ;");
query.addBindValue((int)visibility);
query.addBindValue(static_cast<int>(visibility));
query.addBindValue(table);
query.addBindValue(field);
if (!d->loggedExec(query))
Expand Down
1 change: 1 addition & 0 deletions Libs/DICOM/Core/ctkDICOMDisplayedFieldGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void ctkDICOMDisplayedFieldGenerator::updateDisplayedFieldsForInstance(
QMap<QString, QString> &displayedFieldsForCurrentPatient )
{
Q_D(ctkDICOMDisplayedFieldGenerator);
Q_UNUSED(sopInstanceUID);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lassoan Is this warning fix legitimate or does it reveal an issue ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Since cached tags are now fetched at higher level at once (to improve performance), SOP instance UID is not needed here anymore. It can be removed, and later, if for some reason is needed again then can still be added back.


QMap<QString, QString> newFieldsSeries;
QMap<QString, QString> newFieldsStudy;
Expand Down
3 changes: 1 addition & 2 deletions Libs/DICOM/Core/ctkDICOMIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ static int REQUEST_RESULTS_CACHE_MAXIMUM_SIZE = 5000;
//------------------------------------------------------------------------------
ctkDICOMIndexerPrivateWorker::ctkDICOMIndexerPrivateWorker(DICOMIndexingQueue* queue)
: RequestQueue(queue)
, TimePercentageIndexing(95.0)
, RemainingRequestCount(0)
, CompletedRequestCount(0)
, TimePercentageIndexing(95.0)
{
}

Expand Down Expand Up @@ -168,7 +168,6 @@ void ctkDICOMIndexerPrivateWorker::processIndexingRequest(DICOMIndexingQueue::In
timeProbe.start();

int currentFileIndex = 0;
int lastReportedPercent = 0;
int alreadyAddedFileCount = 0;
QStringList alreadyAddedFiles;
foreach(const QString& filePath, indexingRequest.inputFilesPath)
Expand Down
4 changes: 2 additions & 2 deletions Libs/DICOM/Core/ctkDICOMIndexer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class DICOMIndexingQueue
};

DICOMIndexingQueue()
: Mutex(QMutex::Recursive)
, IsIndexing(false)
: IsIndexing(false)
, StopRequested(false)
, Mutex(QMutex::Recursive)
{
}

Expand Down
1 change: 1 addition & 0 deletions Libs/DICOM/Core/ctkDICOMRetrieve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ QString ctkDICOMRetrieve::moveDestinationAETitle()const

static void skipDelete(QObject* obj)
{
Q_UNUSED(obj);
// this deleter does not delete the object from memory
// useful if the pointer is not owned by the smart pointer
}
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Widgets/ctkDICOMBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ ctkDICOMBrowserPrivate::ctkDICOMBrowserPrivate(ctkDICOMBrowser* parent, QSharedP
, DisplayImportSummary(true)
, ConfirmRemove(false)
, ShemaUpdateAutoCreateDirectory(false)
, SendActionVisible(false)
, PatientsAddedDuringImport(0)
, StudiesAddedDuringImport(0)
, SeriesAddedDuringImport(0)
, InstancesAddedDuringImport(0)
, DefaultDatabaseDirectory("./ctkDICOM-Database")
, SendActionVisible(false)
, BatchUpdateBeforeIndexingUpdate(false)
{
if (this->DICOMDatabase.isNull())
Expand Down