summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/bdsup2sub/files/bdsup2sub-4.0.0-xdg.diff')
-rw-r--r--media-video/bdsup2sub/files/bdsup2sub-4.0.0-xdg.diff37
1 files changed, 37 insertions, 0 deletions
diff --git a/media-video/bdsup2sub/files/bdsup2sub-4.0.0-xdg.diff b/media-video/bdsup2sub/files/bdsup2sub-4.0.0-xdg.diff
new file mode 100644
index 000000000000..4a045d31b190
--- /dev/null
+++ b/media-video/bdsup2sub/files/bdsup2sub-4.0.0-xdg.diff
@@ -0,0 +1,37 @@
+diff -Naur src.orig/deadbeef/SupTools/Core.java src/deadbeef/SupTools/Core.java
+--- src.orig/deadbeef/SupTools/Core.java 2010-07-28 22:56:08.319223422 +0200
++++ src/deadbeef/SupTools/Core.java 2010-07-28 22:56:08.890223411 +0200
+@@ -22,6 +22,8 @@
+ import deadbeef.Tools.Props;
+ import deadbeef.Tools.ToolBox;
+
++import java.io.File;
++
+ /*
+ * Copyright 2009 Volker Oth (0xdeadbeef)
+ *
+@@ -768,6 +770,11 @@
+ }
+ fnameProps += Core.iniName;
+
++ // use XDG spec
++ fnameProps = System.getenv("XDG_CONFIG_HOME");
++ if (fnameProps == null) fnameProps = System.getProperty("user.home") + "/.config";
++ fnameProps += "/" + Core.iniName;
++
+ // read properties from ini file
+ props = new Props();
+ props.setHeader(Core.progNameVer+" settings - don't modify manually");
+@@ -905,8 +912,11 @@
+ * Write properties
+ */
+ public static void storeProps() {
+- if (props != null)
++ if (props != null) {
++ File path = new File(ToolBox.getPathName(fnameProps));
++ path.mkdirs();
+ props.save(fnameProps);
++ }
+ }
+
+ /**