From kde-commits Mon Sep 13 00:10:20 2010 From: Dawit Alemayehu Date: Mon, 13 Sep 2010 00:10:20 +0000 To: kde-commits Subject: KDE/kdelibs/kfile Message-Id: <20100913001020.74FFBAC887 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128433633225701 SVN commit 1174616 by adawit: - Allow the creation of files/directories that start with "~". BUG:117473 M +9 -2 knewfilemenu.cpp --- trunk/KDE/kdelibs/kfile/knewfilemenu.cpp #1174615:1174616 @@ -723,9 +723,16 @@ QString name = m_text; if (!name.isEmpty()) { - if ((name[0] == '/') || (name[0] == '~')) { + // Expand any tilde mark that might have been specified... + const QString expandedName = KShell::tildeExpand(name); + + // When a tilde mark cannot be properly expanded, the above call returns + // an empty string ; so we handle that scenario here... + if (!expandedName.isEmpty()) + name = expandedName; + + if ((name[0] == '/')) url.setPath(KShell::tildeExpand(name)); - } else { if (!m_viewShowsHiddenFiles && name.startsWith('.')) { if (!writeHiddenDir) {