Files
dolphin/Source/Core/DolphinWX/Src/WxUtils.cpp
Tony Wasserka 8a887a6fea Don't prepend file:// in wxUtils::Explore() on windows. Wxw will just remove it, and/or blow up trying to remove it, if the path isn't ascii.
This fixes issue 6721.
(cherry picked from commit cc05f66ba1)

Fix unicode support for File::Rename() on windows.

Partial fix of issue 6721.

(cherry picked from commit 99c89ae109)

Missed a accept error handler.
Init instead of memset.

(cherry picked from commit 935ed814ea)

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 commit f811dbb575)

Only add real HID devices to HID list.

(cherry picked from commit e805bf6068)

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 commit 0791a9ef80)
2013-11-28 20:32:40 +01:00

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());
}