Bladeren bron

fix: correct wrong video wallpaper opening if file of equal name is in the home directory (#450)

Pedro Ribeiro 8 maanden geleden
bovenliggende
commit
ef986841e2

+ 5 - 0
src/WallpaperEngine/Application/WallpaperApplication.cpp

@@ -93,6 +93,11 @@ AssetLocatorUniquePtr WallpaperApplication::setupAssetLocator (const std::string
         sLog.exception ("Cannot find a valid assets folder, resolved to ", this->m_context.settings.general.assets);
     }
 
+    // mount the current directory as root
+    try {
+        container->mount (std::filesystem::current_path (), "/");
+    } catch (std::runtime_error&) { }
+
     auto& vfs = container->getVFS ();
 
     //

+ 0 - 2
src/WallpaperEngine/FileSystem/Container.cpp

@@ -31,8 +31,6 @@ Container::Container () {
 
     this->m_vfs = std::make_shared<VirtualAdapter> ();
     this->m_mountpoints.emplace_back ("/", this->m_vfs);
-    // mount the current directory as root
-    this->mount (std::filesystem::current_path (), "/");
 }
 
 ReadStreamSharedPtr Container::read (const std::filesystem::path& path) const {