[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [digikam] libs/threadimageio: Coverity: Dont pass large structure LoadingDescription by value
From: Marcel Wiesweg <marcel.wiesweg () gmx ! de>
Date: 2013-01-31 21:39:20
Message-ID: 20130131213920.2505CA6091 () git ! kde ! org
[Download RAW message or body]
Git commit 4264ab9d97f34180b7f03ac0d97c6e6c84985c67 by Marcel Wiesweg.
Committed on 31/01/2013 at 22:31.
Pushed by mwiesweg into branch 'master'.
Coverity: Dont pass large structure LoadingDescription by value
M +1 -1 libs/threadimageio/loadingcache.cpp
M +2 -2 libs/threadimageio/loadingcache.h
M +2 -2 libs/threadimageio/loadsavetask.cpp
M +3 -3 libs/threadimageio/loadsavetask.h
M +1 -1 libs/threadimageio/loadsavethread.cpp
M +1 -1 libs/threadimageio/loadsavethread.h
M +1 -1 libs/threadimageio/previewloadthread.cpp
M +1 -1 libs/threadimageio/previewloadthread.h
M +1 -1 libs/threadimageio/previewtask.h
M +1 -1 libs/threadimageio/sharedloadsavethread.cpp
M +1 -1 libs/threadimageio/sharedloadsavethread.h
M +1 -1 libs/threadimageio/thumbnailloadthread.cpp
M +1 -1 libs/threadimageio/thumbnailtask.h
http://commits.kde.org/digikam/4264ab9d97f34180b7f03ac0d97c6e6c84985c67
diff --git a/libs/threadimageio/loadingcache.cpp \
b/libs/threadimageio/loadingcache.cpp index 730edfd..8b0baf5 100644
--- a/libs/threadimageio/loadingcache.cpp
+++ b/libs/threadimageio/loadingcache.cpp
@@ -239,7 +239,7 @@ void LoadingCache::removeLoadingProcess(LoadingProcess* process)
d->loadingDict.remove(process->cacheKey());
}
-void LoadingCache::notifyNewLoadingProcess(LoadingProcess* process, \
LoadingDescription description) +void \
LoadingCache::notifyNewLoadingProcess(LoadingProcess* process, const \
LoadingDescription& description) {
for (QHash<QString, LoadingProcess*>::const_iterator it = \
d->loadingDict.constBegin(); it != d->loadingDict.constEnd(); ++it)
diff --git a/libs/threadimageio/loadingcache.h b/libs/threadimageio/loadingcache.h
index 89f0706..fc9055b 100644
--- a/libs/threadimageio/loadingcache.h
+++ b/libs/threadimageio/loadingcache.h
@@ -65,7 +65,7 @@ public:
virtual QString cacheKey() = 0;
virtual void addListener(LoadingProcessListener* listener) = 0;
virtual void removeListener(LoadingProcessListener* listener) = 0;
- virtual void notifyNewLoadingProcess(LoadingProcess* process, LoadingDescription \
description) = 0; + virtual void notifyNewLoadingProcess(LoadingProcess* process, \
const LoadingDescription& description) = 0; };
// --------------------------------------------------------------------------------------------------------------
@@ -203,7 +203,7 @@ public:
/**
* Notify all currently registered loading processes
*/
- void notifyNewLoadingProcess(LoadingProcess* process, LoadingDescription \
description); + void notifyNewLoadingProcess(LoadingProcess* process, const \
LoadingDescription& description);
/**
* Sets the cache size in megabytes.
diff --git a/libs/threadimageio/loadsavetask.cpp \
b/libs/threadimageio/loadsavetask.cpp index 13c55d2..a63423c 100644
--- a/libs/threadimageio/loadsavetask.cpp
+++ b/libs/threadimageio/loadsavetask.cpp
@@ -84,7 +84,7 @@ void LoadingTask::setStatus(LoadingTaskStatus status)
//---------------------------------------------------------------------------------------------------
-SharedLoadingTask::SharedLoadingTask(LoadSaveThread* thread, LoadingDescription \
description, +SharedLoadingTask::SharedLoadingTask(LoadSaveThread* thread, const \
LoadingDescription& description,
LoadSaveThread::AccessMode mode, \
LoadingTaskStatus loadingTaskStatus) : LoadingTask(thread, description, \
loadingTaskStatus), m_completed(false),
@@ -413,7 +413,7 @@ void SharedLoadingTask::removeListener(LoadingProcessListener* \
listener) m_listeners.removeAll(listener);
}
-void SharedLoadingTask::notifyNewLoadingProcess(LoadingProcess* process, \
LoadingDescription description) +void \
SharedLoadingTask::notifyNewLoadingProcess(LoadingProcess* process, const \
LoadingDescription& description) {
// Ok, we are notified that another task has been started in another thread.
// We are of course only interested if the task loads the same file,
diff --git a/libs/threadimageio/loadsavetask.h b/libs/threadimageio/loadsavetask.h
index f9dffc6..11623e3 100644
--- a/libs/threadimageio/loadsavetask.h
+++ b/libs/threadimageio/loadsavetask.h
@@ -87,7 +87,7 @@ public:
public:
- LoadingTask(LoadSaveThread* thread, LoadingDescription description,
+ LoadingTask(LoadSaveThread* thread, const LoadingDescription& description,
LoadingTaskStatus loadingTaskStatus = LoadingTaskStatusLoading)
: LoadSaveTask(thread),
m_loadingDescription(description),
@@ -136,7 +136,7 @@ class SharedLoadingTask : public LoadingTask,
{
public:
- SharedLoadingTask(LoadSaveThread* thread, LoadingDescription description,
+ SharedLoadingTask(LoadSaveThread* thread, const LoadingDescription& description,
LoadSaveThread::AccessMode mode = \
LoadSaveThread::AccessModeReadWrite,
LoadingTaskStatus loadingTaskStatus = \
LoadingTaskStatusLoading);
@@ -155,7 +155,7 @@ public:
virtual QString cacheKey();
virtual void addListener(LoadingProcessListener* listener);
virtual void removeListener(LoadingProcessListener* listener);
- virtual void notifyNewLoadingProcess(LoadingProcess* process, LoadingDescription \
description); + virtual void notifyNewLoadingProcess(LoadingProcess* process, \
const LoadingDescription& description);
// LoadingProcessListener
diff --git a/libs/threadimageio/loadsavethread.cpp \
b/libs/threadimageio/loadsavethread.cpp index 9bb57ea..28f71a4 100644
--- a/libs/threadimageio/loadsavethread.cpp
+++ b/libs/threadimageio/loadsavethread.cpp
@@ -87,7 +87,7 @@ LoadSaveFileInfoProvider* LoadSaveThread::infoProvider()
return LoadSaveThreadPriv::infoProvider;
}
-void LoadSaveThread::load(LoadingDescription description)
+void LoadSaveThread::load(const LoadingDescription& description)
{
QMutexLocker lock(threadMutex());
m_todo << new LoadingTask(this, description);
diff --git a/libs/threadimageio/loadsavethread.h \
b/libs/threadimageio/loadsavethread.h index 08a24f1..02311da 100644
--- a/libs/threadimageio/loadsavethread.h
+++ b/libs/threadimageio/loadsavethread.h
@@ -117,7 +117,7 @@ public:
~LoadSaveThread();
/** Append a task to load the given file to the task list */
- void load(LoadingDescription description);
+ void load(const LoadingDescription& description);
/** Append a task to save the image to the task list */
void save(DImg& image, const QString& filePath, const QString& format);
diff --git a/libs/threadimageio/previewloadthread.cpp \
b/libs/threadimageio/previewloadthread.cpp index 2df080f..8b42eba 100644
--- a/libs/threadimageio/previewloadthread.cpp
+++ b/libs/threadimageio/previewloadthread.cpp
@@ -79,7 +79,7 @@ void PreviewLoadThread::loadHighQuality(const QString& filePath)
load(filePath, 0);
}
-void PreviewLoadThread::load(LoadingDescription description)
+void PreviewLoadThread::load(const LoadingDescription& description)
{
// creates a PreviewLoadingTask, which uses different mechanisms than a normal \
loading task ManagedLoadSaveThread::loadPreview(description, m_loadingPolicy);
diff --git a/libs/threadimageio/previewloadthread.h \
b/libs/threadimageio/previewloadthread.h index f26cb8a..5b0d002 100644
--- a/libs/threadimageio/previewloadthread.h
+++ b/libs/threadimageio/previewloadthread.h
@@ -68,7 +68,7 @@ public:
/**
* Load a preview. Loading description will not be touched.
*/
- void load(LoadingDescription description);
+ void load(const LoadingDescription& description);
/// Optionally, set the displaying widget for color management
void setDisplayingWidget(QWidget* widget);
diff --git a/libs/threadimageio/previewtask.h b/libs/threadimageio/previewtask.h
index 75828cb..bfd21ef 100644
--- a/libs/threadimageio/previewtask.h
+++ b/libs/threadimageio/previewtask.h
@@ -40,7 +40,7 @@ class PreviewLoadingTask : public SharedLoadingTask
{
public:
- PreviewLoadingTask(LoadSaveThread* thread, LoadingDescription description)
+ PreviewLoadingTask(LoadSaveThread* thread, const LoadingDescription& \
description)
: SharedLoadingTask(thread, description, LoadSaveThread::AccessModeRead, \
LoadingTaskStatusLoading) {}
diff --git a/libs/threadimageio/sharedloadsavethread.cpp \
b/libs/threadimageio/sharedloadsavethread.cpp index f4ac36c..203350d 100644
--- a/libs/threadimageio/sharedloadsavethread.cpp
+++ b/libs/threadimageio/sharedloadsavethread.cpp
@@ -37,7 +37,7 @@ SharedLoadSaveThread::SharedLoadSaveThread(QObject* parent)
{
}
-void SharedLoadSaveThread::load(LoadingDescription description, AccessMode mode, \
LoadingPolicy policy) +void SharedLoadSaveThread::load(const LoadingDescription& \
description, AccessMode mode, LoadingPolicy policy) {
ManagedLoadSaveThread::load(description, LoadingModeShared, policy, mode);
}
diff --git a/libs/threadimageio/sharedloadsavethread.h \
b/libs/threadimageio/sharedloadsavethread.h index c0dc832..8005eb6 100644
--- a/libs/threadimageio/sharedloadsavethread.h
+++ b/libs/threadimageio/sharedloadsavethread.h
@@ -37,7 +37,7 @@ public:
explicit SharedLoadSaveThread(QObject* parent = 0);
- void load(LoadingDescription description, AccessMode mode, LoadingPolicy policy \
= LoadingPolicyAppend); + void load(const LoadingDescription& description, \
AccessMode mode, LoadingPolicy policy = LoadingPolicyAppend); DImg cacheLookup(const \
QString& filePath, AccessMode mode); };
diff --git a/libs/threadimageio/thumbnailloadthread.cpp \
b/libs/threadimageio/thumbnailloadthread.cpp index 37c9493..a83a2ff 100644
--- a/libs/threadimageio/thumbnailloadthread.cpp
+++ b/libs/threadimageio/thumbnailloadthread.cpp
@@ -60,7 +60,7 @@ class ThumbnailResult
public:
- ThumbnailResult(LoadingDescription description, QImage image)
+ ThumbnailResult(const LoadingDescription& description, const QImage& image)
: loadingDescription(description), image(image)
{
}
diff --git a/libs/threadimageio/thumbnailtask.h b/libs/threadimageio/thumbnailtask.h
index 3ee5e30..a5b6c1e 100644
--- a/libs/threadimageio/thumbnailtask.h
+++ b/libs/threadimageio/thumbnailtask.h
@@ -42,7 +42,7 @@ class ThumbnailLoadingTask : public SharedLoadingTask
{
public:
- ThumbnailLoadingTask(LoadSaveThread* thread, LoadingDescription description);
+ ThumbnailLoadingTask(LoadSaveThread* thread, const LoadingDescription& \
description);
virtual void execute();
virtual void setResult(const LoadingDescription& loadingDescription, const \
QImage& qimage);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic