@@ -160,7 +160,8 @@ QString LocalDataInterface::getRamsesPath(QString dbFile)
160160QSet<QString> LocalDataInterface::tableUuids (QString table, bool includeRemoved)
161161{
162162 // If we've got the info in the cache, use it.
163- if (CACHE_LOCAL_DATA && m_uuids.contains (table) ) return m_uuids.value (table);
163+ if (includeRemoved && CACHE_LOCAL_DATA && m_uuids.contains (table) ) return m_uuids.value (table);
164+ if (!includeRemoved && CACHE_LOCAL_DATA && m_uuidsWithoutRemoved.contains (table) ) return m_uuidsWithoutRemoved.value (table);
164165
165166 QString q = " SELECT uuid FROM '%1'" ;
166167 if (!includeRemoved) q += " WHERE removed = 0" ;
@@ -172,7 +173,8 @@ QSet<QString> LocalDataInterface::tableUuids(QString table, bool includeRemoved)
172173 while (qry.next ()) data << qry.value (0 ).toString ();
173174
174175 // Cache
175- m_uuids.insert (table, data);
176+ if (includeRemoved) m_uuids.insert (table, data);
177+ else m_uuidsWithoutRemoved.insert (table, data);
176178
177179 return data;
178180}
@@ -237,10 +239,10 @@ QVector<QStringList> LocalDataInterface::tableData(QString table, QHash<QString,
237239 return tData;
238240}
239241
240- bool LocalDataInterface::contains (QString uuid, QString table)
242+ bool LocalDataInterface::contains (QString uuid, QString table, bool includeRemoved )
241243{
242244 // Get all UUIDS
243- QSet<QString> uuids = tableUuids (table, true );
245+ QSet<QString> uuids = tableUuids (table, includeRemoved );
244246 return uuids.contains (uuid);
245247
246248
@@ -269,6 +271,7 @@ void LocalDataInterface::createObject(QString uuid, QString table, QString data)
269271{
270272 // Remove table cache
271273 m_uuids.remove (table);
274+ m_uuidsWithoutRemoved.remove (table);
272275
273276 QString newData = data;
274277
@@ -489,6 +492,7 @@ ServerConfig LocalDataInterface::setDataFile(const QString &file)
489492{
490493 // Clear all cache
491494 m_uuids.clear ();
495+ m_uuidsWithoutRemoved.clear ();
492496
493497 ProgressManager *pm = ProgressManager::instance ();
494498 pm->addToMaximum (2 );
@@ -641,6 +645,7 @@ void LocalDataInterface::saveSync(SyncData syncData)
641645
642646 // Clear cache
643647 m_uuids.remove (tableName);
648+ m_uuidsWithoutRemoved.remove (tableName);
644649
645650 // We're going to need the uuids and dates of the table
646651 QMap<QString, QString> uuidDates = modificationDates ( tableName );
@@ -717,6 +722,7 @@ void LocalDataInterface::saveSync(SyncData syncData)
717722
718723 // Clear cache
719724 m_uuids.remove (tableName);
725+ m_uuidsWithoutRemoved.remove (tableName);
720726
721727 QSet<TableRow> incomingRows = i.value ();
722728
@@ -932,6 +938,7 @@ QString LocalDataInterface::cleanDataBase(int deleteDataOlderThan)
932938
933939 // Clear cache
934940 m_uuids.clear ();
941+ m_uuidsWithoutRemoved.clear ();
935942
936943 // Get needed data
937944
0 commit comments