]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistview.cpp
Merge branch 'Applications/19.04'
[dolphin.git] / src / kitemviews / kitemlistview.cpp
index f0647fb3eac23fc922532e447a4f20c541cbe3c1..db258eb3969ef748acfd9cd42e61bb5bab705040 100644 (file)
@@ -670,7 +670,7 @@ void KItemListView::paint(QPainter* painter, const QStyleOptionGraphicsItem* opt
         }
 
         QStyleOptionRubberBand opt;
-        opt.initFrom(widget);
+        initStyleOption(&opt);
         opt.shape = QRubberBand::Rectangle;
         opt.opaque = false;
         opt.rect = rubberBandRect.toRect();
@@ -1041,7 +1041,7 @@ void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges)
         // Update the indexes of all KItemListWidget instances that are located
         // after the inserted items. It is important to adjust the indexes in the order
         // from the highest index to the lowest index to prevent overlaps when setting the new index.
-        qSort(itemsToMove);
+        std::sort(itemsToMove.begin(), itemsToMove.end());
         for (int i = itemsToMove.count() - 1; i >= 0; --i) {
             KItemListWidget* widget = m_visibleItems.value(itemsToMove[i]);
             Q_ASSERT(widget);
@@ -1354,12 +1354,12 @@ void KItemListView::slotCurrentChanged(int current, int previous)
     // In SingleSelection mode (e.g., in the Places Panel), the current item is
     // always the selected item. It is not necessary to highlight the current item then.
     if (m_controller->selectionBehavior() != KItemListController::SingleSelection) {
-        KItemListWidget* previousWidget = m_visibleItems.value(previous, 0);
+        KItemListWidget* previousWidget = m_visibleItems.value(previous, nullptr);
         if (previousWidget) {
             previousWidget->setCurrent(false);
         }
 
-        KItemListWidget* currentWidget = m_visibleItems.value(current, 0);
+        KItemListWidget* currentWidget = m_visibleItems.value(current, nullptr);
         if (currentWidget) {
             currentWidget->setCurrent(true);
         }