~ubuntu-branches/debian/stretch/apper/stretch

« back to all changes in this revision

Viewing changes to .pc/02_watch-apt-restart-requests.diff/apperd/ApperdThread.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klumpp
  • Date: 2013-06-24 14:32:36 UTC
  • mfrom: (8.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130624143236-8259lpdjgnrjxiik
Tags: 0.8.0-2
* Upload to unstable (Closes: #696585, #697996, #708090)
* Add patch to compile against new QPK API

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2012 by Daniel Nicoletti <dantti12@gmail.com>           *
3
 
 *                                                                         *
4
 
 *   This program is free software; you can redistribute it and/or modify  *
5
 
 *   it under the terms of the GNU General Public License as published by  *
6
 
 *   the Free Software Foundation; either version 2 of the License, or     *
7
 
 *   (at your option) any later version.                                   *
8
 
 *                                                                         *
9
 
 *   This program is distributed in the hope that it will be useful,       *
10
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 
 *   GNU General Public License for more details.                          *
13
 
 *                                                                         *
14
 
 *   You should have received a copy of the GNU General Public License     *
15
 
 *   along with this program; see the file COPYING. If not, write to       *
16
 
 *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
17
 
 *   Boston, MA 02110-1301, USA.                                           *
18
 
 ***************************************************************************/
19
 
 
20
 
#ifndef APPERDTHREAD_H
21
 
#define APPERDTHREAD_H
22
 
 
23
 
#include <QThread>
24
 
 
25
 
#include <QTimer>
26
 
#include <QDBusConnection>
27
 
#include <QDateTime>
28
 
 
29
 
class ApperdThread : public QObject
30
 
{
31
 
    Q_OBJECT
32
 
public:
33
 
    explicit ApperdThread(QObject *parent = 0);
34
 
    ~ApperdThread();
35
 
 
36
 
private slots:
37
 
    void init();
38
 
    void poll();
39
 
    void configFileChanged();
40
 
 
41
 
    void transactionListChanged(const QStringList &tids);
42
 
    void updatesChanged();
43
 
    void serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);
44
 
 
45
 
private:
46
 
    void callApperSentinel(const QString &method,
47
 
                           const QList<QVariant> &arguments = QList<QVariant>());
48
 
    QDateTime getTimeSinceRefreshCache() const;
49
 
    QString networkState() const;
50
 
    bool nameHasOwner(const QString &name, const QDBusConnection &connection) const;
51
 
    bool isSystemReady(bool ignoreBattery, bool ignoreMobile) const;
52
 
 
53
 
    bool m_actRefreshCacheChecked;
54
 
    bool m_canRefreshCache;
55
 
    bool m_sentinelIsRunning;
56
 
    QDateTime m_lastRefreshCache;
57
 
    uint m_refreshCacheInterval;
58
 
    QTimer *m_qtimer;
59
 
    QThread *m_thread;
60
 
};
61
 
 
62
 
#endif // APPERDTHREAD_H