File indexing completed on 2024-04-14 05:38:07

0001 /* Copyright (c) 2010 Sune Vuorela <sune@vuorela.dk>
0002  *
0003  * Permission is hereby granted, free of charge, to any person
0004  * obtaining a copy of this software and associated documentation
0005  * files (the "Software"), to deal in the Software without
0006  * restriction, including without limitation the rights to use,
0007  * copy, modify, merge, publish, distribute, sublicense, and/or sell
0008  * copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following
0010  * conditions:
0011  *
0012  * The above copyright notice and this permission notice shall be
0013  * included in all copies or substantial portions of the Software.
0014  *
0015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0017  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0018  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0019  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0020  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0021  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0022  * OTHER DEALINGS IN THE SOFTWARE. */
0023 
0024 #ifndef REBOOT_LISTENER_H
0025 #define REBOOT_LISTENER_H
0026 
0027 #include <QObject>
0028 
0029 class KDirWatch;
0030 class QTimer;
0031 
0032 class AptRebootListener : public QObject {
0033     Q_OBJECT
0034 public:
0035     AptRebootListener(QObject* parent = nullptr);
0036 
0037 Q_SIGNALS:
0038     void requestReboot();
0039 
0040 public Q_SLOTS:
0041     void checkForReboot();
0042 
0043 private Q_SLOTS:
0044     void slotDirectoryChanged(const QString &path);
0045 
0046 private:
0047     KDirWatch *m_watcher;
0048     QTimer *m_timer;
0049 };
0050 
0051 #endif // REBOOT_LISTENER_H