]> cloud.milkyroute.net Git - dolphin.git/commitdiff
prevent that a column with an invalid root index shows the root column temporary...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 24 Sep 2007 16:29:03 +0000 (16:29 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 24 Sep 2007 16:29:03 +0000 (16:29 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=716387

src/dolphincolumnview.cpp

index 9fb3e35a81a9bc9987a5f450a77f8faca79ce255..38c9cc5c05d6c9b935b7ffdf2177a1171b8534ad 100644 (file)
@@ -586,11 +586,15 @@ void DolphinColumnView::showColumn(const KUrl& url)
 
             m_columns.append(column);
 
-            // Before invoking layoutColumns() the column must be shown. To prevent
-            // a flickering the initial geometry is set to be invisible.
+            // Before invoking layoutColumns() the column must be set visible temporary.
+            // To prevent a flickering the initial geometry is set to a hidden position.
             column->setGeometry(QRect(-1, -1, 1, 1));
             column->show();
             layoutColumns();
+
+            // the layout is finished, now let the column be invisible until it
+            // gets a valid root index due to expandToActiveUrl()
+            column->hide();
         }
     }
 
@@ -761,7 +765,9 @@ void DolphinColumnView::reloadColumns()
     for (int i = 0; i <= end; ++i) {
         ColumnWidget* nextColumn = m_columns[i + 1];
         const QModelIndex rootIndex = nextColumn->rootIndex();
-        if (!rootIndex.isValid()) {
+        if (rootIndex.isValid()) {
+            nextColumn->show();
+        } else {
             const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_columns[i]->childUrl());
             const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
             if (proxyIndex.isValid()) {