Fix a crash and quitting accidentally

This commit is contained in:
Florian Märkl 2017-11-26 13:36:24 +01:00
parent 2aabec9d05
commit 3ee8c68a4a
2 changed files with 10 additions and 5 deletions

View File

@ -298,20 +298,20 @@ void NewFileDialog::loadFile(const QString &filename)
settings.setValue("recentFileList", files);
close();
// Close dialog and open MainWindow/OptionsDialog
MainWindow *main = new MainWindow();
main->openNewFile(filename);
//OptionsDialog *o = new OptionsDialog(fname);
//o->exec();
close();
}
}
void NewFileDialog::loadProject(const QString &project)
{
close();
MainWindow *main = new MainWindow();
main->openProject(project);
close();
}

View File

@ -79,7 +79,12 @@ void GraphicsBar::fillData()
int to = mainMap["to"].toInt();
int block = mainMap["blocksize"].toInt();
int size = (to - from);
int num = size / block;
int num = 1;
if (block != 0)
{
num = size / block;
}
if (num < 1)
{
num = 1;