Commit 8c94325a authored by Christian Kamm's avatar Christian Kamm
Browse files

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: default avatarChristian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
parent 010ce2d2
...@@ -66,16 +66,13 @@ public: ...@@ -66,16 +66,13 @@ public:
Q_ASSERT(m_objDef != 0); Q_ASSERT(m_objDef != 0);
m_idName = idOfObject(m_objDef); m_idName = idOfObject(m_objDef);
if (!m_idName.isEmpty()) {
if (m_idName.isEmpty()) {
setDescription(QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef",
"Move Component into separate file"));
} else {
m_componentName = m_idName; m_componentName = m_idName;
m_componentName[0] = m_componentName.at(0).toUpper(); 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, virtual void performChanges(QmlJSRefactoringFilePtr currentFile,
...@@ -83,9 +80,7 @@ public: ...@@ -83,9 +80,7 @@ public:
{ {
QString componentName = m_componentName; QString componentName = m_componentName;
QString path = QFileInfo(fileName()).path(); 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()) if (componentName.isEmpty() || path.isEmpty())
return; return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment