From b7404044470bb3ef241dced31839a1d18e70e3b0 Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Thu, 27 Feb 2014 12:17:48 +0100 Subject: Scroll to newly dropped files. If multiple files are dropped, scroll to the first dropped file. BUG: 315722 FIXED-IN: 4.13 REVIEW: 116020 --- src/views/dolphinview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 9f5f48a86..b68e8aa6a 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1046,6 +1046,7 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even if (op && destUrl == url()) { // Mark the dropped urls as selected. m_clearSelectionBeforeSelectingNewItems = true; + m_markFirstNewlySelectedItemAsCurrent = true; connect(op, SIGNAL(aboutToCreate(KUrl::List)), this, SLOT(slotAboutToCreate(KUrl::List))); } -- cgit v1.3 From eab1b76b76d3492c9787cc11a8e8460c69924dc7 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sat, 1 Mar 2014 12:14:47 +0100 Subject: Always go back/forward in history when pressing the respective buttons Before this patch, pressing one of these buttons while an item is hovered selected this item. The motivation for this behavior was to provide a fast way to select items. However, this was counter-intuitive and confusing for many users. BUG: 310288 FIXED-IN: 4.13.0 REVIEW: 116469 --- src/kitemviews/kitemlistcontroller.cpp | 9 ++++----- src/views/dolphinview.cpp | 16 +++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 7344b9960..61337d166 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -538,11 +538,10 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const m_pressedIndex = m_view->itemAt(m_pressedMousePos); emit mouseButtonPressed(m_pressedIndex, event->buttons()); - if ((event->buttons() & (Qt::XButton1 | Qt::XButton2)) && m_pressedIndex < 0) { - // Do not select items when clicking the empty part of the view with - // the back/forward buttons, see https://bugs.kde.org/show_bug.cgi?id=327412. - // Note that clicking an item with these buttons selects it, see comment in - // DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons). + // TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton + if (event->buttons() & (Qt::XButton1 | Qt::XButton2)) { + // Do not select items when clicking the back/forward buttons, see + // https://bugs.kde.org/show_bug.cgi?id=327412. return true; } diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index b68e8aa6a..2769d670d 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1071,17 +1071,15 @@ void DolphinView::slotModelChanged(KItemModelBase* current, KItemModelBase* prev void DolphinView::slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons) { + Q_UNUSED(itemIndex); + hideToolTip(); - if (itemIndex < 0) { - // Trigger the history navigation only when clicking on the viewport: - // Above an item the XButtons provide a simple way to select items in - // the singleClick mode. - if (buttons & Qt::XButton1) { - emit goBackRequested(); - } else if (buttons & Qt::XButton2) { - emit goForwardRequested(); - } + // TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton + if (buttons & Qt::XButton1) { + emit goBackRequested(); + } else if (buttons & Qt::XButton2) { + emit goForwardRequested(); } } -- cgit v1.3 From 08b8d28154df302a1ed0e5b3abd54e823441b72c Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Wed, 5 Mar 2014 08:43:58 +0100 Subject: Remove some unused functions REVIEW: 116562 --- src/views/dolphinview.cpp | 10 ---------- src/views/dolphinview.h | 14 -------------- src/views/renamedialog.cpp | 9 --------- 3 files changed, 33 deletions(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 9f5f48a86..21235e5e7 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1354,16 +1354,6 @@ void DolphinView::calculateItemCount(int& fileCount, } } -void DolphinView::showHoverInformation(const KFileItem& item) -{ - emit requestItemInfo(item); -} - -void DolphinView::clearHoverInformation() -{ - emit requestItemInfo(KFileItem()); -} - void DolphinView::slotDeleteFileFinished(KJob* job) { if (job->error() == 0) { diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 3731464a3..06c09edc3 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -613,20 +613,6 @@ private slots: */ void updateSortFoldersFirst(bool foldersFirst); - /** - * Updates the status bar to show hover information for the - * item \a item. If currently other items are selected, - * no hover information is shown. - * @see DolphinView::clearHoverInformation() - */ - void showHoverInformation(const KFileItem& item); - - /** - * Clears the hover information shown in the status bar. - * @see DolphinView::showHoverInformation(). - */ - void clearHoverInformation(); - /** * Indicates in the status bar that the delete operation * of the job \a job has been finished. diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp index d8dbd7749..5c0ae6126 100644 --- a/src/views/renamedialog.cpp +++ b/src/views/renamedialog.cpp @@ -30,15 +30,6 @@ #include #include -/** - * Helper function for sorting items with qSort() in - * DolphinView::renameSelectedItems(). - */ -bool lessThan(const KFileItem& item1, const KFileItem& item2) -{ - return KStringHandler::naturalCompare(item1.name(), item2.name()) < 0; -} - RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) : KDialog(parent), m_renameOneItem(false), -- cgit v1.3