21 #ifndef SCIMAGECACHEMANAGER_H
22 #define SCIMAGECACHEMANAGER_H
28 #include "scribusapi.h"
29 #include "scimagecachedir.h"
44 typedef ScImageCacheDir::AccessCounter AccessCounter;
56 static QString absolutePath(
const QString & fn);
62 void setEnabled(
bool enableCache);
67 bool enabled(
void)
const {
return m_isEnabled; }
73 bool setMaxCacheSizeMiB(
int maxCacheSizeMiB);
79 bool setMaxCacheEntries(
int maxCacheEntries);
87 bool setCompressionLevel(
int level);
92 int compressionLevel()
const;
106 bool acquireWriteLock();
111 bool releaseWriteLock();
119 void removeMasterLock();
131 bool updateAccess(
const QString & dir, AccessCounter from, AccessCounter to);
141 bool updateFile(
const QString & file);
157 int count()
const {
return m_fa.size(); }
160 typedef QList<ScImageCacheFile *> FAL;
169 static void create();
170 static void cleanupLockDir();
171 static bool createLockDir();
172 static QString lockDir();
173 static QString masterLockFile();
174 static QString writeLockTemplate();
176 void sanitizeCache();
181 bool acquireMasterLock();
182 bool releaseMasterLock();
185 bool m_haveMasterLock;
187 int m_writeLockCount;
188 int m_compressionLevel;
191 qint64 m_maxTotalSize;
192 qint64 m_totalCacheSize;
194 MetaAgeList m_metaAge;
196 QTemporaryFile *m_writeLockFile;
bool enabled(void) const
Check if the image cache is enabled.
Definition: scimagecachemanager.h:67
Representation of a directory node in the image cache tree.
Definition: scimagecachedir.h:38
Scribus image cache manager.
Definition: scimagecachemanager.h:39
Representation of a file node in the image cache tree.
Definition: scimagecachefile.h:37