Fix FilesystemUtil::isEquivalent by eliminating it entirely

This commit is contained in:
Tomas Jakobsson 2019-03-13 21:18:58 +01:00
parent f9e48897d3
commit 07a9f18ac6
3 changed files with 3 additions and 22 deletions

View file

@ -237,11 +237,9 @@ void updateGamelist(SystemData* system)
continue; continue;
} }
std::string nodePath = Utils::FileSystem::resolveRelativePath(pathNode.text().get(), system->getStartPath(), true); std::string nodePath = Utils::FileSystem::getCanonicalPath(Utils::FileSystem::resolveRelativePath(pathNode.text().get(), system->getStartPath(), true));
std::string gamePath = (*fit)->getPath(); std::string gamePath = Utils::FileSystem::getCanonicalPath((*fit)->getPath());
if(nodePath == gamePath || (Utils::FileSystem::exists(nodePath) && if(nodePath == gamePath)
Utils::FileSystem::exists(gamePath) &&
Utils::FileSystem::isEquivalent(nodePath, gamePath)))
{ {
// found it // found it
root.remove_child(fileNode); root.remove_child(fileNode);

View file

@ -652,22 +652,6 @@ namespace Utils
} // isHidden } // isHidden
bool isEquivalent(const std::string& _path1, const std::string& _path2)
{
std::string path1 = getGenericPath(_path1);
std::string path2 = getGenericPath(_path2);
struct stat64 info1;
struct stat64 info2;
// check if stat64 succeeded
if((stat64(path1.c_str(), &info1) != 0) || (stat64(path2.c_str(), &info2) != 0))
return false;
// check if attributes are identical
return ((info1.st_dev == info2.st_dev) && (info1.st_ino == info2.st_ino) && (info1.st_size == info2.st_size) && (info1.st_mtime == info2.st_mtime));
} // isEquivalent
} // FileSystem:: } // FileSystem::
} // Utils:: } // Utils::

View file

@ -37,7 +37,6 @@ namespace Utils
bool isDirectory (const std::string& _path); bool isDirectory (const std::string& _path);
bool isSymlink (const std::string& _path); bool isSymlink (const std::string& _path);
bool isHidden (const std::string& _path); bool isHidden (const std::string& _path);
bool isEquivalent (const std::string& _path1, const std::string& _path2);
} // FileSystem:: } // FileSystem::