Bug 410742

Summary: Externally-opened files no longer open in existing window
Product: [Applications] kate Reporter: Nate Graham <nate>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.kde.org, charles.gorand.dev, christoph, thomas, zmogas
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nate Graham 2019-08-08 20:33:33 UTC
This is with Kate and KTexteditor and the rest of KDE software built from git master on top of Manjaro KDE with Qt 5.13


STEPS TO REPRODUCE
1. Open Kate
2. From within that Kate window, open several documents
3. Open another text document from an external method (e.g.double-clicking on it in Dolphin, opening it in KRunner or Konsole, etc)


OBSERVED RESULT
The file opens in a new window


EXPECTED RESULT
The file opens in an existing window


ADDITIONAL INFORMATION
If you open a file from Konsole, the following is printed:

$ kate ./src/filewidgets/kdiroperator.cpp
Failed to register /MainApplication on DBus

Seems related.
Comment 1 Christoph Cullmann 2019-08-09 18:59:36 UTC
Hmm, true, happens for me now, too.

That means 


    // application dbus interface
    if (QDBusConnection::sessionBus().interface()) {
        QDBusConnection::sessionBus().registerObject(QStringLiteral("/MainApplication"), this);
    }


fails now and we have no dbus communication anymore :/
Comment 2 Christoph Cullmann 2019-08-09 19:20:11 UTC
Git commit bf54ad697f3d8380bf9871cb73e928479b9476fb by Christoph Cullmann.
Committed on 09/08/2019 at 19:19.
Pushed by cullmann into branch 'master'.

fix dbus session registration

M  +0    -5    kate/kateapp.cpp
M  +7    -1    kate/kateappadaptor.cpp

https://commits.kde.org/kate/bf54ad697f3d8380bf9871cb73e928479b9476fb
Comment 3 Christoph Cullmann 2019-08-09 19:20:21 UTC
Please test this, this should perhaps be backported.
Comment 4 Nate Graham 2019-08-09 19:22:47 UTC
Fixed for me! +1 for backporting to stable branch. Might even be worth a re-spin so we don't ship Kate 19.04 like this.
Comment 5 Christoph Cullmann 2019-08-09 19:24:18 UTC
Git commit 636af882e3c936411f56069585940901b39628d1 by Christoph Cullmann.
Committed on 09/08/2019 at 19:24.
Pushed by cullmann into branch 'Applications/19.08'.

fix dbus session registration

M  +0    -5    kate/kateapp.cpp
M  +7    -1    kate/kateappadaptor.cpp

https://commits.kde.org/kate/636af882e3c936411f56069585940901b39628d1
Comment 6 Christoph Cullmann 2019-08-09 19:24:51 UTC
Backported to 19.08, should I do that for 19.04, too?
I am actually not sure why it no longer works, perhaps Qt 5.13 bug/regression or now correct behavior?
Comment 7 Nate Graham 2019-08-09 19:25:52 UTC
Er, yes, 19.08. :) 19.04 is not getting any new releases.
Comment 8 Dominik Haumann 2019-09-25 06:28:47 UTC
*** Bug 412288 has been marked as a duplicate of this bug. ***
Comment 9 Thomas Tanghus 2019-11-09 09:40:29 UTC
*** Bug 375795 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Tanghus 2019-11-09 09:43:53 UTC
I retagged Bug #375795 as a duplicate, although it's technically this one, that's a duplicate. I hope that is OK?
Comment 11 Ken Fallon 2019-12-14 11:05:53 UTC
*** Bug 415099 has been marked as a duplicate of this bug. ***