Skip to content

Commit

Permalink
Disable implicit conversions from wxString to std::string
Browse files Browse the repository at this point in the history
  • Loading branch information
Fs00 committed Sep 13, 2023
1 parent fc1dca5 commit 1472b87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/GameUpdateWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool GameUpdateWindow::ParseUpdate(const fs::path& metaPath)
if (targetSpace.free <= m_required_size)
{
auto string = formatWxString(_("Not enough space available.\nRequired: {0} MB\nAvailable: {1} MB"), (m_required_size / 1024 / 1024), (targetSpace.free / 1024 / 1024));
throw std::runtime_error(string);
throw std::runtime_error(string.utf8_string());
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/GraphicPacksWindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void GraphicPacksWindow2::OnTreeSelectionChanged(wxTreeEvent& event)
m_graphic_pack_name->SetLabel(wxHelper::FromUtf8(m_gp_name));

if (gp->GetDescription().empty())
m_gp_description = _("This graphic pack has no description");
m_gp_description = _("This graphic pack has no description").utf8_string();
else
m_gp_description = gp->GetDescription();

Expand Down
2 changes: 2 additions & 0 deletions src/gui/wxgui.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#define wxNO_UNSAFE_WXSTRING_CONV 1

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
Expand Down

0 comments on commit 1472b87

Please sign in to comment.