X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c3b914a7faed3a7c0195ae77b40204cbc8d31fe5..405dd624fb:/src/panels/places/placesitemmodel.cpp diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index c0cef9315..a1223b5fd 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -44,19 +44,6 @@ #include #include -namespace { - static QList balooURLs = { - QUrl(QStringLiteral("timeline:/today")), - QUrl(QStringLiteral("timeline:/yesterday")), - QUrl(QStringLiteral("timeline:/thismonth")), - QUrl(QStringLiteral("timeline:/lastmonth")), - QUrl(QStringLiteral("search:/documents")), - QUrl(QStringLiteral("search:/images")), - QUrl(QStringLiteral("search:/audio")), - QUrl(QStringLiteral("search:/videos")) - }; -} - PlacesItemModel::PlacesItemModel(QObject* parent) : KStandardItemModel(parent), m_hiddenItemsShown(false), @@ -509,7 +496,7 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error, const QVariant& errorData, const QString& udi) { - Q_UNUSED(udi); + Q_UNUSED(udi) const int index = m_storageSetupInProgress.take(sender()); const PlacesItem* item = placesItem(index); @@ -553,8 +540,8 @@ void PlacesItemModel::onSourceModelRowsAboutToBeRemoved(const QModelIndex &paren void PlacesItemModel::onSourceModelRowsAboutToBeMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) { - Q_UNUSED(destination); - Q_UNUSED(row); + Q_UNUSED(destination) + Q_UNUSED(row) for(int r = start; r <= end; r++) { const QModelIndex sourceIndex = m_sourceModel->index(r, 0, parent); @@ -565,8 +552,8 @@ void PlacesItemModel::onSourceModelRowsAboutToBeMoved(const QModelIndex &parent, void PlacesItemModel::onSourceModelRowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) { - Q_UNUSED(destination); - Q_UNUSED(parent); + Q_UNUSED(destination) + Q_UNUSED(parent) const int blockSize = (end - start) + 1; @@ -581,7 +568,7 @@ void PlacesItemModel::onSourceModelRowsMoved(const QModelIndex &parent, int star void PlacesItemModel::onSourceModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) { - Q_UNUSED(roles); + Q_UNUSED(roles) for (int r = topLeft.row(); r <= bottomRight.row(); r++) { const QModelIndex sourceIndex = m_sourceModel->index(r, 0); @@ -601,11 +588,6 @@ void PlacesItemModel::onSourceModelDataChanged(const QModelIndex &topLeft, const } if (placeItem && !m_sourceModel->isDevice(sourceIndex)) { - placeItem->setText(bookmark.text()); - placeItem->setIcon(sourceIndex.data(KFilePlacesModel::IconNameRole).toString()); - placeItem->setUrl(m_sourceModel->url(sourceIndex)); - placeItem->bookmark().setMetaDataItem(QStringLiteral("OnlyInApp"), - bookmark.metaDataItem(QStringLiteral("OnlyInApp"))); // must update the bookmark object placeItem->setBookmark(bookmark); } @@ -627,6 +609,18 @@ void PlacesItemModel::cleanupBookmarks() { // KIO model now provides support for baloo urls, and because of that we // need to remove old URLs that were visible only in Dolphin to avoid duplication + + static const QVector balooURLs = { + QUrl(QStringLiteral("timeline:/today")), + QUrl(QStringLiteral("timeline:/yesterday")), + QUrl(QStringLiteral("timeline:/thismonth")), + QUrl(QStringLiteral("timeline:/lastmonth")), + QUrl(QStringLiteral("search:/documents")), + QUrl(QStringLiteral("search:/images")), + QUrl(QStringLiteral("search:/audio")), + QUrl(QStringLiteral("search:/videos")) + }; + int row = 0; do { const QModelIndex sourceIndex = m_sourceModel->index(row, 0); @@ -761,7 +755,7 @@ int PlacesItemModel::mapFromSource(const QModelIndex &index) const bool PlacesItemModel::isDir(int index) const { - Q_UNUSED(index); + Q_UNUSED(index) return true; }