diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 737cd74e..155e9bb0 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -99,7 +99,6 @@ MainWindow::MainWindow(QWidget *parent) : MainWindow::~MainWindow() { - delete configuration; } void MainWindow::initUI() diff --git a/src/dialogs/SaveProjectDialog.cpp b/src/dialogs/SaveProjectDialog.cpp index 8985098d..5c295c40 100644 --- a/src/dialogs/SaveProjectDialog.cpp +++ b/src/dialogs/SaveProjectDialog.cpp @@ -4,6 +4,7 @@ #include #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); }