| Summary: | Folderview shouldn't accept an empty directory. | ||
|---|---|---|---|
| Product: | [Unmaintained] plasma4 | Reporter: | FiNeX <finex> |
| Component: | widget-folderview | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | patch | ||
Created attachment 25409 [details]
patch
I've tested it and it works perfectly. If you (@devs) agree I can commit it.
the patch looks good, except: the default url should be KUrl(QDir::homePath()) and it shouldn't default to the desktop directory. that keeps it consistent with the initial state of a new folderview: it views your home directory. so url = KUrl(QDir::homePath()); and invert all the bools and it's good to commit =) thanks for the patch! (hmm.. i also wonder if url.isValid() would also be a useful check?) I've tried to test isValid(), but it always return TRUE. KUrlRequester throw an error: "URL cannot be listed", but nothing else happen. In the meantime I've added the "isempty()" check, later I'll try to understand how to check if the url inserted is a valid one. SVN commit 821481 by finex: Configuration dialog: check if the url isEmpty(). BUG: 164305 M +3 -0 folderview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=821481 SVN commit 821591 by finex: Configuration dialog: if the url is local check if it exist. CCBUG: 164305 M +1 -1 folderview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=821591 |
Version: (using Devel) Installed from: Compiled sources OS: Linux 1) add a folder view 2) go to the config dialog 3) select "show a custom folder" 4) empty the "custom folder" field 5) press OK button First bug: You'll prompted with a "Malformed URL" error, and the config dialog will be closed 6) reopen the config dialog 7) press OK Second bug: You'll not be prompted again. Quick fix: if (url.isEmpty()) { url = KUrl("desktop:/"); ui.showDesktopFolder->setChecked(true); ui.showCustomFolder->setChecked(false); ui.selectLabel->setEnabled(false); ui.lineEdit->setEnabled(false); }