~abreu-alexandre/webbrowser-app/window-open-overlay

« back to all changes in this revision

Viewing changes to src/app/webbrowser/cache-deleter.h

  • Committer: CI Train Bot
  • Author(s): Olivier Tilloy
  • Date: 2015-04-08 14:09:30 UTC
  • mfrom: (930.1.4 clearCache)
  • Revision ID: ci-train-bot@canonical.com-20150408140930-29h9nv4egfzb43q0
Add a "Clear Cache" entry under the privacy settings. Fixes: #1260014, #1296364
Approved by: PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2015 Canonical Ltd.
 
3
 *
 
4
 * This file is part of webbrowser-app.
 
5
 *
 
6
 * webbrowser-app is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * webbrowser-app is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
#ifndef __CACHE_DELETER_H__
 
20
#define __CACHE_DELETER_H__
 
21
 
 
22
#include <QtCore/QFutureWatcher>
 
23
#include <QtCore/QMutex>
 
24
#include <QtCore/QObject>
 
25
#include <QtQml/QJSValue>
 
26
 
 
27
class QString;
 
28
 
 
29
class CacheDeleter : public QObject
 
30
{
 
31
    Q_OBJECT
 
32
 
 
33
public:
 
34
    explicit CacheDeleter(QObject* parent=0);
 
35
 
 
36
    Q_INVOKABLE void clear(const QString& cachePath, const QJSValue& callback=QJSValue::UndefinedValue);
 
37
 
 
38
private:
 
39
    void doClear(const QString& cachePath);
 
40
 
 
41
private Q_SLOTS:
 
42
    void onCleared();
 
43
 
 
44
private:
 
45
    QMutex m_mutex;
 
46
    QFutureWatcher<void> m_clearWatcher;
 
47
    QJSValue m_callback;
 
48
};
 
49
 
 
50
#endif // __CACHE_DELETER_H__