Skip to content

Commit e45458d

Browse files
authored
Merge pull request #549 from tomaz82/eliminate_iequivalent
Fix FilesystemUtil::isEquivalent by eliminating it entirely
2 parents f9e4889 + 07a9f18 commit e45458d

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

es-app/src/Gamelist.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,9 @@ void updateGamelist(SystemData* system)
237237
continue;
238238
}
239239

240-
std::string nodePath = Utils::FileSystem::resolveRelativePath(pathNode.text().get(), system->getStartPath(), true);
241-
std::string gamePath = (*fit)->getPath();
242-
if(nodePath == gamePath || (Utils::FileSystem::exists(nodePath) &&
243-
Utils::FileSystem::exists(gamePath) &&
244-
Utils::FileSystem::isEquivalent(nodePath, gamePath)))
240+
std::string nodePath = Utils::FileSystem::getCanonicalPath(Utils::FileSystem::resolveRelativePath(pathNode.text().get(), system->getStartPath(), true));
241+
std::string gamePath = Utils::FileSystem::getCanonicalPath((*fit)->getPath());
242+
if(nodePath == gamePath)
245243
{
246244
// found it
247245
root.remove_child(fileNode);

es-core/src/utils/FileSystemUtil.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -652,22 +652,6 @@ namespace Utils
652652

653653
} // isHidden
654654

655-
bool isEquivalent(const std::string& _path1, const std::string& _path2)
656-
{
657-
std::string path1 = getGenericPath(_path1);
658-
std::string path2 = getGenericPath(_path2);
659-
struct stat64 info1;
660-
struct stat64 info2;
661-
662-
// check if stat64 succeeded
663-
if((stat64(path1.c_str(), &info1) != 0) || (stat64(path2.c_str(), &info2) != 0))
664-
return false;
665-
666-
// check if attributes are identical
667-
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));
668-
669-
} // isEquivalent
670-
671655
} // FileSystem::
672656

673657
} // Utils::

es-core/src/utils/FileSystemUtil.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ namespace Utils
3737
bool isDirectory (const std::string& _path);
3838
bool isSymlink (const std::string& _path);
3939
bool isHidden (const std::string& _path);
40-
bool isEquivalent (const std::string& _path1, const std::string& _path2);
4140

4241
} // FileSystem::
4342

0 commit comments

Comments
 (0)