forked from qt-creator/qt-creator
AutotoolsPM: Remove unused getters
Change-Id: I7c700893d209670b563ee60230adf8d82111a06f Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace AutotoolsProjectManager::Internal {
|
namespace AutotoolsProjectManager::Internal {
|
||||||
@@ -69,41 +70,6 @@ bool MakefileParser::parse()
|
|||||||
return m_success;
|
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()
|
void MakefileParser::cancel()
|
||||||
{
|
{
|
||||||
m_cancel = true;
|
m_cancel = true;
|
||||||
@@ -263,28 +229,26 @@ void MakefileParser::parseSubDirs()
|
|||||||
if (!success)
|
if (!success)
|
||||||
m_success = false;
|
m_success = false;
|
||||||
|
|
||||||
|
const MakefileParserOutputData result = parser.outputData();
|
||||||
|
|
||||||
m_outputData.m_makefiles.append(subDir + slash + makefileName);
|
m_outputData.m_makefiles.append(subDir + slash + makefileName);
|
||||||
|
|
||||||
// Append the sources of the sub directory to the
|
// Append the sources of the sub directory to the current sources
|
||||||
// current sources
|
for (const QString &source : result.m_sources)
|
||||||
const QStringList sources = parser.sources();
|
|
||||||
for (const QString &source : sources)
|
|
||||||
m_outputData.m_sources.append(subDir + slash + source);
|
m_outputData.m_sources.append(subDir + slash + source);
|
||||||
|
|
||||||
// Append the include paths of the sub directory
|
// 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
|
// Append the flags of the sub directory
|
||||||
m_outputData.m_cflags.append(parser.cflags());
|
m_outputData.m_cflags.append(result.m_cflags);
|
||||||
m_outputData.m_cxxflags.append(parser.cxxflags());
|
m_outputData.m_cxxflags.append(result.m_cxxflags);
|
||||||
|
|
||||||
// Append the macros of the sub directory
|
// Append the macros of the sub directory
|
||||||
const Macros macros = parser.macros();
|
for (const Macro ¯o : result.m_macros) {
|
||||||
for (const auto ¯o : macros) {
|
|
||||||
if (!m_outputData.m_macros.contains(macro))
|
if (!m_outputData.m_macros.contains(macro))
|
||||||
m_outputData.m_macros.append(macro);
|
m_outputData.m_macros.append(macro);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duplicates might be possible in combination with several
|
// Duplicates might be possible in combination with several
|
||||||
@@ -444,7 +408,7 @@ bool MakefileParser::maybeParseDefine(const QString &term)
|
|||||||
{
|
{
|
||||||
if (term.startsWith(QLatin1String("-D"))) {
|
if (term.startsWith(QLatin1String("-D"))) {
|
||||||
QString def = term.mid(2); // remove the "-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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -21,12 +21,23 @@ namespace AutotoolsProjectManager::Internal {
|
|||||||
class MakefileParserOutputData final
|
class MakefileParserOutputData final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// File name of the executable.
|
||||||
QString m_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;
|
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;
|
QStringList m_makefiles;
|
||||||
|
// List of include paths. Should be invoked, after the signal finished() has been emitted.
|
||||||
QStringList m_includePaths;
|
QStringList m_includePaths;
|
||||||
|
// Concatenated normalized defines, just like in code:
|
||||||
|
// #define X12_DEPRECATED __attribute__((deprecated))
|
||||||
|
// #define X12_HAS_DEPRECATED
|
||||||
ProjectExplorer::Macros m_macros;
|
ProjectExplorer::Macros m_macros;
|
||||||
|
// List of compiler flags for C.
|
||||||
QStringList m_cflags;
|
QStringList m_cflags;
|
||||||
|
// List of compiler flags for C++.
|
||||||
QStringList m_cxxflags;
|
QStringList m_cxxflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,50 +74,6 @@ public:
|
|||||||
|
|
||||||
MakefileParserOutputData outputData() const { return m_outputData; }
|
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
|
* Cancels the parsing. Calling this function only makes sense, if the
|
||||||
* parser runs in a different thread than the caller of this function.
|
* parser runs in a different thread than the caller of this function.
|
||||||
|
|||||||
Reference in New Issue
Block a user