[Scummvm-git-logs] scummvm branch-2-7 -> 8d5fc4fbd28939fcd8c8fcf9538ce3e71ed76be1

sev- noreply at scummvm.org
Sun Mar 26 22:30:52 UTC 2023


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
12baed7ab2 IOS: Report the scummvm.log file location
b117fc12f2 IOS7: Report the scummvm.log file location
98895500da BASE: Fix --logfile command line option
4197fde4b3 GUI: Reflect command line override for the log path
8d5fc4fbd2 GUI: Process empty log path and gracefully process unreadable paths


Commit: 12baed7ab22af9a0c50c517a8e5f204f8b72ed23
    https://github.com/scummvm/scummvm/commit/12baed7ab22af9a0c50c517a8e5f204f8b72ed23
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-27T00:25:05+02:00

Commit Message:
IOS: Report the scummvm.log file location

Changed paths:
    backends/platform/iphone/osys_main.h


diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 3b5a3291492..c3bdd9077ed 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -184,6 +184,8 @@ public:
 
 	virtual void logMessage(LogMessageType::Type type, const char *message);
 
+	virtual Common::String getDefaultLogFileName() { return Common::String("/var/mobile/.scummvm.log"); }
+
 protected:
 	void initVideoContext();
 	void updateOutputSurface();


Commit: b117fc12f220e06675607ae21db142ad82fe22de
    https://github.com/scummvm/scummvm/commit/b117fc12f220e06675607ae21db142ad82fe22de
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-27T00:25:13+02:00

Commit Message:
IOS7: Report the scummvm.log file location

Changed paths:
    backends/platform/ios7/ios7_osys_main.h


diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index ce65a2c1199..d0e5f45a3ae 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -218,6 +218,8 @@ public:
 
 	bool isConnectionLimited() override;
 
+	virtual Common::String getDefaultLogFileName() { return Common::String("/var/mobile/.scummvm.log"); }
+
 protected:
 	void initVideoContext();
 	void updateOutputSurface();


Commit: 98895500da344c755d9e8eb09829073298c653b9
    https://github.com/scummvm/scummvm/commit/98895500da344c755d9e8eb09829073298c653b9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-27T00:26:17+02:00

Commit Message:
BASE: Fix --logfile command line option

It was plainly not functional. We were never passing it to backend

Changed paths:
    base/commandLine.cpp


diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index b204c15037f..7020c73afe8 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -1896,6 +1896,7 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
 	// Finally, store the command line settings into the config manager.
 	static const char * const sessionSettings[] = {
 		"config",
+		"logfile",
 		"initial-cfg",
 		"fullscreen",
 		"gfx-mode",


Commit: 4197fde4b376078fbcda70e850dcb5f7965360ad
    https://github.com/scummvm/scummvm/commit/4197fde4b376078fbcda70e850dcb5f7965360ad
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-27T00:26:31+02:00

Commit Message:
GUI: Reflect command line override for the log path

Changed paths:
    gui/options.cpp
    gui/options.h


diff --git a/gui/options.cpp b/gui/options.cpp
index f75abff2003..2e77c1a3b9e 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2493,7 +2493,19 @@ void GlobalOptionsDialog::addPathsControls(GuiObject *boss, const Common::String
 		configPathWidget->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
 
 	Common::U32String logPath = g_system->getDefaultLogFileName();
-	new StaticTextWidget(boss, prefix + "LogPath", _("ScummVM log path: ") + logPath, logPath);
+	bool colorOverride = false;
+
+	if (ConfMan.hasKey("logfile")) {
+		logPath = ConfMan.get("logfile");
+
+		if (ConfMan.isKeyTemporary("logfile"))
+			colorOverride = true;
+	}
+	_logPath = new StaticTextWidget(boss, prefix + "LogPath", _("ScummVM log path: ") + logPath, logPath);
+
+	if (colorOverride)
+		_logPath->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
+
 	new ButtonWidget(boss, prefix + "ViewButton", _("View"), Common::U32String(), kViewLogCmd);
 
 	Common::U32String browserPath = _("<default>");
@@ -3244,7 +3256,14 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
 
 		break;
 	case kViewLogCmd: {
-		TextViewerDialog viewer(g_system->getDefaultLogFileName());
+		Common::String logPath;
+
+		if (ConfMan.hasKey("logfile"))
+			logPath = ConfMan.get("logfile");
+		else
+			logPath = g_system->getDefaultLogFileName();
+
+		TextViewerDialog viewer(logPath);
 		viewer.runModal();
 		g_gui.scheduleTopDialogRedraw();
 		break;
diff --git a/gui/options.h b/gui/options.h
index 25e5d46aa39..b1e7ccf3856 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -286,6 +286,7 @@ protected:
 #endif
 	StaticTextWidget *_browserPath;
 	ButtonWidget	 *_browserPathClearButton;
+	StaticTextWidget *_logPath;
 
 	void addPathsControls(GuiObject *boss, const Common::String &prefix, bool lowres);
 


Commit: 8d5fc4fbd28939fcd8c8fcf9538ce3e71ed76be1
    https://github.com/scummvm/scummvm/commit/8d5fc4fbd28939fcd8c8fcf9538ce3e71ed76be1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-27T00:26:40+02:00

Commit Message:
GUI: Process empty log path and gracefully process unreadable paths

Changed paths:
    gui/options.cpp
    gui/textviewer.cpp


diff --git a/gui/options.cpp b/gui/options.cpp
index 2e77c1a3b9e..5b0e45fa6fc 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2506,7 +2506,10 @@ void GlobalOptionsDialog::addPathsControls(GuiObject *boss, const Common::String
 	if (colorOverride)
 		_logPath->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
 
-	new ButtonWidget(boss, prefix + "ViewButton", _("View"), Common::U32String(), kViewLogCmd);
+	ButtonWidget *viewButton = new ButtonWidget(boss, prefix + "ViewButton", _("View"), Common::U32String(), kViewLogCmd);
+
+	if (logPath.empty())
+		viewButton->setEnabled(false);
 
 	Common::U32String browserPath = _("<default>");
 	if (ConfMan.hasKey("browser_lastpath"))
diff --git a/gui/textviewer.cpp b/gui/textviewer.cpp
index 30e54c17a98..460644c3dce 100644
--- a/gui/textviewer.cpp
+++ b/gui/textviewer.cpp
@@ -75,6 +75,12 @@ bool TextViewerDialog::loadFile(Common::String &fname) {
 
 	Common::SeekableReadStream *stream = file.createReadStream();
 
+	if (!stream) {
+		warning("TextViewerDialog::loadFile(): Cannot load file %s", fname.c_str());
+
+		return false;
+	}
+
 	warning("TextViewerDialog::loadFile(): File size is: %ld", stream->size());
 
 	_linesArray.clear();




More information about the Scummvm-git-logs mailing list