summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-02 14:02:41 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-02 14:02:41 -0300
commite361e8539c889d3ca66e77ebb5d0ceb61d17f49d (patch)
treee34bb70d58e8d023df34c3e6744b5cdfa866ef7d /platform/x11
parent9d5a2cb8470d538fa33f9f7b4d6cdd5390b3b70b (diff)
-Ability to ask for documents/pictures/etc system dirs.
-Fixes to animationplayer -fixes to collada importer
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/os_x11.cpp68
-rw-r--r--platform/x11/os_x11.h2
2 files changed, 69 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 4c45fcfaaf..0466984359 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1088,7 +1088,73 @@ String OS_X11::get_name() {
Error OS_X11::shell_open(String p_uri) {
- return ERR_UNAVAILABLE;
+ Error ok;
+ List<String> args;
+ args.push_back(p_uri);
+ ok = execute("/usr/bin/xdg-open",args,false);
+ if (ok==OK)
+ return OK;
+ ok = execute("gnome-open",args,false);
+ if (ok==OK)
+ return OK;
+ ok = execute("kde-open",args,false);
+ return ok;
+}
+
+String OS_X11::get_system_dir(SystemDir p_dir) const {
+
+
+ String xdgparam;
+
+ switch(p_dir) {
+ case SYSTEM_DIR_DESKTOP: {
+
+ xdgparam="DESKTOP";
+ } break;
+ case SYSTEM_DIR_DCIM: {
+
+ xdgparam="PICTURES";
+
+ } break;
+ case SYSTEM_DIR_DOCUMENTS: {
+
+ xdgparam="DOCUMENTS";
+
+ } break;
+ case SYSTEM_DIR_DOWNLOADS: {
+
+ xdgparam="DOWNLOAD";
+
+ } break;
+ case SYSTEM_DIR_MOVIES: {
+
+ xdgparam="VIDEOS";
+
+ } break;
+ case SYSTEM_DIR_MUSIC: {
+
+ xdgparam="MUSIC";
+
+ } break;
+ case SYSTEM_DIR_PICTURES: {
+
+ xdgparam="PICTURES";
+
+ } break;
+ case SYSTEM_DIR_RINGTONES: {
+
+ xdgparam="MUSIC";
+
+ } break;
+ }
+
+ String pipe;
+ List<String> arg;
+ arg.push_back(xdgparam);
+ Error err = const_cast<OS_X11*>(this)->execute("/usr/bin/xdg-user-dir",arg,true,NULL,&pipe);
+ if (err!=OK)
+ return ".";
+ return pipe.strip_edges();
}
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 2ffca0e042..67772894fa 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -197,6 +197,8 @@ public:
virtual void make_rendering_thread();
virtual void swap_buffers();
+ virtual String get_system_dir(SystemDir p_dir) const;
+
virtual Error shell_open(String p_uri);
virtual void set_video_mode(const VideoMode& p_video_mode,int p_screen=0);