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

List:       kde-commits
Subject:    branches/KDE/3.5/kdewebdev/quanta/components/debugger
From:       Linus McCabe <Linus () mccabe ! nu>
Date:       2005-08-25 20:21:09
Message-ID: 1125001269.403162.25968.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 453306 by linusmc:

All scalar values can now be dumped from watch-tree.
All scalar values can now also be copied to clipboard.
Added support or DGBp variable value changing.



 M  +22 -7     dbgp/quantadebuggerdbgp.cpp  
 M  +1 -0      dbgp/quantadebuggerdbgp.h  
 M  +13 -4     variableslistview.cpp  
 M  +3 -1      variableslistview.h  


--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp \
#453305:453306 @@ -236,7 +236,7 @@
     case DebuggerClientCapabilities::StepInto:
     case DebuggerClientCapabilities::StepOver:
     case DebuggerClientCapabilities::Watches:
-//     case DebuggerClientCapabilities::VariableSetValue:
+    case DebuggerClientCapabilities::VariableSetValue:
     case DebuggerClientCapabilities::ProfilerOpen:
       return true;
 
@@ -304,6 +304,9 @@
     
     else if(command == "property_get")
       showWatch(response);
+    
+    else if(command == "property_set")
+      propertySetResponse(response);
 
     // Unknown command...
     else
@@ -812,14 +815,17 @@
   return debuggerInterface()->Mapper()->mapLocalPathToServer(localpath);
 }
 
-void QuantaDebuggerDBGp::variableSetValue(const DebuggerVariable &)
+void QuantaDebuggerDBGp::variableSetValue(const DebuggerVariable &variable)
 {
-//   sendCommand("setvariable", 
-//               "variable", variable.name().ascii(),
-//               "value", variable.value().ascii(),
-//               0);
- 
+  m_network.sendCommand("property_set", "-n " + variable.name(), variable.value());
 
+  for(QValueList<QString>::iterator it = m_watchlist.begin(); it != \
m_watchlist.end(); ++it) +    if((*it) == variable.name())
+    {
+      m_network.sendCommand("property_get", "-n " + variable.name(), \
variable.value()); +      return;
+    }
+
  return;
 }
 
@@ -900,6 +906,15 @@
   debuggerInterface()->showVariable(buildVariable(variablenode.firstChild()));
 }
 
+void QuantaDebuggerDBGp::propertySetResponse( const QDomNode & setnode)
+{
+  if(attribute(setnode, "success") == "0")
+  {
+    debuggerInterface()->showStatus(i18n("Unable to set value of variable!"), true);
+  }
+}
+
+
 DebuggerVariable* QuantaDebuggerDBGp::buildVariable( const QDomNode & variablenode)
 {
   /*
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/dbgp/quantadebuggerdbgp.h \
#453305:453306 @@ -99,6 +99,7 @@
     void addWatch(const QString &variable);
     void removeWatch(DebuggerVariable *var);
     void variableSetValue(const DebuggerVariable &variable);
+    void propertySetResponse( const QDomNode & setnode);
 
     // Call stack
     void stackShow(const QDomNode&node);
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/variableslistview.cpp \
#453305:453306 @@ -22,7 +22,7 @@
 #include <kdeversion.h>
 #include <kinputdialog.h>
 // #include <kpassivepopup.h>
-// #include <kdatetbl.h>
+#include <qclipboard.h>
 
 // Quanta includes
 #include "variableslistview.h"
@@ -67,6 +67,8 @@
     m_variablePopup->insertItem(SmallIcon("edit"), i18n("&Set Value"), this, \
SLOT(slotVariableSetValue()), 0, setValue);  
   m_variablePopup->insertItem(SmallIcon("viewmag"), i18n("&Dump in messages log"), \
this, SLOT(slotVariableDump()), 0, dumpValue); +  
+  m_variablePopup->insertItem(SmallIcon("editcopy"), i18n("&Copy to clipboard"), \
this, SLOT(slotVariableCopyToClipboard()), 0, copyValue);  
   connect(this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) \
), this, SLOT(slotVariableContextMenu(KListView *, QListViewItem *, const QPoint \
&)));  }
@@ -247,7 +249,8 @@
     m_variablePopup->setItemEnabled(setValue, selected());
 
   DebuggerVariable *v = selected(true);
-  m_variablePopup->setItemEnabled(dumpValue, v && v->type() == \
DebuggerVariableTypes::String); +  m_variablePopup->setItemEnabled(dumpValue, v && \
v->isScalar()); +  m_variablePopup->setItemEnabled(copyValue, v && v->isScalar());
 
   m_variablePopup->popup(point);
 }
@@ -294,8 +297,14 @@
   quantaApp->messageOutput()->showMessage(i18n("Contents of variable \
%1:\n>>>\n").arg(v->name()));  quantaApp->messageOutput()->showMessage(v->value());
   quantaApp->messageOutput()->showMessage("<<<\n");
-  
-  
 }
 
+void VariablesListView::slotVariableCopyToClipboard( )
+{
+  DebuggerVariable *v = selected(true);
+  if(!v)
+    return;
+  QApplication::clipboard()->setText(v->value());
+}
+
 #include "variableslistview.moc"
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/variableslistview.h \
#453305:453306 @@ -33,7 +33,8 @@
   {
     setValue = 1,
     dumpValue,
-    removeWatch 
+    copyValue,
+    removeWatch,
   };
       
   public:
@@ -53,6 +54,7 @@
     void slotRemoveSelected();
     void slotVariableSetValue();
     void slotVariableDump();
+    void slotVariableCopyToClipboard();
     void slotVariableContextMenu(KListView *list, QListViewItem * item, const \
QPoint& point);  
   signals:


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

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