From 7e8f4630b54280295e3c3b642350487cd47aeb9a Mon Sep 17 00:00:00 2001 From: ic005k Date: Thu, 5 May 2022 13:17:52 +0800 Subject: [PATCH] Add files via upload --- mainwindow.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 +