MCPcopy Index your code
hub / github.com/benfry/processing4 / updateCheck

Method updateCheck

app/src/processing/app/UpdateCheck.java:104–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103
104 public void updateCheck() throws IOException {
105 String info = PApplet.urlEncode(getUpdateID() + "\t" +
106 PApplet.nf(Base.getRevision(), 4) + "\t" +
107 System.getProperty("java.version") + "\t" +
108 System.getProperty("java.vendor") + "\t" +
109 System.getProperty("os.name") + "\t" +
110 System.getProperty("os.version") + "\t" +
111 System.getProperty("os.arch"));
112
113 int latest = readInt(LATEST_URL + "?" + info);
114
115 String lastString = Preferences.get("update.last");
116 long now = System.currentTimeMillis();
117 if (lastString != null) {
118 long when = Long.parseLong(lastString);
119 if (now - when < ONE_DAY) {
120 // don't annoy the shit outta people
121 return;
122 }
123 }
124 Preferences.set("update.last", String.valueOf(now));
125
126 if (base.activeEditor != null) {
127// boolean offerToUpdateContributions = true;
128
129 if (latest > Base.getRevision()) {
130 System.out.println("You are running Processing revision 0" +
131 Base.getRevision() + ", the latest build is 0" +
132 latest + ".");
133 // Assume the person is busy downloading the latest version
134// offerToUpdateContributions = !promptToVisitDownloadPage();
135 promptToVisitDownloadPage();
136 }
137
138 /*
139 if (offerToUpdateContributions) {
140 // Wait for xml file to be downloaded and updates to come in.
141 // (this should really be handled better).
142 Thread.sleep(5 * 1000);
143 if ((!base.contributionManagerFrame.hasAlreadyBeenOpened()
144 && (base.contributionManagerFrame.hasUpdates(base)))){
145 promptToOpenContributionManager();
146 }
147 }
148 */
149 }
150 }
151
152
153 protected void promptToVisitDownloadPage() {

Callers 1

UpdateCheckMethod · 0.95

Calls 9

urlEncodeMethod · 0.95
getUpdateIDMethod · 0.95
nfMethod · 0.95
getRevisionMethod · 0.95
readIntMethod · 0.95
getMethod · 0.95
setMethod · 0.95
printlnMethod · 0.45

Tested by

no test coverage detected