Skip to content

Commit b0bd52b

Browse files
committed
Removed duplicate version fields in Base class
1 parent 13fd277 commit b0bd52b

File tree

6 files changed

+11
-37
lines changed

6 files changed

+11
-37
lines changed

app/src/processing/app/Base.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@
5858
* files and images, etc) that comes from that.
5959
*/
6060
public class Base {
61-
public static final int REVISION = BaseNoGui.REVISION;
62-
/** This might be replaced by main() if there's a lib/version.txt file. */
63-
static String VERSION_NAME = BaseNoGui.VERSION_NAME;
64-
/** Set true if this a proper release rather than a numbered revision. */
65-
static public boolean RELEASE = BaseNoGui.RELEASE;
6661

6762
static private boolean commandLine;
6863

@@ -104,8 +99,6 @@ static public void main(String args[]) throws Exception {
10499
BaseNoGui.initParameters(args);
105100

106101
BaseNoGui.initVersion();
107-
VERSION_NAME = BaseNoGui.VERSION_NAME;
108-
RELEASE = BaseNoGui.RELEASE;
109102

110103
// if (System.getProperty("mrj.version") != null) {
111104
// //String jv = System.getProperty("java.version");
@@ -1509,7 +1502,7 @@ public void paint(Graphics g) {
15091502

15101503
g.setFont(new Font("SansSerif", Font.PLAIN, 11));
15111504
g.setColor(Color.white);
1512-
g.drawString(VERSION_NAME, 50, 30);
1505+
g.drawString(BaseNoGui.VERSION_NAME, 50, 30);
15131506
}
15141507
};
15151508
window.addMouseListener(new MouseAdapter() {

app/src/processing/app/Editor.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,13 +2208,8 @@ protected boolean handleOpenInternal(File sketchFile) {
22082208
}
22092209
header.rebuild();
22102210
// Set the title of the window to "sketch_070752a - Processing 0126"
2211-
setTitle(
2212-
I18n.format(
2213-
_("{0} | Arduino {1}"),
2214-
sketch.getName(),
2215-
Base.VERSION_NAME
2216-
)
2217-
);
2211+
setTitle(I18n.format(_("{0} | Arduino {1}"), sketch.getName(),
2212+
BaseNoGui.VERSION_NAME));
22182213
// Disable untitled setting from previous document, if any
22192214
untitled = false;
22202215

app/src/processing/app/EditorStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public void keyTyped(KeyEvent event) {
464464
copyErrorButton.addActionListener(new ActionListener() {
465465
public void actionPerformed(ActionEvent e) {
466466
String message = "";
467-
message += _("Arduino: ") + Base.VERSION_NAME + " (" + System.getProperty("os.name") + "), ";
467+
message += _("Arduino: ") + BaseNoGui.VERSION_NAME + " (" + System.getProperty("os.name") + "), ";
468468
message += _("Board: ") + "\"" + Base.getBoardPreferences().get("name") + "\"\n\n";
469469
message += editor.console.consoleTextPane.getText().trim();
470470
if ((Preferences.getBoolean("build.verbose")) == false) {

app/src/processing/app/UpdateCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void run() {
7979
try {
8080
String info;
8181
info = URLEncoder.encode(id + "\t" +
82-
PApplet.nf(Base.REVISION, 4) + "\t" +
82+
PApplet.nf(BaseNoGui.REVISION, 4) + "\t" +
8383
System.getProperty("java.version") + "\t" +
8484
System.getProperty("java.vendor") + "\t" +
8585
System.getProperty("os.name") + "\t" +
@@ -104,7 +104,7 @@ public void run() {
104104
"would you like to visit the Arduino download page?");
105105

106106
if (base.activeEditor != null) {
107-
if (latest > Base.REVISION) {
107+
if (latest > BaseNoGui.REVISION) {
108108
Object[] options = { _("Yes"), _("No") };
109109
int result = JOptionPane.showOptionDialog(base.activeEditor,
110110
prompt,

arduino-core/src/processing/app/BaseNoGui.java

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@
4141

4242
public class BaseNoGui {
4343

44+
/** Version string to be used for build */
4445
public static final int REVISION = 158;
45-
/** This might be replaced by main() if there's a lib/version.txt file. */
46-
static String VERSION_NAME = "0158";
47-
/** Set true if this a proper release rather than a numbered revision. */
48-
static public boolean RELEASE = false;
46+
/** Extended version string displayed on GUI */
47+
static String VERSION_NAME = "1.5.8";
4948

5049
static File buildFolder;
5150

@@ -608,19 +607,6 @@ static public void initPortableFolder() {
608607
}
609608

610609
static public void initVersion() {
611-
try {
612-
File versionFile = getContentFile("lib/version.txt");
613-
if (versionFile.exists()) {
614-
String version = PApplet.loadStrings(versionFile)[0];
615-
if (!version.equals(VERSION_NAME) && !version.equals("${version}")) {
616-
VERSION_NAME = version;
617-
RELEASE = true;
618-
}
619-
}
620-
} catch (Exception e) {
621-
e.printStackTrace();
622-
}
623-
624610
// help 3rd party installers find the correct hardware path
625611
PreferencesData.set("last.ide." + VERSION_NAME + ".hardwarepath", getHardwarePath());
626612
PreferencesData.set("last.ide." + VERSION_NAME + ".daterun", "" + (new Date()).getTime() / 1000);

build/build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@
169169
<tokenfilter>
170170
<linetokenizer />
171171
<containsregex pattern="String VERSION_NAME = "/>
172-
<replaceregex pattern="[^0-9]*" flags="g" replace=""/>
172+
<replaceregex pattern=".*&quot;(.*)&quot;.*" flags="g" replace="\1"/>
173173
</tokenfilter>
174174
</filterchain>
175175
</loadfile>
176-
<echo message="Revision in BaseNoGui.java is: ${revision.base}" />
176+
<echo message=" Revision in BaseNoGui.java is: ${revision.base}" />
177177
</target>
178178

179179
<!-- - - - - - - - -->

0 commit comments

Comments
 (0)