Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfileplacesmodel.cpp
Show First 20 Lines • Show All 748 Lines • ▼ Show 20 Line(s) | 744 | if (tag.isEmpty()) { | |||
---|---|---|---|---|---|
749 | } | 749 | } | ||
750 | 750 | | |||
751 | bool allowedHere = appName.isEmpty() || | 751 | bool allowedHere = appName.isEmpty() || | ||
752 | ((appName == QCoreApplication::instance()->applicationName()) || | 752 | ((appName == QCoreApplication::instance()->applicationName()) || | ||
753 | (appName == alternativeApplicationName)); | 753 | (appName == alternativeApplicationName)); | ||
754 | bool isSupportedUrl = isBalooUrl(url) ? fileIndexingEnabled : true; | 754 | bool isSupportedUrl = isBalooUrl(url) ? fileIndexingEnabled : true; | ||
755 | bool isSupportedScheme = supportedSchemes.isEmpty() || supportedSchemes.contains(url.scheme()); | 755 | bool isSupportedScheme = supportedSchemes.isEmpty() || supportedSchemes.contains(url.scheme()); | ||
756 | 756 | | |||
757 | if (isSupportedScheme && ((isSupportedUrl && udi.isEmpty() && allowedHere) || deviceAvailable)) { | 757 | KFilePlacesItem *item = nullptr; | ||
758 | | ||||
759 | KFilePlacesItem *item; | | |||
760 | if (deviceAvailable) { | 758 | if (deviceAvailable) { | ||
bruns: you have dropped the `allowedHere` check. Probably just `if (!allowedHere) continue`.
And for… | |||||
Devices are always allowed. The old check was if (isSupportedScheme && ((isSupportedUrl && ... && allowedHere) || deviceAvailable)) so deviceAvailable trumps allowedHere broulik: Devices are always allowed. The old check was
```
if (isSupportedScheme && ((isSupportedUrl && . | |||||
761 | item = new KFilePlacesItem(bookmarkManager, bookmark.address(), udi); | 759 | item = new KFilePlacesItem(bookmarkManager, bookmark.address(), udi); | ||
Does KFilePlacesItem have a move constructor? You can do the heap allocation then only if necessary. bruns: Does KFilePlacesItem have a move constructor? You can do the heap allocation then only if… | |||||
broulik: It does not. | |||||
760 | if (!item->hasSupportedScheme(supportedSchemes)) { | ||||
761 | delete item; | ||||
762 | item = nullptr; | ||||
763 | } | ||||
764 | } else if (isSupportedScheme && isSupportedUrl && udi.isEmpty() && allowedHere) { | ||||
762 | // TODO: Update bookmark internal element | 765 | // TODO: Update bookmark internal element | ||
763 | } else { | | |||
764 | item = new KFilePlacesItem(bookmarkManager, bookmark.address()); | 766 | item = new KFilePlacesItem(bookmarkManager, bookmark.address()); | ||
765 | } | 767 | } | ||
768 | | ||||
769 | if (item) { | ||||
766 | connect(item, SIGNAL(itemChanged(QString)), | 770 | connect(item, SIGNAL(itemChanged(QString)), | ||
767 | q, SLOT(_k_itemChanged(QString))); | 771 | q, SLOT(_k_itemChanged(QString))); | ||
768 | 772 | | |||
769 | items << item; | 773 | items << item; | ||
770 | } | 774 | } | ||
771 | } else { | 775 | } else { | ||
772 | auto it = std::find(tagsList.begin(), tagsList.end(), tag); | 776 | auto it = std::find(tagsList.begin(), tagsList.end(), tag); | ||
773 | if (it != tagsList.end()) { | 777 | if (it != tagsList.end()) { | ||
▲ Show 20 Lines • Show All 609 Lines • Show Last 20 Lines |
you have dropped the allowedHere check. Probably just if (!allowedHere) continue.
And for reasons unknown to me, tags: is not filtered per app - move the allowedHere check to the very beginning of the while(...) loop.