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

List:       kde-commits
Subject:    kdesdk/scripts
From:       David Faure <faure () kde ! org>
Date:       2005-05-02 15:12:33
Message-ID: 20050502151233.4667D635 () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Some Qt4 helpers: printq4string, printq4stringdata, printq4bytearray, printq4stringlist


  M +42 -0     kde-devel-gdb   1.17


--- kdesdk/scripts/kde-devel-gdb  #1.16:1.17
@@ -15,4 +15,10 @@
   Prints the contents of a QString
 end
+define printq4string
+    printq4stringdata $arg0.d
+end
+document printq4string
+  Prints the contents of a Qt QString
+end
 
 define printqstringdata
@@ -32,4 +38,20 @@
 end
 
+define printq4stringdata
+    set $i=0
+    set $d = $arg0
+    while $i < $d->size
+        printf "%c", (char)($d->data[$i++] & 0xff)
+    end
+    printf "\n"
+end
+document printq4stringdata
+  Prints the contents of a Qt4 QString::Data
+  This is useful when the output of another command (e.g. printqmap)
+  shows {d = 0xdeadbeef} for a QString, i.e. the qstringdata address
+  instead of the QString object itself.
+  printq4string $s and printq4stringdata $s.d are equivalent.
+end
+
 define printqstring_utf8
    set $i=0
@@ -64,4 +86,11 @@
 end
 
+define printq4bytearray
+    print $arg0->d->data
+end
+document printq4bytearray
+  Prints the contents of a Qt4 QByteArray (when it contains a string)
+end
+
 define printqfont
     print *($arg0).d
@@ -225,2 +254,15 @@
   Usage: printqstringlist mylist
 end
+
+# Bad implementation, requires a running process.
+# Needs to be refined, i.e. figuring out the right void* pointers casts.
+# Simon says: each Node contains the d pointer of the QString.
+define printq4stringlist
+    set $list = $arg0
+    set $stringdata = QtPrivate::QStringList_join( &paths, "\n" ).d
+    printq4stringdata $stringdata
+end
+document printq4stringlist
+  Prints the contents of a Qt4 QStringList.
+  Usage: printq4stringlist mylist
+end


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

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