From 8c94325a03e08c1dcff53fda3a4b02d99856e2ab Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Tue, 4 Oct 2011 11:21:32 +0200
Subject: [PATCH] QmlJS: Always allow changing name in 'make component'
 quickfix.

Reviewed-by: Fawzi Mohamed
Change-Id: I95a3ea500482731e1a4633683339ff5acd052218
Reviewed-on: http://codereview.qt-project.org/5975
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
---
 .../qmljseditor/qmljscomponentfromobjectdef.cpp   | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp
index 95f6eeb3318..677bf12c5c4 100644
--- a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp
+++ b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp
@@ -66,16 +66,13 @@ public:
         Q_ASSERT(m_objDef != 0);
 
         m_idName = idOfObject(m_objDef);
-
-        if (m_idName.isEmpty()) {
-            setDescription(QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef",
-                                                       "Move Component into separate file"));
-        } else {
+        if (!m_idName.isEmpty()) {
             m_componentName = m_idName;
             m_componentName[0] = m_componentName.at(0).toUpper();
-            setDescription(QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef",
-                                                       "Move Component into '%1.qml'").arg(m_componentName));
         }
+
+        setDescription(QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef",
+                                                   "Move Component into separate file"));
     }
 
     virtual void performChanges(QmlJSRefactoringFilePtr currentFile,
@@ -83,9 +80,7 @@ public:
     {
         QString componentName = m_componentName;
         QString path = QFileInfo(fileName()).path();
-        if (componentName.isEmpty()) {
-            ComponentNameDialog::go(&componentName, &path, assistInterface()->widget());
-        }
+        ComponentNameDialog::go(&componentName, &path, assistInterface()->widget());
 
         if (componentName.isEmpty() || path.isEmpty())
             return;
-- 
GitLab