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

The QuickAccessModel class. More...

#include <quickaccessmodel.h>

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

+ Collaboration diagram for QuickAccessModel:

Signals

void actionTriggered (const FilePath &fp, ui::Action a)
 
void favoriteProjectChanged (const FilePath &fp, bool favorite)
 
void openFileTriggered (const FilePath &fp)
 

Public Member Functions

 QuickAccessModel ()=delete
 
 QuickAccessModel (const QuickAccessModel &other)=delete
 
 QuickAccessModel (Workspace &ws, QObject *parent=nullptr) noexcept
 
virtual ~QuickAccessModel () noexcept
 
void pushRecentProject (const FilePath &fp) noexcept
 
void discardRecentProject (const FilePath &fp) noexcept
 
void setFavoriteProject (const FilePath &fp, bool favorite) noexcept
 
bool isFavoriteProject (const FilePath &fp) const 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
 
QuickAccessModeloperator= (const QuickAccessModel &rhs)=delete
 

Private Member Functions

void load () noexcept
 
void saveRecentProjects () noexcept
 
void saveFavoriteProjects () noexcept
 
void refreshItems () noexcept
 
void setWatchedProjects (const QSet< FilePath > &projects) noexcept
 
void handleAction (const FilePath &fp, ui::Action a) noexcept
 

Private Attributes

const WorkspacemWorkspace
 
const FilePath mRecentProjectsFp
 
const FilePath mFavoriteProjectsFp
 
const slint::Image mIcon
 
QList< FilePathmRecentProjects
 
QList< FilePathmFavoriteProjects
 
std::vector< ui::TreeViewItemData > mItems
 
QFileSystemWatcher mWatcher
 
QTimer mWatcherTimer
 

Detailed Description

The QuickAccessModel class.

Constructor & Destructor Documentation

◆ QuickAccessModel() [1/3]

QuickAccessModel ( )
delete

◆ QuickAccessModel() [2/3]

QuickAccessModel ( const QuickAccessModel other)
delete

◆ QuickAccessModel() [3/3]

QuickAccessModel ( Workspace ws,
QObject *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~QuickAccessModel()

~QuickAccessModel ( )
virtualnoexcept

Member Function Documentation

◆ pushRecentProject()

void pushRecentProject ( const FilePath fp)
noexcept

◆ discardRecentProject()

void discardRecentProject ( const FilePath fp)
noexcept

◆ setFavoriteProject()

void setFavoriteProject ( const FilePath fp,
bool  favorite 
)
noexcept
+ Here is the caller graph for this function:

◆ isFavoriteProject()

bool isFavoriteProject ( const FilePath fp) const
noexcept

◆ 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=()

QuickAccessModel & operator= ( const QuickAccessModel rhs)
delete

◆ actionTriggered

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

◆ favoriteProjectChanged

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

◆ openFileTriggered

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

◆ load()

void load ( )
privatenoexcept
+ Here is the call graph for this function:

◆ saveRecentProjects()

void saveRecentProjects ( )
privatenoexcept
+ Here is the call graph for this function:

◆ saveFavoriteProjects()

void saveFavoriteProjects ( )
privatenoexcept
+ Here is the call graph for this function:

◆ refreshItems()

void refreshItems ( )
privatenoexcept
+ Here is the call graph for this function:

◆ setWatchedProjects()

void setWatchedProjects ( const QSet< FilePath > &  projects)
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 caller graph for this function:

Member Data Documentation

◆ mWorkspace

const Workspace& mWorkspace
private

◆ mRecentProjectsFp

const FilePath mRecentProjectsFp
private

◆ mFavoriteProjectsFp

const FilePath mFavoriteProjectsFp
private

◆ mIcon

const slint::Image mIcon
private

◆ mRecentProjects

QList<FilePath> mRecentProjects
private

◆ mFavoriteProjects

QList<FilePath> mFavoriteProjects
private

◆ mItems

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

◆ mWatcher

QFileSystemWatcher mWatcher
private

◆ mWatcherTimer

QTimer mWatcherTimer
private

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