Bug 292309 - Konsole dbus sessions count is broken
Summary: Konsole dbus sessions count is broken
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.7.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 08:53 UTC by Cédric Bellegarde
Modified: 2012-04-20 05:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cédric Bellegarde 2012-01-24 08:53:00 UTC
Version:           2.7.4 (using KDE 4.7.4) 
OS:                Linux

Sometimes, org.kde.konsole /Konsole isn't available...

Reproducible: Always

Steps to Reproduce:
Launch a konsole:
$ qdbus org.kde.konsole /Konsole org.kde.konsole.Konsole.sessionCount
1

Launch a second konsole (via launcher otherwise, it will create a new org-kde-konsole-number):

$ qdbus org.kde.konsole /Konsole org.kde.konsole.Konsole.sessionCount
1

Result wrong, there is too session in org.kde.Konsole /Sessions

Close the first konsole:
qdbus org.kde.konsole /Konsole org.kde.konsole.Konsole.sessionCount
Error: org.freedesktop.DBus.Error.UnknownObject
No such object path '/Konsole'

Object path invalid but there is on remaining session in org.kde.konsole

Actual Results:  
Session count is wrong

Expected Results:  
Good sessions count, available dbus interface
Comment 1 Jekyll Wu 2012-01-24 09:31:46 UTC
Thanks for reporting. 

This is actually a known issue. See comment #2 in bug 281513 to get a general feeling of why some dbus methods work strangely sometimes.
Comment 2 Jekyll Wu 2012-02-08 17:52:58 UTC
Git commit 07cddfe302233c3555258f077429e55ce622e262 by Jekyll Wu.
Committed on 08/02/2012 at 18:49.
Pushed by jekyllwu into branch 'master'.

Create dbus object for each Konsole window respectively

Its naming scheme is "/Windows/N", similar to "/Sessions/N" for
sessions. That is not the final decision and might change before next
major release.

The old "/Konsole" dbus object is still available at this moment, but
it might disappear or be used for something different in the future, so
it is better to use "/Windows/N" from now on.

For convenience, $KONSOLE_DBUS_WINDOW can be used to refer to the dbus
object corresponding to the Konsole window containing current session.
Note, that environment variable does not work well with detaching and
draging. Maybe it should not be added at all.
Related: bug 276912, bug 281513

REVIEW:103790

M  +2    -0    src/Application.cpp
M  +5    -0    src/Session.cpp
M  +2    -0    src/Session.h
M  +11   -0    src/ViewManager.cpp
M  +5    -0    src/ViewManager.h

http://commits.kde.org/konsole/07cddfe302233c3555258f077429e55ce622e262