[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdebase/apps/dolphin/src
From:       Peter Penz <peter.penz () gmx ! at>
Date:       2008-08-03 10:02:27
Message-ID: 1217757747.725376.17526.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 841420 by ppenz:

Backport of 841418: Prevent that Konqueror crashs if pressing F2 (= Rename) although no items \
are selected. TODO: disable the rename action (and other selection dependent actions) when no \
items are selected.

CCBUG: 168183

 M  +6 -5      dolphinview.cpp  


--- branches/KDE/4.1/kdebase/apps/dolphin/src/dolphinview.cpp #841419:841420
@@ -511,7 +511,12 @@
 void DolphinView::renameSelectedItems()
 {
     const KFileItemList items = selectedItems();
-    if (items.count() > 1) {
+    const int itemCount = items.count();
+    if (itemCount < 1) {
+        return;
+    }
+    
+    if (itemCount > 1) {
         // More than one item has been selected for renaming. Open
         // a rename dialog and rename all items afterwards.
         RenameDialog dialog(this, items);
@@ -546,8 +551,6 @@
             }
         }
     } else if (DolphinSettings::instance().generalSettings()->renameInline()) {
-        Q_ASSERT(items.count() == 1);
-
         if (isColumnViewActive()) {
             m_columnView->editItem(items.first());
         } else {
@@ -556,8 +559,6 @@
             itemView()->edit(proxyIndex);
         }
     } else {
-        Q_ASSERT(items.count() == 1);
-
         RenameDialog dialog(this, items);
         if (dialog.exec() == QDialog::Rejected) {
             return;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic