Element SQLite cache : replace the column mtime by uuid.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4223 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-10-03 15:41:59 +00:00
parent 4edd1f3f24
commit 3e42c3918b
5 changed files with 170 additions and 88 deletions

View File

@@ -110,25 +110,31 @@ QString FileElementDefinition::virtualPath() {
}
/**
Recharge l'element
*/
void FileElementDefinition::reload() {
if (file_path.isEmpty()) {
* @brief FileElementDefinition::reload
* Reload this file element definition
*/
void FileElementDefinition::reload()
{
if (file_path.isEmpty())
{
is_null = true;
return;
}
// recupere le chemin du fichier *.elmt correspondant
QFileInfo file_info(file_path);
if (!file_info.exists() || !file_info.isReadable()) {
if (!file_info.exists() || !file_info.isReadable())
{
is_null = true;
return;
}
file_path = file_info.canonicalFilePath();
if (parentCollection()) {
if (parentCollection())
{
ElementsCollectionCache *cache = parentCollection() -> cache();
if (cache && cache -> fetchNameFromCache(location().toString(), file_info.lastModified())) {
if (cache && cache -> fetchNameFromCache(location().toString(), uuid()))
{
// the element file has not been modified since the last time
// we put its name in cache: we do not need to load it.
is_null = false;