D29602: Add field "Folder" to theme content items and to message tool tip

Christoph VogtlÃĪnder noreply at phabricator.kde.org
Wed May 13 13:21:09 BST 2020


gordin added inline comments.

INLINE COMMENTS

> dvratil wrote in storagemodel.cpp:263
> This will use a ton of memory and will make populating the model slow - for each single email you will need to resolve the real parent collection, traverse the collection parent chain and assemble the string.
> 
> I suggest you add a `QHash<Collection::Id, QString>` lookup table into the StorageModel and try to look up the path by the collection ID there first, then fallback to building the path and inserting it into the hash map. This way we will make use of the implicit QString sharing so all items from the same collection will share the same single string with the path reducing memory footprint, and  we will avoid assembling the string every time, which is more costly than a hash map lookup.
> 
> Remember to clear the hash map when the selected folder is changed.

What do you mean by "selected folder"? I thought the collection ID is globally unique? Why can it not be re-used independent from any selection?

> dvratil wrote in storagemodel.cpp:506
> You can pass the `d->mChildrenFilterModel` here instead of the `etm`, the code inside is clever enough to find the ETM source model.

Actually, this does not work. Neither passing "d->mChildrenFilterModel" nor "static_cast<QAbstractProxyModel *>(d->mChildrenFilterModel)" will produce a result, "idx" is invalid.

REPOSITORY
  R94 PIM: Message Library

REVISION DETAIL
  https://phabricator.kde.org/D29602

To: gordin, #vdg, dvratil
Cc: dvratil, kde-pim, jamesth, fbampaloukas, dvasin, hrouis, rodsevich, ach, winterz, vkrause, mlaurent, knauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200513/2af6ddef/attachment.htm>


More information about the kde-pim mailing list