Cleanup: Make local helpers and variables of static linkage

In core/imagedownloader.cpp the helpers cloudImageUrl() and loadPicture()
are made of static linkage.

The global variables queuedPictures and pictureQueueMutex were moved
into the loadPicture() function, because they are used only there.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-02-06 19:58:07 +01:00 committed by Robert C. Helling
parent 218ea94831
commit 9986ce25d7
2 changed files with 5 additions and 8 deletions

View file

@ -9,7 +9,7 @@
#include <QtConcurrent>
QUrl cloudImageURL(const char *hash)
static QUrl cloudImageURL(const char *hash)
{
return QUrl::fromUserInput(QString("https://cloud.subsurface-divelog.org/images/").append(hash));
}
@ -78,11 +78,11 @@ void ImageDownloader::saveImage(QNetworkReply *reply)
}
QSet<QString> queuedPictures;
QMutex pictureQueueMutex;
void loadPicture(struct picture *picture, bool fromHash)
static void loadPicture(struct picture *picture, bool fromHash)
{
static QSet<QString> queuedPictures;
static QMutex pictureQueueMutex;
if (!picture)
return;
QMutexLocker locker(&pictureQueueMutex);

View file

@ -8,9 +8,6 @@
typedef QPair<QString, QByteArray> SHashedFilename;
extern QUrl cloudImageURL(const char *hash);
class ImageDownloader : public QObject {
Q_OBJECT;
public: