Bug 404566 - KDevelop can get stuck trying to open a project
Summary: KDevelop can get stuck trying to open a project
Status: REPORTED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: project (other bugs)
Version First Reported In: 5.3.1
Platform: Compiled Sources All
: NOR critical
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-19 18:19 UTC by RJVB
Modified: 2019-02-19 18:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2019-02-19 18:19:24 UTC
SUMMARY
Sending a directory from the commandline to be opened in a running session can lead to that session getting stuck calling a KIO function, with a KIO progress dialog opening and closing at maximum speed.

STEPS TO REPRODUCE
1. Open a KDevelop session or two
2. Execute `kdevelop /path/to/projectdir/subdir1/subdir2`, select the session to target

EXPECTED RESULT
Anything but a stuck session.

KDevelop 5.3 branch head
KDE Frameworks Version: 5.52.0
Qt Version: 5.9.7

ADDITIONAL INFORMATION
This is a classic example of a dead loop:

```
        QUrl oldTest = testAt.adjusted(QUrl::RemoveFilename);
        if(oldTest == testAt)
            break;
```

QUrl::adjusted() returns the adjusted, not the old version and doesn't alter its instance. The break test thus never succeeds unless QUrl::adjusted has no effect to start with.

If the logic used is correct (keep removing filename(s) until that no longer has an effect), the code should be something like:

```
        QUrl oldTest = testAt;
        testAt = testAt.adjusted(QUrl::RemoveFilename);
        if(oldTest == testAt)
            break;
```