mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Fixed SegFault when closing LoadOptions dialog
This commit is contained in:
parent
da1cc5918d
commit
8a73abf63f
@ -99,7 +99,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
void MainWindow::initUI()
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user