[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kfile
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2010-09-13 8:33:55
Message-ID: 20100913083355.B9864AC887 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1174798 by adawit:

Do not expand filenames that start with the tilde mark

 M  +3 -3      knewfilemenu.cpp  


--- trunk/KDE/kdelibs/kfile/knewfilemenu.cpp #1174797:1174798
@@ -53,9 +53,9 @@
 #include <ktemporaryfile.h>
 #include <utime.h>
 
-static QString expandTilde(const QString& name)
+static QString expandTilde(const QString& name, bool isfile = false)
 {
-    if (!name.isEmpty())
+    if (!name.isEmpty() && (!isfile || name[0] == '\\'))
     {
         const QString expandedName = KShell::tildeExpand(name);
         // When a tilde mark cannot be properly expanded, the above call
@@ -499,7 +499,7 @@
 {
     m_tempFileToDelete = m_strategy.tempFileToDelete();
     const QString src = m_strategy.sourceFileToCopy();
-    const QString chosenFileName = expandTilde(m_strategy.chosenFileName());
+    QString chosenFileName = expandTilde(m_strategy.chosenFileName(), true);
 
     if (src.isEmpty())
         return;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic