Albert
Loading...
Searching...
No Matches

Description

System/Desktop utility.

Classes

class  albert::Notification
 The notification class. More...
 

System utility

void albert::openUrl (const QString &url)
 Opens url with the default handler for the scheme.
 
void albert::open (const QUrl &url)
 Opens url with the default handler for the scheme.
 
void albert::open (const QString &path)
 Opens a file at path with the associated default application.
 
void albert::open (const std::filesystem::path &path)
 Opens a file at path with the associated default application.
 
void albert::setClipboardText (const QString &text)
 Sets the system clipboard to text.
 
bool albert::havePasteSupport ()
 Returns the true if the platform supports pasting, else false.
 
void albert::setClipboardTextAndPaste (const QString &text)
 Sets the system clipboard to text and pastes text to the front-most window.
 
long long albert::runDetachedProcess (const QStringList &commandline)
 Starts the commandline in a new process, and detaches from it.
 
long long albert::runDetachedProcess (const QStringList &commandline, const QString &working_dir)
 Starts the commandline in a new process, and detaches from it.
 
QString albert::toQString (const std::filesystem::path &path)
 Returns a QString representation of path.
 

Function Documentation

◆ havePasteSupport()

bool albert::havePasteSupport ( )

Returns the true if the platform supports pasting, else false.

◆ open() [1/3]

void albert::open ( const QString &  path)

Opens a file at path with the associated default application.

◆ open() [2/3]

void albert::open ( const QUrl &  url)

Opens url with the default handler for the scheme.

◆ open() [3/3]

void albert::open ( const std::filesystem::path &  path)

Opens a file at path with the associated default application.

◆ openUrl()

void albert::openUrl ( const QString &  url)

Opens url with the default handler for the scheme.

Does nothing if url is not a valid URL.

◆ runDetachedProcess() [1/2]

long long albert::runDetachedProcess ( const QStringList commandline)

Starts the commandline in a new process, and detaches from it.

Returns the PID on success; otherwise returns 0. The working directory is the users home directory.

◆ runDetachedProcess() [2/2]

long long albert::runDetachedProcess ( const QStringList commandline,
const QString &  working_dir 
)

Starts the commandline in a new process, and detaches from it.

Returns the PID on success; otherwise returns 0. The process will be started in the directory working_dir. If working_dir is empty, the working directory is the users home directory.

◆ setClipboardText()

void albert::setClipboardText ( const QString &  text)

Sets the system clipboard to text.

◆ setClipboardTextAndPaste()

void albert::setClipboardTextAndPaste ( const QString &  text)

Sets the system clipboard to text and pastes text to the front-most window.

Check albert::havePasteSupport before using this function.

◆ toQString()

QString albert::toQString ( const std::filesystem::path &  path)

Returns a QString representation of path.