Skip to content

Commit e83462b

Browse files
bitroncmaglie
authored andcommitted
Changed dependency from Preferences to PreferencesData in processing.app.linux.Platform and processing.app.windows.Platform.
1 parent c666274 commit e83462b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app/src/processing/app/linux/Platform.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import org.apache.commons.exec.CommandLine;
2626
import org.apache.commons.exec.Executor;
27-
import processing.app.Preferences;
27+
import processing.app.PreferencesData;
2828
import processing.app.debug.TargetPackage;
2929
import processing.app.tools.ExternalProcessExecutor;
3030
import processing.app.legacy.PConstants;
@@ -64,7 +64,7 @@ public File getDefaultSketchbookFolder() throws Exception {
6464

6565
public void openURL(String url) throws Exception {
6666
if (openFolderAvailable()) {
67-
String launcher = Preferences.get("launcher");
67+
String launcher = PreferencesData.get("launcher");
6868
if (launcher != null) {
6969
Runtime.getRuntime().exec(new String[] { launcher, url });
7070
}
@@ -73,15 +73,15 @@ public void openURL(String url) throws Exception {
7373

7474

7575
public boolean openFolderAvailable() {
76-
if (Preferences.get("launcher") != null) {
76+
if (PreferencesData.get("launcher") != null) {
7777
return true;
7878
}
7979

8080
// Attempt to use xdg-open
8181
try {
8282
Process p = Runtime.getRuntime().exec(new String[] { "xdg-open" });
8383
p.waitFor();
84-
Preferences.set("launcher", "xdg-open");
84+
PreferencesData.set("launcher", "xdg-open");
8585
return true;
8686
} catch (Exception e) { }
8787

@@ -90,15 +90,15 @@ public boolean openFolderAvailable() {
9090
Process p = Runtime.getRuntime().exec(new String[] { "gnome-open" });
9191
p.waitFor();
9292
// Not installed will throw an IOException (JDK 1.4.2, Ubuntu 7.04)
93-
Preferences.set("launcher", "gnome-open");
93+
PreferencesData.set("launcher", "gnome-open");
9494
return true;
9595
} catch (Exception e) { }
9696

9797
// Attempt with kde-open
9898
try {
9999
Process p = Runtime.getRuntime().exec(new String[] { "kde-open" });
100100
p.waitFor();
101-
Preferences.set("launcher", "kde-open");
101+
PreferencesData.set("launcher", "kde-open");
102102
return true;
103103
} catch (Exception e) { }
104104

@@ -108,7 +108,7 @@ public boolean openFolderAvailable() {
108108

109109
public void openFolder(File file) throws Exception {
110110
if (openFolderAvailable()) {
111-
String launcher = Preferences.get("launcher");
111+
String launcher = PreferencesData.get("launcher");
112112
try {
113113
String[] params = new String[] { launcher, file.getAbsolutePath() };
114114
//processing.core.PApplet.println(params);

app/src/processing/app/windows/Platform.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.apache.commons.exec.Executor;
3030

3131
import processing.app.Base;
32-
import processing.app.Preferences;
32+
import processing.app.PreferencesData;
3333
import processing.app.debug.TargetPackage;
3434
import processing.app.legacy.PApplet;
3535
import processing.app.legacy.PConstants;
@@ -74,13 +74,13 @@ protected void checkAssociations() {
7474
Registry.getStringValue(REGISTRY_ROOT_KEY.CLASSES_ROOT,
7575
DOC + "\\shell\\open\\command", "");
7676
if (knownCommand == null) {
77-
if (Preferences.getBoolean("platform.auto_file_type_associations")) {
77+
if (PreferencesData.getBoolean("platform.auto_file_type_associations")) {
7878
setAssociations();
7979
}
8080

8181
} else if (!knownCommand.equals(openCommand)) {
8282
// If the value is set differently, just change the registry setting.
83-
if (Preferences.getBoolean("platform.auto_file_type_associations")) {
83+
if (PreferencesData.getBoolean("platform.auto_file_type_associations")) {
8484
setAssociations();
8585
}
8686
}
@@ -116,7 +116,7 @@ protected void setAssociations() throws UnsupportedEncodingException {
116116
// hooray!
117117

118118
} else {
119-
Preferences.setBoolean("platform.auto_file_type_associations", false);
119+
PreferencesData.setBoolean("platform.auto_file_type_associations", false);
120120
}
121121
}
122122

0 commit comments

Comments
 (0)