Skip to content

Commit

Permalink
update sample path to handle possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Jun 6, 2017
1 parent ab83084 commit 2535f7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DialogTools/ConnectDatasourceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,11 @@ void ConnectDatasourceDlg::OnSample(wxCommandEvent& event)
if (ds_name == "samples.sqlite") {
ds_name = GenUtils::GetSamplesDir() + ds_name;
ds_name.Replace("\\", "\\\\");
ds_json = wxString::Format("{\"ds_type\":\"SQLite\", \"ds_path\": \"%s\"}", ds_name);
//ds_json = wxString::Format("{\"ds_type\":\"SQLite\", \"ds_path\": \"%s\"}", ds_name);
ds_json = "{\"ds_type\":\"SQLite\", \"ds_path\": \""+ds_name+"\"}";
} else {
ds_json = wxString::Format("{\"ds_type\":\"GeoJSON\", \"ds_path\": \"%s\"}", ds_name);
//ds_json = wxString::Format("{\"ds_type\":\"GeoJSON\", \"ds_path\": \"%s\"}", ds_name);
ds_json = "{\"ds_type\":\"GeoJSON\", \"ds_path\": \""+ds_name+"\"}";
}

IDataSource* ds = IDataSource::CreateDataSource(ds_json);
Expand Down

0 comments on commit 2535f7a

Please sign in to comment.