Commit 3fbd088b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QuickToolBars: bugfix for FileWidget

The document path is now taken into account when opening
a document.
Also we use released() instead of pressed()

Task-number: QTCREATORBUG-2621

Reviewed-by: Kai Koehne
parent bf6009ab
......@@ -53,9 +53,8 @@ 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_pushButton, SIGNAL(released()), this, SLOT(onButtonReleased()));
connect(m_comboBox, SIGNAL(editTextChanged(const QString &)), this, SLOT(comboBoxChanged()));
m_currentPath = QDir::currentPath();
......@@ -83,14 +82,11 @@ void FileWidget::comboBoxChanged()
void FileWidget::buttonPressed()
void FileWidget::onButtonReleased()
QString path = m_currentPath;
QString newFile = QFileDialog::getOpenFileName(0, tr("Open File"), path, m_filter);
QString newFile = QFileDialog::getOpenFileName(0, tr("Open File"), m_path.toLocalFile(), m_filter);
if (!newFile.isEmpty())
m_currentPath = QFileInfo(newFile).absolutePath();
void FileWidget::setFileNameStr(const QString &fileName)
......@@ -91,7 +91,7 @@ public:
public slots:
void setFileName(const QUrl &fileName);
void setFileNameStr(const QString &fileName);
void buttonPressed();
void onButtonReleased();
void lineEditChanged();
void comboBoxChanged();
......@@ -113,7 +113,6 @@ private:
QString m_filter;
bool m_showComboBox;
bool m_lock;
QString m_currentPath;
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