Skip to content

Commit

Permalink
GeoDaCenter#2223 update report bug on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Oct 1, 2020
1 parent 9b010cc commit b8c6bb9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions DialogTools/ReportBugDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ ReportResultDlg::ReportResultDlg(wxWindow* parent, wxString issue_url,
m_hyperlink1 = new wxHyperlinkCtrl(panel, wxID_ANY, issue_url,
issue_url);
bSizer->Add(lbl_tip, 1, wxALIGN_TOP | wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10);
bSizer->Add(m_hyperlink1, 1, wxALIGN_TOP | wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 0);
bSizer->Add(m_hyperlink1, 1, wxALIGN_TOP | wxEXPAND | wxLEFT | wxRIGHT, 10);

panel->SetSizerAndFit(bSizer);

Expand Down Expand Up @@ -163,13 +163,14 @@ string CreateIssueOnGithub(wxString& post_data)
CURLcode res;
if (curl) {
struct curl_slist *chunk = NULL;
chunk = curl_slist_append(chunk, "Accept: application/vnd.github.v3+json");
chunk = curl_slist_append(chunk, header_auth.c_str());
chunk = curl_slist_append(chunk, header_user_agent.c_str());
// set our custom set of headers
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
(const char*)post_data.mb_str(wxConvUTF8));
(const char*)post_data.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_to_string_);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1L);
Expand Down Expand Up @@ -337,7 +338,9 @@ bool ReportBugDlg::CreateIssue(wxString title, wxString body)
wxTextFile tfile;
if (tfile.Open(logger_path)) {
while (!tfile.Eof()) {
body << tfile.GetNextLine() << "\\n";
wxString ln = tfile.GetNextLine();
ln.Replace("\\", "\\\\");
body << ln << "\\n";
}
}

Expand Down

0 comments on commit b8c6bb9

Please sign in to comment.