From b6d455a02bd338e9dc0faa09d4d8177ecd8d569a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 10 Apr 2016 15:53:05 +0200 Subject: NOISSUE reorganize and document libraries --- api/gui/DesktopServices.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 api/gui/DesktopServices.h (limited to 'api/gui/DesktopServices.h') diff --git a/api/gui/DesktopServices.h b/api/gui/DesktopServices.h new file mode 100644 index 00000000..9daf192a --- /dev/null +++ b/api/gui/DesktopServices.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include "multimc_gui_export.h" + +/** + * This wraps around QDesktopServices and adds workarounds where needed + * Use this instead of QDesktopServices! + */ +namespace DesktopServices +{ + /** + * Open a file in whatever application is applicable + */ + MULTIMC_GUI_EXPORT bool openFile(const QString &path); + + /** + * Open a file in the specified application + */ + MULTIMC_GUI_EXPORT bool openFile(const QString &application, const QString &path, const QString & workingDirectory = QString(), qint64 *pid = 0); + + /** + * Run an application + */ + MULTIMC_GUI_EXPORT bool run(const QString &application,const QStringList &args, const QString & workingDirectory = QString(), qint64 *pid = 0); + + /** + * Open a directory + */ + MULTIMC_GUI_EXPORT bool openDirectory(const QString &path, bool ensureExists = false); + + /** + * Open the URL, most likely in a browser. Maybe. + */ + MULTIMC_GUI_EXPORT bool openUrl(const QUrl &url); +}; -- cgit v1.2.3