OSDN Git Service

debugger: re-enable "Delete all breakpoints" etc
authorhjk <qtc-committer@nokia.com>
Mon, 15 Nov 2010 14:30:39 +0000 (15:30 +0100)
committerhjk <qtc-committer@nokia.com>
Mon, 15 Nov 2010 14:31:05 +0000 (15:31 +0100)
src/plugins/debugger/breakhandler.cpp
src/plugins/debugger/breakhandler.h
src/plugins/debugger/breakwindow.cpp
src/plugins/debugger/debuggerplugin.cpp

index 1230198..8276220 100644 (file)
@@ -352,6 +352,14 @@ BreakpointId BreakHandler::findBreakpointByIndex(const QModelIndex &index) const
     return BreakpointId(-1);
 }
 
+BreakpointIds BreakHandler::findBreakpointsByIndex(const QList<QModelIndex> &list) const
+{
+    BreakpointIds ids;
+    foreach (const QModelIndex &index, list)
+        ids.append(findBreakpointByIndex(index));
+    return ids;
+}
+
 QVariant BreakHandler::data(const QModelIndex &mi, int role) const
 {
     static const QString empty = QString(QLatin1Char('-'));
index 0bd8b27..3e552d9 100644 (file)
@@ -76,6 +76,7 @@ public:
     BreakpointId findWatchpointByAddress(quint64 address) const;
     BreakpointId findBreakpointByFunction(const QString &functionName) const;
     BreakpointId findBreakpointByIndex(const QModelIndex &index) const;
+    BreakpointIds findBreakpointsByIndex(const QList<QModelIndex> &list) const;
     void setWatchpointByAddress(quint64 address);
     bool hasWatchpointAt(quint64 address) const;
     void updateMarkers();
index 8551ad9..9274d29 100644 (file)
@@ -379,22 +379,22 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
 void BreakWindow::setBreakpointsEnabled(const QModelIndexList &list, bool enabled)
 {
     BreakHandler *handler = breakHandler();
-    foreach (const QModelIndex &index, list)
-        handler->setEnabled(handler->findBreakpointByIndex(index), enabled);
+    foreach (const BreakpointId id, handler->findBreakpointsByIndex(list))
+        handler->setEnabled(id, enabled);
 }
 
 void BreakWindow::setBreakpointsFullPath(const QModelIndexList &list, bool fullpath)
 {
     BreakHandler *handler = breakHandler();
-    foreach (const QModelIndex &index, list)
-       handler->setUseFullPath(handler->findBreakpointByIndex(index), fullpath);
+    foreach (const BreakpointId id, handler->findBreakpointsByIndex(list))
+       handler->setUseFullPath(id, fullpath);
 }
 
 void BreakWindow::deleteBreakpoints(const QModelIndexList &list)
 {
     BreakHandler *handler = breakHandler();
-    foreach (const QModelIndex &index, list)
-       handler->removeBreakpoint(handler->findBreakpointByIndex(index));
+    foreach (const BreakpointId id, handler->findBreakpointsByIndex(list))
+       handler->removeBreakpoint(id);
 }
 
 void BreakWindow::editBreakpoint(BreakpointId id, QWidget *parent)
@@ -416,7 +416,8 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list)
     QTC_ASSERT(!list.isEmpty(), return);
 
     BreakHandler *handler = breakHandler();
-    const BreakpointId id = handler->findBreakpointByIndex(list.at(0));
+    const BreakpointIds ids = handler->findBreakpointsByIndex(list);
+    const BreakpointId id = ids.at(0);
 
     if (list.size() == 1) {
         editBreakpoint(id, this);
@@ -451,8 +452,7 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list)
             && newThreadSpec == oldThreadSpec)
         return;
 
-    foreach (const QModelIndex &idx, list) {
-        BreakpointId id = handler->findBreakpointByIndex(idx);
+    foreach (const BreakpointId id, handler->findBreakpointsByIndex(list)) {
         handler->setCondition(id, newCondition.toLatin1());
         handler->setIgnoreCount(id, newIgnoreCount.toInt());
         handler->setThreadSpec(id, newThreadSpec.toLatin1());
@@ -463,8 +463,8 @@ void BreakWindow::associateBreakpoint(const QModelIndexList &list, int threadId)
 {
     BreakHandler *handler = breakHandler();
     QByteArray spec = QByteArray::number(threadId);
-    foreach (const QModelIndex &index, list)
-        handler->setThreadSpec(handler->findBreakpointByIndex(index), spec);
+    foreach (const BreakpointId id, handler->findBreakpointsByIndex(list))
+        handler->setThreadSpec(id, spec);
 }
 
 void BreakWindow::resizeColumnsToContents()
index ae064ff..74b68dd 100644 (file)
@@ -1382,7 +1382,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
 {
     m_coreSettings = ICore::instance()->settings();
     m_debuggerSettings = new DebuggerSettings(m_coreSettings);
-    
+
     m_continuableContext = Context("Gdb.Continuable");
     m_interruptibleContext = Context("Gdb.Interruptible");
     m_undisturbableContext = Context("Gdb.Undisturbable");