https://bugs.kde.org/show_bug.cgi?id=404566

            Bug ID: 404566
           Summary: KDevelop can get stuck trying to open a project
           Product: kdevplatform
           Version: 5.3.1
          Platform: Compiled Sources
                OS: All
            Status: REPORTED
          Severity: critical
          Priority: NOR
         Component: project
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: rjvber...@gmail.com
  Target Milestone: ---

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;
```

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to