Due to device ids being inconstant duplicates are introduced to the database. I. e. multiple document ids pointing to the same entity.
This class shall eventually sanitize the database. Currently it just displays the issues should there be any.
Details
- Reviewers
ngraham mlaurent - Group Reviewers
Baloo Frameworks - Maniphest Tasks
- T8250: Sanitize the database
- Commits
- R293:9de78becc063: Introduce sanitizer class
Diff Detail
- Repository
- R293 Baloo
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/engine/databasesanitizer.cpp | ||
---|---|---|
201 | This is the best I could think of to make getDocuments accessible to DatabaseSanitizerImpl. But I don't like it. |
src/engine/databasesanitizer.cpp | ||
---|---|---|
45 | initialize value by default please | |
108 | includeIds.count() > 0 => use !isEmpty | |
154 | const QSharedPointer<QRegularExpression> & | |
166 | use qCDebug(BALOO) | |
175 | as you add a i18n in engine directory you need to extract them. |
There were some conflicts I had to solve with this. Because it is not completely clear to me where this is going I wanted to be safe and used a d-pointer.
As a consequence this class does the printing which I prefer to be in the cli.
Secondly I can't make DatabaseSanitizerImpl a friend of the Transaction class. Which leads to the getDocuments() in DatabaseSanitizer, which should not be part of the interface. In the future more of similar functions will be needed.
Is there a better way to accomplish this?
src/engine/databasesanitizer.cpp | ||
---|---|---|
166 | I get a linker error |
This is where it gets complicated.
Essentially I can test only for sane databases, but that's useless.
Or I need to mock an external drive and have control over its device id, which seems to be very difficult if at all possible.
src/engine/databasesanitizer.cpp | ||
---|---|---|
164 | Before landing this will become Create a list of \a FileInfo items and print it to stdout. |