From 0426bfe1b08469b9d61014ce05ed70c13a22dd85 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 21 Mar 2024 07:10:48 +0800 Subject: [PATCH] fix #293 : No icons for inherited class private members. --- NEWS.md | 1 + RedPandaIDE/iconsmanager.cpp | 4 ++++ RedPandaIDE/parser/cppparser.cpp | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9f773432..0691db07 100644 --- a/NEWS.md +++ b/NEWS.md @@ -62,6 +62,7 @@ Red Panda C++ Version 2.27 - change: Invert scroll direction in horizontal, like in vertical. - enhancement: Show type completion info after 'const' and 'volatile' - fix: Caret unseen when move to a long line end by press END. + - fix: No icons for inherited class private members. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index 9a0f3728..acadbb5a 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -308,6 +308,8 @@ QPixmap IconsManager::getPixmapForStatement(PStatement statement) return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_PROTECTED_METHOD)); } else if (statement->accessibility == StatementAccessibility::Public) { return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_METHOD)); + } else { + return *(pIconsManager->getPixmap(IconsManager::PARSER_PRIVATE_METHOD)); } } else { if (statement->accessibility == StatementAccessibility::Protected) { @@ -329,6 +331,8 @@ QPixmap IconsManager::getPixmapForStatement(PStatement statement) return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_PROTECTD_VAR)); } else if (statement->accessibility == StatementAccessibility::Public) { return *(pIconsManager->getPixmap(IconsManager::PARSER_INHERITED_VAR)); + } else { + return *(pIconsManager->getPixmap(IconsManager::PARSER_PRIVATE_VAR)); } } else { if (statement->accessibility == StatementAccessibility::Protected) { diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index a9bb2913..d3a21616 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -1328,7 +1328,7 @@ void CppParser::addProjectFile(const QString &fileName, bool needScan) //value.replace('/','\\'); // only accept full file names // Update project listing - mProjectFiles.insert(fileName); + mProjectFiles.insert(fileName); // Only parse given file if (needScan && !mPreprocessor.fileScanned(fileName)) { @@ -1342,7 +1342,7 @@ PStatement CppParser::addInheritedStatement(const PStatement& derived, const PSt PStatement statement = addStatement( derived, inherit->fileName, - inherit->type, // "Type" is already in use + inherit->type, inherit->command, inherit->args, inherit->noNameArgs,