tuned-switcher 1.1.0
Performance profile manager
Loading...
Searching...
No Matches
AutorunFile Class Reference

#include <autorunfile.h>

Inheritance diagram for AutorunFile:
Collaboration diagram for AutorunFile:

Public Member Functions

 AutorunFile (QObject *parent=nullptr)
 
 ~AutorunFile () override=default
 
bool IsEnabled () const override
 
bool IsSupported () const override
 
bool Enable () const override
 
bool Disable () const override
 
- Public Member Functions inherited from AutorunManager
virtual ~AutorunManager ()=default
 

Private Member Functions

QString GetAutorunDirectoryName () const
 
QString GetAutorunFileName () const
 
QString GetExecutablePath () const
 
void CreateAutorunDirectory () const
 
QString GenerateAutorunFile () const
 
void WriteAutorunFile (const QString &) const
 

Private Attributes

QString AutorunDirectoryName
 
QString AutorunFileName
 

Additional Inherited Members

- Static Public Member Functions inherited from AutorunManager
static AutorunManagerCreate (QObject *parent=nullptr)
 
- Protected Member Functions inherited from AutorunManager
 AutorunManager (QObject *parent=nullptr)
 

Detailed Description

Class for working with standard autorun files.

Constructor & Destructor Documentation

◆ AutorunFile()

AutorunFile::AutorunFile ( QObject * parent = nullptr)
explicit

Main constructor of the AutorunFile class.

Parameters
parentParent.

◆ ~AutorunFile()

AutorunFile::~AutorunFile ( )
overridedefault

Destructor of the AutorunFile class.

Member Function Documentation

◆ CreateAutorunDirectory()

void AutorunFile::CreateAutorunDirectory ( ) const
private

Create the autorun directory if it doesn't exists.

◆ Disable()

bool AutorunFile::Disable ( ) const
overridevirtual

Disable the autorun feature.

Returns
Result of the requested operation.
Return values
trueThe requested operation completed successfully.
falseAn error occurred when trying to perform the requested operation.

Implements AutorunManager.

◆ Enable()

bool AutorunFile::Enable ( ) const
overridevirtual

Enable the autorun feature.

Returns
Result of the requested operation.
Return values
trueThe requested operation completed successfully.
falseAn error occurred when trying to perform the requested operation.

Implements AutorunManager.

◆ GenerateAutorunFile()

QString AutorunFile::GenerateAutorunFile ( ) const
private

Generate the autorun file contents using stored template.

Returns
Autorun file contents.

◆ GetAutorunDirectoryName()

QString AutorunFile::GetAutorunDirectoryName ( ) const
private

Get the fully-qualified autorun directory path.

Returns
Fully-qualified autorun directory path.

◆ GetAutorunFileName()

QString AutorunFile::GetAutorunFileName ( ) const
private

Get the fully-qualified autorun file name.

Returns
Fully-qualified autorun file name.

◆ GetExecutablePath()

QString AutorunFile::GetExecutablePath ( ) const
private

Get the application executable path: relative if the running executable is located in the $PATH or absolute if it doesn't.

Returns
Application executable path.

◆ IsEnabled()

bool AutorunFile::IsEnabled ( ) const
overridevirtual

Check whether the autorun feature is enabled.

Returns
Whether the autorun feature is enabled.
Return values
trueThe autorun feature is enabled.
falseThe autorun feature is not enabled.

Implements AutorunManager.

◆ IsSupported()

bool AutorunFile::IsSupported ( ) const
overridevirtual

Check whether the autorun feature is supported on running platform.

Returns
Whether the autorun feature is supported on running platform.
Return values
trueThe autorun feature is supported on running platform.
falseThe autorun feature is not supported on running platform.

Implements AutorunManager.

◆ WriteAutorunFile()

void AutorunFile::WriteAutorunFile ( const QString & value) const
private

Write the autorun file contents to disk.

Parameters
valueAutorun file contents.

Member Data Documentation

◆ AutorunDirectoryName

QString AutorunFile::AutorunDirectoryName
private

Stores the full path to the autorun directory.

◆ AutorunFileName

QString AutorunFile::AutorunFileName
private

Stores the full path to the autorun file.


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