[Kst] extragear/graphics/kst/src/datasources/nad
Eli Fidler
eli at staikos.net
Sun May 28 16:39:31 CEST 2006
SVN commit 545861 by fidler:
lock and unlock properly
M +12 -9 nadsource.cpp
--- trunk/extragear/graphics/kst/src/datasources/nad/nadsource.cpp #545860:545861
@@ -91,20 +91,23 @@
return setLastUpdateResult(KstObject::UPDATE);
}
- bool updated = false;
+ int updated = 0;
if (_cacheConn->isConnected()) {
- _cacheConn->lock(_filename, "INDEX", NADCacheAgentConnection::READLOCK);
- updated = _cacheConn->update(_filename, "INDEX");
- _cacheConn->unlock(_filename, "INDEX");
+ _cacheConn->lock(_filename, "", NADCacheAgentConnection::WRITELOCK);
+ updated = _cacheConn->update(_filename, "");
+ _cacheConn->unlock(_filename, "");
}
- if (updated) {
+ if (updated > 0) {
updateNumFramesScalar();
kstdDebug() << "NADSource:update(" << QString::number(u) << ") = UPDATE\n";
return setLastUpdateResult(KstObject::UPDATE);
- } else {
+ } else if (updated == 0) {
kstdDebug() << "NADSource:update(" << QString::number(u) << ") = NO_CHANGE\n";
return setLastUpdateResult(KstObject::NO_CHANGE);
+ } else {
+ kstdDebug() << "NADSource:update(" << QString::number(u) << ") = ERROR (" << QString::number(updated) << ")\n";
+ return setLastUpdateResult(KstObject::NO_CHANGE);
}
}
@@ -581,14 +584,14 @@
NAD::NADCacheAgentConnection cacheConn;
cacheConn.connectToCacheAgent();
if (cacheConn.isConnected()) {
- cacheConn.lock(filename, "INDEX", NADCacheAgentConnection::WRITELOCK);
- cacheConn.update(filename, "INDEX");
+ cacheConn.lock(filename, "", NADCacheAgentConnection::WRITELOCK);
+ cacheConn.update(filename, "");
}
QStringList rc = cache.getFields(filename);
if (cacheConn.isConnected()) {
- cacheConn.unlock(filename, "INDEX");
+ cacheConn.unlock(filename, "");
}
if (!rc.empty()) {
More information about the Kst
mailing list