From 0782994f95e512ea383bc53181dcf5054222d145 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 22 Mar 2024 19:37:13 +0800 Subject: [PATCH] fix : menu items for editors are disabled. --- RedPandaIDE/mainwindow.cpp | 9 --------- RedPandaIDE/mainwindow.h | 1 - RedPandaIDE/parser/cppparser.cpp | 1 - 3 files changed, 11 deletions(-) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 0212e155..595c0bf9 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -594,11 +594,6 @@ void MainWindow::updateEncodingActions(const Editor *e) } } -void MainWindow::disableEncodingActions() -{ - updateEncodingActions(nullptr); -} - void MainWindow::updateEditorActions(const Editor *e) { //it's not a compile action, but put here for convinience @@ -3639,8 +3634,6 @@ void MainWindow::buildEncodingMenu() } mMenuEncoding = new QMenu(this); - connect(mMenuEncoding, &QMenu::aboutToHide, - this, &MainWindow::disableEncodingActions); mMenuEncoding->setTitle(tr("File Encoding")); mMenuEncoding->addAction(ui->actionAuto_Detect); mMenuEncoding->addAction(ui->actionEncode_in_ANSI); @@ -4022,8 +4015,6 @@ void MainWindow::onDebugConsoleContextMenu(const QPoint &pos) void MainWindow::onFileEncodingContextMenu(const QPoint &pos) { - Editor * e = mEditorList->getEditor(); - updateEncodingActions(e); if (mMenuEncoding->isEnabled()) mMenuEncoding->exec(mFileEncodingStatus->mapToGlobal(pos)); } diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 5086dac0..887d1a8d 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -132,7 +132,6 @@ public: void updateEditorBreakpoints(); void updateEditorActions(); void updateEncodingActions(const Editor *e); - void disableEncodingActions(); void updateEditorActions(const Editor *e); void updateProjectActions(); void updateCompileActions(); diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index c19b71d7..cfa9ee29 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -2916,7 +2916,6 @@ void CppParser::handleLambda(int index, int maxIndex) StatementProperty::spHasDefinition); scanMethodArgs(lambdaBlock,argStart); addSoloScopeLevel(lambdaBlock,mTokenizer[bodyStart]->line); - qDebug()<<">?>>>>>"; int oldIndex = mIndex; mIndex = bodyStart+1; while (handleStatement(bodyEnd));