From 829e73895b39b49a9a717185963620213dff9ca4 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 6 Aug 2022 08:51:53 +0800 Subject: [PATCH] - fix: files in network drive is opened in readonly mode --- NEWS.md | 1 + RedPandaIDE/parser/parserutils.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index f7e80e23..f047dd09 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ Red Panda C++ Version 1.2 - enhancement: Portuguese Translation ( Thanks for crcpucmg@github) + - fix: files in network drive is opened in readonly mode Red Panda C++ Version 1.1.6 diff --git a/RedPandaIDE/parser/parserutils.cpp b/RedPandaIDE/parser/parserutils.cpp index dfcdbc0d..61c7fe72 100644 --- a/RedPandaIDE/parser/parserutils.cpp +++ b/RedPandaIDE/parser/parserutils.cpp @@ -425,14 +425,15 @@ bool isSystemHeaderFile(const QString &fileName, const QSet &includePat if (includePaths.isEmpty()) return false; bool isFullName = false; + #ifdef Q_OS_WIN - isFullName = fileName.length()>2 && fileName[1]==':'; + isFullName = fileName.startsWith("/") || (fileName.length()>2 && fileName[1]==':'); #else isFullName = fileName.startsWith("/"); #endif if (isFullName) { - // If it's a full file name, check if its directory is an include path QFileInfo info(fileName); + // If it's a full file name, check if its directory is an include path if (info.exists()) { // full file name QDir dir = info.dir(); QString absPath = includeTrailingPathDelimiter(dir.absolutePath());