QortalOS Brooklyn for Raspberry Pi 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.1 KiB

/*
SPDX-FileCopyrightText: 2006 Lukas Tinkl <[email protected]>
SPDX-FileCopyrightText: 2008 Lubos Lunak <[email protected]>
SPDX-FileCopyrightText: 2009 Ivo Anjo <[email protected]>
SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <[email protected]>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QPointer>
#include <QTimer>
#include <KLocalizedString>
#include <KService>
class KNotification;
class FreeSpaceNotifier : public QObject
{
Q_OBJECT
public:
explicit FreeSpaceNotifier(const QString &path, const KLocalizedString &notificationText, QObject *parent = nullptr);
~FreeSpaceNotifier() override;
Q_SIGNALS:
void configureRequested();
private:
void checkFreeDiskSpace();
void resetLastAvailable();
KService::Ptr filelightService() const;
void exploreDrive();
void onNotificationClosed();
QString m_path;
KLocalizedString m_notificationText;
QTimer m_timer;
QTimer *m_lastAvailTimer = nullptr;
QPointer<KNotification> m_notification;
qint64 m_lastAvail = -1; // used to suppress repeated warnings when available space hasn't changed
};