mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user