24#include <wx/filename.h>
37 if( wxGetEnv( wxT(
"XDG_CURRENT_DESKTOP" ), &wm ) && wm.CmpNoCase( wxT(
"Unity" ) ) == 0 )
38 wxSetEnv( wxT(
"UBUNTU_MENUPROXY" ), wxT(
"0" ) );
40 bool forceX11 =
false;
42#if wxCHECK_VERSION( 3, 3, 2 )
45 if( !wxGetEnv( wxT(
"WAYLAND_DISPLAY" ),
nullptr ) )
46 wxSystemOptions::SetOption(
"opengl.egl", 0 );
52 #if !wxUSE_GLCANVAS_EGL
59 wxSetEnv( wxT(
"GDK_BACKEND" ), wxT(
"x11" ) );
65 if( !wxGetEnv( wxT(
"WAYLAND_DISPLAY" ),
nullptr ) )
66 wxSetEnv( wxT(
"GDK_CORE_DEVICE_EVENTS" ), wxT(
"1" ) );
72 GError* err =
nullptr;
73 GFile* file = g_file_new_for_path( aPath.fn_str() );
75 bool retVal = g_file_trash( file,
nullptr, &err );
79 aError = err->message;
81 g_clear_error( &err );
82 g_object_unref( file );
97 wxString docsPath = g_get_user_data_dir();
99 if( docsPath.IsEmpty() )
103 fallback.AssignDir( g_get_home_dir() );
104 fallback.AppendDir( wxT(
".local" ) );
105 fallback.AppendDir( wxT(
"share" ) );
106 fallback.MakeAbsolute();
108 docsPath = fallback.GetFullPath();
117 return g_get_user_config_dir();
123 return g_get_user_data_dir();
129 return g_get_user_data_dir();
135 return g_get_user_cache_dir();
141 bool success =
false;
143 GProxyResolver*
resolver = g_proxy_resolver_get_default();
148 GError* error =
nullptr;
149 char** proxyList = g_proxy_resolver_lookup(
resolver, aURL.utf8_str(),
nullptr, &error );
153 g_error_free( error );
162 for(
int i = 0; proxyList[i] !=
nullptr; i++ )
164 wxString proxyUriStr( proxyList[i], wxConvUTF8 );
167 if( proxyUriStr == wxT(
"direct://" ) )
170 wxURI proxyUri( proxyUriStr );
179 wxString scheme = proxyUri.GetScheme();
181 if( !scheme.IsEmpty() )
182 aCfg.
host = scheme + wxT(
"://" );
184 wxString server = proxyUri.GetServer();
187 bool isIPv6 = server.Contains( wxT(
":" ) );
189 if( isIPv6 && proxyUri.HasPort() )
190 aCfg.
host += wxT(
"[" ) + server + wxT(
"]" );
194 if( proxyUri.HasPort() )
195 aCfg.
host += wxT(
":" ) + proxyUri.GetPort();
198 wxString userInfo = proxyUri.GetUserInfo();
200 if( !userInfo.IsEmpty() )
202 int colonPos = userInfo.Find( wxT(
":" ) );
204 if( colonPos != wxNOT_FOUND )
206 aCfg.
username = userInfo.Left( colonPos );
207 aCfg.
password = userInfo.Mid( colonPos + 1 );
219 g_strfreev( proxyList );
233 return wxEmptyString;
238 const wxString& aRelaunchDisplayName )
245 return wxEmptyString;
static FILENAME_RESOLVER * resolver