aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LPanel.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-21 15:53:51 -0500
committerKen Moore <ken@pcbsd.org>2015-01-21 15:53:51 -0500
commita059c1fdb254fc5e2dca743597fe96c0a8a09aa3 (patch)
tree126af0492cd60a8c7e71721510f03296aa52531a /lumina-desktop/LPanel.cpp
parentClean up a couple other session options: (diff)
downloadlumina-a059c1fdb254fc5e2dca743597fe96c0a8a09aa3.tar.gz
lumina-a059c1fdb254fc5e2dca743597fe96c0a8a09aa3.tar.bz2
lumina-a059c1fdb254fc5e2dca743597fe96c0a8a09aa3.zip
Add a completely new background method for a distributor to set per-system defaults for the Lumina desktop. Also fix a bug this exposed in how the Lumina panel removes plugins.
Diffstat (limited to 'lumina-desktop/LPanel.cpp')
-rw-r--r--lumina-desktop/LPanel.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp
index 8416faaf..dc635300 100644
--- a/lumina-desktop/LPanel.cpp
+++ b/lumina-desktop/LPanel.cpp
@@ -165,7 +165,9 @@ void LPanel::UpdatePanel(){
while( plugins.contains(plugins[i]+"---"+QString::number(screennum)+"."+QString::number(this->number())+"."+QString::number(num)) ){
num++;
}
+
plugins[i] = plugins[i]+"---"+QString::number(screennum)+"."+QString::number(this->number())+"."+QString::number(num);
+ //qDebug() << "Adjust Plugin ID:" << plugins[i];
}
//See if this plugin is already there or in a different spot
bool found = false;
@@ -187,7 +189,7 @@ void LPanel::UpdatePanel(){
}
if(!found){
//New Plugin
- qDebug() << " -- New Plugin:" << plugins[i];
+ qDebug() << " -- New Plugin:" << plugins[i] << i;
LPPlugin *plug = NewPP::createPlugin(plugins[i], panelArea, horizontal);
if(plug != 0){
PLUGINS.insert(i, plug);
@@ -201,8 +203,11 @@ void LPanel::UpdatePanel(){
LSession::processEvents();
}
//Now remove any extra plugins from the end
- for(int i=plugins.length(); i<PLUGINS.length(); i++){
- qDebug() << " -- Remove Plugin: " << i;
+ //qDebug() << "plugins:" << plugins;
+ //qDebug() << "PLUGINS length:" << PLUGINS.length();
+ for(int i=0; i<PLUGINS.length(); i++){
+ if(plugins.contains(PLUGINS[i]->type())){ continue; } //good plugin - skip it
+ qDebug() << " -- Remove Plugin: " << PLUGINS[i]->type();
//If this is the system tray - stop it first
if( PLUGINS[i]->type().startsWith("systemtray---") ){
static_cast<LSysTray*>(PLUGINS[i])->stop();
@@ -210,6 +215,7 @@ void LPanel::UpdatePanel(){
layout->takeAt(i); //remove from the layout
delete PLUGINS.takeAt(i); //delete the actual widget
LSession::processEvents();
+ i--; //need to back up one space to not miss another plugin
}
this->update();
this->show(); //make sure the panel is visible now
bgstack15