Summary: | kate crashes during start when old directories are not there any more | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Andreas Hartmann <andihartmann> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Andreas Hartmann
2003-02-05 08:09:57 UTC
This bug also occurs for me, but only if the directory missing is at least two levels deeper than the existing parent directory (hope it makes sense, my English is far from perfect). For example, /home/user/dir1 does not exist, but /home/user exists. If location=/home/user/dir1 in katerc, kate does not crash, but if location=/home/user/dir1/otherdir, kate crashes directly on startup. Some detailed investigation on this: using kde 3.1 from suse rpms create ~/foo/bar.txt open kate and in the selector, navigate to the directory foo, select bar.txt to open it. close kate and the location line in katerc now looks like this: location=/home/user/foo remove the folder foo and open kate again. in the selector, we pop back to ~/ now close kate again and create ~/foo/foo2/bar.txt, open kate (we start in ~/ again) and navigate to and open bar.txt then close kate and remove ~/foo the location line looks now like this location=/home/user/foo/foo2 now, when we open kate again, we get a sig11: kdecore (KLocale): WARNING: found no definition of PluralForm for de kate: KateCodeFoldingTree::clear() kate: KateCodeFoldingTree::clear() ERROR: KUniqueApplication: DCOP communication error! removing the location line resolves the problem A possible solution would be to default to ~/ if the last location does not exist. another way would be to try to cd .. until we've found an existing directory (better solution imho) Subject: kdebase/kate/app CVS commit by rodda: Fix bug 54120... don't try to change to directories that don't exist It's not the best fix, but at least it doesn't crash. CCMAIL:54120-done@bugs.kde.org M +4 -2 katefileselector.cpp 1.21 --- kdebase/kate/app/katefileselector.cpp #1.20:1.21 @@ -64,4 +64,5 @@ #include <kpopupmenu.h> #include <kdialog.h> +#include <kio/netaccess.h> #include <kdebug.h> @@ -329,4 +330,5 @@ void KateFileSelector::slotFilterChange( void KateFileSelector::setDir( KURL u ) { + if (KIO::NetAccess::exists(u)) dir->setURL(u, true); } |