remove view::init
This commit is contained in:
parent
5d4f1b381f
commit
f979e1bbcb
@ -234,7 +234,6 @@ void DesktopCorona::checkViews()
|
|||||||
for (int i = m_views.count(); i < m_desktopWidget->screenCount(); ++i) {
|
for (int i = m_views.count(); i < m_desktopWidget->screenCount(); ++i) {
|
||||||
View *view = new View(this);
|
View *view = new View(this);
|
||||||
QSurfaceFormat format;
|
QSurfaceFormat format;
|
||||||
view->init();
|
|
||||||
view->show();
|
view->show();
|
||||||
|
|
||||||
m_views << view;
|
m_views << view;
|
||||||
@ -262,7 +261,6 @@ void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Conta
|
|||||||
|
|
||||||
if (isScreen >= 0) {
|
if (isScreen >= 0) {
|
||||||
m_panelViews[containment] = new PanelView(this);
|
m_panelViews[containment] = new PanelView(this);
|
||||||
m_panelViews[containment]->init();
|
|
||||||
m_panelViews[containment]->setContainment(containment);
|
m_panelViews[containment]->setContainment(containment);
|
||||||
m_panelViews[containment]->show();
|
m_panelViews[containment]->show();
|
||||||
} else {
|
} else {
|
||||||
|
@ -58,6 +58,16 @@ PanelView::PanelView(DesktopCorona *corona, QWindow *parent)
|
|||||||
this, &PanelView::positionPanel);
|
this, &PanelView::positionPanel);
|
||||||
connect(this, &View::containmentChanged,
|
connect(this, &View::containmentChanged,
|
||||||
this, &PanelView::restore);
|
this, &PanelView::restore);
|
||||||
|
|
||||||
|
if (!m_corona->package().isValid()) {
|
||||||
|
qWarning() << "Invalid home screen package";
|
||||||
|
}
|
||||||
|
|
||||||
|
setResizeMode(View::SizeRootObjectToView);
|
||||||
|
qmlRegisterType<QScreen>();
|
||||||
|
engine()->rootContext()->setContextProperty("panel", this);
|
||||||
|
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Panel.qml")));
|
||||||
|
positionPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
PanelView::~PanelView()
|
PanelView::~PanelView()
|
||||||
@ -95,19 +105,6 @@ KConfigGroup PanelView::config() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelView::init()
|
|
||||||
{
|
|
||||||
if (!m_corona->package().isValid()) {
|
|
||||||
qWarning() << "Invalid home screen package";
|
|
||||||
}
|
|
||||||
|
|
||||||
setResizeMode(View::SizeRootObjectToView);
|
|
||||||
qmlRegisterType<QScreen>();
|
|
||||||
engine()->rootContext()->setContextProperty("panel", this);
|
|
||||||
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Panel.qml")));
|
|
||||||
positionPanel();
|
|
||||||
}
|
|
||||||
|
|
||||||
Qt::Alignment PanelView::alignment() const
|
Qt::Alignment PanelView::alignment() const
|
||||||
{
|
{
|
||||||
return m_alignment;
|
return m_alignment;
|
||||||
|
@ -43,8 +43,6 @@ public:
|
|||||||
|
|
||||||
virtual KConfigGroup config() const;
|
virtual KConfigGroup config() const;
|
||||||
|
|
||||||
virtual void init();
|
|
||||||
|
|
||||||
Qt::Alignment alignment() const;
|
Qt::Alignment alignment() const;
|
||||||
void setAlignment(Qt::Alignment alignment);
|
void setAlignment(Qt::Alignment alignment);
|
||||||
|
|
||||||
|
@ -42,6 +42,14 @@ View::View(Plasma::Corona *corona, QWindow *parent)
|
|||||||
|
|
||||||
connect(screen(), &QScreen::virtualGeometryChanged,
|
connect(screen(), &QScreen::virtualGeometryChanged,
|
||||||
this, &View::screenGeometryChanged);
|
this, &View::screenGeometryChanged);
|
||||||
|
|
||||||
|
if (!m_corona->package().isValid()) {
|
||||||
|
qWarning() << "Invalid home screen package";
|
||||||
|
}
|
||||||
|
|
||||||
|
setResizeMode(View::SizeRootObjectToView);
|
||||||
|
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Desktop.qml")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
View::~View()
|
View::~View()
|
||||||
@ -63,16 +71,6 @@ KConfigGroup View::config() const
|
|||||||
return KConfigGroup(&views, QString::number(containment()->screen()));
|
return KConfigGroup(&views, QString::number(containment()->screen()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::init()
|
|
||||||
{
|
|
||||||
if (!m_corona->package().isValid()) {
|
|
||||||
qWarning() << "Invalid home screen package";
|
|
||||||
}
|
|
||||||
|
|
||||||
setResizeMode(View::SizeRootObjectToView);
|
|
||||||
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Desktop.qml")));
|
|
||||||
}
|
|
||||||
|
|
||||||
void View::setContainment(Plasma::Containment *cont)
|
void View::setContainment(Plasma::Containment *cont)
|
||||||
{
|
{
|
||||||
Plasma::Types::Location oldLoc = (Plasma::Types::Location)location();
|
Plasma::Types::Location oldLoc = (Plasma::Types::Location)location();
|
||||||
|
@ -41,9 +41,6 @@ public:
|
|||||||
|
|
||||||
virtual KConfigGroup config() const;
|
virtual KConfigGroup config() const;
|
||||||
|
|
||||||
//FIXME: not super nice, but we have to be sure qml assignment is done after window flags
|
|
||||||
virtual void init();
|
|
||||||
|
|
||||||
void setContainment(Plasma::Containment *cont);
|
void setContainment(Plasma::Containment *cont);
|
||||||
Plasma::Containment *containment() const;
|
Plasma::Containment *containment() const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user