LibrePCB Developers Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FileSystemModel Class Reference

The FileSystemModel class. More...

#include <filesystemmodel.h>

Inherits QObject, and Model< ui::TreeViewItemData >.

+ Collaboration diagram for FileSystemModel:

Signals

void actionTriggered (const FilePath &fp, ui::Action a)
 
void pinningRequested (const FilePath &fp, bool pin)
 
void openFileTriggered (const FilePath &fp)
 
void newProjectTriggered (const FilePath &fp)
 

Public Member Functions

 FileSystemModel ()=delete
 
 FileSystemModel (const FileSystemModel &other)=delete
 
 FileSystemModel (const Workspace &ws, const FilePath &root, const QString &settingsPrefix, QuickAccessModel *quickAccessModel=nullptr, QObject *parent=nullptr) noexcept
 
virtual ~FileSystemModel () noexcept
 
std::size_t row_count () const override
 
std::optional< ui::TreeViewItemData > row_data (std::size_t i) const override
 
void set_row_data (std::size_t i, const ui::TreeViewItemData &data) noexcept override
 
FileSystemModeloperator= (const FileSystemModel &rhs)=delete
 

Private Member Functions

void expandDir (const FilePath &fp, std::size_t index, int level) noexcept
 
void collapseDir (const FilePath &fp, std::size_t index, int level) noexcept
 
void directoryChanged (const QString &dir) noexcept
 
void favoriteProjectChanged (const FilePath &fp, bool favorite) noexcept
 
void handleAction (const FilePath &fp, ui::Action a) noexcept
 
void removeFileOrDirectory (const FilePath &fp) noexcept
 

Private Attributes

const WorkspacemWorkspace
 
const FilePath mRoot
 
const QString mSettingsPrefix
 
QPointer< QuickAccessModelmQuickAccess
 
std::vector< ui::TreeViewItemData > mItems
 
QFileSystemWatcher mWatcher
 
QSet< FilePathmExpandedDirs
 

Detailed Description

The FileSystemModel class.

Constructor & Destructor Documentation

◆ FileSystemModel() [1/3]

FileSystemModel ( )
delete

◆ FileSystemModel() [2/3]

FileSystemModel ( const FileSystemModel other)
delete

◆ FileSystemModel() [3/3]

FileSystemModel ( const Workspace ws,
const FilePath root,
const QString &  settingsPrefix,
QuickAccessModel quickAccessModel = nullptr,
QObject *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~FileSystemModel()

~FileSystemModel ( )
virtualnoexcept

Member Function Documentation

◆ row_count()

std::size_t row_count ( ) const
override

◆ row_data()

std::optional< ui::TreeViewItemData > row_data ( std::size_t  i) const
override

◆ set_row_data()

void set_row_data ( std::size_t  i,
const ui::TreeViewItemData &  data 
)
overridenoexcept
+ Here is the call graph for this function:

◆ operator=()

FileSystemModel & operator= ( const FileSystemModel rhs)
delete

◆ actionTriggered

void actionTriggered ( const FilePath fp,
ui::Action  a 
)
signal
+ Here is the caller graph for this function:

◆ pinningRequested

void pinningRequested ( const FilePath fp,
bool  pin 
)
signal
+ Here is the caller graph for this function:

◆ openFileTriggered

void openFileTriggered ( const FilePath fp)
signal
+ Here is the caller graph for this function:

◆ newProjectTriggered

void newProjectTriggered ( const FilePath fp)
signal
+ Here is the caller graph for this function:

◆ expandDir()

void expandDir ( const FilePath fp,
std::size_t  index,
int  level 
)
privatenoexcept
+ Here is the call graph for this function:

◆ collapseDir()

void collapseDir ( const FilePath fp,
std::size_t  index,
int  level 
)
privatenoexcept
+ Here is the call graph for this function:

◆ directoryChanged()

void directoryChanged ( const QString &  dir)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ favoriteProjectChanged()

void favoriteProjectChanged ( const FilePath fp,
bool  favorite 
)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAction()

void handleAction ( const FilePath fp,
ui::Action  a 
)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeFileOrDirectory()

void removeFileOrDirectory ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mWorkspace

const Workspace& mWorkspace
private

◆ mRoot

const FilePath mRoot
private

◆ mSettingsPrefix

const QString mSettingsPrefix
private

◆ mQuickAccess

QPointer<QuickAccessModel> mQuickAccess
private

◆ mItems

std::vector<ui::TreeViewItemData> mItems
private

◆ mWatcher

QFileSystemWatcher mWatcher
private

◆ mExpandedDirs

QSet<FilePath> mExpandedDirs
private

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