diff options
author | Ken Moore <ken@ixsystems.com> | 2018-06-05 10:53:30 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-06-05 10:53:30 -0400 |
commit | acbe8331a904f1cce87ea825caf126819f19dcd1 (patch) | |
tree | b9a7d99b4dc120f4c3cdacccec7b202f17972b9b /src-qt5/core/lumina-desktop-unified/src-desktop | |
parent | Fix the compositing force flag. Missed one of the if setting checks earlier. (diff) | |
download | lumina-acbe8331a904f1cce87ea825caf126819f19dcd1.tar.gz lumina-acbe8331a904f1cce87ea825caf126819f19dcd1.tar.bz2 lumina-acbe8331a904f1cce87ea825caf126819f19dcd1.zip |
Get the panels/plugins updating appropriately when the settings file changes.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Panel.cpp | 25 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/plugins/ClockPlugin.h | 2 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Panel.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Panel.cpp index 07456419..d84c1d87 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Panel.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Panel.cpp @@ -37,6 +37,7 @@ Plugin* Panel::findPlugin(QString id){ Plugin* Panel::createPlugin(QString id){ Plugin* tmp = Plugin::createPlugin(this, id, true, obj->isVertical()); + if(tmp!=0){ PLUGINS << tmp; } return tmp; } @@ -66,12 +67,20 @@ void Panel::updateBackground(){ void Panel::updatePlugins(){ QStringList plugs = obj->plugins(); - qDebug() << "Got panel plugins:" << obj->name() << plugs; + //qDebug() << "Got panel plugins:" << obj->name() << plugs; + while(PLUGINS.length()>0){ + Plugin *plug = PLUGINS.takeFirst(); + //qDebug() << "Removing Plugin:" << plug->id() << PLUGINS.length(); + layout->removeWidget(plug); + plug->deleteLater(); + } for(int i=0; i<plugs.length(); i++){ - lastplugins.removeAll(plugs[i]); //remove this from the last list (handled) - Plugin *plug = findPlugin(plugs[i]); - if(plug==0){ plug = createPlugin(plugs[i]); } - if(plug==0){ continue; } //not a valid plugin - just skip it + //lastplugins.removeAll(plugs[i]); //remove this from the last list (handled) + Plugin *plug = 0; //findPlugin(plugs[i]); + if(plug==0){ + plug = createPlugin(plugs[i]); + if(plug==0){ continue; } //not a valid plugin - just skip it + } //Now setup the order of the plugins properly if( layout->indexOf(plug) >=0 ){ layout->removeWidget(plug); //remove from the layout for a moment @@ -80,10 +89,10 @@ void Panel::updatePlugins(){ plug->setupSizing(); } //Now remove any plugins which were deleted from config - for(int i=0; i<lastplugins.length(); i++){ + /*for(int i=0; i<lastplugins.length(); i++){ Plugin *plug = findPlugin(lastplugins[i]); if(plug==0){ continue; } plug->deleteLater(); - } - lastplugins = plugs; + }*/ + //lastplugins = plugs; } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/plugins/ClockPlugin.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/plugins/ClockPlugin.h index d028de8f..95b6c1cb 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/plugins/ClockPlugin.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/plugins/ClockPlugin.h @@ -88,7 +88,7 @@ protected: if(tmp!=textRows){ textRows = tmp; if(textRows<1){ textRows = 1; } - if(button->isVisible() && !button->text().isEmpty()){ QTimer::singleShot(0, this, SLOT(updateTime()) ); } + if(!button->text().isEmpty()){ QTimer::singleShot(30, this, SLOT(updateTime()) ); } } } }; |