From 1e2a491f9ebe1d9585ffb14a6a36b2435b24b5db Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 16 Mar 2024 22:58:29 -0400 Subject: [PATCH] - don't show path if longsavemessages is false. fixes https://github.com/ZDoom/gzdoom/issues/2467 --- src/common/platform/posix/cocoa/i_system.mm | 5 +++-- src/common/platform/posix/sdl/i_system.cpp | 9 +++++++-- src/common/platform/win32/i_system.cpp | 9 +++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/common/platform/posix/cocoa/i_system.mm b/src/common/platform/posix/cocoa/i_system.mm index 3338f54dba..8d3b5e1526 100644 --- a/src/common/platform/posix/cocoa/i_system.mm +++ b/src/common/platform/posix/cocoa/i_system.mm @@ -40,7 +40,7 @@ #include "st_console.h" #include "v_text.h" - +EXTERN_CVAR(Bool, longsavemessages) double PerfToSec, PerfToMillisec; void CalculateCPUSpeed() @@ -188,7 +188,8 @@ void I_OpenShellFolder(const char* folder) NSString *currentpath = [filemgr currentDirectoryPath]; [filemgr changeCurrentDirectoryPath:[NSString stringWithUTF8String:folder]]; - Printf("Opening folder: %s\n", folder); + if (longsavemessages) + Printf("Opening folder: %s\n", folder); std::system("open ."); [filemgr changeCurrentDirectoryPath:currentpath]; } diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index c6d3df291a..37af023817 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -77,6 +77,7 @@ int I_PickIWad_Cocoa (WadStuff *wads, int numwads, bool showwin, int defaultiwad double PerfToSec, PerfToMillisec; CVAR(Bool, con_printansi, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE); CVAR(Bool, con_4bitansi, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE); +EXTERN_CVAR(Bool, longsavemessages) extern FStartupScreen *StartWindow; @@ -372,13 +373,17 @@ void I_OpenShellFolder(const char* infolder) if (!chdir(infolder)) { - Printf("Opening folder: %s\n", infolder); + if (longsavemessages") + Printf("Opening folder: %s\n", infolder); std::system("xdg-open ."); chdir(curdir); } else { - Printf("Unable to open directory '%s\n", infolder); + if (longsavemessages") + Printf("Unable to open directory '%s\n", infolder); + else + Printf("Unable to open requested directory\n"); } free(curdir); } diff --git a/src/common/platform/win32/i_system.cpp b/src/common/platform/win32/i_system.cpp index 58cfa3c34b..fe5fada533 100644 --- a/src/common/platform/win32/i_system.cpp +++ b/src/common/platform/win32/i_system.cpp @@ -114,6 +114,7 @@ static HCURSOR CreateBitmapCursor(int xhot, int yhot, HBITMAP and_mask, HBITMAP EXTERN_CVAR (Bool, queryiwad); // Used on welcome/IWAD screen. EXTERN_CVAR (Int, vid_preferbackend) +EXTERN_CVAR(Bool, longsavemessages) extern HANDLE StdOut; extern bool FancyStdOut; @@ -824,13 +825,17 @@ void I_OpenShellFolder(const char* infolder) } else if (SetCurrentDirectoryW(WideString(infolder).c_str())) { - Printf("Opening folder: %s\n", infolder); + if (longsavemessages) + Printf("Opening folder: %s\n", infolder); ShellExecuteW(NULL, L"open", L"explorer.exe", L".", NULL, SW_SHOWNORMAL); SetCurrentDirectoryW(curdir.Data()); } else { - Printf("Unable to open directory '%s\n", infolder); + if (longsavemessages) + Printf("Unable to open directory '%s\n", infolder); + else + Printf("Unable to open requested directory\n"); } }