┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2018-10-04 22:52:51 +0200
committerElvis Angelaccio <[email protected]>2018-10-04 22:52:51 +0200
commit50f23e8b11ffeb3d1dabc36f0cc751aa454a0fd1 (patch)
treea9fb0e8407583efb71200709b82a7a5979274c32 /src/panels
parentb663abc6c7f6583537db9a3da5ff665eaedb6749 (diff)
[PlacesItemModel] Drop dead code
m_bookmarkedItems is long gone (since commit da6f8fe0862585287153). Porting `showModelState()` to the new KFilePlacesModel source model is not worth it, since this was just a debugging function and most of the logic has been moved upstream anyway (see T7040).
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/places/placesitemmodel.cpp59
-rw-r--r--src/panels/places/placesitemmodel.h6
2 files changed, 0 insertions, 65 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp
index 7e313482d..f7fe5587c 100644
--- a/src/panels/places/placesitemmodel.cpp
+++ b/src/panels/places/placesitemmodel.cpp
@@ -120,11 +120,6 @@ void PlacesItemModel::setHiddenItemsShown(bool show)
}
}
}
-
-#ifdef PLACESITEMMODEL_DEBUG
- qCDebug(DolphinDebug) << "Changed visibility of hidden items";
- showModelState();
-#endif
}
bool PlacesItemModel::hiddenItemsShown() const
@@ -169,10 +164,6 @@ void PlacesItemModel::insertSortedItem(PlacesItem* item)
void PlacesItemModel::onItemInserted(int index)
{
KStandardItemModel::onItemInserted(index);
-#ifdef PLACESITEMMODEL_DEBUG
- qCDebug(DolphinDebug) << "Inserted item" << index;
- showModelState();
-#endif
}
void PlacesItemModel::onItemRemoved(int index, KStandardItem* removedItem)
@@ -180,10 +171,6 @@ void PlacesItemModel::onItemRemoved(int index, KStandardItem* removedItem)
m_indexMap.removeAt(index);
KStandardItemModel::onItemRemoved(index, removedItem);
-#ifdef PLACESITEMMODEL_DEBUG
- qCDebug(DolphinDebug) << "Removed item" << index;
- showModelState();
-#endif
}
void PlacesItemModel::onItemChanged(int index, const QSet<QByteArray>& changedRoles)
@@ -635,11 +622,6 @@ void PlacesItemModel::loadBookmarks()
addItemFromSourceModel(sourceIndex);
}
}
-
-#ifdef PLACESITEMMODEL_DEBUG
- qCDebug(DolphinDebug) << "Loaded bookmarks";
- showModelState();
-#endif
}
void PlacesItemModel::clear() {
@@ -786,44 +768,3 @@ PlacesItem *PlacesItemModel::itemFromBookmark(const KBookmark &bookmark) const
return nullptr;
}
-#ifdef PLACESITEMMODEL_DEBUG
-void PlacesItemModel::showModelState()
-{
- qCDebug(DolphinDebug) << "=================================";
- qCDebug(DolphinDebug) << "Model:";
- qCDebug(DolphinDebug) << "hidden-index model-index text";
- int modelIndex = 0;
- for (int i = 0; i < m_bookmarkedItems.count(); ++i) {
- if (m_bookmarkedItems[i]) {
- qCDebug(DolphinDebug) << i << "(Hidden) " << " " << m_bookmarkedItems[i]->dataValue("text").toString();
- } else {
- if (item(modelIndex)) {
- qCDebug(DolphinDebug) << i << " " << modelIndex << " " << item(modelIndex)->dataValue("text").toString();
- } else {
- qCDebug(DolphinDebug) << i << " " << modelIndex << " " << "(not available yet)";
- }
- ++modelIndex;
- }
- }
-
- qCDebug(DolphinDebug);
- qCDebug(DolphinDebug) << "Bookmarks:";
-
- int bookmarkIndex = 0;
- KBookmarkGroup root = m_bookmarkManager->root();
- KBookmark bookmark = root.first();
- while (!bookmark.isNull()) {
- const QString udi = bookmark.metaDataItem("UDI");
- const QString text = udi.isEmpty() ? bookmark.text() : udi;
- if (bookmark.metaDataItem("IsHidden") == QLatin1String("true")) {
- qCDebug(DolphinDebug) << bookmarkIndex << "(Hidden)" << text;
- } else {
- qCDebug(DolphinDebug) << bookmarkIndex << " " << text;
- }
-
- bookmark = root.next(bookmark);
- ++bookmarkIndex;
- }
-}
-#endif
-
diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h
index a2086efc5..d31c029a6 100644
--- a/src/panels/places/placesitemmodel.h
+++ b/src/panels/places/placesitemmodel.h
@@ -36,8 +36,6 @@ class KBookmarkManager;
class PlacesItem;
class QAction;
-// #define PLACESITEMMODEL_DEBUG
-
/**
* @brief Model for maintaining the bookmarks of the places panel.
*
@@ -204,10 +202,6 @@ private:
*/
void insertSortedItem(PlacesItem* item);
-#ifdef PLACESITEMMODEL_DEBUG
- void showModelState();
-#endif
-
PlacesItem *itemFromBookmark(const KBookmark &bookmark) const;
void addItemFromSourceModel(const QModelIndex &index);