Blob Blame History Raw
#Patch from gentoo copied from mageia

Index: b/libaegisub/include/libaegisub/lua/utils.h
===================================================================
Index: b/libaegisub/include/libaegisub/lua/utils.h
===================================================================
--- a/libaegisub/include/libaegisub/lua/utils.h	2022-07-03 19:27:30.000000000 +0200
+++ b/libaegisub/include/libaegisub/lua/utils.h	2023-02-08 09:17:04.471853695 +0200
@@ -87,7 +87,10 @@ int exception_wrapper(lua_State *L) {
 
 template<typename T>
 void set_field(lua_State *L, const char *name, T value) {
-	push_value(L, value);
+    if constexpr(std::is_convertible<T, std::string>::value)
+        push_value(L, static_cast<std::string>(value));
+    else
+        push_value(L, value);
 	lua_setfield(L, -2, name);
 }
 
Index: b/src/auto4_lua.cpp
===================================================================
--- a/src/auto4_lua.cpp	2022-07-03 19:27:30.000000000 +0200
+++ b/src/auto4_lua.cpp	2023-02-08 09:20:53.005919645 +0200
@@ -119,7 +119,8 @@ namespace {
 	int get_translation(lua_State *L)
 	{
 		wxString str(check_wxstring(L, 1));
-		push_value(L, _(str).utf8_str());
+		const char* val = static_cast<const char*>( _(str).utf8_str());
+        push_value(L, val);
 		return 1;
 	}
 
Index: b/src/command/video.cpp
===================================================================
--- a/src/command/video.cpp	2022-07-03 19:27:30.000000000 +0200
+++ b/src/command/video.cpp	2023-02-08 09:23:11.799886506 +0200
@@ -475,7 +475,7 @@ static void save_snapshot(agi::Context *
 		// If where ever that is isn't defined, we can't save there
 		if ((basepath == "\\") || (basepath == "/")) {
 			// So save to the current user's home dir instead
-			basepath = wxGetHomeDir().c_str();
+			basepath = wxGetHomeDir().ToStdString();
 		}
 	}
 	// Actual fixed (possibly relative) path, decode it
Index: b/src/dialog_attachments.cpp
===================================================================
--- a/src/dialog_attachments.cpp	2022-07-03 19:27:30.000000000 +0200
+++ b/src/dialog_attachments.cpp	2023-02-08 09:25:23.026182291 +0200
@@ -161,7 +161,7 @@ void DialogAttachments::OnExtract(wxComm
 
 	// Multiple or single?
 	if (listView->GetNextSelected(i) != -1)
-		path = wxDirSelector(_("Select the path to save the files to:"), to_wx(OPT_GET("Path/Fonts Collector Destination")->GetString())).c_str();
+		path = wxDirSelector(_("Select the path to save the files to:"), to_wx(OPT_GET("Path/Fonts Collector Destination")->GetString())).ToStdString();
 	else {
 		path = SaveFileSelector(
 			_("Select the path to save the file to:"),