CCIMXDesktop
 
Loading...
Searching...
No Matches
DesktopDirentLocationManager Class Reference

Manages the locations and existence of various desktop directory entries and configuration files. More...

#include <DesktopDirentLocationManager.h>

Inheritance diagram for DesktopDirentLocationManager:

Signals

void missingDirentFolder (const QString &folder, const DesktopDirentType type)
 Signal emitted when an expected desktop directory entry folder is missing.
 
void missingServerFolder (const QString &folder, const DesktopServerType type)
 Signal emitted when an expected server-related folder is missing.
 

Public Member Functions

 DesktopDirentLocationManager (const QString &root_path, DesktopMainWindow *parent=nullptr)
 Constructs a DesktopDirentLocationManager object.
 
void checkSelfOnce ()
 Performs a one-time check of all critical directory entries and configurations.
 
QString queryFromType (const DesktopDirentType type)
 Queries the expected path for a given DesktopDirentType.
 
QString queryFromType (const DesktopServerType serverType)
 Queries the expected path for a given DesktopServerType.
 
bool checkComponentFolder (const DesktopDirentType type)
 Checks if a component folder of a specific type exists.
 
bool checkServerFolder (const DesktopServerType serverType)
 Checks if a server folder of a specific type exists.
 
QString queryConfigType (const ConfigureFileName name)
 Queries the expected path for a given configuration file name.
 
bool checkConfigExsited (const ConfigureFileName name)
 Checks if a configuration file of a specific name exists.
 

Detailed Description

Manages the locations and existence of various desktop directory entries and configuration files.

This class is responsible for verifying the presence of critical directories and files related to desktop components and server types within a specified root path. It provides methods to query paths based on types and to check for their existence. Signals are emitted when expected folders or configuration files are missing.

Constructor & Destructor Documentation

◆ DesktopDirentLocationManager()

DesktopDirentLocationManager::DesktopDirentLocationManager ( const QString &  root_path,
DesktopMainWindow parent = nullptr 
)
explicit

Constructs a DesktopDirentLocationManager object.

Parameters
root_pathThe base directory path where all desktop directory entries are expected to reside.
parentA pointer to the parent QObject, typically the DesktopMainWindow. Defaults to nullptr.

Member Function Documentation

◆ checkComponentFolder()

bool DesktopDirentLocationManager::checkComponentFolder ( const DesktopDirentType  type)

Checks if a component folder of a specific type exists.

Parameters
typeThe DesktopDirentType to check.
Returns
True if the folder exists, false otherwise.

◆ checkConfigExsited()

bool DesktopDirentLocationManager::checkConfigExsited ( const ConfigureFileName  name)

Checks if a configuration file of a specific name exists.

Parameters
nameThe ConfigureFileName to check.
Returns
True if the configuration file exists, false otherwise.

◆ checkSelfOnce()

void DesktopDirentLocationManager::checkSelfOnce ( )

Performs a one-time check of all critical directory entries and configurations.

  • This method initiates a comprehensive check of all expected component folders, server folders, and configuration files under the root_path. It will emit missingDirentFolder or missingServerFolder signals for any missing entries.

◆ checkServerFolder()

bool DesktopDirentLocationManager::checkServerFolder ( const DesktopServerType  serverType)

Checks if a server folder of a specific type exists.

Parameters
serverTypeThe DesktopServerType to check.
Returns
True if the folder exists, false otherwise.

◆ missingDirentFolder

void DesktopDirentLocationManager::missingDirentFolder ( const QString &  folder,
const DesktopDirentType  type 
)
signal

Signal emitted when an expected desktop directory entry folder is missing.

Parameters
folderThe full path of the missing folder.
typeThe DesktopDirentType of the missing folder.

◆ missingServerFolder

void DesktopDirentLocationManager::missingServerFolder ( const QString &  folder,
const DesktopServerType  type 
)
signal

Signal emitted when an expected server-related folder is missing.

Parameters
folderThe full path of the missing server folder.
typeThe DesktopServerType of the missing server folder.

◆ queryConfigType()

QString DesktopDirentLocationManager::queryConfigType ( const ConfigureFileName  name)

Queries the expected path for a given configuration file name.

Parameters
nameThe ConfigureFileName to query for (e.g., main config, user settings).
Returns
The absolute path string for the specified configuration file.

◆ queryFromType() [1/2]

QString DesktopDirentLocationManager::queryFromType ( const DesktopDirentType  type)

Queries the expected path for a given DesktopDirentType.

Parameters
typeThe type of desktop directory entry to query for (e.g., applications, documents).
Returns
The absolute path string for the specified directory entry.

◆ queryFromType() [2/2]

QString DesktopDirentLocationManager::queryFromType ( const DesktopServerType  serverType)

Queries the expected path for a given DesktopServerType.

Parameters
serverTypeThe type of desktop server directory to query for (e.g., database, web server).
Returns
The absolute path string for the specified server directory.

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