* the corresponding IO-slave. Virtual URLs for bookmarks are used to
* be independent from internal format changes.
*/
- static KUrl convertedUrl(const KUrl& url);
+ static QUrl convertedUrl(const QUrl& url);
- virtual void clear();
+ virtual void clear() Q_DECL_OVERRIDE;
+
+ /**
+ * Saves the bookmarks and indicates to other applications that the
+ * state of the bookmarks has been changed. Is only called by the
+ * timeout of m_saveBookmarksTimer to prevent unnecessary savings.
+ */
+ void saveBookmarks();
+
signals:
void errorMessage(const QString& message);
void storageSetupDone(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)
+void PlacesPanel::slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent)
{
- Q_UNUSED(parent);
- QString error;
- DragAndDropHelper::dropUrls(KFileItem(), dest, event, error);
- if (!error.isEmpty()) {
- emit errorMessage(error);
+ KIO::DropJob *job = DragAndDropHelper::dropUrls(dest, event, parent);
+ if (job) {
+ connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) emit errorMessage(job->errorString()); });
}
-
}
void PlacesPanel::slotTrashUpdated(KJob* job)