[Scummvm-git-logs] scummvm master -> 868b0d3c00c082f40c4a5b52690e11a098aa4197

lephilousophe noreply at scummvm.org
Sun May 5 13:48:47 UTC 2024


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

Summary:
868b0d3c00 GUI: Initialize _path while constructing PathWidget


Commit: 868b0d3c00c082f40c4a5b52690e11a098aa4197
    https://github.com/scummvm/scummvm/commit/868b0d3c00c082f40c4a5b52690e11a098aa4197
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-05-05T15:48:26+02:00

Commit Message:
GUI: Initialize _path while constructing PathWidget

Without this, if PathWidget is never set, the getLabel function returns
an empty Path.
Thanks to athrxx for finding this and proposing a fix.

Changed paths:
    gui/widget.h


diff --git a/gui/widget.h b/gui/widget.h
index 55edf2ffca2..60a4151eae8 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -467,6 +467,7 @@ public:
 		StaticTextWidget(boss, x, y, w, h, scale,
 				path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
 				align, tooltip, font, Common::UNK_LANG, useEllipsis),
+		_path(path),
 		_placeholder(placeholder) { }
 	PathWidget(GuiObject *boss, int x, int y, int w, int h,
 			const Common::Path &path, Graphics::TextAlign align,
@@ -477,6 +478,7 @@ public:
 		StaticTextWidget(boss, x, y, w, h,
 				path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
 				align, tooltip, font, Common::UNK_LANG, useEllipsis),
+		_path(path),
 		_placeholder(placeholder) {}
 	PathWidget(GuiObject *boss, const Common::String &name,
 			const Common::Path &path,
@@ -487,6 +489,7 @@ public:
 		StaticTextWidget(boss, name,
 				path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
 				tooltip, font, Common::UNK_LANG, useEllipsis),
+		_path(path),
 		_placeholder(placeholder) {}
 	void setLabel(const Common::Path &path) {
 		_path = path;




More information about the Scummvm-git-logs mailing list