From: Emmanuel Pescosta Date: Thu, 19 Feb 2015 19:34:35 +0000 (+0100) Subject: Merge branch 'master' into frameworks X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/8679115552ec65ccfc6cbc1db68414d80e3a081b Merge branch 'master' into frameworks --- 8679115552ec65ccfc6cbc1db68414d80e3a081b diff --cc src/panels/places/placesitemmodel.h index 38fcfe6af,7cbf99e95..aa8bb16fe --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@@ -119,9 -121,17 +119,17 @@@ public * 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); diff --cc src/panels/places/placespanel.cpp index 631b6b69d,6b840ef57..5618cee21 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@@ -402,14 -407,18 +404,15 @@@ void PlacesPanel::slotItemDropEventStor 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)