Bug 101628 - dbus: add function to get filename or URL of active document
Summary: dbus: add function to get filename or URL of active document
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-16 17:26 UTC by Martin Feuersaenger
Modified: 2011-07-20 17:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.7.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Feuersaenger 2005-03-16 17:26:27 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

I searchd through the dcop functions provided by kate to get the filename of the active document.
However, there seems to be no such function.
I found a mimeType() and a fileSize() (not working) but no url() or filename().

Or is there a totaly different method to get the filename?

If not, it should be included!

Regards,
   Martin
Comment 1 Jeroen Wijnhout 2005-03-16 17:36:20 UTC
Try:
dcop kate KateDocumentManager activeDocument

best,
Jeroen
Comment 2 Martin Feuersaenger 2005-03-16 21:02:41 UTC
Maybe I need to specify a bit: I want to use the commandline tool dcop in a shell script and what I want is the string of the URL or filename.

'dcop kate KateDocumentManager activeDocument'

gives me: DCOPRef(kate,KateDocument#3)

and 'dcop kate KateDocument#3' gives me

QCStringList interfaces()
QCStringList functions()
uint documentNumber()

So the only thing I get is the document number (which I allready know). No sign of a function that would return the actual name as a string.

Any clues?

   Martin


Comment 3 Jeroen Wijnhout 2005-03-17 13:21:51 UTC
You could try:
dcop kate __KateMainWindow#1 caption
But I agree, there doesn't seem to be a proper way to do this.

best,
Jeroen
Comment 4 Martin Feuersaenger 2005-03-17 14:25:17 UTC
Thanks, with the right sed command that will work for me.

But I keep the wish for a more 'intuitive' access to the filename open.
Comment 5 Dominik Haumann 2011-07-20 17:44:24 UTC
Git commit e06f026555f5b0ef621b194765238e292dd4b418 by Dominik Haumann.
Committed on 20/07/2011 at 19:42.
Pushed by dhaumann into branch 'master'.

add activeDocumentUrl dbus call

BUG: 101628

M  +12   -2    kate/app/katemainwindowadaptor.cpp
M  +6    -1    kate/app/katemainwindowadaptor.h

http://commits.kde.org/kate/e06f026555f5b0ef621b194765238e292dd4b418
Comment 6 Dominik Haumann 2011-07-20 17:44:52 UTC
Git commit 0e88337feb0ab5db8710b8d77ebf9d2e208241fd by Dominik Haumann.
Committed on 20/07/2011 at 19:42.
Pushed by dhaumann into branch 'KDE/4.7'.

add activeDocumentUrl dbus call

BUG: 101628

M  +12   -2    kate/app/katemainwindowadaptor.cpp
M  +6    -1    kate/app/katemainwindowadaptor.h

http://commits.kde.org/kate/0e88337feb0ab5db8710b8d77ebf9d2e208241fd