Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 29930a2

Browse files
committed
Merge remote-tracking branch 'linux/linux' into linux
Conflicts: appshell/client_app_gtk.cpp
2 parents a25ef54 + 3870093 commit 29930a2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

appshell/cefclient_gtk.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -136,7 +134,7 @@ int main(int argc, char* argv[]) {
136134

137135
{
138136
struct stat buf;
139-
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)))
140138
if(GetInitialUrl() < 0)
141139
return 0;
142140
}
@@ -186,7 +184,7 @@ int main(int argc, char* argv[]) {
186184
CefBrowserHost::CreateBrowser(
187185
window_info,
188186
static_cast<CefRefPtr<CefClient> >(g_handler),
189-
szInitialUrl, browserSettings);
187+
"file://"+szInitialUrl, browserSettings);
190188

191189
gtk_container_add(GTK_CONTAINER(window), vbox);
192190
gtk_widget_show_all(GTK_WIDGET(window));

appshell/client_app_gtk.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extern char _binary_appshell_appshell_extensions_js_start;
3737

3838
CefString ClientApp::GetCurrentLanguage()
3939
{
40+
<<<<<<< HEAD
4041
//TODO proper locale in GTK
4142
printf("in GetCurrentLanguage: ");
4243
const char* locconst = pango_language_to_string( gtk_get_default_language() );
@@ -47,6 +48,17 @@ CefString ClientApp::GetCurrentLanguage()
4748
if ( (loc[i] == '-') || (loc[i] == '_') ) { loc[i] = 0; break; }
4849
printf( "%s\n", loc ); // here it prints just "en"
4950
return CefString(loc);
51+
=======
52+
const char* locconst = pango_language_to_string( gtk_get_default_language() );
53+
//Rado: for me it prints "en-us", so I have to strip everything after the "-"
54+
char loc[10] = {0};
55+
strncpy(loc, locconst, 9);
56+
for(int i=0; i<8; i++)
57+
if ( (loc[i] == '-') || (loc[i] == '_') ) { loc[i] = 0; break; }
58+
59+
//TODO Explore possibility of using locale as-is, without stripping
60+
return CefString(loc);
61+
>>>>>>> linux/linux
5062
}
5163

5264
std::string ClientApp::GetExtensionJSSource()

0 commit comments

Comments
 (0)