Fixed SegFault when closing LoadOptions dialog

This commit is contained in:
xarkes 2018-03-07 11:49:40 +01:00
parent da1cc5918d
commit 8a73abf63f
2 changed files with 8 additions and 8 deletions

View File

@ -99,7 +99,6 @@ MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow()
{
delete configuration;
}
void MainWindow::initUI()

View File

@ -4,6 +4,7 @@
#include <Cutter.h>
#include "SaveProjectDialog.h"
#include "ui_SaveProjectDialog.h"
#include "utils/TempConfig.h"
SaveProjectDialog::SaveProjectDialog(bool quit, QWidget *parent) :
QDialog(parent),
@ -82,12 +83,12 @@ void SaveProjectDialog::on_buttonBox_clicked(QAbstractButton *button)
void SaveProjectDialog::accept()
{
CutterCore *core = CutterCore::getInstance();
core->setConfig("dir.projects", ui->projectsDirEdit->text().toUtf8().constData());
core->setConfig("prj.simple", ui->simpleCheckBox->isChecked());
core->setConfig("prj.files", ui->filesCheckBox->isChecked());
core->setConfig("prj.git", ui->gitCheckBox->isChecked());
core->setConfig("prj.zip", ui->zipCheckBox->isChecked());
TempConfig tempConfig;
tempConfig.set("dir.projects", ui->projectsDirEdit->text().toUtf8().constData())
.set("prj.simple", ui->simpleCheckBox->isChecked())
.set("prj.files", ui->filesCheckBox->isChecked())
.set("prj.git", ui->gitCheckBox->isChecked())
.set("prj.zip", ui->zipCheckBox->isChecked());
QString projectName = ui->nameEdit->text().trimmed();
if(!CutterCore::isProjectNameValid(projectName))
@ -96,7 +97,7 @@ void SaveProjectDialog::accept()
return;
}
core->saveProject(projectName);
Core()->saveProject(projectName);
QDialog::done(Saved);
}