Changeset View
Changeset View
Standalone View
Standalone View
src/engine/documenturldb.h
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 106 | } else { | |||
---|---|---|---|---|---|
107 | idTreeDb.del(path.parentId); | 107 | idTreeDb.del(path.parentId); | ||
108 | 108 | | |||
109 | // | 109 | // | ||
110 | // Delete every parent directory which only has 1 child | 110 | // Delete every parent directory which only has 1 child | ||
111 | // | 111 | // | ||
112 | quint64 id = path.parentId; | 112 | quint64 id = path.parentId; | ||
113 | while (id) { | 113 | while (id) { | ||
114 | auto path = idFilenameDb.get(id); | 114 | auto path = idFilenameDb.get(id); | ||
115 | Q_ASSERT(!path.name.isEmpty()); | 115 | // FIXME: Prevents database cleaning | ||
116 | // Q_ASSERT(!path.name.isEmpty()); | ||||
116 | 117 | | |||
117 | QVector<quint64> subDocs = idTreeDb.get(path.parentId); | 118 | QVector<quint64> subDocs = idTreeDb.get(path.parentId); | ||
118 | if (subDocs.size() == 1 && shouldDeleteFolder(id)) { | 119 | if (subDocs.size() == 1 && shouldDeleteFolder(id)) { | ||
119 | idTreeDb.del(path.parentId); | 120 | idTreeDb.del(path.parentId); | ||
120 | idFilenameDb.del(id); | 121 | idFilenameDb.del(id); | ||
121 | } else { | 122 | } else { | ||
122 | break; | 123 | break; | ||
123 | } | 124 | } | ||
Show All 34 Lines |