mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00

This fixes issue 6721. (cherry picked from commitcc05f66ba1
) Fix unicode support for File::Rename() on windows. Partial fix of issue 6721. (cherry picked from commit99c89ae109
) Missed a accept error handler. Init instead of memset. (cherry picked from commit935ed814ea
) Fix accept() bug, which was using the wrong isRW for error conversion. Also fixed a debug issue where local_name is used uninitialised. (cherry picked from commitf811dbb575
) Only add real HID devices to HID list. (cherry picked from commite805bf6068
) Add dxsdk_dir to vc++ paths via base.props. This means you no longer need the paths in a global property sheet. In fact if you have them in such a file, you should remove them as it will cause conflicts with the vs2013 build. (cherry picked from commit0791a9ef80
)
57 lines
983 B
C++
57 lines
983 B
C++
// Copyright 2013 Dolphin Emulator Project
|
|
// Licensed under GPLv2
|
|
// Refer to the license.txt file included.
|
|
|
|
#include "Common.h"
|
|
|
|
#include <wx/wx.h>
|
|
#include <wx/string.h>
|
|
|
|
#include "WxUtils.h"
|
|
|
|
namespace WxUtils {
|
|
|
|
// Launch a file according to its mime type
|
|
void Launch(const char *filename)
|
|
{
|
|
if (! ::wxLaunchDefaultBrowser(StrToWxStr(filename)))
|
|
{
|
|
// WARN_LOG
|
|
}
|
|
}
|
|
|
|
// Launch an file explorer window on a certain path
|
|
void Explore(const char *path)
|
|
{
|
|
wxString wxPath = StrToWxStr(path);
|
|
#ifndef _WIN32
|
|
// Default to file
|
|
if (! wxPath.Contains(wxT("://")))
|
|
{
|
|
wxPath = wxT("file://") + wxPath;
|
|
}
|
|
#endif
|
|
|
|
#ifdef __WXGTK__
|
|
wxPath.Replace(wxT(" "), wxT("\\ "));
|
|
#endif
|
|
|
|
if (! ::wxLaunchDefaultBrowser(wxPath))
|
|
{
|
|
// WARN_LOG
|
|
}
|
|
}
|
|
|
|
} // namespace
|
|
|
|
std::string WxStrToStr(const wxString& str)
|
|
{
|
|
return str.ToUTF8().data();
|
|
}
|
|
|
|
wxString StrToWxStr(const std::string& str)
|
|
{
|
|
//return wxString::FromUTF8Unchecked(str.c_str());
|
|
return wxString::FromUTF8(str.c_str());
|
|
}
|