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

List:       kde-commits
Subject:    [kio] src/widgets: Open .directory files as plain text.
From:       Maarten De Meyer <de.meyer.maarten () gmail ! com>
Date:       2014-08-22 15:48:32
Message-ID: E1XKr4q-0002Cm-PY () scm ! kde ! org
[Download RAW message or body]

Git commit 76eeb6a21c7553d65e02366837c742c1c91d295b by Maarten De Meyer.
Committed on 21/08/2014 at 13:02.
Pushed by demeyer into branch 'master'.

Open .directory files as plain text.

We cannot execute .directory files so we have to trick KRun in opening
them as plain text.
CCBUG: 235457
REVIEW: 119869

M  +5    -0    src/widgets/kdesktopfileactions.cpp

http://commits.kde.org/kio/76eeb6a21c7553d65e02366837c742c1c91d295b

diff --git a/src/widgets/kdesktopfileactions.cpp \
b/src/widgets/kdesktopfileactions.cpp index 9486015..0cbeb00 100644
--- a/src/widgets/kdesktopfileactions.cpp
+++ b/src/widgets/kdesktopfileactions.cpp
@@ -62,6 +62,11 @@ bool KDesktopFileActions::run(const QUrl &u, bool _is_local)
         return false;
     }
 
+    if (u.fileName() == QLatin1String(".directory")) {
+        // We cannot execute a .directory file. Open with a text editor instead.
+        return KRun::runUrl(u, QStringLiteral("text/plain"), 0, false /*tempFile*/, \
false /*runExecutables*/); +    }
+
     KDesktopFile cfg(u.toLocalFile());
     if (!cfg.desktopGroup().hasKey("Type")) {
         QString tmp = i18n("The desktop entry file %1 "


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

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