]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
use "Sort by" instead of "Sort By"
[dolphin.git] / src / dolphinview.cpp
index 073ab55898744d6cc0fee19cbc998ab8e623e3af..7339b82272f37cf6653045323aa5c4ce98748aea 100644 (file)
@@ -302,11 +302,8 @@ QList<KFileItem> DolphinView::selectedItems() const
     QList<KFileItem> itemList;
 
     const QModelIndexList indexList = selection.indexes();
-    QModelIndexList::const_iterator end = indexList.end();
-    for (QModelIndexList::const_iterator it = indexList.begin(); it != end; ++it) {
-        Q_ASSERT((*it).isValid());
-
-        KFileItem item = m_dirModel->itemForIndex(*it);
+    foreach (QModelIndex index, indexList) {
+        KFileItem item = m_dirModel->itemForIndex(index);
         if (!item.isNull()) {
             itemList.append(item);
         }
@@ -430,12 +427,11 @@ void DolphinView::setUrl(const KUrl& url)
         return;
     }
 
-    m_controller->setUrl(url);
+    m_controller->setUrl(url); // emits urlChanged, which we forward
 
     applyViewProperties(url);
 
     startDirLister(url);
-    emit urlChanged(url);
 }
 
 void DolphinView::mouseReleaseEvent(QMouseEvent* event)
@@ -917,7 +913,7 @@ void DolphinView::updateViewportColor()
 {
     QColor color = KColorScheme(KColorScheme::View).background();
     if (m_active) {
-        emit urlChanged(url());
+        emit urlChanged(url()); // Hmm, this is a hack; the url hasn't really changed.
         emit selectionChanged(selectedItems());
     } else {
         color.setAlpha(0);