[chronojump] Avoids repeating the same string.
- From: Carles Pina i Estany <carlespina src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Avoids repeating the same string.
- Date: Wed, 21 Jan 2015 00:16:05 +0000 (UTC)
commit 487fa19e189613361fa5b30a97a9b1e7d5bd1547
Author: Carles Pina i Estany <carles pina cat>
Date: Wed Jan 21 00:15:41 2015 +0000
Avoids repeating the same string.
src/json_post.cs | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/json_post.cs b/src/json_post.cs
index ff3937d..6eb1de2 100644
--- a/src/json_post.cs
+++ b/src/json_post.cs
@@ -36,14 +36,16 @@ public class JsonPost
public bool PostCrashLog()
{
+ string serverUrl = "http://api.chronojump.org:8080";
string filePath = UtilAll.GetLogFileOld();
+
if(! File.Exists(filePath)) {
this.ResultMessage = Catalog.GetString("Could not send file.\nIt does not exist.");
return false;
}
// Create a request using a URL that can receive a post.
- WebRequest request = WebRequest.Create ("http://api.chronojump.org:8080/backtrace");
+ WebRequest request = WebRequest.Create (serverUrl + "/backtrace");
// Set the Method property of the request to POST.
request.Method = "POST";
@@ -63,7 +65,7 @@ public class JsonPost
dataStream = request.GetRequestStream ();
} catch {
this.ResultMessage = string.Format(Catalog.GetString("Could not send file.\nYou are
not connected to the Internet\nor {0} server is down."),
- "http://api.chronojump.org:8080");
+ serverUrl);
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]