D8855: Use Kio::KPlacesModel as source model for PlacesItemModel

Milian Wolff noreply at phabricator.kde.org
Wed Dec 6 12:54:09 GMT 2017


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  sorry, three more cases of the for loops :-/

INLINE COMMENTS

> placesitemmodel.cpp:109
>      if (show) {
> -        // Move all items that are part of m_bookmarkedItems to the model.
> -        QList<PlacesItem*> itemsToInsert;
> -        QList<int> insertPos;
> -        int modelIndex = 0;
> -        for (int i = 0; i < m_bookmarkedItems.count(); ++i) {
> -            if (m_bookmarkedItems[i]) {
> -                itemsToInsert.append(m_bookmarkedItems[i]);
> -                m_bookmarkedItems[i] = 0;
> -                insertPos.append(modelIndex);
> +        for (int r = 0; r < m_sourceModel->rowCount(); r++) {
> +            const QModelIndex index = m_sourceModel->index(r, 0);

missed this one, sorry

> placesitemmodel.cpp:117
>      } else {
> -        // Move all items of the model, where the "isHidden" property is true, to
> -        // m_bookmarkedItems.
> -        Q_ASSERT(m_bookmarkedItems.count() == count());
> -        for (int i = count() - 1; i >= 0; --i) {
> -            if (placesItem(i)->isHidden()) {
> -                hideItem(i);
> +        for (int r = 0; r < m_sourceModel->rowCount(); r++) {
> +            const QModelIndex index = m_sourceModel->index(r, 0);

dito

> placesitemmodel.cpp:427
> +{
> +    for(int i = 0; i < m_sourceModel->rowCount(); i++) {
> +        const QModelIndex index = m_sourceModel->index(i, 0);

dito

REPOSITORY
  R318 Dolphin

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

To: renatoo, elvisangelaccio, emmanuelp, mlaurent, mwolff
Cc: mwolff, mlaurent, anthonyfieroni, nicolasfella, ngraham, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171206/3297af5f/attachment.htm>


More information about the kfm-devel mailing list