mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Lock-related improvement in ElementsCollectionCache.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1365 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -108,7 +108,11 @@ void ElementsCollectionCache::endCollection(ElementsCollection *collection) {
|
||||
bool use_cache = cache_db_.isOpen() && collection -> isCacheable();
|
||||
if (use_cache) {
|
||||
bool transaction_commited = cache_db_.commit();
|
||||
qDebug() << (transaction_commited ? "transaction commited for " : "transaction not commited for") << collection -> protocol();
|
||||
if (transaction_commited) {
|
||||
qDebug() << "transaction commited for " << collection -> protocol();
|
||||
} else {
|
||||
qDebug() << "transaction not commited for " << collection -> protocol() << ":" << cache_db_.lastError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +196,7 @@ bool ElementsCollectionCache::fetchNameFromCache(const QString &path, const QDat
|
||||
if (select_name_ -> exec()) {
|
||||
if (select_name_ -> first()) {
|
||||
current_name_ = select_name_ -> value(0).toString();
|
||||
select_name_ -> finish();
|
||||
return(true);
|
||||
}
|
||||
} else {
|
||||
@@ -217,6 +222,7 @@ bool ElementsCollectionCache::fetchPixmapFromCache(const QString &path, const QD
|
||||
// avoid returning always the same pixmap (i.e. same cacheKey())
|
||||
current_pixmap_.detach();
|
||||
current_pixmap_.loadFromData(ba, qPrintable(pixmap_storage_format_));
|
||||
select_pixmap_ -> finish();
|
||||
}
|
||||
return(true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user