From f9ba9a7236a0252a54a51b2f70a04ab13c68f85b Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 11 Sep 2012 19:25:20 +0200 Subject: Use a better icon for recently accessed items, part 2 I had missed one places where the incorrect icon was used in my previous commit d7e7ca53bb95c7555bbf107d92b47ac25eda1918. BUG: 304323 FIXED-IN: 4.9.2 --- src/panels/places/placesitemmodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/panels/places') diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 497901345..bd50c9a4b 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -885,8 +885,7 @@ void PlacesItemModel::createSystemBookmarks() Q_ASSERT(m_systemBookmarks.isEmpty()); Q_ASSERT(m_systemBookmarksIndexes.isEmpty()); - const QString timeLineIcon = "package_utility_time"; // TODO: Ask the Oxygen team to create - // a custom icon for the timeline-protocol + const QString timeLineIcon = "chronometer"; // Note: The context of the I18N_NOOP2 must be "KFile System Bookmarks". The real // i18nc call is done after reading the bookmark. The reason why the i18nc call is not -- cgit v1.3.1 From 5fbc0101790adf5613e8c686a38bf9d831881a6d Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Tue, 11 Sep 2012 20:17:56 +0200 Subject: Mount unmounted devices, when a file is dropped upon it in places-panel. BUG: 176277 REVIEW: 106072 FIXED-IN: 4.9.2 (cherry picked from commit 824fa6a43734cf9ad2a690778c50bdaf76a1fb0e) --- src/panels/places/placespanel.cpp | 50 ++++++++++++++++++++++++++++++++++++++- src/panels/places/placespanel.h | 5 ++++ 2 files changed, 54 insertions(+), 1 deletion(-) (limited to 'src/panels/places') diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index d4450888e..4b28c8510 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -52,7 +52,10 @@ PlacesPanel::PlacesPanel(QWidget* parent) : m_controller(0), m_model(0), m_storageSetupFailedUrl(), - m_triggerStorageSetupButton() + m_triggerStorageSetupButton(), + m_itemDropEventIndex(-1), + m_itemDropEventMimeData(0), + m_itemDropEvent(0) { } @@ -268,6 +271,30 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even return; } + if (m_model->storageSetupNeeded(index)) { + connect(m_model, SIGNAL(storageSetupDone(int,bool)), + this, SLOT(slotItemDropEventStorageSetupDone(int,bool))); + + m_itemDropEventIndex = index; + + // Make a full copy of the Mime-Data + m_itemDropEventMimeData = new QMimeData; + m_itemDropEventMimeData->setText(event->mimeData()->text()); + m_itemDropEventMimeData->setHtml(event->mimeData()->html()); + m_itemDropEventMimeData->setUrls(event->mimeData()->urls()); + m_itemDropEventMimeData->setImageData(event->mimeData()->imageData()); + m_itemDropEventMimeData->setColorData(event->mimeData()->colorData()); + + m_itemDropEvent = new QDropEvent(event->pos().toPoint(), + event->possibleActions(), + m_itemDropEventMimeData, + event->buttons(), + event->modifiers()); + + m_model->requestStorageSetup(index); + return; + } + KUrl destUrl = m_model->placesItem(index)->url(); QDropEvent dropEvent(event->pos().toPoint(), event->possibleActions(), @@ -278,6 +305,27 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even DragAndDropHelper::dropUrls(KFileItem(), destUrl, &dropEvent); } +void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success) +{ + disconnect(m_model, SIGNAL(storageSetupDone(int,bool)), + this, SLOT(slotItemDropEventStorageSetupDone(int,bool))); + + if ((index == m_itemDropEventIndex) && m_itemDropEvent && m_itemDropEventMimeData) { + if (success) { + KUrl destUrl = m_model->placesItem(index)->url(); + + DragAndDropHelper::dropUrls(KFileItem(), destUrl, m_itemDropEvent); + } + + delete m_itemDropEventMimeData; + delete m_itemDropEvent; + + m_itemDropEventIndex = -1; + m_itemDropEventMimeData = 0; + m_itemDropEvent = 0; + } +} + void PlacesPanel::slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event) { m_model->dropMimeDataBefore(index, event->mimeData()); diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index 8a84e00a0..989a0916b 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -56,6 +56,7 @@ private slots: void slotItemContextMenuRequested(int index, const QPointF& pos); void slotViewContextMenuRequested(const QPointF& pos); void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); + void slotItemDropEventStorageSetupDone(int index, bool success); void slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); void slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent); void slotTrashUpdated(KJob* job); @@ -80,6 +81,10 @@ private: KUrl m_storageSetupFailedUrl; Qt::MouseButton m_triggerStorageSetupButton; + + int m_itemDropEventIndex; + QMimeData* m_itemDropEventMimeData; + QDropEvent* m_itemDropEvent; }; #endif // PLACESPANEL_H -- cgit v1.3.1 From 4855b582b48beafd99c13f591bb9c814807c812d Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Thu, 20 Sep 2012 17:56:00 +0200 Subject: Fixes Bug 304878 - Dolphin shows "ghost" folders in places after autofs umount nfs shares BUG: 304878 REVIEW: 106456 FIXED-IN: 4.9.2 --- src/panels/places/placesitemmodel.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/panels/places') diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index bd50c9a4b..706092bc7 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -659,11 +659,22 @@ void PlacesItemModel::updateBookmarks() } if (!found) { - PlacesItem* item = new PlacesItem(newBookmark); - if (item->isHidden() && !m_hiddenItemsShown) { - m_bookmarkedItems.append(item); - } else { - appendItemToGroup(item); + const QString udi = newBookmark.metaDataItem("UDI"); + + /* + * See Bug 304878 + * Only add a new places item, if the item text is not empty + * and if the device is available. Fixes the strange behaviour - + * add a places item without text in the Places section - when you + * remove a device (e.g. a usb stick) without unmounting. + */ + if (udi.isEmpty() || Solid::Device(udi).isValid()) { + PlacesItem* item = new PlacesItem(newBookmark); + if (item->isHidden() && !m_hiddenItemsShown) { + m_bookmarkedItems.append(item); + } else { + appendItemToGroup(item); + } } } } -- cgit v1.3.1