mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
mplayer: Put dot-config files in user settings folder (#1948)
Fixes https://github.com/haikuports/haikuports/issues/472
This commit is contained in:
committed by
miqlas
parent
3560d8629b
commit
724cf51738
@@ -22,7 +22,7 @@ DVD subtitles (SPU streams, VOBsub and Closed Captions) are supported as well."
|
|||||||
HOMEPAGE="http://www.mplayerhq.hu/"
|
HOMEPAGE="http://www.mplayerhq.hu/"
|
||||||
COPYRIGHT="2001-2016 The MPlayer Team"
|
COPYRIGHT="2001-2016 The MPlayer Team"
|
||||||
LICENSE="GNU LGPL v2.1"
|
LICENSE="GNU LGPL v2.1"
|
||||||
REVISION="4"
|
REVISION="5"
|
||||||
SOURCE_URI="http://www.mplayerhq.hu/MPlayer/releases/MPlayer-$portVersion.tar.xz"
|
SOURCE_URI="http://www.mplayerhq.hu/MPlayer/releases/MPlayer-$portVersion.tar.xz"
|
||||||
CHECKSUM_SHA256="3ad0846c92d89ab2e4e6fb83bf991ea677e7aa2ea775845814cbceb608b09843"
|
CHECKSUM_SHA256="3ad0846c92d89ab2e4e6fb83bf991ea677e7aa2ea775845814cbceb608b09843"
|
||||||
SOURCE_DIR="MPlayer-$portVersion"
|
SOURCE_DIR="MPlayer-$portVersion"
|
||||||
|
|||||||
@@ -1400,3 +1400,55 @@ index 0000000..614c8ff
|
|||||||
--
|
--
|
||||||
2.10.2
|
2.10.2
|
||||||
|
|
||||||
|
From 38ddddaa2dd35b98fdbdaf063163cf28e288dea6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Damillora <duniapengetahuan.12345@gmail.com>
|
||||||
|
Date: Sun, 24 Dec 2017 13:13:40 +0700
|
||||||
|
Subject: Put settings to user settings folder
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/path.c b/path.c
|
||||||
|
index b8d9335..a98f43b 100644
|
||||||
|
--- a/path.c
|
||||||
|
+++ b/path.c
|
||||||
|
@@ -42,6 +42,11 @@
|
||||||
|
#include <sys/cygwin.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifdef __HAIKU__
|
||||||
|
+#include <FindDirectory.h>
|
||||||
|
+#include <fs_info.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include "osdep/osdep.h"
|
||||||
|
|
||||||
|
char *get_path(const char *filename){
|
||||||
|
@@ -51,6 +56,13 @@ char *get_path(const char *filename){
|
||||||
|
char *buff;
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
const char *config_dir = "/mplayer";
|
||||||
|
+#elif defined(__HAIKU__)
|
||||||
|
+ dev_t volume = dev_for_path("/boot");
|
||||||
|
+ char buffer[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
|
||||||
|
+ status_t result;
|
||||||
|
+ result = find_directory(B_USER_SETTINGS_DIRECTORY,volume,false,buffer,sizeof(buffer));
|
||||||
|
+ strcat(buffer,"/mplayer");
|
||||||
|
+ const char *config_dir = &buffer;
|
||||||
|
#else
|
||||||
|
const char *config_dir = "/.mplayer";
|
||||||
|
#endif
|
||||||
|
@@ -94,6 +106,12 @@ char *get_path(const char *filename){
|
||||||
|
else config_dir++;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
+#ifdef __HAIKU__
|
||||||
|
+ // As the home directory path is already on the
|
||||||
|
+ // find_directory call above, we empty the homedir
|
||||||
|
+ // variable
|
||||||
|
+ homedir = "";
|
||||||
|
+#endif
|
||||||
|
len = strlen(homedir) + strlen(config_dir) + 1;
|
||||||
|
if (filename == NULL) {
|
||||||
|
if ((buff = malloc(len)) == NULL)
|
||||||
|
--
|
||||||
|
2.14.2
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user