forked from qt-creator/qt-creator
Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -851,7 +851,7 @@ QList<Snapshot::IncludeLocation> Snapshot::includeLocationsOfDocument(const QStr
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList Snapshot::filesDependingOn(const Utils::FilePath &fileName) const
|
Utils::FilePaths Snapshot::filesDependingOn(const Utils::FilePath &fileName) const
|
||||||
{
|
{
|
||||||
updateDependencyTable();
|
updateDependencyTable();
|
||||||
return m_deps.filesDependingOn(fileName);
|
return m_deps.filesDependingOn(fileName);
|
||||||
|
|||||||
@@ -442,8 +442,8 @@ public:
|
|||||||
QSet<QString> allIncludesForDocument(const QString &fileName) const;
|
QSet<QString> allIncludesForDocument(const QString &fileName) const;
|
||||||
QList<IncludeLocation> includeLocationsOfDocument(const QString &fileName) const;
|
QList<IncludeLocation> includeLocationsOfDocument(const QString &fileName) const;
|
||||||
|
|
||||||
Utils::FilePathList filesDependingOn(const Utils::FilePath &fileName) const;
|
Utils::FilePaths filesDependingOn(const Utils::FilePath &fileName) const;
|
||||||
Utils::FilePathList filesDependingOn(const QString &fileName) const
|
Utils::FilePaths filesDependingOn(const QString &fileName) const
|
||||||
{ return filesDependingOn(Utils::FilePath::fromString(fileName)); }
|
{ return filesDependingOn(Utils::FilePath::fromString(fileName)); }
|
||||||
void updateDependencyTable() const;
|
void updateDependencyTable() const;
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
using namespace CPlusPlus;
|
using namespace CPlusPlus;
|
||||||
|
|
||||||
Utils::FilePathList DependencyTable::filesDependingOn(const Utils::FilePath &fileName) const
|
Utils::FilePaths DependencyTable::filesDependingOn(const Utils::FilePath &fileName) const
|
||||||
{
|
{
|
||||||
Utils::FilePathList deps;
|
Utils::FilePaths deps;
|
||||||
|
|
||||||
int index = fileIndex.value(fileName, -1);
|
int index = fileIndex.value(fileName, -1);
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class CPLUSPLUS_EXPORT DependencyTable
|
|||||||
private:
|
private:
|
||||||
friend class Snapshot;
|
friend class Snapshot;
|
||||||
void build(const Snapshot &snapshot);
|
void build(const Snapshot &snapshot);
|
||||||
Utils::FilePathList filesDependingOn(const Utils::FilePath &fileName) const;
|
Utils::FilePaths filesDependingOn(const Utils::FilePath &fileName) const;
|
||||||
|
|
||||||
QVector<Utils::FilePath> files;
|
QVector<Utils::FilePath> files;
|
||||||
QHash<Utils::FilePath, int> fileIndex;
|
QHash<Utils::FilePath, int> fileIndex;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ struct SshSettings
|
|||||||
FilePath sftpFilePath;
|
FilePath sftpFilePath;
|
||||||
FilePath askpassFilePath;
|
FilePath askpassFilePath;
|
||||||
FilePath keygenFilePath;
|
FilePath keygenFilePath;
|
||||||
QSsh::SshSettings::SearchPathRetriever searchPathRetriever = [] { return FilePathList(); };
|
QSsh::SshSettings::SearchPathRetriever searchPathRetriever = [] { return FilePaths(); };
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
static void setKeygenFilePath(const Utils::FilePath &keygen);
|
static void setKeygenFilePath(const Utils::FilePath &keygen);
|
||||||
static Utils::FilePath keygenFilePath();
|
static Utils::FilePath keygenFilePath();
|
||||||
|
|
||||||
using SearchPathRetriever = std::function<Utils::FilePathList()>;
|
using SearchPathRetriever = std::function<Utils::FilePaths()>;
|
||||||
static void setExtraSearchPathRetriever(const SearchPathRetriever &pathRetriever);
|
static void setExtraSearchPathRetriever(const SearchPathRetriever &pathRetriever);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -101,15 +101,15 @@ static FilePath findQmakeInDir(const FilePath &path)
|
|||||||
|
|
||||||
FilePath BuildableHelperLibrary::findSystemQt(const Environment &env)
|
FilePath BuildableHelperLibrary::findSystemQt(const Environment &env)
|
||||||
{
|
{
|
||||||
const FilePathList list = findQtsInEnvironment(env, 1);
|
const FilePaths list = findQtsInEnvironment(env, 1);
|
||||||
return list.size() == 1 ? list.first() : FilePath();
|
return list.size() == 1 ? list.first() : FilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList BuildableHelperLibrary::findQtsInEnvironment(const Environment &env, int maxCount)
|
FilePaths BuildableHelperLibrary::findQtsInEnvironment(const Environment &env, int maxCount)
|
||||||
{
|
{
|
||||||
FilePathList qmakeList;
|
FilePaths qmakeList;
|
||||||
std::set<QString> canonicalEnvPaths;
|
std::set<QString> canonicalEnvPaths;
|
||||||
const FilePathList paths = env.path();
|
const FilePaths paths = env.path();
|
||||||
for (const FilePath &path : paths) {
|
for (const FilePath &path : paths) {
|
||||||
if (!canonicalEnvPaths.insert(path.toFileInfo().canonicalFilePath()).second)
|
if (!canonicalEnvPaths.insert(path.toFileInfo().canonicalFilePath()).second)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
// returns the full path to the first qmake, qmake-qt4, qmake4 that has
|
// returns the full path to the first qmake, qmake-qt4, qmake4 that has
|
||||||
// at least version 2.0.0 and thus is a qt4 qmake
|
// at least version 2.0.0 and thus is a qt4 qmake
|
||||||
static FilePath findSystemQt(const Environment &env);
|
static FilePath findSystemQt(const Environment &env);
|
||||||
static FilePathList findQtsInEnvironment(const Environment &env, int maxCount = -1);
|
static FilePaths findQtsInEnvironment(const Environment &env, int maxCount = -1);
|
||||||
static bool isQtChooser(const QFileInfo &info);
|
static bool isQtChooser(const QFileInfo &info);
|
||||||
static QString qtChooserToQmakePath(const QString &path);
|
static QString qtChooserToQmakePath(const QString &path);
|
||||||
// return true if the qmake at qmakePath is a Qt (used by QtVersion)
|
// return true if the qmake at qmakePath is a Qt (used by QtVersion)
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ QString Environment::expandedValueForKey(const QString &key) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
FilePath Environment::searchInPath(const QString &executable,
|
FilePath Environment::searchInPath(const QString &executable,
|
||||||
const FilePathList &additionalDirs,
|
const FilePaths &additionalDirs,
|
||||||
const PathFilter &func) const
|
const PathFilter &func) const
|
||||||
{
|
{
|
||||||
if (executable.isEmpty())
|
if (executable.isEmpty())
|
||||||
@@ -256,8 +256,8 @@ FilePath Environment::searchInPath(const QString &executable,
|
|||||||
return FilePath();
|
return FilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList Environment::findAllInPath(const QString &executable,
|
FilePaths Environment::findAllInPath(const QString &executable,
|
||||||
const FilePathList &additionalDirs,
|
const FilePaths &additionalDirs,
|
||||||
const Environment::PathFilter &func) const
|
const Environment::PathFilter &func) const
|
||||||
{
|
{
|
||||||
if (executable.isEmpty())
|
if (executable.isEmpty())
|
||||||
@@ -295,12 +295,12 @@ FilePathList Environment::findAllInPath(const QString &executable,
|
|||||||
return result.values();
|
return result.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList Environment::path() const
|
FilePaths Environment::path() const
|
||||||
{
|
{
|
||||||
return pathListValue("PATH");
|
return pathListValue("PATH");
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList Environment::pathListValue(const QString &varName) const
|
FilePaths Environment::pathListValue(const QString &varName) const
|
||||||
{
|
{
|
||||||
const QStringList pathComponents = expandedValueForKey(varName)
|
const QStringList pathComponents = expandedValueForKey(varName)
|
||||||
.split(OsSpecificAspects::pathListSeparator(m_osType), QString::SkipEmptyParts);
|
.split(OsSpecificAspects::pathListSeparator(m_osType), QString::SkipEmptyParts);
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ public:
|
|||||||
|
|
||||||
using PathFilter = std::function<bool(const FilePath &)>;
|
using PathFilter = std::function<bool(const FilePath &)>;
|
||||||
FilePath searchInPath(const QString &executable,
|
FilePath searchInPath(const QString &executable,
|
||||||
const FilePathList &additionalDirs = FilePathList(),
|
const FilePaths &additionalDirs = FilePaths(),
|
||||||
const PathFilter &func = PathFilter()) const;
|
const PathFilter &func = PathFilter()) const;
|
||||||
FilePathList findAllInPath(const QString &executable,
|
FilePaths findAllInPath(const QString &executable,
|
||||||
const FilePathList &additionalDirs = FilePathList(),
|
const FilePaths &additionalDirs = FilePaths(),
|
||||||
const PathFilter &func = PathFilter()) const;
|
const PathFilter &func = PathFilter()) const;
|
||||||
|
|
||||||
FilePathList path() const;
|
FilePaths path() const;
|
||||||
FilePathList pathListValue(const QString &varName) const;
|
FilePaths pathListValue(const QString &varName) const;
|
||||||
QStringList appendExeExtensions(const QString &executable) const;
|
QStringList appendExeExtensions(const QString &executable) const;
|
||||||
|
|
||||||
bool isSameExecutable(const QString &exe1, const QString &exe2) const;
|
bool isSameExecutable(const QString &exe1, const QString &exe2) const;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ FilePath FileInProjectFinder::projectDirectory() const
|
|||||||
return m_projectDir;
|
return m_projectDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileInProjectFinder::setProjectFiles(const FilePathList &projectFiles)
|
void FileInProjectFinder::setProjectFiles(const FilePaths &projectFiles)
|
||||||
{
|
{
|
||||||
if (m_projectFiles == projectFiles)
|
if (m_projectFiles == projectFiles)
|
||||||
return;
|
return;
|
||||||
@@ -142,12 +142,12 @@ void FileInProjectFinder::addMappedPath(const FilePath &localFilePath, const QSt
|
|||||||
folder specified. Third, we walk the list of project files, and search for a file name match
|
folder specified. Third, we walk the list of project files, and search for a file name match
|
||||||
there. If all fails, it returns the original path from the file URL.
|
there. If all fails, it returns the original path from the file URL.
|
||||||
*/
|
*/
|
||||||
FilePathList FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
|
FilePaths FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
|
||||||
{
|
{
|
||||||
qCDebug(finderLog) << "FileInProjectFinder: trying to find file" << fileUrl.toString() << "...";
|
qCDebug(finderLog) << "FileInProjectFinder: trying to find file" << fileUrl.toString() << "...";
|
||||||
|
|
||||||
if (fileUrl.scheme() == "qrc" || fileUrl.toString().startsWith(':')) {
|
if (fileUrl.scheme() == "qrc" || fileUrl.toString().startsWith(':')) {
|
||||||
const FilePathList result = m_qrcUrlFinder.find(fileUrl);
|
const FilePaths result = m_qrcUrlFinder.find(fileUrl);
|
||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
if (success)
|
if (success)
|
||||||
*success = true;
|
*success = true;
|
||||||
@@ -159,7 +159,7 @@ FilePathList FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) c
|
|||||||
if (originalPath.isEmpty()) // e.g. qrc://
|
if (originalPath.isEmpty()) // e.g. qrc://
|
||||||
originalPath = fileUrl.path();
|
originalPath = fileUrl.path();
|
||||||
|
|
||||||
FilePathList result;
|
FilePaths result;
|
||||||
bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) {
|
bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) {
|
||||||
result << FilePath::fromString(fileName);
|
result << FilePath::fromString(fileName);
|
||||||
});
|
});
|
||||||
@@ -446,12 +446,12 @@ QStringList FileInProjectFinder::bestMatches(const QStringList &filePaths,
|
|||||||
return bestFilePaths;
|
return bestFilePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList FileInProjectFinder::searchDirectories() const
|
FilePaths FileInProjectFinder::searchDirectories() const
|
||||||
{
|
{
|
||||||
return m_searchDirectories;
|
return m_searchDirectories;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileInProjectFinder::setAdditionalSearchDirectories(const FilePathList &searchDirectories)
|
void FileInProjectFinder::setAdditionalSearchDirectories(const FilePaths &searchDirectories)
|
||||||
{
|
{
|
||||||
m_searchDirectories = searchDirectories;
|
m_searchDirectories = searchDirectories;
|
||||||
}
|
}
|
||||||
@@ -461,7 +461,7 @@ FileInProjectFinder::PathMappingNode::~PathMappingNode()
|
|||||||
qDeleteAll(children);
|
qDeleteAll(children);
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList FileInProjectFinder::QrcUrlFinder::find(const QUrl &fileUrl) const
|
FilePaths FileInProjectFinder::QrcUrlFinder::find(const QUrl &fileUrl) const
|
||||||
{
|
{
|
||||||
const auto fileIt = m_fileCache.constFind(fileUrl);
|
const auto fileIt = m_fileCache.constFind(fileUrl);
|
||||||
if (fileIt != m_fileCache.cend())
|
if (fileIt != m_fileCache.cend())
|
||||||
@@ -476,19 +476,19 @@ FilePathList FileInProjectFinder::QrcUrlFinder::find(const QUrl &fileUrl) const
|
|||||||
qrcParser->collectFilesAtPath(QrcParser::normalizedQrcFilePath(fileUrl.toString()), &hits);
|
qrcParser->collectFilesAtPath(QrcParser::normalizedQrcFilePath(fileUrl.toString()), &hits);
|
||||||
}
|
}
|
||||||
hits.removeDuplicates();
|
hits.removeDuplicates();
|
||||||
const FilePathList result = transform(hits, &FilePath::fromString);
|
const FilePaths result = transform(hits, &FilePath::fromString);
|
||||||
m_fileCache.insert(fileUrl, result);
|
m_fileCache.insert(fileUrl, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileInProjectFinder::QrcUrlFinder::setProjectFiles(const FilePathList &projectFiles)
|
void FileInProjectFinder::QrcUrlFinder::setProjectFiles(const FilePaths &projectFiles)
|
||||||
{
|
{
|
||||||
m_allQrcFiles = filtered(projectFiles, [](const FilePath &f) { return f.endsWith(".qrc"); });
|
m_allQrcFiles = filtered(projectFiles, [](const FilePath &f) { return f.endsWith(".qrc"); });
|
||||||
m_fileCache.clear();
|
m_fileCache.clear();
|
||||||
m_parserCache.clear();
|
m_parserCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePath chooseFileFromList(const FilePathList &candidates)
|
FilePath chooseFileFromList(const FilePaths &candidates)
|
||||||
{
|
{
|
||||||
if (candidates.length() == 1)
|
if (candidates.length() == 1)
|
||||||
return candidates.first();
|
return candidates.first();
|
||||||
|
|||||||
@@ -50,17 +50,17 @@ public:
|
|||||||
void setProjectDirectory(const FilePath &absoluteProjectPath);
|
void setProjectDirectory(const FilePath &absoluteProjectPath);
|
||||||
FilePath projectDirectory() const;
|
FilePath projectDirectory() const;
|
||||||
|
|
||||||
void setProjectFiles(const FilePathList &projectFiles);
|
void setProjectFiles(const FilePaths &projectFiles);
|
||||||
void setSysroot(const FilePath &sysroot);
|
void setSysroot(const FilePath &sysroot);
|
||||||
|
|
||||||
void addMappedPath(const FilePath &localFilePath, const QString &remoteFilePath);
|
void addMappedPath(const FilePath &localFilePath, const QString &remoteFilePath);
|
||||||
|
|
||||||
FilePathList findFile(const QUrl &fileUrl, bool *success = nullptr) const;
|
FilePaths findFile(const QUrl &fileUrl, bool *success = nullptr) const;
|
||||||
bool findFileOrDirectory(const QString &originalPath, FileHandler fileHandler = nullptr,
|
bool findFileOrDirectory(const QString &originalPath, FileHandler fileHandler = nullptr,
|
||||||
DirectoryHandler directoryHandler = nullptr) const;
|
DirectoryHandler directoryHandler = nullptr) const;
|
||||||
|
|
||||||
FilePathList searchDirectories() const;
|
FilePaths searchDirectories() const;
|
||||||
void setAdditionalSearchDirectories(const FilePathList &searchDirectories);
|
void setAdditionalSearchDirectories(const FilePaths &searchDirectories);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct PathMappingNode
|
struct PathMappingNode
|
||||||
@@ -77,11 +77,11 @@ private:
|
|||||||
|
|
||||||
class QrcUrlFinder {
|
class QrcUrlFinder {
|
||||||
public:
|
public:
|
||||||
FilePathList find(const QUrl &fileUrl) const;
|
FilePaths find(const QUrl &fileUrl) const;
|
||||||
void setProjectFiles(const FilePathList &projectFiles);
|
void setProjectFiles(const FilePaths &projectFiles);
|
||||||
private:
|
private:
|
||||||
FilePathList m_allQrcFiles;
|
FilePaths m_allQrcFiles;
|
||||||
mutable QHash<QUrl, FilePathList> m_fileCache;
|
mutable QHash<QUrl, FilePaths> m_fileCache;
|
||||||
mutable QHash<FilePath, QSharedPointer<QrcParser>> m_parserCache;
|
mutable QHash<FilePath, QSharedPointer<QrcParser>> m_parserCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -100,14 +100,14 @@ private:
|
|||||||
|
|
||||||
FilePath m_projectDir;
|
FilePath m_projectDir;
|
||||||
FilePath m_sysroot;
|
FilePath m_sysroot;
|
||||||
FilePathList m_projectFiles;
|
FilePaths m_projectFiles;
|
||||||
FilePathList m_searchDirectories;
|
FilePaths m_searchDirectories;
|
||||||
PathMappingNode m_pathMapRoot;
|
PathMappingNode m_pathMapRoot;
|
||||||
|
|
||||||
mutable QHash<QString, CacheEntry> m_cache;
|
mutable QHash<QString, CacheEntry> m_cache;
|
||||||
QrcUrlFinder m_qrcUrlFinder;
|
QrcUrlFinder m_qrcUrlFinder;
|
||||||
};
|
};
|
||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT FilePath chooseFileFromList(const FilePathList &candidates);
|
QTCREATOR_UTILS_EXPORT FilePath chooseFileFromList(const FilePaths &candidates);
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ private:
|
|||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn);
|
QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn);
|
||||||
|
|
||||||
using FilePathList = QList<FilePath>;
|
using FilePaths = QList<FilePath>;
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT CommandLine
|
class QTCREATOR_UTILS_EXPORT CommandLine
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ QVariantMap SettingsAccessor::prepareToWriteSettings(const QVariantMap &data) co
|
|||||||
// BackingUpSettingsAccessor:
|
// BackingUpSettingsAccessor:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
FilePathList BackUpStrategy::readFileCandidates(const FilePath &baseFileName) const
|
FilePaths BackUpStrategy::readFileCandidates(const FilePath &baseFileName) const
|
||||||
{
|
{
|
||||||
|
|
||||||
const QFileInfo pfi = baseFileName.toFileInfo();
|
const QFileInfo pfi = baseFileName.toFileInfo();
|
||||||
@@ -264,7 +264,7 @@ BackingUpSettingsAccessor::BackingUpSettingsAccessor(std::unique_ptr<BackUpStrat
|
|||||||
SettingsAccessor::RestoreData
|
SettingsAccessor::RestoreData
|
||||||
BackingUpSettingsAccessor::readData(const FilePath &path, QWidget *parent) const
|
BackingUpSettingsAccessor::readData(const FilePath &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
const FilePathList fileList = readFileCandidates(path);
|
const FilePaths fileList = readFileCandidates(path);
|
||||||
if (fileList.isEmpty()) // No settings found at all.
|
if (fileList.isEmpty()) // No settings found at all.
|
||||||
return RestoreData(path, QVariantMap());
|
return RestoreData(path, QVariantMap());
|
||||||
|
|
||||||
@@ -301,9 +301,9 @@ BackingUpSettingsAccessor::writeData(const FilePath &path, const QVariantMap &da
|
|||||||
return SettingsAccessor::writeData(path, data, parent);
|
return SettingsAccessor::writeData(path, data, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList BackingUpSettingsAccessor::readFileCandidates(const FilePath &path) const
|
FilePaths BackingUpSettingsAccessor::readFileCandidates(const FilePath &path) const
|
||||||
{
|
{
|
||||||
FilePathList result = Utils::filteredUnique(m_strategy->readFileCandidates(path));
|
FilePaths result = Utils::filteredUnique(m_strategy->readFileCandidates(path));
|
||||||
if (result.removeOne(baseFilePath()))
|
if (result.removeOne(baseFilePath()))
|
||||||
result.prepend(baseFilePath());
|
result.prepend(baseFilePath());
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ FilePathList BackingUpSettingsAccessor::readFileCandidates(const FilePath &path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SettingsAccessor::RestoreData
|
SettingsAccessor::RestoreData
|
||||||
BackingUpSettingsAccessor::bestReadFileData(const FilePathList &candidates, QWidget *parent) const
|
BackingUpSettingsAccessor::bestReadFileData(const FilePaths &candidates, QWidget *parent) const
|
||||||
{
|
{
|
||||||
SettingsAccessor::RestoreData bestMatch;
|
SettingsAccessor::RestoreData bestMatch;
|
||||||
for (const FilePath &c : candidates) {
|
for (const FilePath &c : candidates) {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class QTCREATOR_UTILS_EXPORT BackUpStrategy
|
|||||||
public:
|
public:
|
||||||
virtual ~BackUpStrategy() = default;
|
virtual ~BackUpStrategy() = default;
|
||||||
|
|
||||||
virtual FilePathList readFileCandidates(const FilePath &baseFileName) const;
|
virtual FilePaths readFileCandidates(const FilePath &baseFileName) const;
|
||||||
// Return -1 if data1 is better that data2, 0 if both are equally worthwhile
|
// Return -1 if data1 is better that data2, 0 if both are equally worthwhile
|
||||||
// and 1 if data2 is better than data1
|
// and 1 if data2 is better than data1
|
||||||
virtual int compare(const SettingsAccessor::RestoreData &data1,
|
virtual int compare(const SettingsAccessor::RestoreData &data1,
|
||||||
@@ -179,8 +179,8 @@ public:
|
|||||||
BackUpStrategy *strategy() const { return m_strategy.get(); }
|
BackUpStrategy *strategy() const { return m_strategy.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FilePathList readFileCandidates(const FilePath &path) const;
|
FilePaths readFileCandidates(const FilePath &path) const;
|
||||||
RestoreData bestReadFileData(const FilePathList &candidates, QWidget *parent) const;
|
RestoreData bestReadFileData(const FilePaths &candidates, QWidget *parent) const;
|
||||||
void backupFile(const FilePath &path, const QVariantMap &data, QWidget *parent) const;
|
void backupFile(const FilePath &path, const QVariantMap &data, QWidget *parent) const;
|
||||||
|
|
||||||
std::unique_ptr<BackUpStrategy> m_strategy;
|
std::unique_ptr<BackUpStrategy> m_strategy;
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ QSet<QString> TestTreeItem::dependingInternalTargets(CppTools::CppModelManager *
|
|||||||
bool wasHeader;
|
bool wasHeader;
|
||||||
const QString correspondingFile
|
const QString correspondingFile
|
||||||
= CppTools::correspondingHeaderOrSource(file, &wasHeader, CppTools::CacheUsage::ReadOnly);
|
= CppTools::correspondingHeaderOrSource(file, &wasHeader, CppTools::CacheUsage::ReadOnly);
|
||||||
const Utils::FilePathList dependingFiles = snapshot.filesDependingOn(
|
const Utils::FilePaths dependingFiles = snapshot.filesDependingOn(
|
||||||
wasHeader ? file : correspondingFile);
|
wasHeader ? file : correspondingFile);
|
||||||
for (const Utils::FilePath &fn : dependingFiles) {
|
for (const Utils::FilePath &fn : dependingFiles) {
|
||||||
for (const CppTools::ProjectPart::Ptr &part : cppMM->projectPart(fn))
|
for (const CppTools::ProjectPart::Ptr &part : cppMM->projectPart(fn))
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ QString ArtisticStyle::configurationFile() const
|
|||||||
if (m_settings.useOtherFiles()) {
|
if (m_settings.useOtherFiles()) {
|
||||||
if (const ProjectExplorer::Project *project
|
if (const ProjectExplorer::Project *project
|
||||||
= ProjectExplorer::ProjectTree::currentProject()) {
|
= ProjectExplorer::ProjectTree::currentProject()) {
|
||||||
const Utils::FilePathList astyleRcfiles = project->files(
|
const Utils::FilePaths astyleRcfiles = project->files(
|
||||||
[](const ProjectExplorer::Node *n) { return n->filePath().endsWith(".astylerc"); });
|
[](const ProjectExplorer::Node *n) { return n->filePath().endsWith(".astylerc"); });
|
||||||
for (const Utils::FilePath &file : astyleRcfiles) {
|
for (const Utils::FilePath &file : astyleRcfiles) {
|
||||||
const QFileInfo fi = file.toFileInfo();
|
const QFileInfo fi = file.toFileInfo();
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ QString Uncrustify::configurationFile() const
|
|||||||
if (m_settings.useOtherFiles()) {
|
if (m_settings.useOtherFiles()) {
|
||||||
if (const ProjectExplorer::Project *project
|
if (const ProjectExplorer::Project *project
|
||||||
= ProjectExplorer::ProjectTree::currentProject()) {
|
= ProjectExplorer::ProjectTree::currentProject()) {
|
||||||
const Utils::FilePathList files = project->files(
|
const Utils::FilePaths files = project->files(
|
||||||
[](const ProjectExplorer::Node *n) { return n->filePath().endsWith("cfg"); });
|
[](const ProjectExplorer::Node *n) { return n->filePath().endsWith("cfg"); });
|
||||||
for (const Utils::FilePath &file : files) {
|
for (const Utils::FilePath &file : files) {
|
||||||
const QFileInfo fi = file.toFileInfo();
|
const QFileInfo fi = file.toFileInfo();
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void newExtraCompiler(const ProjectExplorer::Project *,
|
void newExtraCompiler(const ProjectExplorer::Project *,
|
||||||
const Utils::FilePath &,
|
const Utils::FilePath &,
|
||||||
const Utils::FilePathList &targets) override
|
const Utils::FilePaths &targets) override
|
||||||
{
|
{
|
||||||
auto filePaths = Utils::transform<ClangBackEnd::FilePaths>(targets,
|
auto filePaths = Utils::transform<ClangBackEnd::FilePaths>(targets,
|
||||||
[](const Utils::FilePath &filePath) {
|
[](const Utils::FilePath &filePath) {
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
|
|||||||
d->docLocker.unlock();
|
d->docLocker.unlock();
|
||||||
|
|
||||||
// recalculate file list
|
// recalculate file list
|
||||||
FilePathList fileList;
|
FilePaths fileList;
|
||||||
|
|
||||||
// check all projects
|
// check all projects
|
||||||
for (const Project *prj : SessionManager::projects())
|
for (const Project *prj : SessionManager::projects())
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeBuildSystem::findExtraCompilers()
|
|||||||
|
|
||||||
// Find all files generated by any of the extra compilers, in a rather crude way.
|
// Find all files generated by any of the extra compilers, in a rather crude way.
|
||||||
Project *p = project();
|
Project *p = project();
|
||||||
const FilePathList fileList = p->files([&fileExtensions, p](const Node *n) {
|
const FilePaths fileList = p->files([&fileExtensions, p](const Node *n) {
|
||||||
if (!p->SourceFiles(n))
|
if (!p->SourceFiles(n))
|
||||||
return false;
|
return false;
|
||||||
const QString fp = n->filePath().toString();
|
const QString fp = n->filePath().toString();
|
||||||
@@ -660,7 +660,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeBuildSystem::findExtraCompilers()
|
|||||||
if (generated.isEmpty())
|
if (generated.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const FilePathList fileNames = transform(generated, [](const QString &s) {
|
const FilePaths fileNames = transform(generated, [](const QString &s) {
|
||||||
return FilePath::fromString(s);
|
return FilePath::fromString(s);
|
||||||
});
|
});
|
||||||
extraCompilers.append(factory->create(p, file, fileNames));
|
extraCompilers.append(factory->create(p, file, fileNames));
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ int distance(const FilePath &targetDirectory, const FilePath &fileName)
|
|||||||
void CMakeCbpParser::sortFiles()
|
void CMakeCbpParser::sortFiles()
|
||||||
{
|
{
|
||||||
QLoggingCategory log("qtc.cmakeprojectmanager.filetargetmapping", QtWarningMsg);
|
QLoggingCategory log("qtc.cmakeprojectmanager.filetargetmapping", QtWarningMsg);
|
||||||
FilePathList fileNames = transform<QList>(m_fileList, &FileNode::filePath);
|
FilePaths fileNames = transform<QList>(m_fileList, &FileNode::filePath);
|
||||||
|
|
||||||
sort(fileNames);
|
sort(fileNames);
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools()
|
|||||||
{
|
{
|
||||||
Utils::Environment env = Environment::systemEnvironment();
|
Utils::Environment env = Environment::systemEnvironment();
|
||||||
|
|
||||||
Utils::FilePathList path = env.path();
|
Utils::FilePaths path = env.path();
|
||||||
path = Utils::filteredUnique(path);
|
path = Utils::filteredUnique(path);
|
||||||
|
|
||||||
if (HostOsInfo::isWindowsHost()) {
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
@@ -93,7 +93,7 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools()
|
|||||||
|
|
||||||
const QStringList execs = env.appendExeExtensions(QLatin1String("cmake"));
|
const QStringList execs = env.appendExeExtensions(QLatin1String("cmake"));
|
||||||
|
|
||||||
FilePathList suspects;
|
FilePaths suspects;
|
||||||
foreach (const Utils::FilePath &base, path) {
|
foreach (const Utils::FilePath &base, path) {
|
||||||
if (base.isEmpty())
|
if (base.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ public:
|
|||||||
NumberOfColumns
|
NumberOfColumns
|
||||||
};
|
};
|
||||||
|
|
||||||
void initDialog(const FilePathList &filePaths);
|
void initDialog(const FilePaths &filePaths);
|
||||||
void promptFailWarning(const FilePathList &files, ReadOnlyFilesDialog::ReadOnlyResult type) const;
|
void promptFailWarning(const FilePaths &files, ReadOnlyFilesDialog::ReadOnlyResult type) const;
|
||||||
QRadioButton *createRadioButtonForItem(QTreeWidgetItem *item, QButtonGroup *group, ReadOnlyFilesTreeColumn type);
|
QRadioButton *createRadioButtonForItem(QTreeWidgetItem *item, QButtonGroup *group, ReadOnlyFilesTreeColumn type);
|
||||||
|
|
||||||
void setAll(int index);
|
void setAll(int index);
|
||||||
@@ -143,7 +143,7 @@ using namespace Internal;
|
|||||||
* and Save As which is used to save the changes to a document in another file.
|
* and Save As which is used to save the changes to a document in another file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ReadOnlyFilesDialog::ReadOnlyFilesDialog(const Utils::FilePathList &filePaths, QWidget *parent)
|
ReadOnlyFilesDialog::ReadOnlyFilesDialog(const Utils::FilePaths &filePaths, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, d(new ReadOnlyFilesDialogPrivate(this))
|
, d(new ReadOnlyFilesDialogPrivate(this))
|
||||||
{
|
{
|
||||||
@@ -170,7 +170,7 @@ ReadOnlyFilesDialog::ReadOnlyFilesDialog(const QList<IDocument *> &documents, QW
|
|||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, d(new ReadOnlyFilesDialogPrivate(this))
|
, d(new ReadOnlyFilesDialogPrivate(this))
|
||||||
{
|
{
|
||||||
FilePathList files;
|
FilePaths files;
|
||||||
for (IDocument *document : documents)
|
for (IDocument *document : documents)
|
||||||
files << document->filePath();
|
files << document->filePath();
|
||||||
d->initDialog(files);
|
d->initDialog(files);
|
||||||
@@ -205,7 +205,7 @@ void ReadOnlyFilesDialog::setShowFailWarning(bool show, const QString &warning)
|
|||||||
* Opens a message box with an error description according to the type.
|
* Opens a message box with an error description according to the type.
|
||||||
* \internal
|
* \internal
|
||||||
*/
|
*/
|
||||||
void ReadOnlyFilesDialogPrivate::promptFailWarning(const FilePathList &files, ReadOnlyFilesDialog::ReadOnlyResult type) const
|
void ReadOnlyFilesDialogPrivate::promptFailWarning(const FilePaths &files, ReadOnlyFilesDialog::ReadOnlyResult type) const
|
||||||
{
|
{
|
||||||
if (files.isEmpty())
|
if (files.isEmpty())
|
||||||
return;
|
return;
|
||||||
@@ -281,7 +281,7 @@ int ReadOnlyFilesDialog::exec()
|
|||||||
return RO_Cancel;
|
return RO_Cancel;
|
||||||
|
|
||||||
ReadOnlyResult result = RO_Cancel;
|
ReadOnlyResult result = RO_Cancel;
|
||||||
FilePathList failedToMakeWritable;
|
FilePaths failedToMakeWritable;
|
||||||
for (ReadOnlyFilesDialogPrivate::ButtonGroupForFile buttongroup : qAsConst(d->buttonGroups)) {
|
for (ReadOnlyFilesDialogPrivate::ButtonGroupForFile buttongroup : qAsConst(d->buttonGroups)) {
|
||||||
result = static_cast<ReadOnlyResult>(buttongroup.group->checkedId());
|
result = static_cast<ReadOnlyResult>(buttongroup.group->checkedId());
|
||||||
switch (result) {
|
switch (result) {
|
||||||
@@ -388,7 +388,7 @@ void ReadOnlyFilesDialogPrivate::updateSelectAll()
|
|||||||
* dialog.
|
* dialog.
|
||||||
* \internal
|
* \internal
|
||||||
*/
|
*/
|
||||||
void ReadOnlyFilesDialogPrivate::initDialog(const FilePathList &filePaths)
|
void ReadOnlyFilesDialogPrivate::initDialog(const FilePaths &filePaths)
|
||||||
{
|
{
|
||||||
ui.setupUi(q);
|
ui.setupUi(q);
|
||||||
ui.buttonBox->addButton(tr("Change &Permission"), QDialogButtonBox::AcceptRole);
|
ui.buttonBox->addButton(tr("Change &Permission"), QDialogButtonBox::AcceptRole);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
RO_SaveAs = SaveAs
|
RO_SaveAs = SaveAs
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit ReadOnlyFilesDialog(const Utils::FilePathList &filePaths,
|
explicit ReadOnlyFilesDialog(const Utils::FilePaths &filePaths,
|
||||||
QWidget *parent = nullptr);
|
QWidget *parent = nullptr);
|
||||||
explicit ReadOnlyFilesDialog(const Utils::FilePath &filePath,
|
explicit ReadOnlyFilesDialog(const Utils::FilePath &filePath,
|
||||||
QWidget * parent = nullptr);
|
QWidget * parent = nullptr);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<BaseFileFilter::Iterator> iterator;
|
QSharedPointer<BaseFileFilter::Iterator> iterator;
|
||||||
FilePathList previousResultPaths;
|
FilePaths previousResultPaths;
|
||||||
bool forceNewSearchList;
|
bool forceNewSearchList;
|
||||||
QString previousEntry;
|
QString previousEntry;
|
||||||
};
|
};
|
||||||
@@ -220,7 +220,7 @@ void BaseFileFilter::updatePreviousResultData()
|
|||||||
// forceNewSearchList was already reset in prepareSearch
|
// forceNewSearchList was already reset in prepareSearch
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseFileFilter::ListIterator::ListIterator(const FilePathList &filePaths)
|
BaseFileFilter::ListIterator::ListIterator(const FilePaths &filePaths)
|
||||||
{
|
{
|
||||||
m_filePaths = filePaths;
|
m_filePaths = filePaths;
|
||||||
toFront();
|
toFront();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
|
|
||||||
class CORE_EXPORT ListIterator : public Iterator {
|
class CORE_EXPORT ListIterator : public Iterator {
|
||||||
public:
|
public:
|
||||||
ListIterator(const Utils::FilePathList &filePaths);
|
ListIterator(const Utils::FilePaths &filePaths);
|
||||||
|
|
||||||
void toFront() override;
|
void toFront() override;
|
||||||
bool hasNext() const override;
|
bool hasNext() const override;
|
||||||
@@ -59,8 +59,8 @@ public:
|
|||||||
Utils::FilePath filePath() const override;
|
Utils::FilePath filePath() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Utils::FilePathList m_filePaths;
|
Utils::FilePaths m_filePaths;
|
||||||
Utils::FilePathList::const_iterator m_pathPosition;
|
Utils::FilePaths::const_iterator m_pathPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
BaseFileFilter();
|
BaseFileFilter();
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
|
|||||||
}
|
}
|
||||||
Utils::SubDirFileIterator subDirIterator(directories, m_filters, m_exclusionFilters);
|
Utils::SubDirFileIterator subDirIterator(directories, m_filters, m_exclusionFilters);
|
||||||
future.setProgressRange(0, subDirIterator.maxProgress());
|
future.setProgressRange(0, subDirIterator.maxProgress());
|
||||||
Utils::FilePathList filesFound;
|
Utils::FilePaths filesFound;
|
||||||
auto end = subDirIterator.end();
|
auto end = subDirIterator.end();
|
||||||
for (auto it = subDirIterator.begin(); it != end; ++it) {
|
for (auto it = subDirIterator.begin(); it != end; ++it) {
|
||||||
if (future.isCanceled())
|
if (future.isCanceled())
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ private:
|
|||||||
QDialog *m_dialog = nullptr;
|
QDialog *m_dialog = nullptr;
|
||||||
Internal::Ui::DirectoryFilterOptions *m_ui = nullptr;
|
Internal::Ui::DirectoryFilterOptions *m_ui = nullptr;
|
||||||
mutable QMutex m_lock;
|
mutable QMutex m_lock;
|
||||||
Utils::FilePathList m_files;
|
Utils::FilePaths m_files;
|
||||||
bool m_isCustomFilter = true;
|
bool m_isCustomFilter = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ QTC_DECLARE_MYTESTDATADIR("../../../../tests/locators/")
|
|||||||
class MyBaseFileFilter : public Core::BaseFileFilter
|
class MyBaseFileFilter : public Core::BaseFileFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyBaseFileFilter(const Utils::FilePathList &theFiles)
|
MyBaseFileFilter(const Utils::FilePaths &theFiles)
|
||||||
{
|
{
|
||||||
setFileIterator(new BaseFileFilter::ListIterator(theFiles));
|
setFileIterator(new BaseFileFilter::ListIterator(theFiles));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ void SpotlightLocatorFilter::prepareSearch(const QString &entry)
|
|||||||
{
|
{
|
||||||
const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry);
|
const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry);
|
||||||
if (fp.filePath.isEmpty()) {
|
if (fp.filePath.isEmpty()) {
|
||||||
setFileIterator(new BaseFileFilter::ListIterator(Utils::FilePathList()));
|
setFileIterator(new BaseFileFilter::ListIterator(Utils::FilePaths()));
|
||||||
} else {
|
} else {
|
||||||
// only pass the file name part to spotlight to allow searches like "somepath/*foo"
|
// only pass the file name part to spotlight to allow searches like "somepath/*foo"
|
||||||
int lastSlash = fp.filePath.lastIndexOf(QLatin1Char('/'));
|
int lastSlash = fp.filePath.lastIndexOf(QLatin1Char('/'));
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ CppcheckOptions ManualRunDialog::options() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList ManualRunDialog::filePaths() const
|
Utils::FilePaths ManualRunDialog::filePaths() const
|
||||||
{
|
{
|
||||||
return m_model->selectedFiles();
|
return m_model->selectedFiles();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
class FilePath;
|
class FilePath;
|
||||||
using FilePathList = QList<FilePath>;
|
using FilePaths = QList<FilePath>;
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
const ProjectExplorer::Project *project);
|
const ProjectExplorer::Project *project);
|
||||||
|
|
||||||
CppcheckOptions options() const;
|
CppcheckOptions options() const;
|
||||||
Utils::FilePathList filePaths() const;
|
Utils::FilePaths filePaths() const;
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -77,10 +77,10 @@ void CppcheckRunner::reconfigure(const QString &binary, const QString &arguments
|
|||||||
m_arguments = arguments;
|
m_arguments = arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckRunner::addToQueue(const Utils::FilePathList &files,
|
void CppcheckRunner::addToQueue(const Utils::FilePaths &files,
|
||||||
const QString &additionalArguments)
|
const QString &additionalArguments)
|
||||||
{
|
{
|
||||||
Utils::FilePathList &existing = m_queue[additionalArguments];
|
Utils::FilePaths &existing = m_queue[additionalArguments];
|
||||||
if (existing.isEmpty()) {
|
if (existing.isEmpty()) {
|
||||||
existing = files;
|
existing = files;
|
||||||
} else {
|
} else {
|
||||||
@@ -96,7 +96,7 @@ void CppcheckRunner::addToQueue(const Utils::FilePathList &files,
|
|||||||
m_queueTimer.start();
|
m_queueTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckRunner::stop(const Utils::FilePathList &files)
|
void CppcheckRunner::stop(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
if (!m_isRunning)
|
if (!m_isRunning)
|
||||||
return;
|
return;
|
||||||
@@ -105,7 +105,7 @@ void CppcheckRunner::stop(const Utils::FilePathList &files)
|
|||||||
m_process->kill();
|
m_process->kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckRunner::removeFromQueue(const Utils::FilePathList &files)
|
void CppcheckRunner::removeFromQueue(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
if (m_queue.isEmpty())
|
if (m_queue.isEmpty())
|
||||||
return;
|
return;
|
||||||
@@ -121,7 +121,7 @@ void CppcheckRunner::removeFromQueue(const Utils::FilePathList &files)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Utils::FilePathList &CppcheckRunner::currentFiles() const
|
const Utils::FilePaths &CppcheckRunner::currentFiles() const
|
||||||
{
|
{
|
||||||
return m_currentFiles;
|
return m_currentFiles;
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ void CppcheckRunner::checkQueued()
|
|||||||
if (m_queue.isEmpty() || m_binary.isEmpty())
|
if (m_queue.isEmpty() || m_binary.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Utils::FilePathList files = m_queue.begin().value();
|
Utils::FilePaths files = m_queue.begin().value();
|
||||||
QString arguments = m_arguments + ' ' + m_queue.begin().key();
|
QString arguments = m_arguments + ' ' + m_queue.begin().key();
|
||||||
m_currentFiles.clear();
|
m_currentFiles.clear();
|
||||||
int argumentsLength = arguments.length();
|
int argumentsLength = arguments.length();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
class QtcProcess;
|
class QtcProcess;
|
||||||
class FilePath;
|
class FilePath;
|
||||||
using FilePathList = QList<FilePath>;
|
using FilePaths = QList<FilePath>;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Cppcheck {
|
namespace Cppcheck {
|
||||||
@@ -48,12 +48,12 @@ public:
|
|||||||
~CppcheckRunner() override;
|
~CppcheckRunner() override;
|
||||||
|
|
||||||
void reconfigure(const QString &binary, const QString &arguments);
|
void reconfigure(const QString &binary, const QString &arguments);
|
||||||
void addToQueue(const Utils::FilePathList &files,
|
void addToQueue(const Utils::FilePaths &files,
|
||||||
const QString &additionalArguments = {});
|
const QString &additionalArguments = {});
|
||||||
void removeFromQueue(const Utils::FilePathList &files);
|
void removeFromQueue(const Utils::FilePaths &files);
|
||||||
void stop(const Utils::FilePathList &files = {});
|
void stop(const Utils::FilePaths &files = {});
|
||||||
|
|
||||||
const Utils::FilePathList ¤tFiles() const;
|
const Utils::FilePaths ¤tFiles() const;
|
||||||
QString currentCommand() const;
|
QString currentCommand() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -67,8 +67,8 @@ private:
|
|||||||
Utils::QtcProcess *m_process = nullptr;
|
Utils::QtcProcess *m_process = nullptr;
|
||||||
QString m_binary;
|
QString m_binary;
|
||||||
QString m_arguments;
|
QString m_arguments;
|
||||||
QHash<QString, Utils::FilePathList> m_queue;
|
QHash<QString, Utils::FilePaths> m_queue;
|
||||||
Utils::FilePathList m_currentFiles;
|
Utils::FilePaths m_currentFiles;
|
||||||
QTimer m_queueTimer;
|
QTimer m_queueTimer;
|
||||||
int m_maxArgumentsLength = 32767;
|
int m_maxArgumentsLength = 32767;
|
||||||
bool m_isRunning = false;
|
bool m_isRunning = false;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void CppcheckTextMarkManager::add(const Diagnostic &diagnostic)
|
|||||||
fileMarks.push_back(std::make_unique<CppcheckTextMark>(diagnostic));
|
fileMarks.push_back(std::make_unique<CppcheckTextMark>(diagnostic));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckTextMarkManager::clearFiles(const Utils::FilePathList &files)
|
void CppcheckTextMarkManager::clearFiles(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
if (m_marks.empty())
|
if (m_marks.empty())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
~CppcheckTextMarkManager() override;
|
~CppcheckTextMarkManager() override;
|
||||||
|
|
||||||
void add(const Diagnostic &diagnostic) override;
|
void add(const Diagnostic &diagnostic) override;
|
||||||
void clearFiles(const Utils::FilePathList &files);
|
void clearFiles(const Utils::FilePaths &files);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using MarkPtr = std::unique_ptr<CppcheckTextMark>;
|
using MarkPtr = std::unique_ptr<CppcheckTextMark>;
|
||||||
|
|||||||
@@ -181,11 +181,11 @@ const CppcheckOptions &CppcheckTool::options() const
|
|||||||
return m_options;
|
return m_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckTool::check(const Utils::FilePathList &files)
|
void CppcheckTool::check(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_project, return);
|
QTC_ASSERT(m_project, return);
|
||||||
|
|
||||||
Utils::FilePathList filtered;
|
Utils::FilePaths filtered;
|
||||||
if (m_filters.isEmpty()) {
|
if (m_filters.isEmpty()) {
|
||||||
filtered = files;
|
filtered = files;
|
||||||
} else {
|
} else {
|
||||||
@@ -208,7 +208,7 @@ void CppcheckTool::check(const Utils::FilePathList &files)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<CppTools::ProjectPart::Ptr, Utils::FilePathList> groups;
|
std::map<CppTools::ProjectPart::Ptr, Utils::FilePaths> groups;
|
||||||
for (const Utils::FilePath &file : qAsConst(filtered)) {
|
for (const Utils::FilePath &file : qAsConst(filtered)) {
|
||||||
const QString stringed = file.toString();
|
const QString stringed = file.toString();
|
||||||
for (const CppTools::ProjectPart::Ptr &part : parts) {
|
for (const CppTools::ProjectPart::Ptr &part : parts) {
|
||||||
@@ -224,7 +224,7 @@ void CppcheckTool::check(const Utils::FilePathList &files)
|
|||||||
addToQueue(group.second, *group.first);
|
addToQueue(group.second, *group.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckTool::addToQueue(const Utils::FilePathList &files, CppTools::ProjectPart &part)
|
void CppcheckTool::addToQueue(const Utils::FilePaths &files, CppTools::ProjectPart &part)
|
||||||
{
|
{
|
||||||
const QString key = part.id();
|
const QString key = part.id();
|
||||||
if (!m_cachedAdditionalArguments.contains(key))
|
if (!m_cachedAdditionalArguments.contains(key))
|
||||||
@@ -232,7 +232,7 @@ void CppcheckTool::addToQueue(const Utils::FilePathList &files, CppTools::Projec
|
|||||||
m_runner->addToQueue(files, m_cachedAdditionalArguments[key]);
|
m_runner->addToQueue(files, m_cachedAdditionalArguments[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckTool::stop(const Utils::FilePathList &files)
|
void CppcheckTool::stop(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
m_runner->removeFromQueue(files);
|
m_runner->removeFromQueue(files);
|
||||||
m_runner->stop(files);
|
m_runner->stop(files);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
class FilePath;
|
class FilePath;
|
||||||
using FilePathList = QList<FilePath>;
|
using FilePaths = QList<FilePath>;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CppTools {
|
namespace CppTools {
|
||||||
@@ -63,8 +63,8 @@ public:
|
|||||||
|
|
||||||
void updateOptions(const CppcheckOptions &options);
|
void updateOptions(const CppcheckOptions &options);
|
||||||
void setProject(ProjectExplorer::Project *project);
|
void setProject(ProjectExplorer::Project *project);
|
||||||
void check(const Utils::FilePathList &files);
|
void check(const Utils::FilePaths &files);
|
||||||
void stop(const Utils::FilePathList &files);
|
void stop(const Utils::FilePaths &files);
|
||||||
|
|
||||||
void startParsing();
|
void startParsing();
|
||||||
void parseOutputLine(const QString &line);
|
void parseOutputLine(const QString &line);
|
||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void updateArguments();
|
void updateArguments();
|
||||||
void addToQueue(const Utils::FilePathList &files, CppTools::ProjectPart &part);
|
void addToQueue(const Utils::FilePaths &files, CppTools::ProjectPart &part);
|
||||||
QStringList additionalArguments(const CppTools::ProjectPart &part) const;
|
QStringList additionalArguments(const CppTools::ProjectPart &part) const;
|
||||||
|
|
||||||
CppcheckDiagnosticManager &m_manager;
|
CppcheckDiagnosticManager &m_manager;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void CppcheckTrigger::checkEditors(const QList<Core::IEditor *> &editors)
|
|||||||
const QList<Core::IEditor *> editorList = !editors.isEmpty()
|
const QList<Core::IEditor *> editorList = !editors.isEmpty()
|
||||||
? editors : Core::DocumentModel::editorsForOpenedDocuments();
|
? editors : Core::DocumentModel::editorsForOpenedDocuments();
|
||||||
|
|
||||||
Utils::FilePathList toCheck;
|
Utils::FilePaths toCheck;
|
||||||
for (const Core::IEditor *editor : editorList) {
|
for (const Core::IEditor *editor : editorList) {
|
||||||
QTC_ASSERT(editor, continue);
|
QTC_ASSERT(editor, continue);
|
||||||
Core::IDocument *document = editor->document();
|
Core::IDocument *document = editor->document();
|
||||||
@@ -128,7 +128,7 @@ void CppcheckTrigger::removeEditors(const QList<Core::IEditor *> &editors)
|
|||||||
const QList<Core::IEditor *> editorList = !editors.isEmpty()
|
const QList<Core::IEditor *> editorList = !editors.isEmpty()
|
||||||
? editors : Core::DocumentModel::editorsForOpenedDocuments();
|
? editors : Core::DocumentModel::editorsForOpenedDocuments();
|
||||||
|
|
||||||
Utils::FilePathList toRemove;
|
Utils::FilePaths toRemove;
|
||||||
for (const Core::IEditor *editor : editorList) {
|
for (const Core::IEditor *editor : editorList) {
|
||||||
QTC_ASSERT(editor, return);
|
QTC_ASSERT(editor, return);
|
||||||
const Core::IDocument *document = editor->document();
|
const Core::IDocument *document = editor->document();
|
||||||
@@ -185,12 +185,12 @@ void CppcheckTrigger::updateProjectFiles(ProjectExplorer::Project *project)
|
|||||||
checkEditors(Core::DocumentModel::editorsForOpenedDocuments());
|
checkEditors(Core::DocumentModel::editorsForOpenedDocuments());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckTrigger::check(const Utils::FilePathList &files)
|
void CppcheckTrigger::check(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
m_tool.check(files);
|
m_tool.check(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppcheckTrigger::remove(const Utils::FilePathList &files)
|
void CppcheckTrigger::remove(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
m_marks.clearFiles(files);
|
m_marks.clearFiles(files);
|
||||||
m_tool.stop(files);
|
m_tool.stop(files);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
class FilePath;
|
class FilePath;
|
||||||
using FilePathList = QList<FilePath>;
|
using FilePaths = QList<FilePath>;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -64,8 +64,8 @@ private:
|
|||||||
void checkChangedDocument(Core::IDocument *document);
|
void checkChangedDocument(Core::IDocument *document);
|
||||||
void changeCurrentProject(ProjectExplorer::Project *project);
|
void changeCurrentProject(ProjectExplorer::Project *project);
|
||||||
void updateProjectFiles(ProjectExplorer::Project *project);
|
void updateProjectFiles(ProjectExplorer::Project *project);
|
||||||
void check(const Utils::FilePathList &files);
|
void check(const Utils::FilePaths &files);
|
||||||
void remove(const Utils::FilePathList &files);
|
void remove(const Utils::FilePaths &files);
|
||||||
|
|
||||||
CppcheckTextMarkManager &m_marks;
|
CppcheckTextMarkManager &m_marks;
|
||||||
CppcheckTool &m_tool;
|
CppcheckTool &m_tool;
|
||||||
|
|||||||
@@ -1960,7 +1960,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
|
|||||||
|
|
||||||
Snapshot localForwardHeaders = forwardHeaders;
|
Snapshot localForwardHeaders = forwardHeaders;
|
||||||
localForwardHeaders.insert(interface.snapshot().document(info->fileName()));
|
localForwardHeaders.insert(interface.snapshot().document(info->fileName()));
|
||||||
Utils::FilePathList headerAndItsForwardingHeaders;
|
Utils::FilePaths headerAndItsForwardingHeaders;
|
||||||
headerAndItsForwardingHeaders << Utils::FilePath::fromString(info->fileName());
|
headerAndItsForwardingHeaders << Utils::FilePath::fromString(info->fileName());
|
||||||
headerAndItsForwardingHeaders += localForwardHeaders.filesDependingOn(info->fileName());
|
headerAndItsForwardingHeaders += localForwardHeaders.filesDependingOn(info->fileName());
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ static QString findResourceInProject(const QString &resName)
|
|||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
if (auto *project = ProjectExplorer::ProjectTree::currentProject()) {
|
if (auto *project = ProjectExplorer::ProjectTree::currentProject()) {
|
||||||
const Utils::FilePathList files = project->files(
|
const Utils::FilePaths files = project->files(
|
||||||
[](const ProjectExplorer::Node *n) { return n->filePath().endsWith(".qrc"); });
|
[](const ProjectExplorer::Node *n) { return n->filePath().endsWith(".qrc"); });
|
||||||
for (const Utils::FilePath &file : files) {
|
for (const Utils::FilePath &file : files) {
|
||||||
const QFileInfo fi = file.toFileInfo();
|
const QFileInfo fi = file.toFileInfo();
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ void BuiltinEditorDocumentParser::addFileAndDependencies(Snapshot *snapshot,
|
|||||||
|
|
||||||
toRemove->insert(fileName);
|
toRemove->insert(fileName);
|
||||||
if (fileName != Utils::FilePath::fromString(filePath())) {
|
if (fileName != Utils::FilePath::fromString(filePath())) {
|
||||||
Utils::FilePathList deps = snapshot->filesDependingOn(fileName);
|
Utils::FilePaths deps = snapshot->filesDependingOn(fileName);
|
||||||
toRemove->unite(Utils::toSet(deps));
|
toRemove->unite(Utils::toSet(deps));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ static void find_helper(QFutureInterface<CPlusPlus::Usage> &future,
|
|||||||
|
|
||||||
const Utils::FilePath sourceFile = Utils::FilePath::fromUtf8(symbol->fileName(),
|
const Utils::FilePath sourceFile = Utils::FilePath::fromUtf8(symbol->fileName(),
|
||||||
symbol->fileNameLength());
|
symbol->fileNameLength());
|
||||||
Utils::FilePathList files{sourceFile};
|
Utils::FilePaths files{sourceFile};
|
||||||
|
|
||||||
if (symbol->isClass()
|
if (symbol->isClass()
|
||||||
|| symbol->isForwardClassDeclaration()
|
|| symbol->isForwardClassDeclaration()
|
||||||
@@ -689,7 +689,7 @@ static void findMacroUses_helper(QFutureInterface<CPlusPlus::Usage> &future,
|
|||||||
const CPlusPlus::Macro macro)
|
const CPlusPlus::Macro macro)
|
||||||
{
|
{
|
||||||
const Utils::FilePath sourceFile = Utils::FilePath::fromString(macro.fileName());
|
const Utils::FilePath sourceFile = Utils::FilePath::fromString(macro.fileName());
|
||||||
Utils::FilePathList files{sourceFile};
|
Utils::FilePaths files{sourceFile};
|
||||||
files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile));
|
files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile));
|
||||||
|
|
||||||
future.setProgressRange(0, files.size());
|
future.setProgressRange(0, files.size());
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ void CppIncludesFilter::prepareSearch(const QString &entry)
|
|||||||
m_needsUpdate = false;
|
m_needsUpdate = false;
|
||||||
QSet<QString> seedPaths;
|
QSet<QString> seedPaths;
|
||||||
for (Project *project : SessionManager::projects()) {
|
for (Project *project : SessionManager::projects()) {
|
||||||
const Utils::FilePathList allFiles = project->files(Project::SourceFiles);
|
const Utils::FilePaths allFiles = project->files(Project::SourceFiles);
|
||||||
for (const Utils::FilePath &filePath : allFiles )
|
for (const Utils::FilePath &filePath : allFiles )
|
||||||
seedPaths.insert(filePath.toString());
|
seedPaths.insert(filePath.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1137,7 +1137,7 @@ QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies(
|
|||||||
const Utils::FilePath &fileName) const
|
const Utils::FilePath &fileName) const
|
||||||
{
|
{
|
||||||
QSet<ProjectPart::Ptr> parts;
|
QSet<ProjectPart::Ptr> parts;
|
||||||
const Utils::FilePathList deps = snapshot().filesDependingOn(fileName);
|
const Utils::FilePaths deps = snapshot().filesDependingOn(fileName);
|
||||||
|
|
||||||
QMutexLocker locker(&d->m_projectMutex);
|
QMutexLocker locker(&d->m_projectMutex);
|
||||||
for (const Utils::FilePath &dep : deps)
|
for (const Utils::FilePath &dep : deps)
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
// Used by Android to avoid false positives on warnOnRelease
|
// Used by Android to avoid false positives on warnOnRelease
|
||||||
bool skipExecutableValidation = false;
|
bool skipExecutableValidation = false;
|
||||||
bool useTargetAsync = false;
|
bool useTargetAsync = false;
|
||||||
Utils::FilePathList additionalSearchDirectories;
|
Utils::FilePaths additionalSearchDirectories;
|
||||||
|
|
||||||
// Used by iOS.
|
// Used by iOS.
|
||||||
QString platform;
|
QString platform;
|
||||||
@@ -181,7 +181,7 @@ public:
|
|||||||
ProjectExplorer::Abi toolChainAbi;
|
ProjectExplorer::Abi toolChainAbi;
|
||||||
|
|
||||||
Utils::FilePath projectSourceDirectory;
|
Utils::FilePath projectSourceDirectory;
|
||||||
Utils::FilePathList projectSourceFiles;
|
Utils::FilePaths projectSourceFiles;
|
||||||
|
|
||||||
// Used by Script debugging
|
// Used by Script debugging
|
||||||
QString interpreter;
|
QString interpreter;
|
||||||
|
|||||||
@@ -625,7 +625,7 @@ void DebuggerOptionsPage::finish()
|
|||||||
|
|
||||||
void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
||||||
{
|
{
|
||||||
FilePathList cdbs;
|
FilePaths cdbs;
|
||||||
|
|
||||||
const QStringList programDirs = {
|
const QStringList programDirs = {
|
||||||
QString::fromLocal8Bit(qgetenv("ProgramFiles")),
|
QString::fromLocal8Bit(qgetenv("ProgramFiles")),
|
||||||
@@ -697,7 +697,7 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::FilePathList searchGdbPathsFromRegistry()
|
static Utils::FilePaths searchGdbPathsFromRegistry()
|
||||||
{
|
{
|
||||||
if (!HostOsInfo::isWindowsHost())
|
if (!HostOsInfo::isWindowsHost())
|
||||||
return {};
|
return {};
|
||||||
@@ -706,7 +706,7 @@ static Utils::FilePathList searchGdbPathsFromRegistry()
|
|||||||
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \
|
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \
|
||||||
"Windows\\CurrentVersion\\Uninstall\\";
|
"Windows\\CurrentVersion\\Uninstall\\";
|
||||||
|
|
||||||
Utils::FilePathList searchPaths;
|
Utils::FilePaths searchPaths;
|
||||||
|
|
||||||
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
||||||
const auto productGroups = registry.childGroups();
|
const auto productGroups = registry.childGroups();
|
||||||
@@ -755,7 +755,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FilePathList suspects;
|
FilePaths suspects;
|
||||||
|
|
||||||
if (HostOsInfo::isMacHost()) {
|
if (HostOsInfo::isMacHost()) {
|
||||||
SynchronousProcess lldbInfo;
|
SynchronousProcess lldbInfo;
|
||||||
@@ -771,7 +771,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList path = Utils::filteredUnique(
|
FilePaths path = Utils::filteredUnique(
|
||||||
Environment::systemEnvironment().path() + searchGdbPathsFromRegistry());
|
Environment::systemEnvironment().path() + searchGdbPathsFromRegistry());
|
||||||
|
|
||||||
QDir dir;
|
QDir dir;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *g
|
|||||||
void FilesSelectionWizardPage::initializePage()
|
void FilesSelectionWizardPage::initializePage()
|
||||||
{
|
{
|
||||||
m_filesWidget->resetModel(Utils::FilePath::fromString(m_genericProjectWizardDialog->path()),
|
m_filesWidget->resetModel(Utils::FilePath::fromString(m_genericProjectWizardDialog->path()),
|
||||||
Utils::FilePathList());
|
Utils::FilePaths());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilesSelectionWizardPage::cleanupPage()
|
void FilesSelectionWizardPage::cleanupPage()
|
||||||
@@ -73,12 +73,12 @@ bool FilesSelectionWizardPage::isComplete() const
|
|||||||
return m_filesWidget->hasFilesSelected();
|
return m_filesWidget->hasFilesSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList FilesSelectionWizardPage::selectedPaths() const
|
Utils::FilePaths FilesSelectionWizardPage::selectedPaths() const
|
||||||
{
|
{
|
||||||
return m_filesWidget->selectedPaths();
|
return m_filesWidget->selectedPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList FilesSelectionWizardPage::selectedFiles() const
|
Utils::FilePaths FilesSelectionWizardPage::selectedFiles() const
|
||||||
{
|
{
|
||||||
return m_filesWidget->selectedFiles();
|
return m_filesWidget->selectedFiles();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ public:
|
|||||||
bool isComplete() const override;
|
bool isComplete() const override;
|
||||||
void initializePage() override;
|
void initializePage() override;
|
||||||
void cleanupPage() override;
|
void cleanupPage() override;
|
||||||
Utils::FilePathList selectedFiles() const;
|
Utils::FilePaths selectedFiles() const;
|
||||||
Utils::FilePathList selectedPaths() const;
|
Utils::FilePaths selectedPaths() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GenericProjectWizardDialog *m_genericProjectWizardDialog;
|
GenericProjectWizardDialog *m_genericProjectWizardDialog;
|
||||||
|
|||||||
@@ -83,12 +83,12 @@ QString GenericProjectWizardDialog::path() const
|
|||||||
return m_firstPage->path();
|
return m_firstPage->path();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList GenericProjectWizardDialog::selectedPaths() const
|
Utils::FilePaths GenericProjectWizardDialog::selectedPaths() const
|
||||||
{
|
{
|
||||||
return m_secondPage->selectedPaths();
|
return m_secondPage->selectedPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList GenericProjectWizardDialog::selectedFiles() const
|
Utils::FilePaths GenericProjectWizardDialog::selectedFiles() const
|
||||||
{
|
{
|
||||||
return m_secondPage->selectedFiles();
|
return m_secondPage->selectedFiles();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ public:
|
|||||||
|
|
||||||
QString path() const;
|
QString path() const;
|
||||||
void setPath(const QString &path);
|
void setPath(const QString &path);
|
||||||
Utils::FilePathList selectedFiles() const;
|
Utils::FilePaths selectedFiles() const;
|
||||||
Utils::FilePathList selectedPaths() const;
|
Utils::FilePaths selectedPaths() const;
|
||||||
|
|
||||||
QString projectName() const;
|
QString projectName() const;
|
||||||
|
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ void ModelIndexer::scanProject(ProjectExplorer::Project *project)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO harmonize following code with findFirstModel()?
|
// TODO harmonize following code with findFirstModel()?
|
||||||
const Utils::FilePathList files = project->files(ProjectExplorer::Project::SourceFiles);
|
const Utils::FilePaths files = project->files(ProjectExplorer::Project::SourceFiles);
|
||||||
QQueue<QueuedFile> filesQueue;
|
QQueue<QueuedFile> filesQueue;
|
||||||
QSet<QueuedFile> filesSet;
|
QSet<QueuedFile> filesSet;
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode)
|
|||||||
|
|
||||||
void ModelIndexer::forgetProject(ProjectExplorer::Project *project)
|
void ModelIndexer::forgetProject(ProjectExplorer::Project *project)
|
||||||
{
|
{
|
||||||
const Utils::FilePathList files = project->files(ProjectExplorer::Project::SourceFiles);
|
const Utils::FilePaths files = project->files(ProjectExplorer::Project::SourceFiles);
|
||||||
|
|
||||||
QMutexLocker locker(&d->indexerMutex);
|
QMutexLocker locker(&d->indexerMutex);
|
||||||
for (const Utils::FilePath &file : files) {
|
for (const Utils::FilePath &file : files) {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ NimBuildConfiguration::NimBuildConfiguration(Target *target, Core::Id id)
|
|||||||
}
|
}
|
||||||
nimCompilerBuildStep->setDefaultCompilerOptions(defaultOption);
|
nimCompilerBuildStep->setDefaultCompilerOptions(defaultOption);
|
||||||
|
|
||||||
const Utils::FilePathList nimFiles = project()->files([](const Node *n) {
|
const Utils::FilePaths nimFiles = project()->files([](const Node *n) {
|
||||||
return Project::AllFiles(n) && n->path().endsWith(".nim");
|
return Project::AllFiles(n) && n->path().endsWith(".nim");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ void NimCompilerBuildStep::updateTargetNimFile()
|
|||||||
{
|
{
|
||||||
if (!m_targetNimFile.isEmpty())
|
if (!m_targetNimFile.isEmpty())
|
||||||
return;
|
return;
|
||||||
const Utils::FilePathList nimFiles = project()->files([](const Node *n) {
|
const Utils::FilePaths nimFiles = project()->files([](const Node *n) {
|
||||||
return Project::AllFiles(n) && n->path().endsWith(".nim");
|
return Project::AllFiles(n) && n->path().endsWith(".nim");
|
||||||
});
|
});
|
||||||
if (!nimFiles.isEmpty())
|
if (!nimFiles.isEmpty())
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ void NimCompilerBuildStepConfigWidget::updateTargetComboBox()
|
|||||||
// Re enter the files
|
// Re enter the files
|
||||||
m_ui->targetComboBox->clear();
|
m_ui->targetComboBox->clear();
|
||||||
|
|
||||||
const FilePathList nimFiles = m_buildStep->project()->files([](const Node *n) {
|
const FilePaths nimFiles = m_buildStep->project()->files([](const Node *n) {
|
||||||
return Project::AllFiles(n) && n->path().endsWith(".nim");
|
return Project::AllFiles(n) && n->path().endsWith(".nim");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -550,12 +550,12 @@ void PerfProfilerTool::gotoSourceLocation(QString filePath, int lineNumber, int
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::FilePathList collectQtIncludePaths(const ProjectExplorer::Kit *kit)
|
static Utils::FilePaths collectQtIncludePaths(const ProjectExplorer::Kit *kit)
|
||||||
{
|
{
|
||||||
QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(kit);
|
QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(kit);
|
||||||
if (qt == nullptr)
|
if (qt == nullptr)
|
||||||
return Utils::FilePathList();
|
return Utils::FilePaths();
|
||||||
Utils::FilePathList paths{qt->headerPath()};
|
Utils::FilePaths paths{qt->headerPath()};
|
||||||
QDirIterator dit(paths.first().toString(), QStringList(), QDir::Dirs | QDir::NoDotAndDotDot,
|
QDirIterator dit(paths.first().toString(), QStringList(), QDir::Dirs | QDir::NoDotAndDotDot,
|
||||||
QDirIterator::Subdirectories);
|
QDirIterator::Subdirectories);
|
||||||
while (dit.hasNext()) {
|
while (dit.hasNext()) {
|
||||||
@@ -570,9 +570,9 @@ static Utils::FilePath sysroot(const Kit *kit)
|
|||||||
return SysRootKitAspect::sysRoot(kit);
|
return SysRootKitAspect::sysRoot(kit);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::FilePathList sourceFiles(const Project *currentProject = nullptr)
|
static Utils::FilePaths sourceFiles(const Project *currentProject = nullptr)
|
||||||
{
|
{
|
||||||
Utils::FilePathList sourceFiles;
|
Utils::FilePaths sourceFiles;
|
||||||
|
|
||||||
// Have the current project first.
|
// Have the current project first.
|
||||||
if (currentProject)
|
if (currentProject)
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ void AbstractProcessStep::taskAdded(const Task &task, int linkedOutputLines, int
|
|||||||
while (filePath.startsWith("../"))
|
while (filePath.startsWith("../"))
|
||||||
filePath.remove(0, 3);
|
filePath.remove(0, 3);
|
||||||
bool found = false;
|
bool found = false;
|
||||||
const Utils::FilePathList candidates
|
const Utils::FilePaths candidates
|
||||||
= d->m_fileFinder.findFile(QUrl::fromLocalFile(filePath), &found);
|
= d->m_fileFinder.findFile(QUrl::fromLocalFile(filePath), &found);
|
||||||
if (found && candidates.size() == 1)
|
if (found && candidates.size() == 1)
|
||||||
editable.file = candidates.first();
|
editable.file = candidates.first();
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void AllProjectsFilter::prepareSearch(const QString &entry)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(entry)
|
Q_UNUSED(entry)
|
||||||
if (!fileIterator()) {
|
if (!fileIterator()) {
|
||||||
Utils::FilePathList paths;
|
Utils::FilePaths paths;
|
||||||
for (Project *project : SessionManager::projects())
|
for (Project *project : SessionManager::projects())
|
||||||
paths.append(project->files(Project::SourceFiles));
|
paths.append(project->files(Project::SourceFiles));
|
||||||
Utils::sort(paths);
|
Utils::sort(paths);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void CurrentProjectFilter::prepareSearch(const QString &entry)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(entry)
|
Q_UNUSED(entry)
|
||||||
if (!fileIterator()) {
|
if (!fileIterator()) {
|
||||||
Utils::FilePathList paths;
|
Utils::FilePaths paths;
|
||||||
if (m_project)
|
if (m_project)
|
||||||
paths = m_project->files(Project::SourceFiles);
|
paths = m_project->files(Project::SourceFiles);
|
||||||
setFileIterator(new BaseFileFilter::ListIterator(paths));
|
setFileIterator(new BaseFileFilter::ListIterator(paths));
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
ExtraCompiler::ExtraCompiler(const Project *project, const Utils::FilePath &source,
|
ExtraCompiler::ExtraCompiler(const Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent) :
|
const Utils::FilePaths &targets, QObject *parent) :
|
||||||
QObject(parent), d(std::make_unique<ExtraCompilerPrivate>())
|
QObject(parent), d(std::make_unique<ExtraCompilerPrivate>())
|
||||||
{
|
{
|
||||||
d->project = project;
|
d->project = project;
|
||||||
@@ -146,7 +146,7 @@ QByteArray ExtraCompiler::content(const Utils::FilePath &file) const
|
|||||||
return d->contents.value(file);
|
return d->contents.value(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList ExtraCompiler::targets() const
|
Utils::FilePaths ExtraCompiler::targets() const
|
||||||
{
|
{
|
||||||
return d->contents.keys();
|
return d->contents.keys();
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@ ExtraCompilerFactory::~ExtraCompilerFactory()
|
|||||||
|
|
||||||
void ExtraCompilerFactory::annouceCreation(const Project *project,
|
void ExtraCompilerFactory::annouceCreation(const Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets)
|
const Utils::FilePaths &targets)
|
||||||
{
|
{
|
||||||
for (ExtraCompilerFactoryObserver *observer : *observers)
|
for (ExtraCompilerFactoryObserver *observer : *observers)
|
||||||
observer->newExtraCompiler(project, source, targets);
|
observer->newExtraCompiler(project, source, targets);
|
||||||
@@ -335,7 +335,7 @@ QList<ExtraCompilerFactory *> ExtraCompilerFactory::extraCompilerFactories()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProcessExtraCompiler::ProcessExtraCompiler(const Project *project, const Utils::FilePath &source,
|
ProcessExtraCompiler::ProcessExtraCompiler(const Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent) :
|
const Utils::FilePaths &targets, QObject *parent) :
|
||||||
ExtraCompiler(project, source, targets, parent)
|
ExtraCompiler(project, source, targets, parent)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class PROJECTEXPLORER_EXPORT ExtraCompiler : public QObject
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ExtraCompiler(const Project *project, const Utils::FilePath &source,
|
ExtraCompiler(const Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent = nullptr);
|
const Utils::FilePaths &targets, QObject *parent = nullptr);
|
||||||
~ExtraCompiler() override;
|
~ExtraCompiler() override;
|
||||||
|
|
||||||
const Project *project() const;
|
const Project *project() const;
|
||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
void setContent(const Utils::FilePath &file, const QByteArray &content);
|
void setContent(const Utils::FilePath &file, const QByteArray &content);
|
||||||
QByteArray content(const Utils::FilePath &file) const;
|
QByteArray content(const Utils::FilePath &file) const;
|
||||||
|
|
||||||
Utils::FilePathList targets() const;
|
Utils::FilePaths targets() const;
|
||||||
void forEachTarget(std::function<void(const Utils::FilePath &)> func);
|
void forEachTarget(std::function<void(const Utils::FilePath &)> func);
|
||||||
|
|
||||||
void setCompileTime(const QDateTime &time);
|
void setCompileTime(const QDateTime &time);
|
||||||
@@ -99,7 +99,7 @@ class PROJECTEXPLORER_EXPORT ProcessExtraCompiler : public ExtraCompiler
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ProcessExtraCompiler(const Project *project, const Utils::FilePath &source,
|
ProcessExtraCompiler(const Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent = nullptr);
|
const Utils::FilePaths &targets, QObject *parent = nullptr);
|
||||||
~ProcessExtraCompiler() override;
|
~ProcessExtraCompiler() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -147,7 +147,7 @@ protected:
|
|||||||
|
|
||||||
virtual void newExtraCompiler(const Project *project,
|
virtual void newExtraCompiler(const Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets)
|
const Utils::FilePaths &targets)
|
||||||
= 0;
|
= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -163,12 +163,12 @@ public:
|
|||||||
|
|
||||||
virtual ExtraCompiler *create(const Project *project,
|
virtual ExtraCompiler *create(const Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets)
|
const Utils::FilePaths &targets)
|
||||||
= 0;
|
= 0;
|
||||||
|
|
||||||
void annouceCreation(const Project *project,
|
void annouceCreation(const Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets);
|
const Utils::FilePaths &targets);
|
||||||
|
|
||||||
static QList<ExtraCompilerFactory *> extraCompilerFactories();
|
static QList<ExtraCompilerFactory *> extraCompilerFactories();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class FileInSessionFinder : public QObject
|
|||||||
public:
|
public:
|
||||||
FileInSessionFinder();
|
FileInSessionFinder();
|
||||||
|
|
||||||
FilePathList doFindFile(const FilePath &filePath);
|
FilePaths doFindFile(const FilePath &filePath);
|
||||||
void invalidateFinder() { m_finderIsUpToDate = false; }
|
void invalidateFinder() { m_finderIsUpToDate = false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -64,13 +64,13 @@ FileInSessionFinder::FileInSessionFinder()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList FileInSessionFinder::doFindFile(const FilePath &filePath)
|
FilePaths FileInSessionFinder::doFindFile(const FilePath &filePath)
|
||||||
{
|
{
|
||||||
if (!m_finderIsUpToDate) {
|
if (!m_finderIsUpToDate) {
|
||||||
m_finder.setProjectDirectory(SessionManager::startupProject()
|
m_finder.setProjectDirectory(SessionManager::startupProject()
|
||||||
? SessionManager::startupProject()->projectDirectory()
|
? SessionManager::startupProject()->projectDirectory()
|
||||||
: FilePath());
|
: FilePath());
|
||||||
FilePathList allFiles;
|
FilePaths allFiles;
|
||||||
for (const Project * const p : SessionManager::projects())
|
for (const Project * const p : SessionManager::projects())
|
||||||
allFiles << p->files(Project::SourceFiles);
|
allFiles << p->files(Project::SourceFiles);
|
||||||
m_finder.setProjectFiles(allFiles);
|
m_finder.setProjectFiles(allFiles);
|
||||||
@@ -81,7 +81,7 @@ FilePathList FileInSessionFinder::doFindFile(const FilePath &filePath)
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
FilePathList findFileInSession(const FilePath &filePath)
|
FilePaths findFileInSession(const FilePath &filePath)
|
||||||
{
|
{
|
||||||
static Internal::FileInSessionFinder finder;
|
static Internal::FileInSessionFinder finder;
|
||||||
return finder.doFindFile(filePath);
|
return finder.doFindFile(filePath);
|
||||||
|
|||||||
@@ -32,6 +32,6 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
// Possibly used by "QtCreatorTerminalPlugin"
|
// Possibly used by "QtCreatorTerminalPlugin"
|
||||||
PROJECTEXPLORER_EXPORT Utils::FilePathList findFileInSession(const Utils::FilePath &filePath);
|
PROJECTEXPLORER_EXPORT Utils::FilePaths findFileInSession(const Utils::FilePath &filePath);
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ static Utils::FilePath findLocalCompiler(const Utils::FilePath &compilerPath,
|
|||||||
return compilerPath;
|
return compilerPath;
|
||||||
|
|
||||||
// Filter out network compilers
|
// Filter out network compilers
|
||||||
const FilePathList pathComponents = Utils::filtered(env.path(), [] (const FilePath &dirPath) {
|
const FilePaths pathComponents = Utils::filtered(env.path(), [] (const FilePath &dirPath) {
|
||||||
return !isNetworkCompiler(dirPath.toString());
|
return !isNetworkCompiler(dirPath.toString());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -905,7 +905,7 @@ Utils::FilePath GccToolChain::detectInstallDir() const
|
|||||||
// GccToolChainFactory
|
// GccToolChainFactory
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
static Utils::FilePathList gnuSearchPathsFromRegistry()
|
static Utils::FilePaths gnuSearchPathsFromRegistry()
|
||||||
{
|
{
|
||||||
if (!HostOsInfo::isWindowsHost())
|
if (!HostOsInfo::isWindowsHost())
|
||||||
return {};
|
return {};
|
||||||
@@ -914,7 +914,7 @@ static Utils::FilePathList gnuSearchPathsFromRegistry()
|
|||||||
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \
|
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \
|
||||||
"Windows\\CurrentVersion\\Uninstall\\";
|
"Windows\\CurrentVersion\\Uninstall\\";
|
||||||
|
|
||||||
Utils::FilePathList searchPaths;
|
Utils::FilePaths searchPaths;
|
||||||
|
|
||||||
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
||||||
const auto productGroups = registry.childGroups();
|
const auto productGroups = registry.childGroups();
|
||||||
@@ -937,7 +937,7 @@ static Utils::FilePathList gnuSearchPathsFromRegistry()
|
|||||||
return searchPaths;
|
return searchPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::FilePathList atmelSearchPathsFromRegistry()
|
static Utils::FilePaths atmelSearchPathsFromRegistry()
|
||||||
{
|
{
|
||||||
if (!HostOsInfo::isWindowsHost())
|
if (!HostOsInfo::isWindowsHost())
|
||||||
return {};
|
return {};
|
||||||
@@ -946,7 +946,7 @@ static Utils::FilePathList atmelSearchPathsFromRegistry()
|
|||||||
// "Atmel Studio" IDE.
|
// "Atmel Studio" IDE.
|
||||||
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Atmel\\";
|
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Atmel\\";
|
||||||
|
|
||||||
Utils::FilePathList searchPaths;
|
Utils::FilePaths searchPaths;
|
||||||
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
||||||
|
|
||||||
// This code enumerate the installed toolchains provided
|
// This code enumerate the installed toolchains provided
|
||||||
@@ -1015,7 +1015,7 @@ static Utils::FilePathList atmelSearchPathsFromRegistry()
|
|||||||
return searchPaths;
|
return searchPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::FilePathList renesasRl78SearchPathsFromRegistry()
|
static Utils::FilePaths renesasRl78SearchPathsFromRegistry()
|
||||||
{
|
{
|
||||||
if (!HostOsInfo::isWindowsHost())
|
if (!HostOsInfo::isWindowsHost())
|
||||||
return {};
|
return {};
|
||||||
@@ -1024,7 +1024,7 @@ static Utils::FilePathList renesasRl78SearchPathsFromRegistry()
|
|||||||
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \
|
static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \
|
||||||
"Windows\\CurrentVersion\\Uninstall";
|
"Windows\\CurrentVersion\\Uninstall";
|
||||||
|
|
||||||
Utils::FilePathList searchPaths;
|
Utils::FilePaths searchPaths;
|
||||||
|
|
||||||
QSettings registry(QLatin1String(kRegistryToken), QSettings::NativeFormat);
|
QSettings registry(QLatin1String(kRegistryToken), QSettings::NativeFormat);
|
||||||
const auto productGroups = registry.childGroups();
|
const auto productGroups = registry.childGroups();
|
||||||
@@ -1093,13 +1093,13 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(
|
|||||||
const Core::Id requiredTypeId, const QList<ToolChain *> &alreadyKnown,
|
const Core::Id requiredTypeId, const QList<ToolChain *> &alreadyKnown,
|
||||||
const ToolchainChecker &checker)
|
const ToolchainChecker &checker)
|
||||||
{
|
{
|
||||||
FilePathList compilerPaths;
|
FilePaths compilerPaths;
|
||||||
QFileInfo fi(compilerName);
|
QFileInfo fi(compilerName);
|
||||||
if (fi.isAbsolute()) {
|
if (fi.isAbsolute()) {
|
||||||
if (fi.isFile())
|
if (fi.isFile())
|
||||||
compilerPaths << FilePath::fromString(compilerName);
|
compilerPaths << FilePath::fromString(compilerName);
|
||||||
} else {
|
} else {
|
||||||
FilePathList searchPaths = Environment::systemEnvironment().path();
|
FilePaths searchPaths = Environment::systemEnvironment().path();
|
||||||
searchPaths << gnuSearchPathsFromRegistry();
|
searchPaths << gnuSearchPathsFromRegistry();
|
||||||
searchPaths << atmelSearchPathsFromRegistry();
|
searchPaths << atmelSearchPathsFromRegistry();
|
||||||
searchPaths << renesasRl78SearchPathsFromRegistry();
|
searchPaths << renesasRl78SearchPathsFromRegistry();
|
||||||
|
|||||||
@@ -334,9 +334,9 @@ static QStringList environmentTemplatesPaths()
|
|||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList &JsonWizardFactory::searchPaths()
|
Utils::FilePaths &JsonWizardFactory::searchPaths()
|
||||||
{
|
{
|
||||||
static Utils::FilePathList m_searchPaths = Utils::FilePathList()
|
static Utils::FilePaths m_searchPaths = Utils::FilePaths()
|
||||||
<< Utils::FilePath::fromString(Core::ICore::userResourcePath() + QLatin1Char('/') +
|
<< Utils::FilePath::fromString(Core::ICore::userResourcePath() + QLatin1Char('/') +
|
||||||
QLatin1String(WIZARD_PATH))
|
QLatin1String(WIZARD_PATH))
|
||||||
<< Utils::FilePath::fromString(Core::ICore::resourcePath() + QLatin1Char('/') +
|
<< Utils::FilePath::fromString(Core::ICore::resourcePath() + QLatin1Char('/') +
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ private:
|
|||||||
static QList<IWizardFactory *> createWizardFactories();
|
static QList<IWizardFactory *> createWizardFactories();
|
||||||
static JsonWizardFactory *createWizardFactory(const QVariantMap &data, const QDir &baseDir,
|
static JsonWizardFactory *createWizardFactory(const QVariantMap &data, const QDir &baseDir,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
static Utils::FilePathList &searchPaths();
|
static Utils::FilePaths &searchPaths();
|
||||||
|
|
||||||
static void setVerbose(int level);
|
static void setVerbose(int level);
|
||||||
static int verbose();
|
static int verbose();
|
||||||
|
|||||||
@@ -591,11 +591,11 @@ Project::RestoreResult Project::restoreSettings(QString *errorMessage)
|
|||||||
/*!
|
/*!
|
||||||
* Returns a sorted list of all files matching the predicate \a filter.
|
* Returns a sorted list of all files matching the predicate \a filter.
|
||||||
*/
|
*/
|
||||||
Utils::FilePathList Project::files(const Project::NodeMatcher &filter) const
|
Utils::FilePaths Project::files(const Project::NodeMatcher &filter) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(filter, return {});
|
QTC_ASSERT(filter, return {});
|
||||||
|
|
||||||
Utils::FilePathList result;
|
Utils::FilePaths result;
|
||||||
if (d->m_sortedNodeList.empty() && filter(containerNode()))
|
if (d->m_sortedNodeList.empty() && filter(containerNode()))
|
||||||
result.append(projectFilePath());
|
result.append(projectFilePath());
|
||||||
|
|
||||||
@@ -1177,14 +1177,14 @@ void ProjectExplorerPlugin::testProject_projectTree()
|
|||||||
QCOMPARE(project.isKnownFile(TEST_PROJECT_CPP_FILE), true);
|
QCOMPARE(project.isKnownFile(TEST_PROJECT_CPP_FILE), true);
|
||||||
QCOMPARE(project.isKnownFile(TEST_PROJECT_GENERATED_FILE), true);
|
QCOMPARE(project.isKnownFile(TEST_PROJECT_GENERATED_FILE), true);
|
||||||
|
|
||||||
Utils::FilePathList allFiles = project.files(Project::AllFiles);
|
Utils::FilePaths allFiles = project.files(Project::AllFiles);
|
||||||
QCOMPARE(allFiles.count(), 3);
|
QCOMPARE(allFiles.count(), 3);
|
||||||
QVERIFY(allFiles.contains(TEST_PROJECT_PATH));
|
QVERIFY(allFiles.contains(TEST_PROJECT_PATH));
|
||||||
QVERIFY(allFiles.contains(TEST_PROJECT_CPP_FILE));
|
QVERIFY(allFiles.contains(TEST_PROJECT_CPP_FILE));
|
||||||
QVERIFY(allFiles.contains(TEST_PROJECT_GENERATED_FILE));
|
QVERIFY(allFiles.contains(TEST_PROJECT_GENERATED_FILE));
|
||||||
|
|
||||||
QCOMPARE(project.files(Project::GeneratedFiles), {TEST_PROJECT_GENERATED_FILE});
|
QCOMPARE(project.files(Project::GeneratedFiles), {TEST_PROJECT_GENERATED_FILE});
|
||||||
Utils::FilePathList sourceFiles = project.files(Project::SourceFiles);
|
Utils::FilePaths sourceFiles = project.files(Project::SourceFiles);
|
||||||
QCOMPARE(sourceFiles.count(), 2);
|
QCOMPARE(sourceFiles.count(), 2);
|
||||||
QVERIFY(sourceFiles.contains(TEST_PROJECT_PATH));
|
QVERIFY(sourceFiles.contains(TEST_PROJECT_PATH));
|
||||||
QVERIFY(sourceFiles.contains(TEST_PROJECT_CPP_FILE));
|
QVERIFY(sourceFiles.contains(TEST_PROJECT_CPP_FILE));
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public:
|
|||||||
static const NodeMatcher SourceFiles;
|
static const NodeMatcher SourceFiles;
|
||||||
static const NodeMatcher GeneratedFiles;
|
static const NodeMatcher GeneratedFiles;
|
||||||
|
|
||||||
Utils::FilePathList files(const NodeMatcher &matcher) const;
|
Utils::FilePaths files(const NodeMatcher &matcher) const;
|
||||||
bool isKnownFile(const Utils::FilePath &filename) const;
|
bool isKnownFile(const Utils::FilePath &filename) const;
|
||||||
|
|
||||||
virtual QVariantMap toMap() const;
|
virtual QVariantMap toMap() const;
|
||||||
|
|||||||
@@ -1904,14 +1904,14 @@ void ProjectExplorerPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
QSsh::SshSettings::loadSettings(Core::ICore::settings());
|
QSsh::SshSettings::loadSettings(Core::ICore::settings());
|
||||||
const auto searchPathRetriever = [] {
|
const auto searchPathRetriever = [] {
|
||||||
Utils::FilePathList searchPaths;
|
Utils::FilePaths searchPaths;
|
||||||
searchPaths << Utils::FilePath::fromString(Core::ICore::libexecPath());
|
searchPaths << Utils::FilePath::fromString(Core::ICore::libexecPath());
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||||
const QString gitBinary = Core::ICore::settings()->value("Git/BinaryPath", "git")
|
const QString gitBinary = Core::ICore::settings()->value("Git/BinaryPath", "git")
|
||||||
.toString();
|
.toString();
|
||||||
const QStringList rawGitSearchPaths = Core::ICore::settings()->value("Git/Path")
|
const QStringList rawGitSearchPaths = Core::ICore::settings()->value("Git/Path")
|
||||||
.toString().split(':', QString::SkipEmptyParts);
|
.toString().split(':', QString::SkipEmptyParts);
|
||||||
const Utils::FilePathList gitSearchPaths = Utils::transform(rawGitSearchPaths,
|
const Utils::FilePaths gitSearchPaths = Utils::transform(rawGitSearchPaths,
|
||||||
[](const QString &rawPath) { return Utils::FilePath::fromString(rawPath); });
|
[](const QString &rawPath) { return Utils::FilePath::fromString(rawPath); });
|
||||||
const Utils::FilePath fullGitPath = Utils::Environment::systemEnvironment()
|
const Utils::FilePath fullGitPath = Utils::Environment::systemEnvironment()
|
||||||
.searchInPath(gitBinary, gitSearchPaths);
|
.searchInPath(gitBinary, gitSearchPaths);
|
||||||
@@ -3578,7 +3578,7 @@ void ProjectExplorerPluginPrivate::addExistingDirectory()
|
|||||||
QTC_ASSERT(folderNode, return);
|
QTC_ASSERT(folderNode, return);
|
||||||
|
|
||||||
SelectableFilesDialogAddDirectory dialog(Utils::FilePath::fromString(node->directory()),
|
SelectableFilesDialogAddDirectory dialog(Utils::FilePath::fromString(node->directory()),
|
||||||
Utils::FilePathList(), ICore::mainWindow());
|
Utils::FilePaths(), ICore::mainWindow());
|
||||||
dialog.setAddFileFilter({});
|
dialog.setAddFileFilter({});
|
||||||
|
|
||||||
if (dialog.exec() == QDialog::Accepted)
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ SelectableFilesModel::SelectableFilesModel(QObject *parent) : QAbstractItemModel
|
|||||||
m_root = new Tree;
|
m_root = new Tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectableFilesModel::setInitialMarkedFiles(const Utils::FilePathList &files)
|
void SelectableFilesModel::setInitialMarkedFiles(const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
m_files = Utils::toSet(files);
|
m_files = Utils::toSet(files);
|
||||||
m_allFiles = files.isEmpty();
|
m_allFiles = files.isEmpty();
|
||||||
@@ -302,14 +302,14 @@ Qt::ItemFlags SelectableFilesModel::flags(const QModelIndex &index) const
|
|||||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
|
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList SelectableFilesModel::selectedPaths() const
|
Utils::FilePaths SelectableFilesModel::selectedPaths() const
|
||||||
{
|
{
|
||||||
Utils::FilePathList result;
|
Utils::FilePaths result;
|
||||||
collectPaths(m_root, &result);
|
collectPaths(m_root, &result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectableFilesModel::collectPaths(Tree *root, Utils::FilePathList *result) const
|
void SelectableFilesModel::collectPaths(Tree *root, Utils::FilePaths *result) const
|
||||||
{
|
{
|
||||||
if (root->checked == Qt::Unchecked)
|
if (root->checked == Qt::Unchecked)
|
||||||
return;
|
return;
|
||||||
@@ -318,14 +318,14 @@ void SelectableFilesModel::collectPaths(Tree *root, Utils::FilePathList *result)
|
|||||||
collectPaths(t, result);
|
collectPaths(t, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList SelectableFilesModel::selectedFiles() const
|
Utils::FilePaths SelectableFilesModel::selectedFiles() const
|
||||||
{
|
{
|
||||||
Utils::FilePathList result = Utils::toList(m_outOfBaseDirFiles);
|
Utils::FilePaths result = Utils::toList(m_outOfBaseDirFiles);
|
||||||
collectFiles(m_root, &result);
|
collectFiles(m_root, &result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList SelectableFilesModel::preservedFiles() const
|
Utils::FilePaths SelectableFilesModel::preservedFiles() const
|
||||||
{
|
{
|
||||||
return Utils::toList(m_outOfBaseDirFiles);
|
return Utils::toList(m_outOfBaseDirFiles);
|
||||||
}
|
}
|
||||||
@@ -335,7 +335,7 @@ bool SelectableFilesModel::hasCheckedFiles() const
|
|||||||
return m_root->checked != Qt::Unchecked;
|
return m_root->checked != Qt::Unchecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectableFilesModel::collectFiles(Tree *root, Utils::FilePathList *result) const
|
void SelectableFilesModel::collectFiles(Tree *root, Utils::FilePaths *result) const
|
||||||
{
|
{
|
||||||
if (root->checked == Qt::Unchecked)
|
if (root->checked == Qt::Unchecked)
|
||||||
return;
|
return;
|
||||||
@@ -592,7 +592,7 @@ SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
SelectableFilesWidget::SelectableFilesWidget(const Utils::FilePath &path,
|
SelectableFilesWidget::SelectableFilesWidget(const Utils::FilePath &path,
|
||||||
const Utils::FilePathList &files, QWidget *parent) :
|
const Utils::FilePaths &files, QWidget *parent) :
|
||||||
SelectableFilesWidget(parent)
|
SelectableFilesWidget(parent)
|
||||||
{
|
{
|
||||||
resetModel(path, files);
|
resetModel(path, files);
|
||||||
@@ -615,14 +615,14 @@ void SelectableFilesWidget::setBaseDirEditable(bool edit)
|
|||||||
m_startParsingButton->setVisible(edit);
|
m_startParsingButton->setVisible(edit);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList SelectableFilesWidget::selectedFiles() const
|
Utils::FilePaths SelectableFilesWidget::selectedFiles() const
|
||||||
{
|
{
|
||||||
return m_model ? m_model->selectedFiles() : Utils::FilePathList();
|
return m_model ? m_model->selectedFiles() : Utils::FilePaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList SelectableFilesWidget::selectedPaths() const
|
Utils::FilePaths SelectableFilesWidget::selectedPaths() const
|
||||||
{
|
{
|
||||||
return m_model ? m_model->selectedPaths() : Utils::FilePathList();
|
return m_model ? m_model->selectedPaths() : Utils::FilePaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SelectableFilesWidget::hasFilesSelected() const
|
bool SelectableFilesWidget::hasFilesSelected() const
|
||||||
@@ -630,7 +630,7 @@ bool SelectableFilesWidget::hasFilesSelected() const
|
|||||||
return m_model ? m_model->hasCheckedFiles() : false;
|
return m_model ? m_model->hasCheckedFiles() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectableFilesWidget::resetModel(const Utils::FilePath &path, const Utils::FilePathList &files)
|
void SelectableFilesWidget::resetModel(const Utils::FilePath &path, const Utils::FilePaths &files)
|
||||||
{
|
{
|
||||||
m_view->setModel(nullptr);
|
m_view->setModel(nullptr);
|
||||||
|
|
||||||
@@ -711,7 +711,7 @@ void SelectableFilesWidget::parsingFinished()
|
|||||||
|
|
||||||
smartExpand(m_model->index(0,0, QModelIndex()));
|
smartExpand(m_model->index(0,0, QModelIndex()));
|
||||||
|
|
||||||
const Utils::FilePathList preservedFiles = m_model->preservedFiles();
|
const Utils::FilePaths preservedFiles = m_model->preservedFiles();
|
||||||
m_preservedFilesLabel->setText(tr("Not showing %n files that are outside of the base directory.\n"
|
m_preservedFilesLabel->setText(tr("Not showing %n files that are outside of the base directory.\n"
|
||||||
"These files are preserved.", nullptr, preservedFiles.count()));
|
"These files are preserved.", nullptr, preservedFiles.count()));
|
||||||
|
|
||||||
@@ -736,7 +736,7 @@ void SelectableFilesWidget::smartExpand(const QModelIndex &idx)
|
|||||||
//////////
|
//////////
|
||||||
|
|
||||||
SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::FilePath &path,
|
SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::FilePath &path,
|
||||||
const Utils::FilePathList &files,
|
const Utils::FilePaths &files,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
m_filesWidget(new SelectableFilesWidget(path, files))
|
m_filesWidget(new SelectableFilesWidget(path, files))
|
||||||
@@ -759,7 +759,7 @@ SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::File
|
|||||||
layout->addWidget(buttonBox);
|
layout->addWidget(buttonBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePathList SelectableFilesDialogEditFiles::selectedFiles() const
|
Utils::FilePaths SelectableFilesDialogEditFiles::selectedFiles() const
|
||||||
{
|
{
|
||||||
return m_filesWidget->selectedFiles();
|
return m_filesWidget->selectedFiles();
|
||||||
}
|
}
|
||||||
@@ -771,7 +771,7 @@ Utils::FilePathList SelectableFilesDialogEditFiles::selectedFiles() const
|
|||||||
|
|
||||||
|
|
||||||
SelectableFilesDialogAddDirectory::SelectableFilesDialogAddDirectory(const Utils::FilePath &path,
|
SelectableFilesDialogAddDirectory::SelectableFilesDialogAddDirectory(const Utils::FilePath &path,
|
||||||
const Utils::FilePathList &files,
|
const Utils::FilePaths &files,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
SelectableFilesDialogEditFiles(path, files, parent)
|
SelectableFilesDialogEditFiles(path, files, parent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
SelectableFilesModel(QObject *parent);
|
SelectableFilesModel(QObject *parent);
|
||||||
~SelectableFilesModel() override;
|
~SelectableFilesModel() override;
|
||||||
|
|
||||||
void setInitialMarkedFiles(const Utils::FilePathList &files);
|
void setInitialMarkedFiles(const Utils::FilePaths &files);
|
||||||
|
|
||||||
int columnCount(const QModelIndex &parent) const override;
|
int columnCount(const QModelIndex &parent) const override;
|
||||||
int rowCount(const QModelIndex &parent) const override;
|
int rowCount(const QModelIndex &parent) const override;
|
||||||
@@ -118,9 +118,9 @@ public:
|
|||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||||
|
|
||||||
Utils::FilePathList selectedFiles() const;
|
Utils::FilePaths selectedFiles() const;
|
||||||
Utils::FilePathList selectedPaths() const;
|
Utils::FilePaths selectedPaths() const;
|
||||||
Utils::FilePathList preservedFiles() const;
|
Utils::FilePaths preservedFiles() const;
|
||||||
|
|
||||||
bool hasCheckedFiles() const;
|
bool hasCheckedFiles() const;
|
||||||
|
|
||||||
@@ -141,8 +141,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
QList<Glob> parseFilter(const QString &filter);
|
QList<Glob> parseFilter(const QString &filter);
|
||||||
Qt::CheckState applyFilter(const QModelIndex &idx);
|
Qt::CheckState applyFilter(const QModelIndex &idx);
|
||||||
void collectFiles(Tree *root, Utils::FilePathList *result) const;
|
void collectFiles(Tree *root, Utils::FilePaths *result) const;
|
||||||
void collectPaths(Tree *root, Utils::FilePathList *result) const;
|
void collectPaths(Tree *root, Utils::FilePaths *result) const;
|
||||||
void selectAllFiles(Tree *root);
|
void selectAllFiles(Tree *root);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -192,18 +192,18 @@ class PROJECTEXPLORER_EXPORT SelectableFilesWidget : public QWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SelectableFilesWidget(QWidget *parent = nullptr);
|
explicit SelectableFilesWidget(QWidget *parent = nullptr);
|
||||||
SelectableFilesWidget(const Utils::FilePath &path, const Utils::FilePathList &files,
|
SelectableFilesWidget(const Utils::FilePath &path, const Utils::FilePaths &files,
|
||||||
QWidget *parent = nullptr);
|
QWidget *parent = nullptr);
|
||||||
|
|
||||||
void setAddFileFilter(const QString &filter);
|
void setAddFileFilter(const QString &filter);
|
||||||
void setBaseDirEditable(bool edit);
|
void setBaseDirEditable(bool edit);
|
||||||
|
|
||||||
Utils::FilePathList selectedFiles() const;
|
Utils::FilePaths selectedFiles() const;
|
||||||
Utils::FilePathList selectedPaths() const;
|
Utils::FilePaths selectedPaths() const;
|
||||||
|
|
||||||
bool hasFilesSelected() const;
|
bool hasFilesSelected() const;
|
||||||
|
|
||||||
void resetModel(const Utils::FilePath &path, const Utils::FilePathList &files);
|
void resetModel(const Utils::FilePath &path, const Utils::FilePaths &files);
|
||||||
void cancelParsing();
|
void cancelParsing();
|
||||||
|
|
||||||
void enableFilterHistoryCompletion(const QString &keyPrefix);
|
void enableFilterHistoryCompletion(const QString &keyPrefix);
|
||||||
@@ -249,9 +249,9 @@ class PROJECTEXPLORER_EXPORT SelectableFilesDialogEditFiles : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SelectableFilesDialogEditFiles(const Utils::FilePath &path, const Utils::FilePathList &files,
|
SelectableFilesDialogEditFiles(const Utils::FilePath &path, const Utils::FilePaths &files,
|
||||||
QWidget *parent);
|
QWidget *parent);
|
||||||
Utils::FilePathList selectedFiles() const;
|
Utils::FilePaths selectedFiles() const;
|
||||||
|
|
||||||
void setAddFileFilter(const QString &filter) { m_filesWidget->setAddFileFilter(filter); }
|
void setAddFileFilter(const QString &filter) { m_filesWidget->setAddFileFilter(filter); }
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ class SelectableFilesDialogAddDirectory : public SelectableFilesDialogEditFiles
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SelectableFilesDialogAddDirectory(const Utils::FilePath &path, const Utils::FilePathList &files,
|
SelectableFilesDialogAddDirectory(const Utils::FilePath &path, const Utils::FilePaths &files,
|
||||||
QWidget *parent);
|
QWidget *parent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ void Task::setFile(const Utils::FilePath &file_)
|
|||||||
{
|
{
|
||||||
file = file_;
|
file = file_;
|
||||||
if (!file.isEmpty() && !file.toFileInfo().isAbsolute()) {
|
if (!file.isEmpty() && !file.toFileInfo().isAbsolute()) {
|
||||||
Utils::FilePathList possiblePaths = findFileInSession(file);
|
Utils::FilePaths possiblePaths = findFileInSession(file);
|
||||||
if (possiblePaths.length() == 1)
|
if (possiblePaths.length() == 1)
|
||||||
file = possiblePaths.first();
|
file = possiblePaths.first();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public:
|
|||||||
Options options = AddTextMark | FlashWorthy;
|
Options options = AddTextMark | FlashWorthy;
|
||||||
QString description;
|
QString description;
|
||||||
Utils::FilePath file;
|
Utils::FilePath file;
|
||||||
Utils::FilePathList fileCandidates;
|
Utils::FilePaths fileCandidates;
|
||||||
int line = -1;
|
int line = -1;
|
||||||
int movedLine = -1; // contains a line number if the line was moved in the editor
|
int movedLine = -1; // contains a line number if the line was moved in the editor
|
||||||
Core::Id category;
|
Core::Id category;
|
||||||
|
|||||||
@@ -278,10 +278,10 @@ public:
|
|||||||
UserFileBackUpStrategy(UserFileAccessor *accessor) : Utils::VersionedBackUpStrategy(accessor)
|
UserFileBackUpStrategy(UserFileAccessor *accessor) : Utils::VersionedBackUpStrategy(accessor)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
FilePathList readFileCandidates(const Utils::FilePath &baseFileName) const final;
|
FilePaths readFileCandidates(const Utils::FilePath &baseFileName) const final;
|
||||||
};
|
};
|
||||||
|
|
||||||
FilePathList UserFileBackUpStrategy::readFileCandidates(const FilePath &baseFileName) const
|
FilePaths UserFileBackUpStrategy::readFileCandidates(const FilePath &baseFileName) const
|
||||||
{
|
{
|
||||||
const auto *const ac = static_cast<const UserFileAccessor *>(accessor());
|
const auto *const ac = static_cast<const UserFileAccessor *>(accessor());
|
||||||
const FilePath externalUser = ac->externalUserFile();
|
const FilePath externalUser = ac->externalUserFile();
|
||||||
@@ -289,7 +289,7 @@ FilePathList UserFileBackUpStrategy::readFileCandidates(const FilePath &baseFile
|
|||||||
QTC_CHECK(!baseFileName.isEmpty());
|
QTC_CHECK(!baseFileName.isEmpty());
|
||||||
QTC_CHECK(baseFileName == externalUser || baseFileName == projectUser);
|
QTC_CHECK(baseFileName == externalUser || baseFileName == projectUser);
|
||||||
|
|
||||||
FilePathList result = Utils::VersionedBackUpStrategy::readFileCandidates(projectUser);
|
FilePaths result = Utils::VersionedBackUpStrategy::readFileCandidates(projectUser);
|
||||||
if (!externalUser.isEmpty())
|
if (!externalUser.isEmpty())
|
||||||
result.append(Utils::VersionedBackUpStrategy::readFileCandidates(externalUser));
|
result.append(Utils::VersionedBackUpStrategy::readFileCandidates(externalUser));
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ QbsBuildSystem::QbsBuildSystem(QbsBuildConfiguration *bc)
|
|||||||
for (auto it = m_sourcesForGeneratedFiles.cbegin();
|
for (auto it = m_sourcesForGeneratedFiles.cbegin();
|
||||||
it != m_sourcesForGeneratedFiles.cend(); ++it) {
|
it != m_sourcesForGeneratedFiles.cend(); ++it) {
|
||||||
for (const QString &sourceFile : it.value()) {
|
for (const QString &sourceFile : it.value()) {
|
||||||
const FilePathList generatedFilePaths = transform(
|
const FilePaths generatedFilePaths = transform(
|
||||||
generatedFiles.value(sourceFile),
|
generatedFiles.value(sourceFile),
|
||||||
[](const QString &s) { return FilePath::fromString(s); });
|
[](const QString &s) { return FilePath::fromString(s); });
|
||||||
if (!generatedFilePaths.empty()) {
|
if (!generatedFilePaths.empty()) {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace QmakeProjectManager {
|
|||||||
static void createTree(QmakeBuildSystem *buildSystem,
|
static void createTree(QmakeBuildSystem *buildSystem,
|
||||||
const QmakePriFile *pri,
|
const QmakePriFile *pri,
|
||||||
QmakePriFileNode *node,
|
QmakePriFileNode *node,
|
||||||
const FilePathList &toExclude)
|
const FilePaths &toExclude)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(pri, return);
|
QTC_ASSERT(pri, return);
|
||||||
QTC_ASSERT(node, return);
|
QTC_ASSERT(node, return);
|
||||||
@@ -146,7 +146,7 @@ static void createTree(QmakeBuildSystem *buildSystem,
|
|||||||
|
|
||||||
// other normal files:
|
// other normal files:
|
||||||
const QVector<QmakeStaticData::FileTypeData> &fileTypes = qmakeStaticData()->fileTypeData;
|
const QVector<QmakeStaticData::FileTypeData> &fileTypes = qmakeStaticData()->fileTypeData;
|
||||||
FilePathList generatedFiles;
|
FilePaths generatedFiles;
|
||||||
const auto proFile = dynamic_cast<const QmakeProFile *>(pri);
|
const auto proFile = dynamic_cast<const QmakeProFile *>(pri);
|
||||||
for (int i = 0; i < fileTypes.size(); ++i) {
|
for (int i = 0; i < fileTypes.size(); ++i) {
|
||||||
FileType type = fileTypes.at(i).type;
|
FileType type = fileTypes.at(i).type;
|
||||||
@@ -242,7 +242,7 @@ std::unique_ptr<QmakeProFileNode> QmakeNodeTreeBuilder::buildTree(QmakeBuildSyst
|
|||||||
Target *t = buildSystem->target();
|
Target *t = buildSystem->target();
|
||||||
BaseQtVersion *qt = QtKitAspect::qtVersion(t->kit());
|
BaseQtVersion *qt = QtKitAspect::qtVersion(t->kit());
|
||||||
|
|
||||||
const FilePathList toExclude = qt ? qt->directoriesToIgnoreInProjectTree() : FilePathList();
|
const FilePaths toExclude = qt ? qt->directoriesToIgnoreInProjectTree() : FilePaths();
|
||||||
|
|
||||||
auto root = std::make_unique<QmakeProFileNode>(buildSystem,
|
auto root = std::make_unique<QmakeProFileNode>(buildSystem,
|
||||||
buildSystem->projectFilePath(),
|
buildSystem->projectFilePath(),
|
||||||
|
|||||||
@@ -1397,7 +1397,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
if (result->state == QmakeEvalResult::EvalOk) {
|
if (result->state == QmakeEvalResult::EvalOk) {
|
||||||
if (result->projectType == ProjectType::SubDirsTemplate) {
|
if (result->projectType == ProjectType::SubDirsTemplate) {
|
||||||
QStringList errors;
|
QStringList errors;
|
||||||
FilePathList subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
|
FilePaths subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
|
||||||
result->errors.append(errors);
|
result->errors.append(errors);
|
||||||
|
|
||||||
foreach (const Utils::FilePath &subDirName, subDirs) {
|
foreach (const Utils::FilePath &subDirName, subDirs) {
|
||||||
@@ -1434,7 +1434,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result->projectType == ProjectType::SubDirsTemplate) {
|
if (result->projectType == ProjectType::SubDirsTemplate) {
|
||||||
FilePathList subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
|
FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
|
||||||
foreach (const Utils::FilePath &subDirName, subDirs) {
|
foreach (const Utils::FilePath &subDirName, subDirs) {
|
||||||
auto it = result->includedFiles.children.find(subDirName);
|
auto it = result->includedFiles.children.find(subDirName);
|
||||||
if (it == result->includedFiles.children.end()) {
|
if (it == result->includedFiles.children.end()) {
|
||||||
@@ -1869,12 +1869,12 @@ QStringList QmakeProFile::libDirectories(QtSupport::ProFileReader *reader)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader,
|
FilePaths QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader,
|
||||||
const QString &projectDir,
|
const QString &projectDir,
|
||||||
QStringList *subProjectsNotToDeploy,
|
QStringList *subProjectsNotToDeploy,
|
||||||
QStringList *errors)
|
QStringList *errors)
|
||||||
{
|
{
|
||||||
FilePathList subProjectPaths;
|
FilePaths subProjectPaths;
|
||||||
|
|
||||||
const QStringList subDirVars = reader->values(QLatin1String("SUBDIRS"));
|
const QStringList subDirVars = reader->values(QLatin1String("SUBDIRS"));
|
||||||
|
|
||||||
@@ -2043,7 +2043,7 @@ FilePath QmakeProFile::buildDir(BuildConfiguration *bc) const
|
|||||||
return FilePath::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir)));
|
return FilePath::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir)));
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList QmakeProFile::generatedFiles(const FilePath &buildDir,
|
FilePaths QmakeProFile::generatedFiles(const FilePath &buildDir,
|
||||||
const FilePath &sourceFile,
|
const FilePath &sourceFile,
|
||||||
const FileType &sourceFileType) const
|
const FileType &sourceFileType) const
|
||||||
{
|
{
|
||||||
@@ -2086,7 +2086,7 @@ void QmakeProFile::setupExtraCompiler(const FilePath &buildDir,
|
|||||||
const FileType &fileType, ExtraCompilerFactory *factory)
|
const FileType &fileType, ExtraCompilerFactory *factory)
|
||||||
{
|
{
|
||||||
for (const FilePath &fn : collectFiles(fileType)) {
|
for (const FilePath &fn : collectFiles(fileType)) {
|
||||||
const FilePathList generated = generatedFiles(buildDir, fn, fileType);
|
const FilePaths generated = generatedFiles(buildDir, fn, fileType);
|
||||||
if (!generated.isEmpty())
|
if (!generated.isEmpty())
|
||||||
m_extraCompilers.append(factory->create(m_buildSystem->project(), fn, generated));
|
m_extraCompilers.append(factory->create(m_buildSystem->project(), fn, generated));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ public:
|
|||||||
Utils::FilePath sourceDir() const;
|
Utils::FilePath sourceDir() const;
|
||||||
Utils::FilePath buildDir(ProjectExplorer::BuildConfiguration *bc = nullptr) const;
|
Utils::FilePath buildDir(ProjectExplorer::BuildConfiguration *bc = nullptr) const;
|
||||||
|
|
||||||
Utils::FilePathList generatedFiles(const Utils::FilePath &buildDirectory,
|
Utils::FilePaths generatedFiles(const Utils::FilePath &buildDirectory,
|
||||||
const Utils::FilePath &sourceFile,
|
const Utils::FilePath &sourceFile,
|
||||||
const ProjectExplorer::FileType &sourceFileType) const;
|
const ProjectExplorer::FileType &sourceFileType) const;
|
||||||
QList<ProjectExplorer::ExtraCompiler *> extraCompilers() const;
|
QList<ProjectExplorer::ExtraCompiler *> extraCompilers() const;
|
||||||
@@ -361,7 +361,7 @@ private:
|
|||||||
static QString sysrootify(const QString &path, const QString &sysroot, const QString &baseDir, const QString &outputDir);
|
static QString sysrootify(const QString &path, const QString &sysroot, const QString &baseDir, const QString &outputDir);
|
||||||
static QStringList includePaths(QtSupport::ProFileReader *reader, const Utils::FilePath &sysroot, const Utils::FilePath &buildDir, const QString &projectDir);
|
static QStringList includePaths(QtSupport::ProFileReader *reader, const Utils::FilePath &sysroot, const Utils::FilePath &buildDir, const QString &projectDir);
|
||||||
static QStringList libDirectories(QtSupport::ProFileReader *reader);
|
static QStringList libDirectories(QtSupport::ProFileReader *reader);
|
||||||
static Utils::FilePathList subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors);
|
static Utils::FilePaths subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors);
|
||||||
|
|
||||||
static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const Utils::FilePath &buildDir, const Utils::FilePath &projectFilePath);
|
static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const Utils::FilePath &buildDir, const Utils::FilePath &projectFilePath);
|
||||||
static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir, const QString &buildDir);
|
static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir, const QString &buildDir);
|
||||||
@@ -382,7 +382,7 @@ private:
|
|||||||
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
|
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
|
||||||
|
|
||||||
TargetInformation m_qmakeTargetInformation;
|
TargetInformation m_qmakeTargetInformation;
|
||||||
Utils::FilePathList m_subProjectsNotToDeploy;
|
Utils::FilePaths m_subProjectsNotToDeploy;
|
||||||
InstallsList m_installsList;
|
InstallsList m_installsList;
|
||||||
QStringList m_featureRoots;
|
QStringList m_featureRoots;
|
||||||
|
|
||||||
|
|||||||
@@ -748,7 +748,7 @@ static void notifyChangedHelper(const FilePath &fileName, QmakeProFile *file)
|
|||||||
|
|
||||||
void QmakeBuildSystem::notifyChanged(const FilePath &name)
|
void QmakeBuildSystem::notifyChanged(const FilePath &name)
|
||||||
{
|
{
|
||||||
FilePathList files = project()->files([&name](const Node *n) {
|
FilePaths files = project()->files([&name](const Node *n) {
|
||||||
return Project::SourceFiles(n) && n->filePath() == name;
|
return Project::SourceFiles(n) && n->filePath() == name;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ public:
|
|||||||
bool isComplete() const override { return m_filesWidget->hasFilesSelected(); }
|
bool isComplete() const override { return m_filesWidget->hasFilesSelected(); }
|
||||||
void initializePage() override;
|
void initializePage() override;
|
||||||
void cleanupPage() override { m_filesWidget->cancelParsing(); }
|
void cleanupPage() override { m_filesWidget->cancelParsing(); }
|
||||||
FilePathList selectedFiles() const { return m_filesWidget->selectedFiles(); }
|
FilePaths selectedFiles() const { return m_filesWidget->selectedFiles(); }
|
||||||
FilePathList selectedPaths() const { return m_filesWidget->selectedPaths(); }
|
FilePaths selectedPaths() const { return m_filesWidget->selectedPaths(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SimpleProjectWizardDialog *m_simpleProjectWizardDialog;
|
SimpleProjectWizardDialog *m_simpleProjectWizardDialog;
|
||||||
@@ -117,8 +117,8 @@ public:
|
|||||||
|
|
||||||
QString path() const { return m_firstPage->path(); }
|
QString path() const { return m_firstPage->path(); }
|
||||||
void setPath(const QString &path) { m_firstPage->setPath(path); }
|
void setPath(const QString &path) { m_firstPage->setPath(path); }
|
||||||
FilePathList selectedFiles() const { return m_secondPage->selectedFiles(); }
|
FilePaths selectedFiles() const { return m_secondPage->selectedFiles(); }
|
||||||
FilePathList selectedPaths() const { return m_secondPage->selectedPaths(); }
|
FilePaths selectedPaths() const { return m_secondPage->selectedPaths(); }
|
||||||
QString projectName() const { return m_firstPage->fileName(); }
|
QString projectName() const { return m_firstPage->fileName(); }
|
||||||
|
|
||||||
FileWizardPage *m_firstPage;
|
FileWizardPage *m_firstPage;
|
||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
void FilesSelectionWizardPage::initializePage()
|
void FilesSelectionWizardPage::initializePage()
|
||||||
{
|
{
|
||||||
m_filesWidget->resetModel(FilePath::fromString(m_simpleProjectWizardDialog->path()),
|
m_filesWidget->resetModel(FilePath::fromString(m_simpleProjectWizardDialog->path()),
|
||||||
FilePathList());
|
FilePaths());
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleProjectWizard::SimpleProjectWizard()
|
SimpleProjectWizard::SimpleProjectWizard()
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ QmlPreviewConnectionManager::QmlPreviewConnectionManager(QObject *parent) :
|
|||||||
void QmlPreviewConnectionManager::setTarget(ProjectExplorer::Target *target)
|
void QmlPreviewConnectionManager::setTarget(ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
QtSupport::BaseQtVersion::populateQmlFileFinder(&m_projectFileFinder, target);
|
QtSupport::BaseQtVersion::populateQmlFileFinder(&m_projectFileFinder, target);
|
||||||
m_projectFileFinder.setAdditionalSearchDirectories(Utils::FilePathList());
|
m_projectFileFinder.setAdditionalSearchDirectories(Utils::FilePaths());
|
||||||
m_targetFileFinder.setTarget(target);
|
m_targetFileFinder.setTarget(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public:
|
|||||||
void setId(int id); // used by the qtversionmanager for legacy restore
|
void setId(int id); // used by the qtversionmanager for legacy restore
|
||||||
// and by the qtoptionspage to replace Qt versions
|
// and by the qtoptionspage to replace Qt versions
|
||||||
|
|
||||||
FilePathList qtCorePaths();
|
FilePaths qtCorePaths();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BaseQtVersion *q;
|
BaseQtVersion *q;
|
||||||
@@ -645,9 +645,9 @@ FilePath BaseQtVersion::librarySearchPath() const
|
|||||||
return HostOsInfo::isWindowsHost() ? binPath() : libraryPath();
|
return HostOsInfo::isWindowsHost() ? binPath() : libraryPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList BaseQtVersion::directoriesToIgnoreInProjectTree() const
|
FilePaths BaseQtVersion::directoriesToIgnoreInProjectTree() const
|
||||||
{
|
{
|
||||||
FilePathList result;
|
FilePaths result;
|
||||||
const FilePath mkspecPathGet = mkspecsPath();
|
const FilePath mkspecPathGet = mkspecsPath();
|
||||||
result.append(mkspecPathGet);
|
result.append(mkspecPathGet);
|
||||||
|
|
||||||
@@ -1381,7 +1381,7 @@ FilePath BaseQtVersion::examplesPath() const // QT_INSTALL_EXAMPLES
|
|||||||
|
|
||||||
QStringList BaseQtVersion::qtSoPaths() const
|
QStringList BaseQtVersion::qtSoPaths() const
|
||||||
{
|
{
|
||||||
const FilePathList qtPaths = {libraryPath(), pluginPath(), qmlPath(), importsPath()};
|
const FilePaths qtPaths = {libraryPath(), pluginPath(), qmlPath(), importsPath()};
|
||||||
QSet<QString> paths;
|
QSet<QString> paths;
|
||||||
for (const FilePath &p : qtPaths) {
|
for (const FilePath &p : qtPaths) {
|
||||||
QString path = p.toString();
|
QString path = p.toString();
|
||||||
@@ -1574,7 +1574,7 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar
|
|||||||
QTC_CHECK(projects.isEmpty() || startupProject);
|
QTC_CHECK(projects.isEmpty() || startupProject);
|
||||||
|
|
||||||
FilePath projectDirectory;
|
FilePath projectDirectory;
|
||||||
FilePathList sourceFiles;
|
FilePaths sourceFiles;
|
||||||
|
|
||||||
// Sort files from startupProject to the front of the list ...
|
// Sort files from startupProject to the front of the list ...
|
||||||
if (startupProject) {
|
if (startupProject) {
|
||||||
@@ -1598,8 +1598,8 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar
|
|||||||
const FilePath activeSysroot = SysRootKitAspect::sysRoot(kit);
|
const FilePath activeSysroot = SysRootKitAspect::sysRoot(kit);
|
||||||
const BaseQtVersion *qtVersion = QtVersionManager::isLoaded()
|
const BaseQtVersion *qtVersion = QtVersionManager::isLoaded()
|
||||||
? QtKitAspect::qtVersion(kit) : nullptr;
|
? QtKitAspect::qtVersion(kit) : nullptr;
|
||||||
FilePathList additionalSearchDirectories = qtVersion
|
FilePaths additionalSearchDirectories = qtVersion
|
||||||
? FilePathList({qtVersion->qmlPath()}) : FilePathList();
|
? FilePaths({qtVersion->qmlPath()}) : FilePaths();
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
for (const DeployableFile &file : target->deploymentData().allFiles())
|
for (const DeployableFile &file : target->deploymentData().allFiles())
|
||||||
@@ -2002,7 +2002,7 @@ bool BaseQtVersion::isQtQuickCompilerSupported(QString *reason) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePathList BaseQtVersionPrivate::qtCorePaths()
|
FilePaths BaseQtVersionPrivate::qtCorePaths()
|
||||||
{
|
{
|
||||||
updateVersionInfo();
|
updateVersionInfo();
|
||||||
const QString versionString = m_data.qtVersionString;
|
const QString versionString = m_data.qtVersionString;
|
||||||
@@ -2020,8 +2020,8 @@ FilePathList BaseQtVersionPrivate::qtCorePaths()
|
|||||||
result += QDir(installBinDir).entryInfoList(filters);
|
result += QDir(installBinDir).entryInfoList(filters);
|
||||||
return result;
|
return result;
|
||||||
}();
|
}();
|
||||||
FilePathList staticLibs;
|
FilePaths staticLibs;
|
||||||
FilePathList dynamicLibs;
|
FilePaths dynamicLibs;
|
||||||
for (const QFileInfo &info : entryInfoList) {
|
for (const QFileInfo &info : entryInfoList) {
|
||||||
const QString file = info.fileName();
|
const QString file = info.fileName();
|
||||||
if (info.isDir()
|
if (info.isDir()
|
||||||
@@ -2215,7 +2215,7 @@ static Abi scanQtBinaryForBuildStringAndRefineAbi(const FilePath &library,
|
|||||||
return results.value(library);
|
return results.value(library);
|
||||||
}
|
}
|
||||||
|
|
||||||
Abis BaseQtVersion::qtAbisFromLibrary(const FilePathList &coreLibraries)
|
Abis BaseQtVersion::qtAbisFromLibrary(const FilePaths &coreLibraries)
|
||||||
{
|
{
|
||||||
Abis res;
|
Abis res;
|
||||||
for (const FilePath &library : coreLibraries) {
|
for (const FilePath &library : coreLibraries) {
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ public:
|
|||||||
Utils::FilePath qmlBinPath() const;
|
Utils::FilePath qmlBinPath() const;
|
||||||
Utils::FilePath librarySearchPath() const;
|
Utils::FilePath librarySearchPath() const;
|
||||||
|
|
||||||
Utils::FilePathList directoriesToIgnoreInProjectTree() const;
|
Utils::FilePaths directoriesToIgnoreInProjectTree() const;
|
||||||
|
|
||||||
QString qtNamespace() const;
|
QString qtNamespace() const;
|
||||||
QString qtLibInfix() const;
|
QString qtLibInfix() const;
|
||||||
@@ -242,7 +242,7 @@ protected:
|
|||||||
virtual ProjectExplorer::Tasks reportIssuesImpl(const QString &proFile, const QString &buildDir) const;
|
virtual ProjectExplorer::Tasks reportIssuesImpl(const QString &proFile, const QString &buildDir) const;
|
||||||
|
|
||||||
// helper function for desktop and simulator to figure out the supported abis based on the libraries
|
// helper function for desktop and simulator to figure out the supported abis based on the libraries
|
||||||
static ProjectExplorer::Abis qtAbisFromLibrary(const Utils::FilePathList &coreLibraries);
|
static ProjectExplorer::Abis qtAbisFromLibrary(const Utils::FilePaths &coreLibraries);
|
||||||
|
|
||||||
void resetCache() const;
|
void resetCache() const;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ static const char TaskCategory[] = "Task.Category.ExtraCompiler.QScxmlc";
|
|||||||
|
|
||||||
QScxmlcGenerator::QScxmlcGenerator(const Project *project,
|
QScxmlcGenerator::QScxmlcGenerator(const Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent) :
|
const Utils::FilePaths &targets, QObject *parent) :
|
||||||
ProcessExtraCompiler(project, source, targets, parent),
|
ProcessExtraCompiler(project, source, targets, parent),
|
||||||
m_tmpdir("qscxmlgenerator")
|
m_tmpdir("qscxmlgenerator")
|
||||||
{
|
{
|
||||||
@@ -144,7 +144,7 @@ QString QScxmlcGeneratorFactory::sourceTag() const
|
|||||||
|
|
||||||
ExtraCompiler *QScxmlcGeneratorFactory::create(
|
ExtraCompiler *QScxmlcGeneratorFactory::create(
|
||||||
const Project *project, const Utils::FilePath &source,
|
const Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets)
|
const Utils::FilePaths &targets)
|
||||||
{
|
{
|
||||||
annouceCreation(project, source, targets);
|
annouceCreation(project, source, targets);
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class QScxmlcGenerator : public ProjectExplorer::ProcessExtraCompiler
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QScxmlcGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source,
|
QScxmlcGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent = nullptr);
|
const Utils::FilePaths &targets, QObject *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Utils::FilePath command() const override;
|
Utils::FilePath command() const override;
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
ProjectExplorer::ExtraCompiler *create(const ProjectExplorer::Project *project,
|
ProjectExplorer::ExtraCompiler *create(const ProjectExplorer::Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets) override;
|
const Utils::FilePaths &targets) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // QtSupport
|
} // QtSupport
|
||||||
|
|||||||
@@ -408,11 +408,11 @@ static QString qmakePath(const QString &qtchooser, const QString &version)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static FilePathList gatherQmakePathsFromQtChooser()
|
static FilePaths gatherQmakePathsFromQtChooser()
|
||||||
{
|
{
|
||||||
const QString qtchooser = QStandardPaths::findExecutable(QStringLiteral("qtchooser"));
|
const QString qtchooser = QStandardPaths::findExecutable(QStringLiteral("qtchooser"));
|
||||||
if (qtchooser.isEmpty())
|
if (qtchooser.isEmpty())
|
||||||
return FilePathList();
|
return FilePaths();
|
||||||
|
|
||||||
const QList<QByteArray> versions = runQtChooser(qtchooser, QStringList("-l"));
|
const QList<QByteArray> versions = runQtChooser(qtchooser, QStringList("-l"));
|
||||||
QSet<FilePath> foundQMakes;
|
QSet<FilePath> foundQMakes;
|
||||||
@@ -427,12 +427,12 @@ static FilePathList gatherQmakePathsFromQtChooser()
|
|||||||
|
|
||||||
static void findSystemQt()
|
static void findSystemQt()
|
||||||
{
|
{
|
||||||
FilePathList systemQMakes
|
FilePaths systemQMakes
|
||||||
= BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment());
|
= BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment());
|
||||||
|
|
||||||
systemQMakes.append(gatherQmakePathsFromQtChooser());
|
systemQMakes.append(gatherQmakePathsFromQtChooser());
|
||||||
|
|
||||||
const FilePathList uniqueSystemQmakes = Utils::filteredUnique(systemQMakes);
|
const FilePaths uniqueSystemQmakes = Utils::filteredUnique(systemQMakes);
|
||||||
for (const FilePath &qmakePath : uniqueSystemQmakes) {
|
for (const FilePath &qmakePath : uniqueSystemQmakes) {
|
||||||
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath,
|
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath,
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ using namespace ProjectExplorer;
|
|||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
|
|
||||||
UicGenerator::UicGenerator(const Project *project, const Utils::FilePath &source,
|
UicGenerator::UicGenerator(const Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent) :
|
const Utils::FilePaths &targets, QObject *parent) :
|
||||||
ProcessExtraCompiler(project, source, targets, parent)
|
ProcessExtraCompiler(project, source, targets, parent)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(targets.count() == 1, return);
|
QTC_ASSERT(targets.count() == 1, return);
|
||||||
@@ -76,7 +76,7 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
|||||||
if (process->exitStatus() != QProcess::NormalExit && process->exitCode() != 0)
|
if (process->exitStatus() != QProcess::NormalExit && process->exitCode() != 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
const Utils::FilePathList targetList = targets();
|
const Utils::FilePaths targetList = targets();
|
||||||
if (targetList.size() != 1)
|
if (targetList.size() != 1)
|
||||||
return result;
|
return result;
|
||||||
// As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The
|
// As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The
|
||||||
@@ -105,7 +105,7 @@ QString UicGeneratorFactory::sourceTag() const
|
|||||||
|
|
||||||
ExtraCompiler *UicGeneratorFactory::create(const Project *project,
|
ExtraCompiler *UicGeneratorFactory::create(const Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets)
|
const Utils::FilePaths &targets)
|
||||||
{
|
{
|
||||||
annouceCreation(project, source, targets);
|
annouceCreation(project, source, targets);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class UicGenerator : public ProjectExplorer::ProcessExtraCompiler
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
UicGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source,
|
UicGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets, QObject *parent = nullptr);
|
const Utils::FilePaths &targets, QObject *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Utils::FilePath command() const override;
|
Utils::FilePath command() const override;
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
ProjectExplorer::ExtraCompiler *create(const ProjectExplorer::Project *project,
|
ProjectExplorer::ExtraCompiler *create(const ProjectExplorer::Project *project,
|
||||||
const Utils::FilePath &source,
|
const Utils::FilePath &source,
|
||||||
const Utils::FilePathList &targets) override;
|
const Utils::FilePaths &targets) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // QtSupport
|
} // QtSupport
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ QVariant::Type VcsBaseClientSettings::valueType(const QString &key) const
|
|||||||
FilePath VcsBaseClientSettings::binaryPath() const
|
FilePath VcsBaseClientSettings::binaryPath() const
|
||||||
{
|
{
|
||||||
if (d->m_binaryFullPath.isEmpty()) {
|
if (d->m_binaryFullPath.isEmpty()) {
|
||||||
const FilePathList searchPaths = Utils::transform(searchPathList(), &FilePath::fromString);
|
const FilePaths searchPaths = Utils::transform(searchPathList(), &FilePath::fromString);
|
||||||
d->m_binaryFullPath = Environment::systemEnvironment().searchInPath(
|
d->m_binaryFullPath = Environment::systemEnvironment().searchInPath(
|
||||||
stringValue(binaryPathKey), searchPaths);
|
stringValue(binaryPathKey), searchPaths);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public:
|
|||||||
|
|
||||||
QHash<Utils::FilePath, QVariantMap> files() const { return m_files; }
|
QHash<Utils::FilePath, QVariantMap> files() const { return m_files; }
|
||||||
void addFile(const Utils::FilePath &path, const QVariantMap &data) const { m_files.insert(path, data); }
|
void addFile(const Utils::FilePath &path, const QVariantMap &data) const { m_files.insert(path, data); }
|
||||||
Utils::FilePathList fileNames() const { return m_files.keys(); }
|
Utils::FilePaths fileNames() const { return m_files.keys(); }
|
||||||
QVariantMap fileContents(const Utils::FilePath &path) const { return m_files.value(path); }
|
QVariantMap fileContents(const Utils::FilePath &path) const { return m_files.value(path); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -137,7 +137,7 @@ public:
|
|||||||
VersionedBackUpStrategy(accessor)
|
VersionedBackUpStrategy(accessor)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
FilePathList readFileCandidates(const Utils::FilePath &baseFileName) const
|
FilePaths readFileCandidates(const Utils::FilePath &baseFileName) const
|
||||||
{
|
{
|
||||||
return Utils::filtered(static_cast<const BasicTestSettingsAccessor *>(accessor())->fileNames(),
|
return Utils::filtered(static_cast<const BasicTestSettingsAccessor *>(accessor())->fileNames(),
|
||||||
[&baseFileName](const Utils::FilePath &f) {
|
[&baseFileName](const Utils::FilePath &f) {
|
||||||
|
|||||||
Reference in New Issue
Block a user