diff options
| author | Emmanuel Pescosta <[email protected]> | 2015-02-19 20:15:49 +0100 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2015-02-19 20:15:49 +0100 |
| commit | 1ef5434572d0289a160589395b8b80cd800bc195 (patch) | |
| tree | 6947fed56d8db2607a55522f6b11e4ff5935bedd | |
| parent | 9f3ac5f9416beb1bf9858bbb7fa4e3b63ca59bb9 (diff) | |
| parent | a8f4f01eaa4027476ea799b7815f353f5cdd99ad (diff) | |
Merge branch 'Applications/14.12'
| -rw-r--r-- | src/main.cpp | 2 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 20 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.h | 21 | ||||
| -rw-r--r-- | src/panels/places/placespanel.cpp | 5 |
4 files changed, 14 insertions, 34 deletions
diff --git a/src/main.cpp b/src/main.cpp index 620505666..f0ab1d9dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,7 @@ KDE_EXPORT int kdemain(int argc, char **argv) { KAboutData about("dolphin", 0, ki18nc("@title", "Dolphin"), - "4.14.98", + "14.12.3", ki18nc("@title", "File Manager"), KAboutData::License_GPL, ki18nc("@info:credit", "(C) 2006-2014 Peter Penz, Frank Reininghaus, and Emmanuel Pescosta")); diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 6accdc837..46f40b65c 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -78,7 +78,6 @@ PlacesItemModel::PlacesItemModel(QObject* parent) : m_systemBookmarksIndexes(), m_bookmarkedItems(), m_hiddenItemToRemove(-1), - m_saveBookmarksTimer(0), m_updateBookmarksTimer(0), m_storageSetupInProgress() { @@ -95,11 +94,6 @@ PlacesItemModel::PlacesItemModel(QObject* parent) : const int syncBookmarksTimeout = 100; - m_saveBookmarksTimer = new QTimer(this); - m_saveBookmarksTimer->setInterval(syncBookmarksTimeout); - m_saveBookmarksTimer->setSingleShot(true); - connect(m_saveBookmarksTimer, SIGNAL(timeout()), this, SLOT(saveBookmarks())); - m_updateBookmarksTimer = new QTimer(this); m_updateBookmarksTimer->setInterval(syncBookmarksTimeout); m_updateBookmarksTimer->setSingleShot(true); @@ -498,8 +492,6 @@ void PlacesItemModel::onItemInserted(int index) m_bookmarkedItems.insert(bookmarkIndex, 0); } - triggerBookmarksSaving(); - #ifdef PLACESITEMMODEL_DEBUG kDebug() << "Inserted item" << index; showModelState(); @@ -518,8 +510,6 @@ void PlacesItemModel::onItemRemoved(int index, KStandardItem* removedItem) Q_ASSERT(!m_bookmarkedItems[boomarkIndex]); m_bookmarkedItems.removeAt(boomarkIndex); - triggerBookmarksSaving(); - #ifdef PLACESITEMMODEL_DEBUG kDebug() << "Removed item" << index; showModelState(); @@ -549,8 +539,6 @@ void PlacesItemModel::onItemChanged(int index, const QSet<QByteArray>& changedRo QTimer::singleShot(0, this, SLOT(hideItem())); } } - - triggerBookmarksSaving(); } void PlacesItemModel::slotDeviceAdded(const QString& udi) @@ -1033,20 +1021,12 @@ void PlacesItemModel::hideItem(int index) // bookmark should still be remembered, so readd it again: m_bookmarkManager->root().addBookmark(hiddenBookmark); m_bookmarkManager->root().moveBookmark(hiddenBookmark, previousBookmark); - triggerBookmarksSaving(); } m_bookmarkedItems.insert(newIndex, hiddenItem); } } -void PlacesItemModel::triggerBookmarksSaving() -{ - if (m_saveBookmarksTimer) { - m_saveBookmarksTimer->start(); - } -} - QString PlacesItemModel::internalMimeType() const { return "application/x-dolphinplacesmodel-" + diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 4a374e502..7cbf99e95 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -124,6 +124,14 @@ public: static KUrl convertedUrl(const KUrl& url); virtual void clear(); + + /** + * 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); @@ -147,12 +155,6 @@ private slots: */ void updateBookmarks(); - /** - * 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(); private: struct SystemBookmarkData; @@ -199,12 +201,6 @@ private: */ void hideItem(int index); - /** - * Triggers a delayed saving of bookmarks by starting - * m_saveBookmarksTimer. - */ - void triggerBookmarksSaving(); - QString internalMimeType() const; /** @@ -287,7 +283,6 @@ private: // removing an item is not allowed. int m_hiddenItemToRemove; - QTimer* m_saveBookmarksTimer; QTimer* m_updateBookmarksTimer; QHash<QObject*, int> m_storageSetupInProgress; diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 720e07ce3..6b840ef57 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -280,8 +280,10 @@ 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) { // TriggerItem does set up the storage first and then it will // emit the slotItemMiddleClicked signal, because of Qt::MiddleButton. @@ -405,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) @@ -477,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; @@ -498,6 +502,7 @@ void PlacesPanel::editEntry(int index) oldItem->setText(dialog->text()); oldItem->setUrl(dialog->url()); oldItem->setIcon(dialog->icon()); + m_model->saveBookmarks(); } } |
