Commit 6d271615 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas
Browse files

fix browse button default directory behaviour

parent 8e622a24
......@@ -1172,11 +1172,17 @@ void dtkComposerSceneNodeEditor::onTitleChanged(const QString& text)
void dtkComposerSceneNodeEditor::onBrowse(void)
{
QSettings settings("inria", "dtk");
settings.beginGroup("composer");
QString path = settings.value("last_open_file_node", QDir::homePath()).toString();
settings.endGroup();
QString default_path = d->edit_s->text();
if (default_path.isEmpty()) {
settings.beginGroup("composer");
default_path = settings.value("last_open_file_node", QDir::homePath()).toString();
settings.endGroup();
}
QString file = QFileDialog::getOpenFileName(0, "Open file", default_path);
QString file = QFileDialog::getOpenFileName(0, "Open composition");
if (file.isEmpty())
return ;
QFileInfo info(file);
......@@ -1190,11 +1196,17 @@ void dtkComposerSceneNodeEditor::onBrowse(void)
void dtkComposerSceneNodeEditor::onBrowseDirectory(void)
{
QSettings settings("inria", "dtk");
settings.beginGroup("composer");
QString path = settings.value("last_open_directory_node", QDir::homePath()).toString();
settings.endGroup();
QString default_path = d->edit_s->text();
if (default_path.isEmpty()) {
settings.beginGroup("composer");
default_path = settings.value("last_open_directory_node", QDir::homePath()).toString();
settings.endGroup();
}
QString dir = QFileDialog::getExistingDirectory(0, "Open directory", default_path);
QString dir = QFileDialog::getExistingDirectory(0, "Open directory");
if (dir.isEmpty())
return ;
QDir info(dir);
......
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