X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8118d8e24317b697f78bf32b41fda4200bc56ff9..177ddea85335ceb33af8cf1df07ceb2c0e336c15:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 3a8d6a8ea..3e8070cb3 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -302,11 +302,8 @@ QList DolphinView::selectedItems() const QList 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); } @@ -435,6 +432,7 @@ void DolphinView::setUrl(const KUrl& url) applyViewProperties(url); startDirLister(url); + itemView()->setFocus(); } void DolphinView::mouseReleaseEvent(QMouseEvent* event) @@ -838,6 +836,7 @@ void DolphinView::createView() this, SLOT(emitContentsMoved())); connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(emitContentsMoved())); + view->setFocus(); } QAbstractItemView* DolphinView::itemView() const @@ -914,7 +913,7 @@ void DolphinView::applyCutItemEffect() void DolphinView::updateViewportColor() { - QColor color = KColorScheme(KColorScheme::View).background(); + QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color(); if (m_active) { emit urlChanged(url()); // Hmm, this is a hack; the url hasn't really changed. emit selectionChanged(selectedItems());