]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placespanel.cpp
Merge branch 'Applications/14.12'
[dolphin.git] / src / panels / places / placespanel.cpp
index d5308eabe1ccf366978d00a2b800cd9f5be60199..6b840ef570295626ed2c3983d948ae3d2ed1b462 100644 (file)
@@ -280,11 +280,14 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
                 editEntry(index);
             } else if (action == removeAction) {
                 m_model->removeItem(index);
+                m_model->saveBookmarks();
             } else if (action == hideAction) {
                 item->setHidden(hideAction->isChecked());
+                m_model->saveBookmarks();
             } else if (action == openInNewTabAction) {
-                const KUrl url = m_model->item(index)->dataValue("url").value<KUrl>();
-                emit placeMiddleClicked(url);
+                // TriggerItem does set up the storage first and then it will
+                // emit the slotItemMiddleClicked signal, because of Qt::MiddleButton.
+                triggerItem(index, Qt::MiddleButton);
             } else if (action == teardownAction) {
                 m_model->requestTeardown(index);
             } else if (action == ejectAction) {
@@ -334,7 +337,7 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
 
     const PlacesItem* destItem = m_model->placesItem(index);
     const PlacesItem::GroupType group = destItem->groupType();
-    if (group == PlacesItem::SearchForType || group == PlacesItem::RecentlyAccessedType) {
+    if (group == PlacesItem::SearchForType || group == PlacesItem::RecentlySavedType) {
         return;
     }
 
@@ -404,6 +407,7 @@ void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success)
 void PlacesPanel::slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event)
 {
     m_model->dropMimeDataBefore(index, event->mimeData());
+    m_model->saveBookmarks();
 }
 
 void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent)
@@ -476,6 +480,7 @@ void PlacesPanel::addEntry()
     if (dialog->exec() == QDialog::Accepted) {
         PlacesItem* item = m_model->createPlacesItem(dialog->text(), dialog->url(), dialog->icon());
         m_model->appendItemToGroup(item);
+        m_model->saveBookmarks();
     }
 
     delete dialog;
@@ -497,6 +502,7 @@ void PlacesPanel::editEntry(int index)
             oldItem->setText(dialog->text());
             oldItem->setUrl(dialog->url());
             oldItem->setIcon(dialog->icon());
+            m_model->saveBookmarks();
         }
     }