refactor: use QDir::fromNativeSeperators / toNativeSeperators

This commit is contained in:
Roy Qu 2024-09-06 15:32:18 +08:00
parent b326058ea2
commit 2c5ff4f956
2 changed files with 4 additions and 3 deletions

View File

@ -2560,7 +2560,7 @@ void MainWindow::debug()
inferior=mProject->options().hostApplication;
inferiorHasSymbols = false;
}
inferior.replace('\\','/');
QDir::fromNativeSeparators(inferior);
if (!mDebugger->startClient(
mProject->options().compilerSet,
inferior,
@ -2657,7 +2657,7 @@ void MainWindow::debug()
}
prepareDebugger();
QString newFilePath = debugFile.filePath().replace('\\','/');
QString newFilePath =QDir::fromNativeSeparators(debugFile.filePath());
if (!mDebugger->startClient(
pSettings->compilerSets().defaultIndex(),
newFilePath,

View File

@ -21,6 +21,7 @@
#include <QFileInfo>
#include <QDebug>
#include <QGlobalStatic>
#include "../systemconsts.h"
#include "../utils.h"
QStringList CppDirectives;
@ -506,7 +507,7 @@ bool isSystemHeaderFile(const QString &fileName, const QSet<QString> &includePat
QDir dir = info.dir();
QString absPath = dir.absolutePath();
foreach (const QString& incPath, includePaths) {
if (absPath.startsWith(incPath))
if (absPath.startsWith(incPath, PATH_SENSITIVITY))
return true;
}
}