Added multi-select deletion to debugger

https://codereview.appspot.com/7190043/



git-svn-id: http://skia.googlecode.com/svn/trunk@7318 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 812ce03..4486434 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -66,6 +66,7 @@
     , fLoading(false)
 {
     setupUi(this);
+    fListWidget.setSelectionMode(QAbstractItemView::ExtendedSelection);
     connect(&fListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(registerListClick(QListWidgetItem *)));
     connect(&fActionOpen, SIGNAL(triggered()), this, SLOT(openFile()));
     connect(&fActionDirectory, SIGNAL(triggered()), this, SLOT(toggleDirectory()));
@@ -448,19 +449,27 @@
 }
 
 void SkDebuggerGUI::actionDelete() {
-    int currentRow = fListWidget.currentRow();
-    QListWidgetItem* item = fListWidget.currentItem();
 
-    if (fDebugger.isCommandVisible(currentRow)) {
-        item->setData(Qt::UserRole + 2, QPixmap(":/delete.png"));
-        fDebugger.setCommandVisible(currentRow, false);
-        fSkipCommands[currentRow] = true;
-    } else {
-        item->setData(Qt::UserRole + 2, QPixmap(":/blank.png"));
-        fDebugger.setCommandVisible(currentRow, true);
-        fSkipCommands[currentRow] = false;
+    for (int row = 0; row < fListWidget.count(); ++row) {
+        QListWidgetItem* item = fListWidget.item(row);
+
+        if (!item->isSelected()) {
+            continue;
+        }
+
+        if (fDebugger.isCommandVisible(row)) {
+            item->setData(Qt::UserRole + 2, QPixmap(":/delete.png"));
+            fDebugger.setCommandVisible(row, false);
+            fSkipCommands[row] = true;
+        } else {
+            item->setData(Qt::UserRole + 2, QPixmap(":/blank.png"));
+            fDebugger.setCommandVisible(row, true);
+            fSkipCommands[row] = false;
+        }
     }
 
+    int currentRow = fListWidget.currentRow();
+
     if (fPause) {
         fCanvasWidget.drawTo(fPausedRow);
         fImageWidget.draw();