wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
InstallRelativePaths Class Reference

Static utility resolving where a named content folder (e.g. "Examples", "Exercises", "Tours") lives relative to the running application's install location. More...

#include <InstallRelativePaths.h>

Public Member Functions

 InstallRelativePaths ()=delete

Static Public Member Functions

static QStringList candidates (const QString &category)
static QString resolve (const QString &category)

Detailed Description

Static utility resolving where a named content folder (e.g. "Examples", "Exercises", "Tours") lives relative to the running application's install location.

Shared by MainWindow::setupExamplesMenu() and ExerciseTourResources so the per-platform candidate list (Windows/dev, macOS app bundle, Linux AppImage, Linux native FHS install, WASM, CWD dev fallback) exists in exactly one place.

Definition at line 22 of file InstallRelativePaths.h.

Constructor & Destructor Documentation

◆ InstallRelativePaths()

InstallRelativePaths::InstallRelativePaths ( )
delete

Member Function Documentation

◆ candidates()

QStringList InstallRelativePaths::candidates ( const QString & category)
static

Builds the ordered list of candidate directories for category, relative to QCoreApplication::applicationDirPath(): Windows/dev builds, macOS app bundle Resources, Linux AppImage (via $APPDIR), Linux native FHS install (share/wiredpanda/<category> next to a bin/ install), WASM's virtual filesystem, and finally a bare-category CWD fallback for development.

Definition at line 9 of file InstallRelativePaths.cpp.

Referenced by ExerciseTourResources::preferredContentDir(), and resolve().

◆ resolve()

QString InstallRelativePaths::resolve ( const QString & category)
static

Returns the first candidate() entry that already exists on disk, or "" if none do. Read-only — creates nothing.

Definition at line 31 of file InstallRelativePaths.cpp.

References candidates().

Referenced by ExerciseTourResources::discover().


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