Bläddra i källkod

File editing app logging

Source commit: d6987c58747dd6863cc578437ec0427208d0fc98
Martin Prikryl 3 år sedan
förälder
incheckning
4e8624e83b
3 ändrade filer med 9 tillägg och 4 borttagningar
  1. 1 3
      source/core/CoreMain.h
  2. 2 0
      source/forms/CustomScpExplorer.cpp
  3. 6 1
      source/windows/EditorManager.cpp

+ 1 - 3
source/core/CoreMain.h

@@ -3,13 +3,11 @@
 #define CoreMainH
 //---------------------------------------------------------------------------
 #include "Common.h"
+#include "SessionInfo.h"
 //---------------------------------------------------------------------------
-class TConfiguration;
 extern TConfiguration *Configuration;
-class TStoredSessionList;
 extern TStoredSessionList *StoredSessions;
 extern bool AnySession;
-class TApplicationLog;
 extern TApplicationLog * ApplicationLog;
 #define AppLog(S) if (ApplicationLog->Logging) ApplicationLog->Log(S)
 #define AppLogFmt(S, F) AppLog(FORMAT(S, F))

+ 2 - 0
source/forms/CustomScpExplorer.cpp

@@ -3381,6 +3381,7 @@ void __fastcall TCustomScpExplorerForm::CustomExecuteFile(TOperationSide Side,
       }
 
       FEditorManager->AddFileInternal(FileName, Data.release(), Editor);
+      AppLogFmt(L"Opened internal editor with \"%s\"", (FileName));
     }
     else
     {
@@ -3442,6 +3443,7 @@ void __fastcall TCustomScpExplorerForm::CustomExecuteFile(TOperationSide Side,
     if (!IsSideLocalBrowser(Side))
     {
       FEditorManager->AddFileExternal(FileName, Data.release(), Process);
+      AppLogFmt(L"Opened external editor with remote file \"%s\".", (FileName));
     }
   }
 }

+ 6 - 1
source/windows/EditorManager.cpp

@@ -437,10 +437,10 @@ bool __fastcall TEditorManager::CloseFile(int Index, bool IgnoreErrors, bool Del
   if (FileData->UploadCompleteEvent != INVALID_HANDLE_VALUE)
   {
     FileData->Closed = true;
+    AppLogFmt(L"Opened/edited file \"%s\" has been closed, but the file is still being uploaded.", (FileData->FileName));
   }
   else
   {
-    UnicodeString FileName = FileData->FileName;
     UnicodeString LocalRootDirectory = FileData->Data->LocalRootDirectory;
 
     ReleaseFile(Index);
@@ -454,6 +454,11 @@ bool __fastcall TEditorManager::CloseFile(int Index, bool IgnoreErrors, bool Del
       {
         throw Exception(FMTLOAD(DELETE_TEMP_EXECUTE_FILE_ERROR, (LocalRootDirectory)));
       }
+      AppLogFmt(L"Deleted opened/edited file [%s] folder \"%s\".", (FileData->FileName, LocalRootDirectory));
+    }
+    else
+    {
+      AppLogFmt(L"Opened/edited file \"%s\" has been closed.", (FileData->FileName));
     }
   }
   return Result;