| Summary: | Deleting items with trailing whitespace in the projects view deletes something else | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Petr Mrázek <peterix> |
| Component: | file tree | Assignee: | kdevelop-bugs-null |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | mail, software |
| Priority: | HI | ||
| Version First Reported In: | 5.1.0 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Petr Mrázek
2017-04-18 20:40:38 UTC
Confirmed. That's... bad. There's another issue: When removing " " inside $projectroot, KDevelop thinks that the whole project got removed and then closes the project: "The base folder of project X got deleted or moved outside of KDevelop. The project has to be closed." Git commit 080ed286fe100f7c736d5a77c587e0a1b9453882 by Kevin Funk.
Committed on 19/04/2017 at 09:56.
Pushed by kfunk into branch '5.1'.
Work-around issue in Path(QString) ctor
Problem: Path(QString) will call Path(QUrl) constructor, constructing an
url via QUrl::fromUserInput(...).
Because QUrl::fromUserInput by default is in tolerant mode, Path("/tmp/
") would be transformed into Path(QUrl("file:///tmp")) -> thus break the
path.
Consider this example:
```
#include <QDebug>
#include <QUrl>
int main()
{
auto u1 = QUrl::fromLocalFile("/tmp/ ");
auto u2 = QUrl::fromUserInput("/tmp/ ");
qDebug() << u1.toLocalFile();
qDebug() << u2.toLocalFile();
}
```
Will give:
```
main(8): "/tmp/ "
main(9): "/tmp/"
```
TODO: We need another Path ctor when we are sure we want to pass a local
file (e.g. by adding a static Path::fromLocalFile(...))?
M +1 -1 project/abstractfilemanagerplugin.cpp
https://commits.kde.org/kdevplatform/080ed286fe100f7c736d5a77c587e0a1b9453882
Git commit 76765692538d3af40374b0c9ae63eb6eb41c53c0 by Kevin Funk. Committed on 19/04/2017 at 09:56. Pushed by kfunk into branch '5.1'. backgroundparser: Relax assert a bit A file with just a space as file name is fine -- let's rather make sure we don't pass a folder instead of a file as url M +1 -1 language/backgroundparser/backgroundparser.cpp https://commits.kde.org/kdevplatform/76765692538d3af40374b0c9ae63eb6eb41c53c0 Issue from comment #2 is fixed by 080ed286fe100f7c736d5a77c587e0a1b9453882 There are more issues with files ending in space. When I click on one of them in the file tree manager, it opens a new window file with the space trimmed. Then, I save it and it creates a new file with the ending space trimmed. |