From 6c59100c31a49f9af27dabd2d1760bc973e52e87 Mon Sep 17 00:00:00 2001 From: phantom Date: Sat, 29 Jun 2013 18:47:16 +0200 Subject: [PATCH] Implemented ArchHooks_Unix::GoToURL --- src/arch/ArchHooks/ArchHooks_Unix.cpp | 7 +++++++ src/arch/ArchHooks/ArchHooks_Unix.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/arch/ArchHooks/ArchHooks_Unix.cpp b/src/arch/ArchHooks/ArchHooks_Unix.cpp index d3cd93840e..1374590f36 100644 --- a/src/arch/ArchHooks/ArchHooks_Unix.cpp +++ b/src/arch/ArchHooks/ArchHooks_Unix.cpp @@ -198,6 +198,13 @@ void ArchHooks_Unix::Init() #endif } +bool ArchHooks_Unix::GoToURL( RString sUrl ) +{ + RString command = "xdg-open " + sUrl; + int result = system( command.c_str() ); + return result != -1 && WEXITSTATUS( result ) == 0; +} + #ifndef _CS_GNU_LIBC_VERSION #define _CS_GNU_LIBC_VERSION 2 #endif diff --git a/src/arch/ArchHooks/ArchHooks_Unix.h b/src/arch/ArchHooks/ArchHooks_Unix.h index 4606f0948e..81c52ec522 100644 --- a/src/arch/ArchHooks/ArchHooks_Unix.h +++ b/src/arch/ArchHooks/ArchHooks_Unix.h @@ -15,6 +15,8 @@ public: void MountInitialFilesystems( const RString &sDirOfExecutable ); float GetDisplayAspectRatio() { return 4.0f/3; } + bool GoToURL( RString sUrl ); + static clockid_t GetClock(); };