Skip to content

Commit 2475e72

Browse files
committed
Fix unchanged modified state after uploading
1 parent 61003eb commit 2475e72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

qrgui/mainWindow/mainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ void MainWindow::setTextChanged(text::QScintillaTextEdit *editor, bool changed)
827827
const QString chIndicator = changed ? CHANGED_MARK : "";
828828
const QString filePath = mTextManager->path(editor);
829829
setWindowTitle(windowTitle + " " + chIndicator + filePath);
830-
const int index = mUi->tabs->currentIndex();
830+
const int index = mUi->tabs->indexOf(editor);
831831
mUi->tabs->setTabText(index, mUi->tabs->tabText(index).remove(CHANGED_MARK, Qt::CaseInsensitive) + chIndicator);
832832
}
833833

qrgui/textEditor/textManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ bool TextManager::openFile(const QString &filePath, const QString &generatorName
4444
QTextStream inStream(&file);
4545
inStream.setCodec(QTextCodec::codecForName("UTF-8"));
4646
const auto &area = new QScintillaTextEdit();
47-
connect(&*area, &QScintillaTextEdit::textWasModified, this
48-
, [this](QScintillaTextEdit *t) { setModified(t, true); });
4947
area->setCurrentLanguage(language);
5048
area->setText(inStream.readAll());
49+
connect(&*area, &QScintillaTextEdit::textWasModified, this
50+
, [this](QScintillaTextEdit *t) { setModified(t, true); });
5151
mText.insert(filePath, area);
5252
mPath.insert(area, filePath);
5353
mPathType.insert(filePath, true);

0 commit comments

Comments
 (0)