D12222: baloodb: Use complete access filtering for all outputs
Stefan BrĂ¼ns
noreply at phabricator.kde.org
Tue Apr 17 23:43:05 UTC 2018
bruns added inline comments.
INLINE COMMENTS
> databasesanitizer.cpp:179
> +
> + bool isMounted(const quint32 id) {
> + return m_devices.mounted.contains(id);
`isMounted(id)` can be implemented as `getStorageInfo(id).isValid()`
> databasesanitizer.cpp:183
> +
> + bool isUnMounted(const quint32 id) {
> + return m_devices.unmounted.contains(id);
unused, please remove
> databasesanitizer.cpp:189
> {
> - QMap<quint32, bool> result;
> + createDeviceStates(infos, accessFilter);
> + auto tail = infos.end();
I can not see what this function is useful for. Just inline the FileInfo -> DeviceIds reduction here, and ...
> databasesanitizer.cpp:192
> + Summary summary;
> + for (const quint32 deviceId : m_devices.ignored) {
> + tail = std::remove_if(infos.begin(), tail,
... skip the deviceId if it should be ignored:
const auto storageInfo = getStorageInfo(id);
if (isDeviceIgnored(storageInfo, accessFilter)) {
continue;
}
> databasesanitizer.cpp:195
> + [deviceId, &summary] (const FileInfo& info) {
> + summary.accessible += (info.deviceId == deviceId && info.accessible ? 1 : 0);
> + return info.deviceId == deviceId;
if (info.deviceId != deviceId) {
return false;
}
summary.accessible += info.accessible ? 1 : 0;
return true;
REPOSITORY
R293 Baloo
REVISION DETAIL
https://phabricator.kde.org/D12222
To: michaelh, #baloo, #frameworks
Cc: bruns, ashaposhnikov, michaelh, astippich, spoorun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180417/fdf96fa1/attachment.html>
More information about the Kde-frameworks-devel
mailing list