Commit 17431b40 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: save current path in file dialog

parent a2edfd2a
......@@ -56,6 +56,7 @@ FileWidget::FileWidget(QWidget *parent) : QWidget(parent), m_filter("(*.*)"), m_
connect(m_lineEdit, SIGNAL(editingFinished()), this, SLOT(lineEditChanged()));
connect(m_pushButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
connect(m_comboBox, SIGNAL(editTextChanged(const QString &)), this, SLOT(comboBoxChanged()));
m_currentPath = QDir::currentPath();
}
FileWidget::~FileWidget()
......@@ -95,13 +96,15 @@ void FileWidget::comboBoxChanged()
void FileWidget::buttonPressed()
{
QString path = QDir::currentPath();
QString path = m_currentPath;
if (m_itemNode.isValid()) {
path = QFileInfo(m_itemNode.modelNode().model()->fileUrl().toLocalFile()).absoluteDir().absolutePath();
}
QString newFile = QFileDialog::getOpenFileName(0, tr("Open File"), path, m_filter);
if (!newFile.isEmpty())
setFileNameStr(newFile);
m_currentPath = QFileInfo(newFile).absolutePath();
}
void FileWidget::setFileNameStr(const QString &fileName)
......
......@@ -118,6 +118,7 @@ private:
QString m_filter;
bool m_showComboBox;
bool m_lock;
QString m_currentPath;
};
......
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