browserchooser 0.0.2
A simple browser chooser.
Loading...
Searching...
No Matches
BrowserOption Class Reference

#include <browseroption.h>

Public Member Functions

 BrowserOption (const QString &desktopPath, const QString &profileId=QString(), const QString &profileDisplayName=QString(), bool singleProfile=false, bool fromProfileDiscovery=false)
 BrowserOption (const DesktopEntry &entry, const QString &profileId=QString(), const QString &profileDisplayName=QString(), bool singleProfile=false, bool fromProfileDiscovery=false)
QString desktopPath () const
QString profileName () const
QString displayName () const
QString profileLabel () const
DesktopEntry entry () const
bool isValid () const
bool fromProfileDiscovery () const

Detailed Description

A selectable browser option: a desktop entry plus an optional Chrome/Chromium profile. Default profile is represented by an empty profile name.

Constructor & Destructor Documentation

◆ BrowserOption() [1/2]

BrowserOption::BrowserOption ( const QString & desktopPath,
const QString & profileId = QString(),
const QString & profileDisplayName = QString(),
bool singleProfile = false,
bool fromProfileDiscovery = false )

Construct from .desktop file path, profile ID (for launch), and optional profile display name (for UI). If display name is empty, profile ID is used.

Parameters
singleProfileWhen true, displayName() returns only the browser name.
fromProfileDiscoveryWhen true, this option came from profile discovery.

◆ BrowserOption() [2/2]

BrowserOption::BrowserOption ( const DesktopEntry & entry,
const QString & profileId = QString(),
const QString & profileDisplayName = QString(),
bool singleProfile = false,
bool fromProfileDiscovery = false )

Construct from a desktop entry, profile ID, and optional display name.

Member Function Documentation

◆ desktopPath()

QString BrowserOption::desktopPath ( ) const
inlinenodiscard

Path to the .desktop file.

◆ displayName()

QString BrowserOption::displayName ( ) const
nodiscard

Display name, e.g. "Google Chrome Beta (Default)" or "Google Chrome Beta (Work)".

◆ entry()

DesktopEntry BrowserOption::entry ( ) const
nodiscard

Underlying desktop entry.

◆ fromProfileDiscovery()

bool BrowserOption::fromProfileDiscovery ( ) const
inlinenodiscard

Whether this option came from profile discovery (Chrome/Firefox profiles).

◆ isValid()

bool BrowserOption::isValid ( ) const
nodiscard

Whether this option is valid (.desktop file exists and parses).

◆ profileLabel()

QString BrowserOption::profileLabel ( ) const
nodiscard

Profile label for use under a browser section header (e.g. "Default", "Work").

◆ profileName()

QString BrowserOption::profileName ( ) const
inlinenodiscard

Profile ID for launch (e.g. --profile= or -P); empty for Default.


The documentation for this class was generated from the following files: