From 5d6a0f9dbb216e76930a4c01bc3df13f062c94f2 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 20 Apr 2019 17:29:25 -0230 Subject: [PATCH] When saving logfile, show a message indicating location. Since the logfile is now saved to the default OSystem location, we no longer need PATH_SEPARATOR, so remove all instances of it. --- src/common/bspf.hxx | 14 -------------- src/debugger/gui/PromptWidget.hxx | 7 +++++++ src/gui/LoggerDialog.cxx | 5 ++++- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index 7983cdbab..dde629eca 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -93,20 +93,6 @@ static const string EmptyString(""); namespace BSPF { - // Defines to help with path handling - #if defined(BSPF_UNIX) || defined(BSPF_MACOS) - static const string PATH_SEPARATOR = "/"; - #define ATTRIBUTE_FMT_PRINTF __attribute__((__format__ (__printf__, 2, 0))) - #elif defined(BSPF_WINDOWS) - static const string PATH_SEPARATOR = "\\"; - #define ATTRIBUTE_FMT_PRINTF - #elif defined(__LIB_RETRO__) - static const string PATH_SEPARATOR = "/"; - #define ATTRIBUTE_FMT_PRINTF - #else - #error Update src/common/bspf.hxx for path separator - #endif - // CPU architecture type // This isn't complete yet, but takes care of all the major platforms #if defined(__i386__) || defined(_M_IX86) diff --git a/src/debugger/gui/PromptWidget.hxx b/src/debugger/gui/PromptWidget.hxx index 955b7670b..9a1f06c2d 100644 --- a/src/debugger/gui/PromptWidget.hxx +++ b/src/debugger/gui/PromptWidget.hxx @@ -27,6 +27,13 @@ class FilesystemNode; #include "Command.hxx" #include "bspf.hxx" +// TODO - remove this once we clean up the printf stuff +#if defined(BSPF_UNIX) || defined(BSPF_MACOS) + #define ATTRIBUTE_FMT_PRINTF __attribute__((__format__ (__printf__, 2, 0))) +#else + #define ATTRIBUTE_FMT_PRINTF +#endif + class PromptWidget : public Widget, public CommandSender { public: diff --git a/src/gui/LoggerDialog.cxx b/src/gui/LoggerDialog.cxx index 69e0375d1..3b03468f3 100644 --- a/src/gui/LoggerDialog.cxx +++ b/src/gui/LoggerDialog.cxx @@ -106,12 +106,15 @@ void LoggerDialog::saveConfig() void LoggerDialog::saveLogFile() { ostringstream path; - path << "~" << BSPF::PATH_SEPARATOR << "stella.log"; + path << instance().defaultSaveDir() << "stella.log"; FilesystemNode node(path.str()); ofstream out(node.getPath()); if(out.is_open()) + { out << instance().logMessages(); + instance().frameBuffer().showMessage("Saving log file to " + path.str()); + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -