From f83bc666993df655740a8a805f2f2d2632a7a3c5 Mon Sep 17 00:00:00 2001 From: Almamu Date: Thu, 11 Sep 2025 21:14:49 +0200 Subject: [PATCH] chore: rename realpath to physicalPath so codefactor doesn't complain --- src/WallpaperEngine/Data/Parsers/TextureParser.cpp | 2 -- src/WallpaperEngine/FileSystem/Adapters/Directory.cpp | 2 +- src/WallpaperEngine/FileSystem/Adapters/Directory.h | 2 +- src/WallpaperEngine/FileSystem/Adapters/Package.cpp | 2 +- src/WallpaperEngine/FileSystem/Adapters/Package.h | 2 +- src/WallpaperEngine/FileSystem/Adapters/Types.h | 2 +- src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp | 2 +- src/WallpaperEngine/FileSystem/Adapters/Virtual.h | 2 +- src/WallpaperEngine/FileSystem/Container.cpp | 4 ++-- src/WallpaperEngine/FileSystem/Container.h | 2 +- src/WallpaperEngine/Render/Wallpapers/CVideo.cpp | 2 +- 11 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/WallpaperEngine/Data/Parsers/TextureParser.cpp b/src/WallpaperEngine/Data/Parsers/TextureParser.cpp index 6b81cb1..2360fca 100644 --- a/src/WallpaperEngine/Data/Parsers/TextureParser.cpp +++ b/src/WallpaperEngine/Data/Parsers/TextureParser.cpp @@ -184,7 +184,6 @@ void TextureParser::parseContainer (Texture& header, const BinaryReader& file) { } else { sLog.exception ("unknown texture format type: ", std::string_view (magic, 9)); } - } void TextureParser::parseAnimations (Texture& header, const BinaryReader& file) { @@ -217,7 +216,6 @@ void TextureParser::parseAnimations (Texture& header, const BinaryReader& file) header.gifWidth = (*header.frames.begin ())->width1; header.gifHeight = (*header.frames.begin ())->height1; } - } uint32_t TextureParser::parseTextureFlags (uint32_t value) { diff --git a/src/WallpaperEngine/FileSystem/Adapters/Directory.cpp b/src/WallpaperEngine/FileSystem/Adapters/Directory.cpp index c2d57ae..c226ee7 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Directory.cpp +++ b/src/WallpaperEngine/FileSystem/Adapters/Directory.cpp @@ -53,7 +53,7 @@ bool DirectoryAdapter::exists (const std::filesystem::path& path) const { } } -std::filesystem::path DirectoryAdapter::realpath (const std::filesystem::path& path) const { +std::filesystem::path DirectoryAdapter::physicalPath (const std::filesystem::path& path) const { auto finalpath = std::filesystem::canonical(this->basepath / path); if (finalpath.string ().find (this->basepath.string ()) != 0) { diff --git a/src/WallpaperEngine/FileSystem/Adapters/Directory.h b/src/WallpaperEngine/FileSystem/Adapters/Directory.h index ace001c..3f73a87 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Directory.h +++ b/src/WallpaperEngine/FileSystem/Adapters/Directory.h @@ -18,7 +18,7 @@ struct DirectoryAdapter final : Adapter { [[nodiscard]] ReadStreamSharedPtr open (const std::filesystem::path& path) const override; [[nodiscard]] bool exists (const std::filesystem::path& path) const override; - [[nodiscard]] std::filesystem::path realpath (const std::filesystem::path& path) const override; + [[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const override; const std::filesystem::path basepath; }; diff --git a/src/WallpaperEngine/FileSystem/Adapters/Package.cpp b/src/WallpaperEngine/FileSystem/Adapters/Package.cpp index 2ff250e..009ca36 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Package.cpp +++ b/src/WallpaperEngine/FileSystem/Adapters/Package.cpp @@ -44,7 +44,7 @@ bool PackageAdapter::exists (const std::filesystem::path& path) const { return false; } -std::filesystem::path PackageAdapter::realpath (const std::filesystem::path& path) const { +std::filesystem::path PackageAdapter::physicalPath (const std::filesystem::path& path) const { throw Assets::CAssetLoadException ("Package adapter does not support realpath", path); } diff --git a/src/WallpaperEngine/FileSystem/Adapters/Package.h b/src/WallpaperEngine/FileSystem/Adapters/Package.h index fcef143..90c2a84 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Package.h +++ b/src/WallpaperEngine/FileSystem/Adapters/Package.h @@ -22,7 +22,7 @@ struct PackageAdapter final : Adapter { [[nodiscard]] ReadStreamSharedPtr open (const std::filesystem::path& path) const override; [[nodiscard]] bool exists (const std::filesystem::path& path) const override; - [[nodiscard]] std::filesystem::path realpath (const std::filesystem::path& path) const override; + [[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const override; PackageUniquePtr package; }; diff --git a/src/WallpaperEngine/FileSystem/Adapters/Types.h b/src/WallpaperEngine/FileSystem/Adapters/Types.h index 437e406..cd97dd3 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Types.h +++ b/src/WallpaperEngine/FileSystem/Adapters/Types.h @@ -11,7 +11,7 @@ struct Adapter { [[nodiscard]] virtual ReadStreamSharedPtr open (const std::filesystem::path& path) const = 0; [[nodiscard]] virtual bool exists (const std::filesystem::path& path) const = 0; - [[nodiscard]] virtual std::filesystem::path realpath (const std::filesystem::path& path) const = 0; + [[nodiscard]] virtual std::filesystem::path physicalPath (const std::filesystem::path& path) const = 0; }; using AdapterSharedPtr = std::shared_ptr; diff --git a/src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp b/src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp index 5b3cb3f..d8cc424 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp +++ b/src/WallpaperEngine/FileSystem/Adapters/Virtual.cpp @@ -21,7 +21,7 @@ bool VirtualAdapter::exists (const std::filesystem::path& path) const { return this->files.contains (path); } -std::filesystem::path VirtualAdapter::realpath (const std::filesystem::path& path) const { +std::filesystem::path VirtualAdapter::physicalPath (const std::filesystem::path& path) const { throw Assets::CAssetLoadException ("Virtual adapter does not support realpath", path); } diff --git a/src/WallpaperEngine/FileSystem/Adapters/Virtual.h b/src/WallpaperEngine/FileSystem/Adapters/Virtual.h index be61a41..4e2d2f3 100644 --- a/src/WallpaperEngine/FileSystem/Adapters/Virtual.h +++ b/src/WallpaperEngine/FileSystem/Adapters/Virtual.h @@ -20,7 +20,7 @@ struct VirtualFactory final : Factory { struct VirtualAdapter final : Adapter { [[nodiscard]] ReadStreamSharedPtr open (const std::filesystem::path& path) const override; [[nodiscard]] bool exists (const std::filesystem::path& path) const override; - [[nodiscard]] std::filesystem::path realpath (const std::filesystem::path& path) const override; + [[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const override; void add (const std::filesystem::path& path, const char* data); void add (const std::filesystem::path& path, const JSON& contents); diff --git a/src/WallpaperEngine/FileSystem/Container.cpp b/src/WallpaperEngine/FileSystem/Container.cpp index cf63d19..f4f215e 100644 --- a/src/WallpaperEngine/FileSystem/Container.cpp +++ b/src/WallpaperEngine/FileSystem/Container.cpp @@ -76,10 +76,10 @@ std::string Container::readString (const std::filesystem::path& path) const { return buffer.str (); } -std::filesystem::path Container::realpath (const std::filesystem::path& path) const { +std::filesystem::path Container::physicalPath (const std::filesystem::path& path) const { std::filesystem::path normalized = normalize_path (path); - return this->resolveAdapterForFile (path).realpath (normalized); + return this->resolveAdapterForFile (path).physicalPath (normalized); } diff --git a/src/WallpaperEngine/FileSystem/Container.h b/src/WallpaperEngine/FileSystem/Container.h index 11a8fef..8daf51f 100644 --- a/src/WallpaperEngine/FileSystem/Container.h +++ b/src/WallpaperEngine/FileSystem/Container.h @@ -38,7 +38,7 @@ class Container { * @param path The path to resolve to a real file * @return The full public, absolute path to the given file */ - [[nodiscard]] std::filesystem::path realpath (const std::filesystem::path& path) const; + [[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const; /** * diff --git a/src/WallpaperEngine/Render/Wallpapers/CVideo.cpp b/src/WallpaperEngine/Render/Wallpapers/CVideo.cpp index e8a36b2..58a8e11 100644 --- a/src/WallpaperEngine/Render/Wallpapers/CVideo.cpp +++ b/src/WallpaperEngine/Render/Wallpapers/CVideo.cpp @@ -57,7 +57,7 @@ CVideo::CVideo ( sLog.exception ("Failed to initialize MPV's GL context"); const std::filesystem::path videopath = - this->getVideo ().project.container->realpath (this->getVideo ().filename); + this->getVideo ().project.container->physicalPath (this->getVideo ().filename); // build the path to the video file const char* command [] = {"loadfile", videopath.c_str (), nullptr};