@@ -57,7 +57,6 @@ int GetInitialUrl() {
5757
5858 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
5959 {
60- szInitialUrl = " file://" ;
6160 szInitialUrl.append (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)));
6261 gtk_widget_destroy (dialog);
6362 return 0 ;
@@ -75,7 +74,6 @@ std::string AppGetRunningDirectory() {
7574 if (szRunningDir.length () > 0 )
7675 return szRunningDir;
7776
78- szRunningDir = " file://" ;
7977 char buf[512 ];
8078 int len = readlink (" /proc/self/exe" , buf, 512 );
8179
@@ -92,9 +90,7 @@ std::string AppGetRunningDirectory() {
9290}
9391
9492CefString AppGetCachePath () {
95- std::string cachePath = " file://" ; // To avoid Unix paths being interpreted as http:// URLs
96- cachePath.append (ClientApp::AppGetSupportDirectory ());
97- cachePath.append (" /cef_data" );
93+ std::string cachePath = std::string (ClientApp::AppGetSupportDirectory ()) + " /cef_data" ;
9894
9995 return CefString (cachePath);
10096}
@@ -138,7 +134,7 @@ int main(int argc, char* argv[]) {
138134
139135 {
140136 struct stat buf;
141- if (!(stat (szInitialUrl.c_str ()+ 7 , &buf) >= 0 ) || !(S_ISREG (buf.st_mode )))
137+ if (!(stat (szInitialUrl.c_str (), &buf) >= 0 ) || !(S_ISREG (buf.st_mode )))
142138 if (GetInitialUrl () < 0 )
143139 return 0 ;
144140 }
@@ -188,7 +184,7 @@ int main(int argc, char* argv[]) {
188184 CefBrowserHost::CreateBrowser (
189185 window_info,
190186 static_cast <CefRefPtr<CefClient> >(g_handler),
191- szInitialUrl, browserSettings);
187+ " file:// " + szInitialUrl, browserSettings);
192188
193189 gtk_container_add (GTK_CONTAINER (window), vbox);
194190 gtk_widget_show_all (GTK_WIDGET (window));
0 commit comments