Bug 327655 - Marble application will not exit when a plugin configuration dialog is open
Summary: Marble application will not exit when a plugin configuration dialog is open
Status: CONFIRMED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.9 (KDE 4.14)
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Mihir Thakkar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-15 15:28 UTC by filnet.marble
Modified: 2021-03-09 22:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description filnet.marble 2013-11-15 15:28:30 UTC
To reproduce:
1/ open the Marble Configuration dialog
2/ go to the plugin tab and open any plugin configuration dialog
3/ don't close any dialogs and exit from Marble

When exiting, the main window will close but the plugin configuration dialog will remain open and will prevent the process form terminating.


Reproducible: Always
Comment 1 Mihir Thakkar 2014-11-02 14:38:59 UTC
Any codepointer for this bug?
Comment 2 Dennis Nienhüser 2014-11-03 02:42:48 UTC
The reason for this behavior is that the config dialog is created without any parent QWidget* set. A possible fix is this one:

diff --git a/src/lib/marble/MarblePluginSettingsWidget.cpp b/src/lib/marble/MarblePluginSettingsWidget.cpp
index 00576e9..ad592aa 100644
--- a/src/lib/marble/MarblePluginSettingsWidget.cpp
+++ b/src/lib/marble/MarblePluginSettingsWidget.cpp
@@ -75,6 +75,9 @@ void MarblePluginSettingsWidgetPrivate::showPluginConfigDialog( const QModelInde
     DialogConfigurationInterface *configInterface = m_pluginModel->pluginDialogConfigurationInterface( index );;
     QDialog *configDialog = configInterface ? configInterface->configDialog() : 0;
     if ( configDialog ) {
+        Qt::WindowFlags const flags = configDialog->windowFlags();
+        configDialog->setParent( q );
+        configDialog->setWindowFlags( flags );
         configDialog->show();
     }
 }


Here the parent is set before it is shown. Because QDialog clears its window flags on setParent() calls the original window flags are restored afterwards. Otherwise it would lose its dialog state and be embedded into the parent dialog.

This patch is slightly ugly however, so I'd rather have a cleaner approach. Do you want to look into that? To do so:

- Open DialogConfigurationInterface.h and add parameters QWidget * parent = 0, Qt::WindowFlags f = 0 to its virtual QDialog *configDialog() = 0; method
- Change org.kde.Marble.DialogConfigurationInterface/1.0 to org.kde.Marble.DialogConfigurationInterface/1.1 in the same file
- Change all plugins which implement this method to use those parameters and pass it to the QDialog they create
- In MarblePluginSettingsWidget.cpp, change the configInterface->configDialog() call to configInterface->configDialog( q )
Comment 3 Philippe Renon 2014-11-03 09:53:06 UTC
An alternative approach is to call http://qt-project.org/doc/qt-4.8/qapplication.html#closeAllWindows when exiting.

It is not a perfect solution but it prevents similar issues to creep back in.

This is the solution we adopted in our application.
Comment 4 Mihir Thakkar 2014-11-04 14:32:41 UTC
This problem does not persist in Marble version 1.9.20 (1.10 Alpha). The main window is closed along with all the dialogs, when exiting.
However, a similar problem exists. The plugin config dialogs remain open even when the Marble configuration dialog is closed.

I would modify the bug statement as:
When exiting Marble Configuration dialog, the Plugin Configuration dialogs does not get closed.

Reproducible: Always

Steps to reproduce:
- open settings->"Configure Marble"
- in Plugin tab, open the Configure Plugin Dialog
- close the Marble Configuration Dialog.
Comment 5 Justin Zobel 2021-03-09 22:51:45 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.