From d65bed648fa05129c351a4dcc3e212a258c9863b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 15 Jul 2024 12:15:35 +0200 Subject: [PATCH] AutotoolsPM: Remove unused getters Change-Id: I7c700893d209670b563ee60230adf8d82111a06f Reviewed-by: hjk --- .../makefileparser.cpp | 56 ++++--------------- .../autotoolsprojectmanager/makefileparser.h | 55 ++++-------------- 2 files changed, 21 insertions(+), 90 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp index ab427bfb016..c40f63c6886 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp @@ -13,6 +13,7 @@ #include #include +using namespace ProjectExplorer; using namespace Utils; namespace AutotoolsProjectManager::Internal { @@ -69,41 +70,6 @@ bool MakefileParser::parse() return m_success; } -QStringList MakefileParser::sources() const -{ - return m_outputData.m_sources; -} - -QStringList MakefileParser::makefiles() const -{ - return m_outputData.m_makefiles; -} - -QString MakefileParser::executable() const -{ - return m_outputData.m_executable; -} - -QStringList MakefileParser::includePaths() const -{ - return m_outputData.m_includePaths; -} - -ProjectExplorer::Macros MakefileParser::macros() const -{ - return m_outputData.m_macros; -} - -QStringList MakefileParser::cflags() const -{ - return m_cppflags + m_outputData.m_cflags; -} - -QStringList MakefileParser::cxxflags() const -{ - return m_cppflags + m_outputData.m_cxxflags; -} - void MakefileParser::cancel() { m_cancel = true; @@ -263,28 +229,26 @@ void MakefileParser::parseSubDirs() if (!success) m_success = false; + const MakefileParserOutputData result = parser.outputData(); + m_outputData.m_makefiles.append(subDir + slash + makefileName); - // Append the sources of the sub directory to the - // current sources - const QStringList sources = parser.sources(); - for (const QString &source : sources) + // Append the sources of the sub directory to the current sources + for (const QString &source : result.m_sources) m_outputData.m_sources.append(subDir + slash + source); // Append the include paths of the sub directory - m_outputData.m_includePaths.append(parser.includePaths()); + m_outputData.m_includePaths.append(result.m_includePaths); // Append the flags of the sub directory - m_outputData.m_cflags.append(parser.cflags()); - m_outputData.m_cxxflags.append(parser.cxxflags()); + m_outputData.m_cflags.append(result.m_cflags); + m_outputData.m_cxxflags.append(result.m_cxxflags); // Append the macros of the sub directory - const Macros macros = parser.macros(); - for (const auto ¯o : macros) { + for (const Macro ¯o : result.m_macros) { if (!m_outputData.m_macros.contains(macro)) m_outputData.m_macros.append(macro); } - } // Duplicates might be possible in combination with several @@ -444,7 +408,7 @@ bool MakefileParser::maybeParseDefine(const QString &term) { if (term.startsWith(QLatin1String("-D"))) { QString def = term.mid(2); // remove the "-D" - m_outputData.m_macros += ProjectExplorer::Macro::fromKeyValue(def); + m_outputData.m_macros += Macro::fromKeyValue(def); return true; } return false; diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h index 58bf3d52966..0c432fe543d 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.h +++ b/src/plugins/autotoolsprojectmanager/makefileparser.h @@ -21,12 +21,23 @@ namespace AutotoolsProjectManager::Internal { class MakefileParserOutputData final { public: + // File name of the executable. QString m_executable; + // List of sources that are set for the _SOURCES target. + // Sources in sub directorties contain the sub directory as prefix. QStringList m_sources; + // List of Makefile.am files from the current directory and all sub directories. + // The values for sub directories contain the sub directory as prefix. QStringList m_makefiles; + // List of include paths. Should be invoked, after the signal finished() has been emitted. QStringList m_includePaths; + // Concatenated normalized defines, just like in code: + // #define X12_DEPRECATED __attribute__((deprecated)) + // #define X12_HAS_DEPRECATED ProjectExplorer::Macros m_macros; + // List of compiler flags for C. QStringList m_cflags; + // List of compiler flags for C++. QStringList m_cxxflags; }; @@ -63,50 +74,6 @@ public: MakefileParserOutputData outputData() const { return m_outputData; } - /** - * @return List of sources that are set for the _SOURCES target. - * Sources in sub directorties contain the sub directory as - * prefix. - */ - QStringList sources() const; - - /** - * @return List of Makefile.am files from the current directory and - * all sub directories. The values for sub directories contain - * the sub directory as prefix. - */ - QStringList makefiles() const; - - /** - * @return File name of the executable. - */ - QString executable() const; - - /** - * @return List of include paths. Should be invoked, after the signal - * finished() has been emitted. - */ - QStringList includePaths() const; - - /** - * @return Concatenated normalized defines, just like in code: - * @code - * #define X12_DEPRECATED __attribute__((deprecated)) - * #define X12_HAS_DEPRECATED - * @endcode - */ - Macros macros() const; - - /** - * @return List of compiler flags for C. - */ - QStringList cflags() const; - - /** - * @return List of compiler flags for C++. - */ - QStringList cxxflags() const; - /** * Cancels the parsing. Calling this function only makes sense, if the * parser runs in a different thread than the caller of this function.