return true;
}
+QStringRef IoUtils::pathName(const QString &fileName)
+{
+ return fileName.leftRef(fileName.lastIndexOf(QLatin1Char('/')) + 1);
+}
+
QStringRef IoUtils::fileName(const QString &fileName)
{
return fileName.midRef(fileName.lastIndexOf(QLatin1Char('/')) + 1);
static bool exists(const QString &fileName) { return fileType(fileName) != FileNotFound; }
static bool isRelativePath(const QString &fileName);
static bool isAbsolutePath(const QString &fileName) { return !isRelativePath(fileName); }
+ static QStringRef pathName(const QString &fileName); // Requires normalized path
static QStringRef fileName(const QString &fileName); // Requires normalized path
static QString resolvePath(const QString &baseDir, const QString &fileName);
static QString shellQuoteUnix(const QString &arg);
int start_root = 0;
QString currFn = currentFileName();
if (IoUtils::fileName(currFn) == IoUtils::fileName(fn)) {
+ QStringRef currPath = IoUtils::pathName(currFn);
for (int root = 0; root < m_featureRoots.size(); ++root)
- if (currFn == m_featureRoots.at(root) + fn) {
+ if (currPath == m_featureRoots.at(root)) {
start_root = root + 1;
break;
}