Commit a212b1f7 authored by Marco Benelli's avatar Marco Benelli

Fixed wrong behavior of "Move Component in Separate File" for qml.

The dialog accepted/rejected value is now checked.

Task-number: QTCREATORBUG-14175
Change-Id: I9a39c0cf87b7e11613a333b2d3a63b77e39b6d97
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 7aa8ae54
...@@ -103,7 +103,10 @@ public: ...@@ -103,7 +103,10 @@ public:
{ {
QString componentName = m_componentName; QString componentName = m_componentName;
QString path = QFileInfo(fileName()).path(); QString path = QFileInfo(fileName()).path();
ComponentNameDialog::go(&componentName, &path, Core::ICore::dialogParent()); bool confirm = ComponentNameDialog::go(&componentName, &path, Core::ICore::dialogParent());
if (!confirm)
return;
if (componentName.isEmpty() || path.isEmpty()) if (componentName.isEmpty() || path.isEmpty())
return; return;
......
...@@ -54,7 +54,7 @@ ComponentNameDialog::~ComponentNameDialog() ...@@ -54,7 +54,7 @@ ComponentNameDialog::~ComponentNameDialog()
delete ui; delete ui;
} }
void ComponentNameDialog::go(QString *proposedName, bool ComponentNameDialog::go(QString *proposedName,
QString *proposedPath, QString *proposedPath,
QWidget *parent) QWidget *parent)
{ {
...@@ -73,7 +73,10 @@ void ComponentNameDialog::go(QString *proposedName, ...@@ -73,7 +73,10 @@ void ComponentNameDialog::go(QString *proposedName,
if (QDialog::Accepted == d.exec()) { if (QDialog::Accepted == d.exec()) {
*proposedName = d.ui->componentNameEdit->text(); *proposedName = d.ui->componentNameEdit->text();
*proposedPath = d.ui->pathEdit->path(); *proposedPath = d.ui->pathEdit->path();
return true;
} }
return false;
} }
void ComponentNameDialog::choosePath() void ComponentNameDialog::choosePath()
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
explicit ComponentNameDialog(QWidget *parent = 0); explicit ComponentNameDialog(QWidget *parent = 0);
~ComponentNameDialog(); ~ComponentNameDialog();
static void go(QString *proposedName, QString *proposedPath, QWidget *parent = 0); static bool go(QString *proposedName, QString *proposedPath, QWidget *parent = 0);
public slots: public slots:
void choosePath(); void choosePath();
......
Markdown is supported
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