forked from qt-creator/qt-creator
CppTools: Do not append '/' to fallback header paths
...since this will confuse the completer. Task-number: QTCREATORBUG-13567 Change-Id: I4172d433f23f3907690d4c00f92fadb68fa354e8 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -38,17 +38,9 @@
|
|||||||
|
|
||||||
using namespace Core::Tests;
|
using namespace Core::Tests;
|
||||||
|
|
||||||
static void maybeAppendSlash(QString *string)
|
|
||||||
{
|
|
||||||
const QChar slash = QLatin1Char('/');
|
|
||||||
if (!string->endsWith(slash))
|
|
||||||
string->append(slash);
|
|
||||||
}
|
|
||||||
|
|
||||||
TestDataDir::TestDataDir(const QString &directory)
|
TestDataDir::TestDataDir(const QString &directory)
|
||||||
: m_directory(directory)
|
: m_directory(directory)
|
||||||
{
|
{
|
||||||
maybeAppendSlash(&m_directory);
|
|
||||||
QFileInfo fi(m_directory);
|
QFileInfo fi(m_directory);
|
||||||
QVERIFY(fi.exists());
|
QVERIFY(fi.exists());
|
||||||
QVERIFY(fi.isDir());
|
QVERIFY(fi.isDir());
|
||||||
@@ -56,7 +48,7 @@ TestDataDir::TestDataDir(const QString &directory)
|
|||||||
|
|
||||||
QString TestDataDir::file(const QString &fileName) const
|
QString TestDataDir::file(const QString &fileName) const
|
||||||
{
|
{
|
||||||
return directory() + fileName;
|
return directory() + QLatin1Char('/') + fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TestDataDir::directory(const QString &subdir, bool clean) const
|
QString TestDataDir::directory(const QString &subdir, bool clean) const
|
||||||
@@ -66,6 +58,5 @@ QString TestDataDir::directory(const QString &subdir, bool clean) const
|
|||||||
path += QLatin1Char('/') + subdir;
|
path += QLatin1Char('/') + subdir;
|
||||||
if (clean)
|
if (clean)
|
||||||
path = QDir::cleanPath(path);
|
path = QDir::cleanPath(path);
|
||||||
maybeAppendSlash(&path);
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,8 +393,7 @@ ProjectPart::HeaderPaths CppModelManager::internalHeaderPaths() const
|
|||||||
const ProjectInfo pinfo = it.value();
|
const ProjectInfo pinfo = it.value();
|
||||||
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
||||||
foreach (const ProjectPart::HeaderPath &path, part->headerPaths) {
|
foreach (const ProjectPart::HeaderPath &path, part->headerPaths) {
|
||||||
const ProjectPart::HeaderPath hp(CppSourceProcessor::cleanPath(path.path),
|
const ProjectPart::HeaderPath hp(QDir::cleanPath(path.path), path.type);
|
||||||
path.type);
|
|
||||||
if (!headerPaths.contains(hp))
|
if (!headerPaths.contains(hp))
|
||||||
headerPaths += hp;
|
headerPaths += hp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
{ return directory(_("frameworks"), cleaned); }
|
{ return directory(_("frameworks"), cleaned); }
|
||||||
|
|
||||||
QString fileFromSourcesDir(const QString &fileName) const
|
QString fileFromSourcesDir(const QString &fileName) const
|
||||||
{ return directory(_("sources")) + fileName; }
|
{ return directory(_("sources")) + QLatin1Char('/') + fileName; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: When possible, use this helper class in all tests
|
// TODO: When possible, use this helper class in all tests
|
||||||
|
|||||||
Reference in New Issue
Block a user