+ const PlacesItem* insertedItem = placesItem(index);
+ if (insertedItem) {
+ // Take care to apply the PlacesItemModel-order of the inserted item
+ // also to the bookmark-manager.
+ const KBookmark insertedBookmark = insertedItem->bookmark();
+
+ const PlacesItem* previousItem = placesItem(index - 1);
+ KBookmark previousBookmark;
+ if (previousItem) {
+ previousBookmark = previousItem->bookmark();
+ }
+
+ m_bookmarkManager->root().moveBookmark(insertedBookmark, previousBookmark);
+ }
+