mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:56:22 +00:00
UI: Fix unrecognized kernel paths handling
This commit is contained in:
parent
7acd81cd02
commit
206392988c
@ -39,6 +39,13 @@ TEST_F(FileUtilTest, paths)
|
||||
ASSERT_EQ(FileUtil::pathToKernelPath(path, /*lower=*/false), kernelPath);
|
||||
}
|
||||
|
||||
TEST_F(FileUtilTest, mupPath)
|
||||
{
|
||||
const QString path(R"(\device\mup\vmware-host\shared folders\d\test.exe)");
|
||||
|
||||
ASSERT_EQ(FileUtil::kernelPathToPath(path), path);
|
||||
}
|
||||
|
||||
TEST_F(FileUtilTest, systemPath)
|
||||
{
|
||||
ASSERT_EQ(FileUtil::pathToKernelPath("System", /*lower=*/true), FileUtil::systemApp());
|
||||
|
@ -105,7 +105,11 @@ QString kernelPathToPath(const QString &kernelPath)
|
||||
const int sepPos2 = kernelPath.indexOf(sep, sepPos1 + 1);
|
||||
if (sepPos2 > 0) {
|
||||
const QString kernelName = kernelPath.left(sepPos2);
|
||||
return kernelNameToDrive(kernelName) + kernelPath.mid(sepPos2);
|
||||
const QString driveName = kernelNameToDrive(kernelName);
|
||||
|
||||
if (!driveName.isEmpty()) {
|
||||
return driveName + kernelPath.mid(sepPos2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user