Added keyboard shortcut operations in the file system tree view, to complete SpartanJ/ecode#71.

This commit is contained in:
Martín Lucas Golini
2025-09-07 19:48:29 -03:00
parent 873274e33c
commit 7e6de3f9b2
10 changed files with 160 additions and 68 deletions

View File

@@ -1306,26 +1306,11 @@ void LLMChatUI::updateTabTitle() {
tab->setText( title );
}
static bool fsRenameFile( const std::string& fpath, const std::string& newFilePath ) {
try {
#if EE_PLATFORM == EE_PLATFORM_WIN
std::filesystem::rename( String( fpath ).toWideString(),
String( newFilePath ).toWideString() );
#else
std::filesystem::rename( fpath, newFilePath );
#endif
} catch ( const std::filesystem::filesystem_error& ) {
return false;
}
return true;
}
void LLMChatUI::renameChat( const std::string& newName, bool invertLockedState ) {
auto oldPath = getNewFilePath( mUUID.toString(), mSummary, mChatLocked );
auto newPath =
getNewFilePath( mUUID.toString(), newName, invertLockedState ? !mChatLocked : mChatLocked );
if ( fsRenameFile( oldPath, newPath ) ) {
if ( FileSystem::fileMove( oldPath, newPath ) ) {
mSummary = newName;
if ( invertLockedState )
mChatLocked = !mChatLocked;