]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Clazy fix
[dolphin.git] / src / views / dolphinview.cpp
index a18f5376986d79f9d456ce73284256b67ddac12e..0afa27d738220f179bd6eb6bbec5da58d5fe0d35 100644 (file)
@@ -1174,6 +1174,9 @@ void DolphinView::slotItemContextMenuRequested(int index, const QPointF &pos)
     if (m_selectionChangedTimer->isActive()) {
         emitSelectionChangedSignal();
     }
+    if (m_twoClicksRenamingTimer->isActive()) {
+        abortTwoClicksRenaming();
+    }
 
     const KFileItem item = m_model->fileItem(index);
     Q_EMIT requestContextMenu(pos.toPoint(), item, selectedItems(), url());
@@ -1773,7 +1776,6 @@ void DolphinView::updateSelectionState()
             if (!selectedItems.isEmpty()) {
                 selectionManager->beginAnchoredSelection(selectionManager->currentItem());
                 selectionManager->setSelectedItems(selectedItems);
-                selectionManager->endAnchoredSelection();
                 if (shouldScrollToCurrentItem) {
                     m_view->scrollToItem(selectedItems.first());
                 }
@@ -1881,7 +1883,7 @@ void DolphinView::selectNextItem()
             Q_ASSERT_X(false, "DolphinView", "Selecting the next item failed.");
             return;
         }
-        const auto lastSelectedIndex = m_model->index(selectedItems().last());
+        const auto lastSelectedIndex = m_model->index(*selectedItems().constEnd());
         if (lastSelectedIndex < 0) {
             Q_ASSERT_X(false, "DolphinView", "Selecting the next item failed.");
             return;
@@ -2285,6 +2287,22 @@ bool DolphinView::isFolderWritable() const
     return m_isFolderWritable;
 }
 
+int DolphinView::horizontalScrollBarHeight() const
+{
+    if (m_container && m_container->horizontalScrollBar() && m_container->horizontalScrollBar()->isVisible()) {
+        return m_container->horizontalScrollBar()->height();
+    }
+    return 0;
+}
+
+void DolphinView::setStatusBarOffset(int offset)
+{
+    KItemListView *view = m_container->controller()->view();
+    if (view) {
+        view->setStatusBarOffset(offset);
+    }
+}
+
 QUrl DolphinView::viewPropertiesUrl() const
 {
     if (m_viewPropertiesContext.isEmpty()) {
@@ -2424,7 +2442,7 @@ bool DolphinView::tryShowNameToolTip(QHelpEvent *event)
             const KFileItem item = m_model->fileItem(index.value());
             const QString text = item.text();
             const QPoint pos = mapToGlobal(event->pos());
-            QToolTip::showText(pos, text);
+            QToolTip::showText(pos, text, this);
             return true;
         }
     }