diff options
author | Ken Moore <moorekou@gmail.com> | 2015-08-05 15:27:03 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-08-05 15:27:03 -0400 |
commit | 4e63029d42dbbeec6f1d574e76bb0de1125ec966 (patch) | |
tree | 3d06db412db132ed6ede4240efcb5a67a8b3617d /lumina-desktop/panel-plugins/userbutton | |
parent | Do a review of all Lumina dependencies and update the list as appropriate: (diff) | |
download | lumina-4e63029d42dbbeec6f1d574e76bb0de1125ec966.tar.gz lumina-4e63029d42dbbeec6f1d574e76bb0de1125ec966.tar.bz2 lumina-4e63029d42dbbeec6f1d574e76bb0de1125ec966.zip |
Fix up the file/dir removal options within the userbutton.
Diffstat (limited to 'lumina-desktop/panel-plugins/userbutton')
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp | 7 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserWidget.cpp | 6 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserWidget.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp index baf8f6de..ffee7b69 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp @@ -182,8 +182,11 @@ void UserItemWidget::buttonClicked(){ }else{ QFile::remove(icon->whatsThis()); } - }else{ LUtils::removeFavorite(icon->whatsThis()); } //This is a favorite - emit RemovedShortcut(); + //Don't emit the RemovedShortcut signal here - the automatic ~/Desktop watcher will see the change when finished + }else{ + LUtils::removeFavorite(icon->whatsThis()); //This is a favorite + emit RemovedShortcut(); + } } } diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp index 5d1a2bc9..6848d12d 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp @@ -11,6 +11,7 @@ UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWidget){ ui->setupUi(this); + updatingfavs = false; if(parent!=0){ parent->setMouseTracking(true); } this->setMouseTracking(true); sysapps = LSession::handle()->applicationMenu()->currentAppHash(); //get the raw info @@ -217,6 +218,8 @@ void UserWidget::FavChanged(){ } void UserWidget::updateFavItems(bool newfilter){ + if(updatingfavs){ return; } + updatingfavs = true; //qDebug() << "Updating User Favorite Items"; QStringList newfavs = LUtils::listFavorites(); //qDebug() << "Favorites:" << newfavs; @@ -225,7 +228,7 @@ void UserWidget::updateFavItems(bool newfilter){ homefiles = LSession::handle()->DesktopFiles(); lastHomeUpdate = QDateTime::currentDateTime(); - }else if(!newfilter){ return; } //nothing new to change - stop now + }else if(!newfilter){ updatingfavs = false; return; } //nothing new to change - stop now //qDebug() << " - Passed Smoke Test..."; QStringList favitems; //Remember for format for favorites: <name>::::[app/dir/<mimetype>]::::<full path> @@ -270,6 +273,7 @@ void UserWidget::updateFavItems(bool newfilter){ QApplication::processEvents(); //keep the UI snappy - might be a number of these } SortScrollArea(ui->scroll_fav); + updatingfavs = false; //qDebug() << " - Done"; } diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h index 6d01e940..f2e8f6d8 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.h +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h @@ -50,6 +50,7 @@ private: void ClearScrollArea(QScrollArea *area); void SortScrollArea(QScrollArea *area); QIcon rotateIcon(QIcon); + bool updatingfavs; private slots: void LaunchItem(QString path, bool fix = true); |