2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-12-01 16:09:08 +01:00
|
|
|
**
|
2016-01-15 14:58:39 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-12-01 16:09:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-12-01 16:09:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:58:39 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-12-01 16:09:08 +01:00
|
|
|
**
|
2016-01-15 14:58:39 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 17:14:20 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-12-01 16:09:08 +01:00
|
|
|
|
|
|
|
|
#include "fileinprojectfinder.h"
|
2015-01-10 23:40:32 +02:00
|
|
|
#include "fileutils.h"
|
2016-09-10 22:57:46 +03:00
|
|
|
#include "hostosinfo.h"
|
2015-01-10 23:40:32 +02:00
|
|
|
#include "qtcassert.h"
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2012-04-17 08:01:25 +02:00
|
|
|
#include <QDebug>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QFileInfo>
|
|
|
|
|
#include <QUrl>
|
2017-12-04 12:31:17 +01:00
|
|
|
#include <QDir>
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2015-02-05 11:52:03 +01:00
|
|
|
#include <algorithm>
|
|
|
|
|
|
2012-04-16 11:33:18 +02:00
|
|
|
enum { debug = false };
|
|
|
|
|
|
2010-12-01 16:09:08 +01:00
|
|
|
namespace Utils {
|
|
|
|
|
|
2018-01-29 13:59:28 +01:00
|
|
|
static bool checkPath(const QString &candidate, FileInProjectFinder::FindMode findMode)
|
|
|
|
|
{
|
|
|
|
|
const QFileInfo candidateInfo(candidate);
|
|
|
|
|
return (candidateInfo.isFile() && (findMode & FileInProjectFinder::FindFile))
|
|
|
|
|
|| (candidateInfo.isDir() && (findMode & FileInProjectFinder::FindDirectory));
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-02 17:13:33 +01:00
|
|
|
/*!
|
|
|
|
|
\class Utils::FileInProjectFinder
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2013-06-05 14:29:24 +02:00
|
|
|
\brief The FileInProjectFinder class is a helper class to find the \e original
|
|
|
|
|
file in the project directory for a given file URL.
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2013-09-06 13:23:11 +02:00
|
|
|
Often files are copied in the build and deploy process. findFile() searches for an existing file
|
|
|
|
|
in the project directory for a given file path.
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2013-09-06 13:23:11 +02:00
|
|
|
For example, the following file paths should all be mapped to
|
|
|
|
|
$PROJECTDIR/qml/app/main.qml:
|
2011-03-02 17:13:33 +01:00
|
|
|
\list
|
2013-02-06 08:50:23 +01:00
|
|
|
\li C:/app-build-desktop/qml/app/main.qml (shadow build directory)
|
|
|
|
|
\li /Users/x/app-build-desktop/App.app/Contents/Resources/qml/App/main.qml (folder on Mac OS X)
|
2011-03-02 17:13:33 +01:00
|
|
|
\endlist
|
|
|
|
|
*/
|
|
|
|
|
|
2010-12-01 16:09:08 +01:00
|
|
|
FileInProjectFinder::FileInProjectFinder()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-10-11 15:17:44 +02:00
|
|
|
static QString stripTrailingSlashes(const QString &path)
|
|
|
|
|
{
|
|
|
|
|
QString newPath = path;
|
|
|
|
|
while (newPath.endsWith(QLatin1Char('/')))
|
|
|
|
|
newPath.remove(newPath.length() - 1, 1);
|
|
|
|
|
return newPath;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-01 16:09:08 +01:00
|
|
|
void FileInProjectFinder::setProjectDirectory(const QString &absoluteProjectPath)
|
|
|
|
|
{
|
2011-10-11 15:17:44 +02:00
|
|
|
const QString newProjectPath = stripTrailingSlashes(absoluteProjectPath);
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2011-10-11 15:17:44 +02:00
|
|
|
if (newProjectPath == m_projectDir)
|
2010-12-01 16:09:08 +01:00
|
|
|
return;
|
|
|
|
|
|
2011-10-11 15:17:44 +02:00
|
|
|
const QFileInfo infoPath(newProjectPath);
|
|
|
|
|
QTC_CHECK(newProjectPath.isEmpty()
|
2011-10-12 13:49:26 +02:00
|
|
|
|| (infoPath.exists() && infoPath.isAbsolute()));
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2011-10-11 15:17:44 +02:00
|
|
|
m_projectDir = newProjectPath;
|
2010-12-01 16:09:08 +01:00
|
|
|
m_cache.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString FileInProjectFinder::projectDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return m_projectDir;
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-23 14:19:06 +01:00
|
|
|
void FileInProjectFinder::setProjectFiles(const QStringList &projectFiles)
|
|
|
|
|
{
|
2011-10-11 15:17:44 +02:00
|
|
|
if (m_projectFiles == projectFiles)
|
|
|
|
|
return;
|
|
|
|
|
|
2011-03-23 14:19:06 +01:00
|
|
|
m_projectFiles = projectFiles;
|
|
|
|
|
m_cache.clear();
|
|
|
|
|
}
|
|
|
|
|
|
2011-10-11 15:21:00 +02:00
|
|
|
void FileInProjectFinder::setSysroot(const QString &sysroot)
|
|
|
|
|
{
|
|
|
|
|
QString newsys = sysroot;
|
|
|
|
|
while (newsys.endsWith(QLatin1Char('/')))
|
|
|
|
|
newsys.remove(newsys.length() - 1, 1);
|
|
|
|
|
|
|
|
|
|
if (m_sysroot == newsys)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_sysroot = newsys;
|
|
|
|
|
m_cache.clear();
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-06 13:23:11 +02:00
|
|
|
/*!
|
|
|
|
|
Returns the best match for the given file URL in the project directory.
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2013-10-07 13:34:40 +02:00
|
|
|
The function first checks whether the file inside the project directory exists.
|
2010-12-01 16:09:08 +01:00
|
|
|
If not, the leading directory in the path is stripped, and the - now shorter - path is
|
2011-10-11 15:21:00 +02:00
|
|
|
checked for existence, and so on. Second, it tries to locate the file in the sysroot
|
|
|
|
|
folder specified. Third, we walk the list of project files, and search for a file name match
|
2013-09-06 13:23:11 +02:00
|
|
|
there. If all fails, it returns the original path from the file URL.
|
2010-12-01 16:09:08 +01:00
|
|
|
*/
|
2011-07-19 17:48:57 +02:00
|
|
|
QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
|
2010-12-01 16:09:08 +01:00
|
|
|
{
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: trying to find file" << fileUrl.toString() << "...";
|
|
|
|
|
|
2011-07-21 15:32:20 +02:00
|
|
|
QString originalPath = fileUrl.toLocalFile();
|
|
|
|
|
if (originalPath.isEmpty()) // e.g. qrc://
|
2011-07-19 17:48:57 +02:00
|
|
|
originalPath = fileUrl.path();
|
|
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
return findFileOrDirectory(originalPath, FindFile, success);
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-29 13:59:28 +01:00
|
|
|
QString FileInProjectFinder::handleSuccess(const QString &originalPath, const QString &found,
|
|
|
|
|
bool *success, const char *where, bool doCache) const
|
|
|
|
|
{
|
|
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: found" << found << where;
|
|
|
|
|
if (doCache)
|
|
|
|
|
m_cache.insert(originalPath, found);
|
|
|
|
|
if (success)
|
|
|
|
|
*success = true;
|
|
|
|
|
return found;
|
|
|
|
|
}
|
2017-12-04 12:31:17 +01:00
|
|
|
|
|
|
|
|
QString FileInProjectFinder::findFileOrDirectory(const QString &originalPath, FindMode findMode,
|
|
|
|
|
bool *success) const
|
|
|
|
|
{
|
2011-07-19 17:48:57 +02:00
|
|
|
if (originalPath.isEmpty()) {
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
2017-12-04 12:31:17 +01:00
|
|
|
qDebug() << "FileInProjectFinder: malformed original path, returning";
|
2011-07-19 17:48:57 +02:00
|
|
|
if (success)
|
2011-07-28 13:04:34 +00:00
|
|
|
*success = false;
|
2011-07-19 17:48:57 +02:00
|
|
|
return originalPath;
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-01 16:03:45 +02:00
|
|
|
if (!m_projectDir.isEmpty()) {
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: checking project directory ...";
|
|
|
|
|
|
2018-01-29 13:59:28 +01:00
|
|
|
auto it = m_cache.find(originalPath);
|
|
|
|
|
if (it != m_cache.end()) {
|
|
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: checking cache ...";
|
|
|
|
|
// check if cached path is still there
|
|
|
|
|
const QString &candidate = it.value();
|
|
|
|
|
if (checkPath(candidate, findMode))
|
|
|
|
|
return handleSuccess(originalPath, candidate, success, "in the cache", false);
|
|
|
|
|
else
|
|
|
|
|
m_cache.erase(it);
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-15 12:07:20 +02:00
|
|
|
int prefixToIgnore = -1;
|
2011-06-01 16:03:45 +02:00
|
|
|
const QChar separator = QLatin1Char('/');
|
|
|
|
|
if (originalPath.startsWith(m_projectDir + separator)) {
|
2016-09-10 22:57:46 +03:00
|
|
|
if (Utils::HostOsInfo::isMacHost()) {
|
|
|
|
|
// starting with the project path is not sufficient if the file was
|
|
|
|
|
// copied in an insource build, e.g. into MyApp.app/Contents/Resources
|
|
|
|
|
static const QString appResourcePath = QString::fromLatin1(".app/Contents/Resources");
|
|
|
|
|
if (originalPath.contains(appResourcePath)) {
|
|
|
|
|
// the path is inside the project, but most probably as a resource of an insource build
|
|
|
|
|
// so ignore that path
|
|
|
|
|
prefixToIgnore = originalPath.indexOf(appResourcePath) + appResourcePath.length();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-29 13:59:28 +01:00
|
|
|
if (prefixToIgnore == -1 && checkPath(originalPath, findMode))
|
|
|
|
|
return handleSuccess(originalPath, originalPath, success, "in project directory");
|
2011-06-01 16:03:45 +02:00
|
|
|
}
|
2010-12-01 16:09:08 +01:00
|
|
|
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: checking stripped paths in project directory ...";
|
|
|
|
|
|
2011-06-01 16:03:45 +02:00
|
|
|
// Strip directories one by one from the beginning of the path,
|
|
|
|
|
// and see if the new relative path exists in the build directory.
|
2011-07-19 17:48:57 +02:00
|
|
|
if (prefixToIgnore < 0) {
|
|
|
|
|
if (!QFileInfo(originalPath).isAbsolute()
|
|
|
|
|
&& !originalPath.startsWith(separator)) {
|
|
|
|
|
prefixToIgnore = 0;
|
|
|
|
|
} else {
|
2011-07-15 12:07:20 +02:00
|
|
|
prefixToIgnore = originalPath.indexOf(separator);
|
2011-07-19 17:48:57 +02:00
|
|
|
}
|
|
|
|
|
}
|
2011-07-15 12:07:20 +02:00
|
|
|
while (prefixToIgnore != -1) {
|
|
|
|
|
QString candidate = originalPath;
|
|
|
|
|
candidate.remove(0, prefixToIgnore);
|
|
|
|
|
candidate.prepend(m_projectDir);
|
2018-01-29 13:59:28 +01:00
|
|
|
if (checkPath(candidate, findMode))
|
|
|
|
|
return handleSuccess(originalPath, candidate, success, "in project directory");
|
2011-07-15 12:07:20 +02:00
|
|
|
prefixToIgnore = originalPath.indexOf(separator, prefixToIgnore + 1);
|
2010-12-01 16:09:08 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-05 11:52:03 +01:00
|
|
|
// find best matching file path in project files
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: checking project files ...";
|
|
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
QStringList matches;
|
|
|
|
|
const QString lastSegment = FileName::fromString(originalPath).fileName();
|
|
|
|
|
if (findMode & FindFile)
|
|
|
|
|
matches.append(filesWithSameFileName(lastSegment));
|
|
|
|
|
if (findMode & FindDirectory)
|
|
|
|
|
matches.append(pathSegmentsWithSameName(lastSegment));
|
|
|
|
|
const QString matchedFilePath = bestMatch(matches, originalPath);
|
2018-01-29 13:59:28 +01:00
|
|
|
if (!matchedFilePath.isEmpty())
|
|
|
|
|
return handleSuccess(originalPath, matchedFilePath, success, "when matching project files");
|
2011-10-28 13:15:18 +02:00
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
bool foundinSearchPaths = false;
|
|
|
|
|
const QString foundPath = findInSearchPaths(originalPath, findMode, &foundinSearchPaths);
|
2018-01-29 13:59:28 +01:00
|
|
|
if (foundinSearchPaths)
|
|
|
|
|
return handleSuccess(originalPath, foundPath, success, "in search path");
|
2015-03-06 18:21:11 +01:00
|
|
|
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: checking absolute path in sysroot ...";
|
|
|
|
|
|
2011-10-11 15:21:00 +02:00
|
|
|
// check if absolute path is found in sysroot
|
|
|
|
|
if (!m_sysroot.isEmpty()) {
|
2011-10-15 13:36:39 +02:00
|
|
|
const QString sysrootPath = m_sysroot + originalPath;
|
2018-01-29 13:59:28 +01:00
|
|
|
if (checkPath(sysrootPath, findMode))
|
|
|
|
|
return handleSuccess(originalPath, sysrootPath, success, "in sysroot");
|
2011-10-11 15:21:00 +02:00
|
|
|
}
|
|
|
|
|
|
2010-12-01 16:09:08 +01:00
|
|
|
if (success)
|
|
|
|
|
*success = false;
|
|
|
|
|
|
2012-04-16 11:33:18 +02:00
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: couldn't find file!";
|
2010-12-01 16:09:08 +01:00
|
|
|
return originalPath;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-29 13:59:28 +01:00
|
|
|
QString FileInProjectFinder::findInSearchPaths(const QString &filePath, FindMode findMode,
|
2017-12-04 12:31:17 +01:00
|
|
|
bool *success) const
|
2015-03-06 18:21:11 +01:00
|
|
|
{
|
2017-12-04 12:31:17 +01:00
|
|
|
*success = false;
|
|
|
|
|
for (const QString &dirPath : m_searchDirectories) {
|
|
|
|
|
const QString found = findInSearchPath(dirPath, filePath, findMode, success);
|
|
|
|
|
if (*success)
|
|
|
|
|
return found;
|
2015-03-06 18:21:11 +01:00
|
|
|
}
|
2017-12-04 12:31:17 +01:00
|
|
|
return QString();
|
2015-03-06 18:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
static QString chopFirstDir(const QString &dirPath)
|
2015-03-06 18:21:11 +01:00
|
|
|
{
|
2017-12-04 12:31:17 +01:00
|
|
|
int i = dirPath.indexOf(QLatin1Char('/'));
|
2015-03-06 18:21:11 +01:00
|
|
|
if (i == -1)
|
2017-12-04 12:31:17 +01:00
|
|
|
return QString();
|
2015-03-06 18:21:11 +01:00
|
|
|
else
|
2017-12-04 12:31:17 +01:00
|
|
|
return dirPath.mid(i + 1);
|
2015-03-06 18:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
QString FileInProjectFinder::findInSearchPath(const QString &searchPath, const QString &filePath,
|
|
|
|
|
FindMode findMode, bool *success)
|
2015-03-06 18:21:11 +01:00
|
|
|
{
|
|
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: checking search path" << searchPath;
|
|
|
|
|
|
|
|
|
|
QFileInfo fi;
|
2017-12-04 12:31:17 +01:00
|
|
|
QString s = filePath;
|
2015-03-06 18:21:11 +01:00
|
|
|
while (!s.isEmpty()) {
|
2018-01-29 13:59:28 +01:00
|
|
|
const QString candidate = searchPath + QLatin1Char('/') + s;
|
2015-03-06 18:21:11 +01:00
|
|
|
if (debug)
|
2018-01-29 13:59:28 +01:00
|
|
|
qDebug() << "FileInProjectFinder: trying" << candidate;
|
|
|
|
|
if (checkPath(candidate, findMode)) {
|
2017-12-04 12:31:17 +01:00
|
|
|
*success = true;
|
2018-01-29 13:59:28 +01:00
|
|
|
return candidate;
|
2015-03-06 18:21:11 +01:00
|
|
|
}
|
2017-12-04 12:31:17 +01:00
|
|
|
QString next = chopFirstDir(s);
|
|
|
|
|
if (next.isEmpty()) {
|
|
|
|
|
if ((findMode & FindDirectory) && QFileInfo(searchPath).fileName() == s) {
|
|
|
|
|
*success = true;
|
|
|
|
|
return searchPath;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
s = next;
|
2015-03-06 18:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
*success = false;
|
|
|
|
|
return QString();
|
2015-03-06 18:21:11 +01:00
|
|
|
}
|
|
|
|
|
|
2015-02-05 11:52:03 +01:00
|
|
|
QStringList FileInProjectFinder::filesWithSameFileName(const QString &fileName) const
|
|
|
|
|
{
|
|
|
|
|
QStringList result;
|
|
|
|
|
foreach (const QString &f, m_projectFiles) {
|
|
|
|
|
if (FileName::fromString(f).fileName() == fileName)
|
|
|
|
|
result << f;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-04 12:31:17 +01:00
|
|
|
QStringList FileInProjectFinder::pathSegmentsWithSameName(const QString &pathSegment) const
|
|
|
|
|
{
|
|
|
|
|
QStringList result;
|
|
|
|
|
for (const QString &f : m_projectFiles) {
|
|
|
|
|
QDir dir = FileName::fromString(f).toFileInfo().absoluteDir();
|
|
|
|
|
do {
|
|
|
|
|
if (dir.dirName() == pathSegment) {
|
|
|
|
|
if (result.isEmpty() || result.last() != dir.path())
|
|
|
|
|
result.append(dir.path());
|
|
|
|
|
}
|
|
|
|
|
} while (dir.cdUp());
|
|
|
|
|
}
|
|
|
|
|
result.removeDuplicates();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-05 11:52:03 +01:00
|
|
|
int FileInProjectFinder::rankFilePath(const QString &candidatePath, const QString &filePathToFind)
|
|
|
|
|
{
|
|
|
|
|
int rank = 0;
|
|
|
|
|
for (int a = candidatePath.length(), b = filePathToFind.length();
|
|
|
|
|
--a >= 0 && --b >= 0 && candidatePath.at(a) == filePathToFind.at(b);)
|
|
|
|
|
rank++;
|
|
|
|
|
return rank;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString FileInProjectFinder::bestMatch(const QStringList &filePaths, const QString &filePathToFind)
|
|
|
|
|
{
|
|
|
|
|
if (filePaths.isEmpty())
|
|
|
|
|
return QString();
|
|
|
|
|
if (filePaths.length() == 1) {
|
|
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: found" << filePaths.first() << "in project files";
|
|
|
|
|
return filePaths.first();
|
|
|
|
|
}
|
|
|
|
|
auto it = std::max_element(filePaths.constBegin(), filePaths.constEnd(),
|
|
|
|
|
[&filePathToFind] (const QString &a, const QString &b) -> bool {
|
|
|
|
|
return rankFilePath(a, filePathToFind) < rankFilePath(b, filePathToFind);
|
|
|
|
|
});
|
|
|
|
|
if (it != filePaths.cend()) {
|
|
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "FileInProjectFinder: found best match" << *it << "in project files";
|
|
|
|
|
return *it;
|
|
|
|
|
}
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-06 18:21:11 +01:00
|
|
|
QStringList FileInProjectFinder::searchDirectories() const
|
|
|
|
|
{
|
|
|
|
|
return m_searchDirectories;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FileInProjectFinder::setAdditionalSearchDirectories(const QStringList &searchDirectories)
|
|
|
|
|
{
|
|
|
|
|
m_searchDirectories = searchDirectories;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-12-01 16:09:08 +01:00
|
|
|
} // namespace Utils
|