From 3e750afc7333b5e477cc1646c4f59e81acd1e963 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Wed, 17 Mar 2010 10:55:43 +0100
Subject: [PATCH] DesignMode: Do not open .js-files in Design mode.

---
 src/plugins/qmljseditor/qmljseditor.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 0822dd39ebf..7bf3057c095 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -602,7 +602,8 @@ static bool openInDesignMode()
 
 QString QmlJSEditorEditable::preferredMode() const
 {
-    if (openInDesignMode())
+    if (editor()->mimeType() == QLatin1String(QmlJSEditor::Constants::QML_MIMETYPE)
+        && openInDesignMode())
         return QLatin1String(Core::Constants::MODE_DESIGN);
     return QString();
 }
-- 
GitLab