Skip to content

Commit

Permalink
Correctly parent dialog to window, not browser
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 3, 2018
1 parent 5774b9a commit 7ae3864
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgsdataitem.cpp
Expand Up @@ -1530,8 +1530,12 @@ QList<QAction *> QgsProjectHomeItem::actions( QWidget *parent )
QAction *setHome = new QAction( tr( "Set Project Home…" ), parent );
connect( setHome, &QAction::triggered, this, [ = ]
{
QWidget *parentWindow = parent;
while ( parentWindow->parentWidget() )
parentWindow = parentWindow->parentWidget();

QString oldHome = QgsProject::instance()->homePath();
QString newPath = QFileDialog::getExistingDirectory( parent->window(), tr( "Select Project Home Directory" ), oldHome );
QString newPath = QFileDialog::getExistingDirectory( parentWindow, tr( "Select Project Home Directory" ), oldHome );
if ( !newPath.isEmpty() )
{
QgsProject::instance()->setPresetHomePath( newPath );
Expand Down

0 comments on commit 7ae3864

Please sign in to comment.