From 66c57a11e4139fc3f2282befbcb1eeeac0ec5e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 17 Oct 2024 01:28:14 -0300 Subject: [PATCH] loadFolder lnk support. --- src/tools/ecode/ecode.cpp | 14 +++++++++++++- src/tools/ecode/ecode.hpp | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index f586d29a0..72a6a4459 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -2957,8 +2957,20 @@ void App::cleanUpRecentFolders() { mRecentFolders = recentFolders; } -void App::loadFolder( const std::string& path ) { Clock dirTreeClock; +void App::loadFolder( std::string path ) { + + if ( FileSystem::fileExtension( path ) == "lnk" ) { + auto target = Sys::getShortcutTarget( path ); + if ( !target.empty() ) { + if ( FileSystem::fileExists( target ) ) + path = target; + else + return; + } else if ( !FileSystem::fileExists( path ) ) + return; + } + if ( !mCurrentProject.empty() ) { closeEditors(); } else { diff --git a/src/tools/ecode/ecode.hpp b/src/tools/ecode/ecode.hpp index 4a10a89b6..6d246a3b8 100644 --- a/src/tools/ecode/ecode.hpp +++ b/src/tools/ecode/ecode.hpp @@ -590,7 +590,7 @@ class App : public UICodeEditorSplitter::Client { void saveDoc(); - void loadFolder( const std::string& path ); + void loadFolder( std::string path ); void loadKeybindings();