mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
plasma: lock while updating devicenotifier applet layout
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
66c9071a02
commit
1dc79c3ddf
1 changed files with 5 additions and 7 deletions
|
@ -18,9 +18,8 @@
|
|||
|
||||
#include "devicenotifier.h"
|
||||
|
||||
#include <QMutex>
|
||||
#include <QTimer>
|
||||
#include <QEventLoop>
|
||||
#include <QCoreApplication>
|
||||
#include <QGraphicsGridLayout>
|
||||
#include <QGraphicsLinearLayout>
|
||||
#include <QGridLayout>
|
||||
|
@ -54,7 +53,6 @@ class DeviceNotifierWidget : public QGraphicsWidget
|
|||
Q_OBJECT
|
||||
public:
|
||||
DeviceNotifierWidget(DeviceNotifier* devicenotifier, QGraphicsWidget *parent);
|
||||
~DeviceNotifierWidget();
|
||||
|
||||
bool onlyremovable;
|
||||
|
||||
|
@ -68,6 +66,7 @@ private Q_SLOTS:
|
|||
void slotRemoveActivated();
|
||||
|
||||
private:
|
||||
QMutex m_mutex;
|
||||
DeviceNotifier* m_devicenotifier;
|
||||
QGraphicsLinearLayout* m_layout;
|
||||
Plasma::Label* m_title;
|
||||
|
@ -110,10 +109,6 @@ DeviceNotifierWidget::DeviceNotifierWidget(DeviceNotifier* devicenotifier, QGrap
|
|||
);
|
||||
}
|
||||
|
||||
DeviceNotifierWidget::~DeviceNotifierWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void DeviceNotifierWidget::slotUpdateLayout()
|
||||
{
|
||||
Solid::Predicate solidpredicate(Solid::DeviceInterface::StorageVolume);
|
||||
|
@ -137,6 +132,7 @@ void DeviceNotifierWidget::slotUpdateLayout()
|
|||
}
|
||||
|
||||
m_freetimer->stop();
|
||||
QMutexLocker locker(&m_mutex);
|
||||
foreach (Plasma::Frame* frame, m_frames) {
|
||||
m_layout->removeItem(frame);
|
||||
}
|
||||
|
@ -221,6 +217,7 @@ void DeviceNotifierWidget::slotUpdateLayout()
|
|||
minimumsize.setHeight(minimumsize.height() * 2);
|
||||
m_devicenotifier->setMinimumSize(minimumsize);
|
||||
|
||||
locker.unlock();
|
||||
slotCheckFreeSpace();
|
||||
m_freetimer->start();
|
||||
}
|
||||
|
@ -257,6 +254,7 @@ void DeviceNotifierWidget::slotCheckFreeSpace()
|
|||
|
||||
void DeviceNotifierWidget::slotCheckEmblem(const bool accessible, const QString &udi)
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
foreach (const Plasma::Frame* frame, m_frames) {
|
||||
const QString solidudi = frame->property("_k_udi").toString();
|
||||
if (solidudi != udi) {
|
||||
|
|
Loading…
Add table
Reference in a new issue