qdbus with kdevelop

Georges Lours geo.lours at free.fr
Thu Apr 5 09:08:14 BST 2012


Hello,

This a bug report project (below the ####) and i need a little help
Is my English enough good to be clear?
In the bug report interface, i have to choose
Component ? What have i to choose ?
Severity ? I think "task", is that good ?
Hardware ? My distribution ?
OS: Linux
What else ?

Thank you.


##################################

extend kdevelop's dbus interface

I try to write a script bash which inserts characters' strings into an opened 
document in kdevelop. When we had kde 3.x, I had succeeded in making something 
similar with quanta 3.x and dcop. But now, I try to use kdevelop...
NB except one about set cursor position (cf. second problem), all these 
problems are common with kate application.

First problem

I did not find a dbus method which allows to detect the active document (when 
several are opened in various tabs) neither in kate, nor in kdevelop.
In quanta 3.x and dcop, I used:
-----------------------
num=$(dcop "$dcop_id" WindowManagerIf currentEditorIfNum)
-----------------------
Would it be possible to have a similar function for kdevelop?

Second problem

How to locate the cursor position in my document kdevelop?
It use to exist with quanta 3.x and dcop
-----------------------
col=$(dcop `dcop | grep quanta` ViewCursorInterface#$num-$num cursorColumn)
line=$(dcop `dcop | grep quanta` ViewCursorInterface#$num-$num cursorLine)
(where num is a corresponding variable to the document I want to treat(handle) 
in kdevelop - cf first problem)
-----------------------
Would it be possible to have a similar function for kdevelop?
NB: Still about the cursor, there is a dbus command which exists for kate, but 
not for kdevelop to place the cursor where I wish it to be.
-----------------------
qdbus `qdbus | grep kate` /MainApplication org.kde.Kate.Application.setCursor 
$line $col
-----------------------
Is it possible to have the same with kdevelop too?

Third problem

Is there a method allowing to erase the selected part of the active document? 
and to replace it?
With quanta 3.x and dcop, I used this one :
-----------------------
dcop `dcop | grep quanta` SelectionInterface#$num removeSelectedText
dcop `dcop | grep quanta` "ClipboardInterface#$num-$num" paste
-----------------------
Would it be possible to have a similar function for kdevelop?

Fourth problem

I'm not able to manage to make the method insertText work
-----------------------
$ qdbus `qdbus | grep kdevelop` /Kate/Document/$num |grep insertText
method bool org.kde.KTextEditor.Document.insertText(QDBusRawType::(ii cursor)
method bool org.kde.KTextEditor.Document.insertTextLines(QDBusRawType::(ii 
cursor)
(where num is a corresponding variable to the document I want to treat(handle) 
in kdevelop - cf first problem)
-----------------------
I have the same problem with the method cursorInText
-----------------------
$ qdbus `qdbus | grep kdevelop` /Kate/Document/$num |grep cursorInText
method bool org.kde.KTextEditor.Document.cursorInText(QDBusRawType::(ii 
cursor)
-----------------------
How must i write the parameters of the cursor? I believe to have tried 
everything, and nothing works...
##############################################

-- 
Georges Lours
Geo.Lours at free.fr
Utilisateur Linux (counter 383333)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20120405/83a7e05c/attachment.html>


More information about the KDevelop mailing list