@@ -57,7 +57,6 @@ int GetInitialUrl() {
57
57
58
58
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
59
59
{
60
- szInitialUrl = " file://" ;
61
60
szInitialUrl.append (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)));
62
61
gtk_widget_destroy (dialog);
63
62
return 0 ;
@@ -75,7 +74,6 @@ std::string AppGetRunningDirectory() {
75
74
if (szRunningDir.length () > 0 )
76
75
return szRunningDir;
77
76
78
- szRunningDir = " file://" ;
79
77
char buf[512 ];
80
78
int len = readlink (" /proc/self/exe" , buf, 512 );
81
79
@@ -92,9 +90,7 @@ std::string AppGetRunningDirectory() {
92
90
}
93
91
94
92
CefString 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" ;
98
94
99
95
return CefString (cachePath);
100
96
}
@@ -138,7 +134,7 @@ int main(int argc, char* argv[]) {
138
134
139
135
{
140
136
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 )))
142
138
if (GetInitialUrl () < 0 )
143
139
return 0 ;
144
140
}
@@ -188,7 +184,7 @@ int main(int argc, char* argv[]) {
188
184
CefBrowserHost::CreateBrowser (
189
185
window_info,
190
186
static_cast <CefRefPtr<CefClient> >(g_handler),
191
- szInitialUrl, browserSettings);
187
+ " file:// " + szInitialUrl, browserSettings);
192
188
193
189
gtk_container_add (GTK_CONTAINER (window), vbox);
194
190
gtk_widget_show_all (GTK_WIDGET (window));
0 commit comments