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 | |
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')
4 files changed, 12 insertions, 15 deletions
diff --git a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp index d6a87c72..461a73e6 100644 --- a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp +++ b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp @@ -7,18 +7,6 @@ #include "LSysTray.h" #include "../../LSession.h" -/*#include <LuminaX11.h> -//X includes (these need to be last due to Qt compile issues) -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xatom.h> -#include <X11/extensions/Xrender.h> -#include <X11/extensions/Xdamage.h>*/ - -//Static variables for damage detection (tray update notifications) -//static int dmgEvent = 0; -//static int dmgError = 0; - LSysTray::LSysTray(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ frame = new QFrame(this); frame->setContentsMargins(0,0,0,0); @@ -163,6 +151,7 @@ void LSysTray::UpdateTrayWindow(WId win){ if(trayIcons[i]->appID()==win){ qDebug() << "System Tray: Update Window " << win; trayIcons[i]->update(); + QTimer::singleShot(1000, trayIcons[i], SLOT(update()) ); return; //finished now } } 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); |