~osomon/webbrowser-app/rtm-fix-flaky-container-test

« back to all changes in this revision

Viewing changes to src/Ubuntu/Web/favicon-image-provider.h

  • Committer: CI bot
  • Author(s): Olivier Tilloy
  • Date: 2014-12-02 12:28:56 UTC
  • mfrom: (774.1.2 disable-favicon-provider-rtm)
  • Revision ID: ps-jenkins@lists.canonical.com-20141202122856-0aay2c0m5sn30zu9
Replace the custom favicon image provider with a FaviconFetcher component that better handles cancelling pending requests. Fixes: #1395748

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2014 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 __FAVICON_IMAGE_PROVIDER_H__
20
 
#define __FAVICON_IMAGE_PROVIDER_H__
21
 
 
22
 
// Qt
23
 
#include <QtCore/QScopedPointer>
24
 
#include <QtCore/QString>
25
 
#include <QtCore/QtGlobal>
26
 
#include <QtQuick/QQuickImageProvider>
27
 
 
28
 
class QNetworkAccessManager;
29
 
class QUrl;
30
 
 
31
 
class FaviconImageProvider Q_DECL_FINAL : public QQuickImageProvider
32
 
{
33
 
public:
34
 
    FaviconImageProvider();
35
 
 
36
 
    const QString& cacheLocation() const;
37
 
 
38
 
    QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize);
39
 
 
40
 
private:
41
 
    QImage downloadImage(const QUrl& url);
42
 
 
43
 
    QString m_cacheLocation;
44
 
    QScopedPointer<QNetworkAccessManager> m_manager;
45
 
};
46
 
 
47
 
#endif // __FAVICON_IMAGE_PROVIDER_H__