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

Commit

Permalink
check for /dev at executable location
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonsanjose committed May 2, 2013
1 parent 96738d6 commit c1aefaf
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions appshell/cefclient_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ static gboolean HandleQuit(int signatl) {
destroy();
}

bool FileExists(std::string path) {
struct stat buf;
return (stat(path.c_str(), &buf) >= 0) && (S_ISREG(buf.st_mode));
}

int GetInitialUrl() {
GtkWidget *dialog;
const char* dialog_title = "Please select the index.html file";
Expand Down Expand Up @@ -143,13 +148,16 @@ int main(int argc, char* argv[]) {
}

szInitialUrl = AppGetRunningDirectory();
szInitialUrl.append("/www/index.html");
szInitialUrl.append("/dev/src/index.html");

{
struct stat buf;
if(!(stat(szInitialUrl.c_str(), &buf) >= 0) || !(S_ISREG(buf.st_mode)))
if(GetInitialUrl() < 0)
if (!FileExists(szInitialUrl)) {
szInitialUrl = AppGetRunningDirectory();
szInitialUrl.append("/www/index.html");

if (!FileExists(szInitialUrl)) {
if (GetInitialUrl() < 0)
return 0;
}
}

// Initialize CEF.
Expand Down

0 comments on commit c1aefaf

Please sign in to comment.