mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00

The old implementation only monitor the trash folder in user's partition It will make other partition's recycle bin out of monitor, Now use GIO to monitor all trash and empty trash log: Fix the trash icon status might out-of-sync in some cases
46 lines
872 B
C++
46 lines
872 B
C++
// Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
#ifndef POPUPCONTROLWIDGET_H
|
|
#define POPUPCONTROLWIDGET_H
|
|
|
|
#include "trashhelper.h"
|
|
|
|
#include <QWidget>
|
|
|
|
class PopupControlWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit PopupControlWidget(QWidget *parent = 0);
|
|
|
|
bool empty() const;
|
|
int trashItems() const;
|
|
QSize sizeHint() const;
|
|
// static const QString trashDir();
|
|
|
|
public slots:
|
|
void openTrashFloder();
|
|
void clearTrashFloder();
|
|
|
|
signals:
|
|
void emptyChanged(const bool empty) const;
|
|
|
|
private:
|
|
int trashItemCount() const;
|
|
|
|
private slots:
|
|
void trashStatusChanged();
|
|
|
|
private:
|
|
bool m_empty;
|
|
int m_trashItemsCount;
|
|
|
|
TrashHelper *m_trashHelper;
|
|
};
|
|
|
|
#endif // POPUPCONTROLWIDGET_H
|