aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-08-02 11:47:03 -0400
committerKen Moore <ken@pcbsd.org>2016-08-02 11:47:03 -0400
commitdeeec1ffe13e91b5ef4442080c970a6540c86d8d (patch)
treeaa3c067b4ac29cf59fc47a6aeab6cf6fb5f0b5de
parentAdd application/pdf mimetype defaults to the TrueOS settings. (diff)
downloadlumina-deeec1ffe13e91b5ef4442080c970a6540c86d8d.tar.gz
lumina-deeec1ffe13e91b5ef4442080c970a6540c86d8d.tar.bz2
lumina-deeec1ffe13e91b5ef4442080c970a6540c86d8d.zip
Add a quick existance check to the userbutton plugin when adding favorites to the menu.
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
index 32193643..c7d8109c 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
@@ -169,7 +169,7 @@ void UserWidget::UpdateMenu(bool forceall){
ui->tool_fav_dirs->setChecked(false);
ui->tool_fav_files->setChecked(false);
cfav = 0; //favorite apps
- updateFavItems();
+ FavChanged();
QString cdir = ui->label_home_dir->whatsThis();
if(cdir.isEmpty() || !QFile::exists(cdir)){
//Directory deleted or nothing loaded yet
@@ -265,8 +265,9 @@ void UserWidget::updateFavItems(bool newfilter){
favitems.sort(); //sort them alphabetically
//qDebug() << " - Creating Items:" << favitems;
for(int i=0; i<favitems.length(); i++){
+ if( !QFile::exists(favitems[i].section("::::",2,50)) ){ continue; } //file does not exist - just skip it
UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), favitems[i].section("::::",2,50), favitems[i].section("::::",1,1) );
- if(!it->gooditem){ continue; }
+ if(!it->gooditem){ it->deleteLater(); continue; }
ui->scroll_fav->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
bgstack15