- don't show path if longsavemessages is false. fixes https://github.com/ZDoom/gzdoom/issues/2467

This commit is contained in:
Rachael Alexanderson 2024-03-16 22:58:29 -04:00
parent cc88dfbe50
commit 1e2a491f9e
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0
3 changed files with 17 additions and 6 deletions

View file

@ -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];
}

View file

@ -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);
}

View file

@ -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");
}
}