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" ) );
40 || ( wxCHECK_VERSION( 3, 3, 2 ) && !wxHAS_EGL ) \
41 || ( !wxCHECK_VERSION( 3, 3, 2 ) && !wxUSE_GLCANVAS_EGL )
44 wxSetEnv( wxT(
"GDK_BACKEND" ), wxT(
"x11" ) );
50 wxSetEnv( wxT(
"GDK_CORE_DEVICE_EVENTS" ), wxT(
"1" ) );
56 GError* err =
nullptr;
57 GFile* file = g_file_new_for_path( aPath.fn_str() );
59 bool retVal = g_file_trash( file,
nullptr, &err );
63 aError = err->message;
65 g_clear_error( &err );
66 g_object_unref( file );
81 wxString docsPath = g_get_user_data_dir();
83 if( docsPath.IsEmpty() )
87 fallback.AssignDir( g_get_home_dir() );
88 fallback.AppendDir( wxT(
".local" ) );
89 fallback.AppendDir( wxT(
"share" ) );
90 fallback.MakeAbsolute();
92 docsPath = fallback.GetFullPath();
101 return g_get_user_config_dir();
107 return g_get_user_data_dir();
113 return g_get_user_data_dir();
119 return g_get_user_cache_dir();
125 bool success =
false;
127 GProxyResolver*
resolver = g_proxy_resolver_get_default();
132 GError* error =
nullptr;
133 char** proxyList = g_proxy_resolver_lookup(
resolver, aURL.utf8_str(),
nullptr, &error );
137 g_error_free( error );
146 for(
int i = 0; proxyList[i] !=
nullptr; i++ )
148 wxString proxyUriStr( proxyList[i], wxConvUTF8 );
151 if( proxyUriStr == wxT(
"direct://" ) )
154 wxURI proxyUri( proxyUriStr );
163 wxString scheme = proxyUri.GetScheme();
165 if( !scheme.IsEmpty() )
166 aCfg.
host = scheme + wxT(
"://" );
168 wxString server = proxyUri.GetServer();
171 bool isIPv6 = server.Contains( wxT(
":" ) );
173 if( isIPv6 && proxyUri.HasPort() )
174 aCfg.
host += wxT(
"[" ) + server + wxT(
"]" );
178 if( proxyUri.HasPort() )
179 aCfg.
host += wxT(
":" ) + proxyUri.GetPort();
182 wxString userInfo = proxyUri.GetUserInfo();
184 if( !userInfo.IsEmpty() )
186 int colonPos = userInfo.Find( wxT(
":" ) );
188 if( colonPos != wxNOT_FOUND )
190 aCfg.
username = userInfo.Left( colonPos );
191 aCfg.
password = userInfo.Mid( colonPos + 1 );
203 g_strfreev( proxyList );
217 return wxEmptyString;
222 const wxString& aRelaunchDisplayName )
229 return wxEmptyString;
static FILENAME_RESOLVER * resolver