#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include "browseroption.h"
Go to the source code of this file.
|
| QList< BrowserOption > | getBrowsers (IncludeNoDisplay includeNoDisplay=IncludeNoDisplay::No) |
| void | launchBrowser (const BrowserOption &option, const QStringList &urls=QStringList()) |
| QString | getCommandLineForDisplay (const BrowserOption &option, const QString &url=QString()) |
| QString | getExecutablePath (const BrowserOption &option) |
| QString | getConfigFilePath () |
| void | setConfigFilePathOverride (const QString &path) |
| void | clearConfigFilePathOverride () |
| QString | getChromeProfileDisplayName (const QString &desktopPath, const QString &profileId) |
| QString | getChromeProfilePicturePath (const QString &desktopPath, const QString &profileId) |
| QString | getChromeUserDataDir (const QString &desktopPath) |
| QStringList | readCommaSeparatedList (const QString &key) |
| bool | listContainsIdentifier (const QStringList &list, const QString &identifier) |
| bool | isBrowserHidden (const BrowserOption &option, const QStringList &hiddenIdentifiers) |
| QString | quoteArg (const QString &arg) |
| void | sortBrowserOptionsByDisplayName (QList< BrowserOption > &options) |
| QList< QStringList > | getPreLaunchCommands (const QString &desktopPath, const QString &profileName) |
| QList< QStringList > | getPostLaunchCommands (const QString &desktopPath, const QString &profileName) |
| void | runLaunchHookCommand (const QStringList &argv, bool wait) |
| void | runPreLaunchCommands (const QString &desktopPath, const QString &profileName) |
| void | runPostLaunchCommands (const QString &desktopPath, const QString &profileName) |
◆ IncludeNoDisplay
If entries with NoDisplay=true should be included (Linux XDG).
◆ clearConfigFilePathOverride()
| void clearConfigFilePathOverride |
( |
| ) |
|
Clears the config file path override.
◆ getBrowsers()
Finds available web browsers on the current platform.
- Parameters
-
| includeNoDisplay | Whether to include entries with NoDisplay=true (Linux only). |
- Returns
- List of BrowserOption objects.
◆ getChromeProfileDisplayName()
Resolves the profile display name for a saved option (Linux: Chromium profile; other backends may return empty).
- Parameters
-
| desktopPath | Path to the .desktop file (Linux) or backend-specific identifier. |
| profileId | Profile identifier. |
- Returns
- Display name for the profile, or empty if not found or not applicable.
◆ getChromeProfilePicturePath()
Resolves the full path to the Chrome/Chromium profile picture (gaia_picture_file_name in Local State).
- Parameters
-
| desktopPath | Path to the .desktop file (Linux) or backend-specific identifier. |
| profileId | Profile identifier. |
- Returns
- Full path to the picture file, or empty if not found or not applicable.
◆ getChromeUserDataDir()
Returns the Chrome/Chromium user data directory for the given browser path. Used by getChromeProfileDisplayName and getChromeProfilePicturePath.
- Parameters
-
| desktopPath | Path to the .desktop file (Linux), .app (macOS), or .exe (Windows). |
- Returns
- User data directory path, or empty if not Chrome/Chromium or not found.
◆ getCommandLineForDisplay()
Builds the command line for display (e.g. tooltip).
- Parameters
-
| option | The browser option. |
| url | Single URL to substitute, or empty. |
- Returns
- The full command line string.
◆ getConfigFilePath()
Returns the path to the configuration file for the current platform. If setConfigFilePathOverride was called, returns that path instead.
- Returns
- Full path to the config file.
◆ getExecutablePath()
Returns the resolved full path to the browser executable.
- Parameters
-
| option | The browser option. |
- Returns
- Full path to the executable, or empty if not found.
◆ getPostLaunchCommands()
Returns the post-launch commands from config for the given browser or browser+profile. Key is the same as RememberedBrowsers: desktopPath, or desktopPath + "|" + profileName. Under group PostLaunchCommands. Value is a JSON array of arrays of strings. If no entry for browser+profile, falls back to browser-only (desktopPath).
- Parameters
-
| desktopPath | Path to the .desktop file (Linux) or backend-specific identifier. |
| profileName | Profile identifier. |
- Returns
- List of command argument lists.
◆ getPreLaunchCommands()
Returns the pre-launch commands from config for the given browser or browser+profile. Key is the same as RememberedBrowsers: desktopPath, or desktopPath + "|" + profileName. Under group PreLaunchCommands. Value is a JSON array of arrays of strings. If no entry for browser+profile, falls back to browser-only (desktopPath).
- Parameters
-
| desktopPath | Path to the .desktop file (Linux) or backend-specific identifier. |
| profileName | Profile identifier. |
- Returns
- List of command argument lists.
◆ isBrowserHidden()
Returns true if the given option should be hidden (its desktop file base name is in hiddenIdentifiers, case-insensitive).
- Parameters
-
| option | The browser option. |
| hiddenIdentifiers | List of identifiers (e.g. desktop base names) to hide. |
◆ launchBrowser()
Launches the given browser option with the specified URLs.
- Parameters
-
| option | The browser and optional profile to launch. |
| urls | List of URLs to open; defaults to empty. |
◆ listContainsIdentifier()
Returns true if list contains identifier (case-insensitive).
- Parameters
-
| list | List of strings to search. |
◆ quoteArg()
Quotes arg for display in a command line (handles space, quotes, backslash).
- Parameters
-
◆ readCommaSeparatedList()
Reads a comma-separated list from the config file (e.g. Advanced/hideProfileBrowsers).
- Parameters
-
◆ runLaunchHookCommand()
| void runLaunchHookCommand |
( |
const QStringList & | argv, |
|
|
bool | wait ) |
Runs a launch-hook command (pre or post). Executes argv directly (no shell).
- Parameters
-
| argv | Program as first element, then arguments. Empty or single empty string is a no-op. |
| wait | If true, block until the command exits; if false, start detached. |
◆ runPostLaunchCommands()
| void runPostLaunchCommands |
( |
const QString & | desktopPath, |
|
|
const QString & | profileName ) |
Runs all post-launch commands for the given browser or browser+profile (detached).
- Parameters
-
| desktopPath | Path to the .desktop file (Linux) or backend-specific identifier. |
| profileName | Profile identifier. |
◆ runPreLaunchCommands()
| void runPreLaunchCommands |
( |
const QString & | desktopPath, |
|
|
const QString & | profileName ) |
Runs all pre-launch commands for the given browser or browser+profile (synchronously).
- Parameters
-
| desktopPath | Path to the .desktop file (Linux) or backend-specific identifier. |
| profileName | Profile identifier. |
◆ setConfigFilePathOverride()
| void setConfigFilePathOverride |
( |
const QString & | path | ) |
|
Overrides the config file path (for tests). getConfigFilePath() returns this until cleared.
- Parameters
-
| path | Override path, or empty to clear. |
◆ sortBrowserOptionsByDisplayName()
Sorts browser options by display name (case-insensitive).
- Parameters
-