~ubuntu-branches/debian/stretch/psi-plus/stretch

« back to all changes in this revision

Viewing changes to src/webview.h

  • Committer: Package Import Robot
  • Author(s): Boris Pek
  • Date: 2013-10-23 02:42:20 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20131023024220-bk2hyoenqkwfhpgw
Tags: 0.16.242-1
* New upstream release:
  fixed the problem of initialization of private conversation when both
  sides use libotr 4.0.x. (Closes: #724880)
* Update debian/watch: sources were moved.
* Delete psi-plus-content-downloader package and update all related files.
  This plugin is in psi-plus-plugins package now.
* Update debian/control:
  - remove all currently unneeded Replaces and Breaks fields
  - add build dependency on libidn11-dev
* Update debian/rules: simplify get-orig-source section.
* Update debian/copyright:
  - update Source field due to changes in sources location
  - remove copyright holders whose code was deleted from source tree
    (bundled libidn library was removed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <QContextMenuEvent>
28
28
#include <QClipboard>
29
29
#include <QBuffer>
 
30
#ifdef HAVE_QT5
 
31
#include <QUrlQuery>
 
32
#endif
30
33
 
31
34
#include "networkaccessmanager.h"
32
35
#include "iconset.h"
34
37
class IconHandler : public NAMSchemeHandler
35
38
{
36
39
        QByteArray data(const QUrl &url) const {
 
40
#ifdef HAVE_QT5
 
41
                int w = QUrlQuery(url.query()).queryItemValue("w").toInt();
 
42
                int h = QUrlQuery(url.query()).queryItemValue("h").toInt();
 
43
#else
37
44
                int w = url.queryItemValue("w").toInt();
38
45
                int h = url.queryItemValue("h").toInt();
 
46
#endif
39
47
                PsiIcon icon = IconsetFactory::icon(url.path());
40
48
                if (w && h && !icon.isAnimated()) {
41
49
                        QByteArray ba;
54
62
 * Extended QWebView.
55
63
 *
56
64
 * It's used in EventView and HTMLChatView.
57
 
 * Provides evaluateJavaScript escaping and secure NetworkManager with icon:// URL 
58
 
 * support and \<img\> whitelisting. 
 
65
 * Provides evaluateJavaScript escaping and secure NetworkManager with icon:// URL
 
66
 * support and \<img\> whitelisting.
59
67
 *
60
 
 * Better name for it would be: PsiWebView, but it's used in HTMLChatView which is 
61
 
 * Psi-unaware.  
 
68
 * Better name for it would be: PsiWebView, but it's used in HTMLChatView which is
 
69
 * Psi-unaware.
62
70
 */
63
71
class WebView : public QWebView {
64
72
 
70
78
        /** Evaluates JavaScript code */
71
79
        void evaluateJS(const QString &scriptSource = "");
72
80
 
73
 
        QString selectedHtml();
74
81
        QString selectedText();
75
82
        bool isLoading() { return isLoading_; }
76
83