Summary: | Cannot open projects with -p or --project command line option or any other way on command line | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Evren <evren320> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED NOT A BUG | ||
Severity: | normal | CC: | igorkuo |
Priority: | NOR | ||
Version First Reported In: | 5.14.240501 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | workaround script that can be used |
Description
Evren
2022-04-19 12:38:51 UTC
Take a look at https://invent.kde.org/kdevelop/kdevelop/-/blob/3427bd11ff34b18d3efdec3b4f23c65c0316a6e0/app/main.cpp#L720. KDevelop looks for a session that contains the project specified on the command line. If such a session exists, it is opened. Otherwise, the last used session is opened. You can debug this with: QT_LOGGING_RULES='kdevelop.app.debug=true' kdevelop -p '/path/to/project' Note that the project URL must match the one stored in the session verbatim, because unfortunately KDevelop does not seamlessly resolve symlinks. You could implement creating and opening a new session with the project passed on the command line if there is no suitable existing session. Seems like an unexpected behaviour from a software. I have never seen such behavior in any other kde or non kde software before. I think i need this in daily life and this bug reduces productivity. > I think i need this in daily life and this bug reduces productivity.
Fortunately KDevelop is free software. You can implement the feature to boost productivity.
KDevelop accepts positional arguments on the command line. From the output of `kdevelop --help`:
> Arguments:
> files Files to load, or directories to load as projects
So you can load a project into the last used session by passing its directory to KDevelop on the command line. For the current directory:
kdevelop .
Created attachment 170592 [details]
workaround script that can be used
This is a workaround bash script to be used if you want to open kdevelop projects directly by double clicking on the project files, it will search a session with the project and if it doesn't find it, creates a session with the project then opens the project in this new session. I wish i could implement this in kdevelop source code itself, but i just did a quick workaround instead of a full work.
|