SyncLogDialog: Do not delete SyncLogDialog after close.

Keep one instance for the lifetime of the generalsettings widget.
This commit is contained in:
Klaas Freitag 2015-10-07 18:59:48 +02:00
parent afd081f40b
commit a8eb913535
2 changed files with 6 additions and 3 deletions

View file

@ -100,6 +100,7 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
GeneralSettings::~GeneralSettings()
{
delete _ui;
delete _syncLogDialog;
}
QSize GeneralSettings::sizeHint() const {
@ -157,9 +158,12 @@ void GeneralSettings::slotToggleOptionalDesktopNotifications(bool enable)
void GeneralSettings::slotOpenSyncLog()
{
// the protocolwidget is connected to the ProgressDispatcher ot collect
// notifications also in case the logwindow is not visible. It is passed
// here to the LogDialog constructor which is not destroyed once created
// except in the destructor here.
if (_syncLogDialog.isNull()) {
_syncLogDialog = new SyncLogDialog(this, _protocolWidget);
_syncLogDialog->setAttribute( Qt::WA_DeleteOnClose, true );
_syncLogDialog = new SyncLogDialog(0, _protocolWidget);
_syncLogDialog->open();
} else {
ownCloudGui::raiseDialog(_syncLogDialog);

View file

@ -30,7 +30,6 @@ SyncLogDialog::SyncLogDialog(QWidget *parent, ProtocolWidget *protoWidget) :
QDialog(parent),
_ui(new Ui::SyncLogDialog)
{
setAttribute(Qt::WA_DeleteOnClose);
setObjectName("SyncLogDialog"); // required as group for saveGeometry call
_ui->setupUi(this);