AutotoolsPM: Remove unused getters

Change-Id: I7c700893d209670b563ee60230adf8d82111a06f
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-07-15 12:15:35 +02:00
parent 931cc6820a
commit d65bed648f
2 changed files with 21 additions and 90 deletions

View File

@@ -13,6 +13,7 @@
#include <QFile>
#include <QFileInfo>
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 &macro : macros) {
for (const Macro &macro : 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;

View File

@@ -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.