~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/threadimageio/loadingcacheinterface.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
void LoadingCacheInterface::fileChanged(const QString& filePath)
44
44
{
45
 
    LoadingCache *cache = LoadingCache::cache();
 
45
    LoadingCache* cache = LoadingCache::cache();
46
46
    LoadingCache::CacheLock lock(cache);
47
47
    cache->notifyFileChanged(filePath);
48
48
 
55
55
    */
56
56
}
57
57
 
58
 
void LoadingCacheInterface::connectToSignalFileChanged(QObject *object, const char *slot)
 
58
void LoadingCacheInterface::connectToSignalFileChanged(QObject* object, const char* slot)
59
59
{
60
 
    LoadingCache *cache = LoadingCache::cache();
61
 
    QObject::connect(cache, SIGNAL(fileChanged(const QString &)),
 
60
    LoadingCache* cache = LoadingCache::cache();
 
61
    QObject::connect(cache, SIGNAL(fileChanged(const QString&)),
62
62
                     object, slot,
63
63
                     Qt::QueuedConnection);
64
64
    // make it a queued connection because the signal is emitted when the CacheLock is held!
66
66
 
67
67
void LoadingCacheInterface::cleanCache()
68
68
{
69
 
    LoadingCache *cache = LoadingCache::cache();
 
69
    LoadingCache* cache = LoadingCache::cache();
70
70
    LoadingCache::CacheLock lock(cache);
71
71
    cache->removeImages();
72
72
}
73
73
 
74
74
void LoadingCacheInterface::cleanThumbnailCache()
75
75
{
76
 
    LoadingCache *cache = LoadingCache::cache();
 
76
    LoadingCache* cache = LoadingCache::cache();
77
77
    LoadingCache::CacheLock lock(cache);
78
78
    cache->removeThumbnails();
79
79
}
80
80
 
81
81
void LoadingCacheInterface::putImage(const QString& filePath, const DImg& img)
82
82
{
83
 
    LoadingCache *cache = LoadingCache::cache();
 
83
    LoadingCache* cache = LoadingCache::cache();
84
84
    LoadingCache::CacheLock lock(cache);
 
85
 
85
86
    if (cache->isCacheable(&img))
86
87
    {
87
 
        DImg *copy = new DImg(img);
 
88
        DImg* copy = new DImg(img);
88
89
        copy->detach();
89
90
        cache->putImage(filePath, copy, filePath);
90
91
    }
92
93
 
93
94
void LoadingCacheInterface::setCacheOptions(int cacheSize)
94
95
{
95
 
    LoadingCache *cache = LoadingCache::cache();
 
96
    LoadingCache* cache = LoadingCache::cache();
96
97
    LoadingCache::CacheLock lock(cache);
97
98
    cache->setCacheSize(cacheSize);
98
99
}