24#include <wx/filename.h>
36 if( wxGetEnv( wxT(
"XDG_CURRENT_DESKTOP" ), &wm ) && wm.CmpNoCase( wxT(
"Unity" ) ) == 0 )
37 wxSetEnv( wxT(
"UBUNTU_MENUPROXY" ), wxT(
"0" ) );
39#if !wxUSE_GLCANVAS_EGL
42 wxSetEnv( wxT(
"GDK_BACKEND" ), wxT(
"x11" ) );
48 wxSetEnv( wxT(
"GDK_CORE_DEVICE_EVENTS" ), wxT(
"1" ) );
54 GError* err =
nullptr;
55 GFile* file = g_file_new_for_path( aPath.fn_str() );
57 bool retVal = g_file_trash( file,
nullptr, &err );
61 aError = err->message;
63 g_clear_error( &err );
64 g_object_unref( file );
79 wxString docsPath = g_get_user_data_dir();
81 if( docsPath.IsEmpty() )
85 fallback.AssignDir( g_get_home_dir() );
86 fallback.AppendDir( wxT(
".local" ) );
87 fallback.AppendDir( wxT(
"share" ) );
88 fallback.MakeAbsolute();
90 docsPath = fallback.GetFullPath();
99 return g_get_user_config_dir();
105 return g_get_user_data_dir();
111 return g_get_user_data_dir();
117 return g_get_user_cache_dir();
123 bool success =
false;
125 GProxyResolver*
resolver = g_proxy_resolver_get_default();
130 GError* error =
nullptr;
131 char** proxyList = g_proxy_resolver_lookup(
resolver, aURL.utf8_str(),
nullptr, &error );
135 g_error_free( error );
144 for(
int i = 0; proxyList[i] !=
nullptr; i++ )
146 wxString proxyUriStr( proxyList[i], wxConvUTF8 );
149 if( proxyUriStr == wxT(
"direct://" ) )
152 wxURI proxyUri( proxyUriStr );
161 wxString scheme = proxyUri.GetScheme();
163 if( !scheme.IsEmpty() )
164 aCfg.
host = scheme + wxT(
"://" );
166 wxString server = proxyUri.GetServer();
169 bool isIPv6 = server.Contains( wxT(
":" ) );
171 if( isIPv6 && proxyUri.HasPort() )
172 aCfg.
host += wxT(
"[" ) + server + wxT(
"]" );
176 if( proxyUri.HasPort() )
177 aCfg.
host += wxT(
":" ) + proxyUri.GetPort();
180 wxString userInfo = proxyUri.GetUserInfo();
182 if( !userInfo.IsEmpty() )
184 int colonPos = userInfo.Find( wxT(
":" ) );
186 if( colonPos != wxNOT_FOUND )
188 aCfg.
username = userInfo.Left( colonPos );
189 aCfg.
password = userInfo.Mid( colonPos + 1 );
201 g_strfreev( proxyList );
215 return wxEmptyString;
220 const wxString& aRelaunchDisplayName )
227 return wxEmptyString;
static FILENAME_RESOLVER * resolver