mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
feat: warnings when instance resources are linked
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
9f441a9678
commit
a1053a4c5a
13 changed files with 179 additions and 3 deletions
|
|
@ -56,6 +56,8 @@
|
|||
|
||||
#include <optional>
|
||||
|
||||
#include "FileSystem.h"
|
||||
|
||||
using std::optional;
|
||||
using std::nullopt;
|
||||
|
||||
|
|
@ -567,3 +569,25 @@ bool World::operator==(const World &other) const
|
|||
{
|
||||
return is_valid == other.is_valid && folderName() == other.folderName();
|
||||
}
|
||||
|
||||
bool World::isSymLinkUnder(const QString& instPath) const
|
||||
{
|
||||
if (isSymLink())
|
||||
return true;
|
||||
|
||||
auto instDir = QDir(instPath);
|
||||
|
||||
auto relAbsPath = instDir.relativeFilePath(m_containerFile.absoluteFilePath());
|
||||
auto relCanonPath = instDir.relativeFilePath(m_containerFile.canonicalFilePath());
|
||||
|
||||
return relAbsPath != relCanonPath;
|
||||
}
|
||||
|
||||
bool World::isMoreThanOneHardLink() const
|
||||
{
|
||||
if (m_containerFile.isDir())
|
||||
{
|
||||
return FS::hardLinkCount(QDir(m_containerFile.absoluteFilePath()).filePath("level.dat")) > 1;
|
||||
}
|
||||
return FS::hardLinkCount(m_containerFile.absoluteFilePath()) > 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue