Corona::packageChanged() signal
views listen to it to know when to reload theirview qml file
This commit is contained in:
parent
29042ed585
commit
de6d0f12d0
@ -73,6 +73,7 @@ Plasma::Package Corona::package() const
|
||||
void Corona::setPackage(const Plasma::Package &package)
|
||||
{
|
||||
d->package = package;
|
||||
emit packageChanged(package);
|
||||
}
|
||||
|
||||
void Corona::saveLayout(const QString &configName) const
|
||||
|
@ -235,6 +235,14 @@ Q_SIGNALS:
|
||||
*/
|
||||
void immutabilityChanged(Plasma::Types::ImmutabilityType immutability);
|
||||
|
||||
/**
|
||||
* Emitted when the package for this corona has been changed.
|
||||
* Shells must support changing the shell package on the fly (for instance due to device form factor changing)
|
||||
*
|
||||
* @param package the new package that defines the Corona furniture and behavior
|
||||
*/
|
||||
void packageChanged(const Plasma::Package &package);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Loads the default (system wide) layout for this user
|
||||
|
@ -52,6 +52,8 @@ View::View(Plasma::Corona *corona, QWindow *parent)
|
||||
setResizeMode(View::SizeRootObjectToView);
|
||||
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Desktop.qml")));
|
||||
|
||||
connect(m_corona, &Plasma::Corona::packageChanged,
|
||||
this, &View::coronaPackageChanged);
|
||||
}
|
||||
|
||||
View::~View()
|
||||
@ -188,4 +190,10 @@ void View::showConfigurationInterface(Plasma::Applet *applet)
|
||||
m_configView.data()->show();
|
||||
}
|
||||
|
||||
void View::coronaPackageChanged(const Plasma::Package &package)
|
||||
{
|
||||
setContainment(0);
|
||||
setSource(QUrl::fromLocalFile(package.filePath("views", "Desktop.qml")));
|
||||
}
|
||||
|
||||
#include "moc_view.cpp"
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
protected Q_SLOTS:
|
||||
void showConfigurationInterface(Plasma::Applet *applet);
|
||||
|
||||
private Q_SLOTS:
|
||||
void coronaPackageChanged(const Plasma::Package &package);
|
||||
|
||||
Q_SIGNALS:
|
||||
void locationChanged(Plasma::Types::Location location);
|
||||
void formFactorChanged(Plasma::Types::FormFactor formFactor);
|
||||
|
Loading…
Reference in New Issue
Block a user