diff --git a/mainwindow.cpp b/mainwindow.cpp index 9d9913e..ad29e54 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -14,7 +14,7 @@ #endif #include "methods.h" -QString CurVersion = "1.1.64"; +QString CurVersion = "1.1.65"; QString fileName, curFile, dragFileName, findStr, findPath, search_string, curFindFile; @@ -5005,24 +5005,25 @@ void MainWindow::closeEvent(QCloseEvent* event) { // Save tabs int tabcount = ui->tabWidget_textEdit->tabBar()->count(); + int m = 0; for (int i = 0; i < tabcount; i++) { pWidget = ui->tabWidget_textEdit->widget(i); lblCurrentFile = (QLabel*)pWidget->children().at(lblNumber); if (lblCurrentFile->text() == tr("untitled") + ".dsl") { - tabcount--; } else { getCurrentEditor(i)->getCursorPosition(&rowDrag, &colDrag); vs = getCurrentEditor(i)->verticalScrollBar()->sliderPosition(); hs = getCurrentEditor(i)->horizontalScrollBar()->sliderPosition(); - Reg.setValue(QString::number(i) + "/" + "file", lblCurrentFile->text()); - Reg.setValue(QString::number(i) + "/" + "row", rowDrag); - Reg.setValue(QString::number(i) + "/" + "col", colDrag); - Reg.setValue(QString::number(i) + "/" + "vs", vs); - Reg.setValue(QString::number(i) + "/" + "hs", hs); + Reg.setValue(QString::number(m) + "/" + "file", lblCurrentFile->text()); + Reg.setValue(QString::number(m) + "/" + "row", rowDrag); + Reg.setValue(QString::number(m) + "/" + "col", colDrag); + Reg.setValue(QString::number(m) + "/" + "vs", vs); + Reg.setValue(QString::number(m) + "/" + "hs", hs); + m++; } } - Reg.setValue("count", tabcount); + Reg.setValue("count", m); // Save scribble board QSaveFile fileScribble(QDir::homePath() + "/.config/" + strAppName +