Some checks failed
CodeQL Code Scanning / CodeQL (push) Has been cancelled
Build Application / Build Debug (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-13, x86_64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-14, aarch64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04, x86_64-linux) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04-arm, aarch64-linux) (push) Has been cancelled
Update Flake Lockfile / update-flake (push) Has been cancelled
45 lines
1.0 KiB
C++
Executable File
45 lines
1.0 KiB
C++
Executable File
#pragma once
|
|
|
|
#include <QString>
|
|
#include <QUrl>
|
|
|
|
class QFileInfo;
|
|
|
|
/**
|
|
* This wraps around QDesktopServices and adds workarounds where needed
|
|
* Use this instead of QDesktopServices!
|
|
*/
|
|
namespace DesktopServices {
|
|
/**
|
|
* Open a path in whatever application is applicable.
|
|
* @param ensureFolderPathExists Make sure the path exists
|
|
*/
|
|
bool openPath(const QFileInfo& path, bool ensureFolderPathExists = false);
|
|
|
|
/**
|
|
* Open a path in whatever application is applicable.
|
|
* @param ensureFolderPathExists Make sure the path exists
|
|
*/
|
|
bool openPath(const QString& path, bool ensureFolderPathExists = false);
|
|
|
|
/**
|
|
* Run an application
|
|
*/
|
|
bool run(const QString& application, const QStringList& args, const QString& workingDirectory = QString(), qint64* pid = 0);
|
|
|
|
/**
|
|
* Open the URL, most likely in a browser. Maybe.
|
|
*/
|
|
bool openUrl(const QUrl& url);
|
|
|
|
/**
|
|
* Determine whether the launcher is running in a Flatpak environment
|
|
*/
|
|
bool isFlatpak();
|
|
|
|
/**
|
|
* Determine whether the launcher is running in a Snap environment
|
|
*/
|
|
bool isSnap();
|
|
} // namespace DesktopServices
|