Bug 491899

Summary: regression 2.9.94: --line option no longer works when kile is already running.
Product: [Applications] kile Reporter: gamall.ida
Component: generalAssignee: Michel Ludwig <michel.ludwig>
Status: CONFIRMED ---    
Severity: normal CC: artal, christian.saemann, mfroeb
Priority: NOR    
Version First Reported In: 2.9.94   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description gamall.ida 2024-08-19 11:30:08 UTC
SUMMARY

--line option no longer works when kile is already running.

Note: It is essential for LaTeX workflow (search)

STEPS TO REPRODUCE
1. start kile
2.  kile file.tex --line 5

(or just play around with a synctex PDF file...)

OBSERVED RESULT

file.tex is opened / selected, as expected, but the line number is ignored

Note that the line number is not ignored when kile is _started_ via this command. 

EXPECTED RESULT

file.tex is opened / selected, and the cursor goes to specified --line number

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
Operating System: EndeavourOS 
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.10.3-arch1-2 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION

works just fine in 2.9.93.
Comment 1 Enrique Artal 2024-08-22 13:05:23 UTC
I can confirm it in Fedora 40, see https://bugs.kde.org/show_bug.cgi?id=490618
Comment 2 Christian Saemann 2024-09-14 10:11:42 UTC
Same on latest openSUSE. Unfortunately strong impact on productivity.

Also, running "kile --line 100 file.tex&" twice in terminal leads to the following output:

qt.dbus.integration: QDBusConnection: couldn't handle call to setLine, no slot matched
qt.dbus.integration: QDBusConnection: couldn't handle call to setLine, no slot matched
qt.dbus.integration: Could not find slot MainAdaptor::setLine
Comment 3 Enrique Artal 2024-09-14 10:25:23 UTC
Until it is solved, the internal document viewer works.
Comment 4 mfroeb 2025-10-25 17:10:39 UTC
This seems to result from commit https://invent.kde.org/office/kile/-/commit/2b9ea67456f4433b0f774f1ab186c38f8a3a2820 which added a second parameter to the setLine() method. This parameter is not set when calling the DBus interface in main.cpp, line 223: https://invent.kde.org/office/kile/-/blob/master/src/main.cpp#L223 . I believe adding an empty second parameter in this call should fix it, but I cannot test this right now.

As a workaround, using the command "qdbus6 org.kde.kile /main setLine %l %f" as the custom editor call (in Settings - Okular settings - Editor - Custom Text Editor) works for me if the file is currently open in Kile. %f is not the correct parameter to pass, but without specifying %f in the command okular appends it, and then qdbus complains about an invalid number of parameters.
Comment 5 mfroeb 2025-10-25 17:20:42 UTC
*** Bug 490618 has been marked as a duplicate of this bug. ***
Comment 6 gamall.ida 2025-10-27 12:12:53 UTC
(In reply to mfroeb from comment #4)

> As a workaround, using the command "qdbus6 org.kde.kile /main setLine %l %f"
> as the custom editor call (in Settings - Okular settings - Editor - Custom
> Text Editor) works for me if the file is currently open in Kile. 

For me, even if the file is open, if it's not the *active* one,  kile goes to the line in the active file, not the actual source file. 

So, --line selects the right file, but the wrong line, and dbus selects the right line, but ignores the file.

Hence the following monstrosity of a workaround, which seems to work for me:

sh -c "kile --line %l %f; qdbus6 org.kde.kile /main setLine %l %f"