[calamares] No need for progresstreeview to be singleton
This commit is contained in:
parent
e9965d37e3
commit
290a708e56
@ -23,19 +23,9 @@
|
|||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
|
||||||
ProgressTreeView* ProgressTreeView::s_instance = nullptr;
|
|
||||||
|
|
||||||
ProgressTreeView*
|
|
||||||
ProgressTreeView::instance()
|
|
||||||
{
|
|
||||||
return s_instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProgressTreeView::ProgressTreeView( QWidget* parent )
|
ProgressTreeView::ProgressTreeView( QWidget* parent )
|
||||||
: QTreeView( parent )
|
: QTreeView( parent )
|
||||||
{
|
{
|
||||||
s_instance = this; //FIXME: should assert when s_instance gets written and it wasn't nullptr
|
|
||||||
|
|
||||||
this->setObjectName( "sidebarMenuApp" );
|
this->setObjectName( "sidebarMenuApp" );
|
||||||
setFrameShape( QFrame::NoFrame );
|
setFrameShape( QFrame::NoFrame );
|
||||||
setContentsMargins( 0, 0, 0, 0 );
|
setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
@ -27,14 +27,11 @@ class ProgressTreeDelegate;
|
|||||||
/**
|
/**
|
||||||
* @brief The ProgressTreeView class is a modified QTreeView which displays the
|
* @brief The ProgressTreeView class is a modified QTreeView which displays the
|
||||||
* available view steps and the user's progress through them.
|
* available view steps and the user's progress through them.
|
||||||
* @note singleton, only access through ProgressTreeView::instance().
|
|
||||||
*/
|
*/
|
||||||
class ProgressTreeView : public QTreeView
|
class ProgressTreeView : public QTreeView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static ProgressTreeView* instance();
|
|
||||||
|
|
||||||
explicit ProgressTreeView( QWidget* parent = nullptr );
|
explicit ProgressTreeView( QWidget* parent = nullptr );
|
||||||
virtual ~ProgressTreeView() override;
|
virtual ~ProgressTreeView() override;
|
||||||
|
|
||||||
@ -44,7 +41,6 @@ public:
|
|||||||
void setModel( QAbstractItemModel* model ) override;
|
void setModel( QAbstractItemModel* model ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static ProgressTreeView* s_instance;
|
|
||||||
ProgressTreeDelegate* m_delegate;
|
ProgressTreeDelegate* m_delegate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user