mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Qt5: Main code has been edited to support both Qt4 and Qt5
It doesn't include plugins yet. Even thought the app can be built with Qt5 now, it won't run. I am still working on a fix.
This commit is contained in:
parent
14874913b4
commit
89e091f09c
|
@ -14,5 +14,10 @@ lessThan(QT_VERSION, 4.7) {
|
|||
mac|unix: system(test -d bin/plugins || mkdir bin/plugins)
|
||||
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = src/lib src/main src/plugins
|
||||
SUBDIRS = src/lib src/main
|
||||
CONFIG += ordered
|
||||
|
||||
# TODO: Fix plugins for Qt5
|
||||
!isEqual(QT_MAJOR_VERSION, 5) {
|
||||
SUBDIRS += src/plugins
|
||||
}
|
||||
|
|
4
src/lib/3rdparty/fancytabwidget.cpp
vendored
4
src/lib/3rdparty/fancytabwidget.cpp
vendored
|
@ -45,7 +45,7 @@
|
|||
#include <QToolButton>
|
||||
#include <QToolTip>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWindowsStyle>
|
||||
//#include <QWindowsStyle>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Internal;
|
||||
|
@ -250,7 +250,7 @@ FancyTabBar::FancyTabBar(QWidget* parent)
|
|||
: QWidget(parent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
||||
setStyle(new QWindowsStyle);
|
||||
//setStyle(new QWindowsStyle);
|
||||
setMinimumWidth(qMax(2 * m_rounding, 40));
|
||||
setAttribute(Qt::WA_Hover, true);
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
|
|
3
src/lib/3rdparty/lineedit.cpp
vendored
3
src/lib/3rdparty/lineedit.cpp
vendored
|
@ -86,7 +86,8 @@ void LineEdit::init()
|
|||
mainLayout->addWidget(m_leftWidget, 0, Qt::AlignVCenter | Qt::AlignLeft);
|
||||
mainLayout->addItem(horizontalSpacer);
|
||||
mainLayout->addWidget(m_rightWidget, 0, Qt::AlignVCenter | Qt::AlignRight);
|
||||
//by this we undo reversing of layout when direction is RTL. //TODO: don't do this and show reversed icon when needed
|
||||
// by this we undo reversing of layout when direction is RTL.
|
||||
// TODO: don't do this and show reversed icon when needed
|
||||
mainLayout->setDirection(isRightToLeft() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight);
|
||||
|
||||
setWidgetSpacing(3);
|
||||
|
|
16
src/lib/3rdparty/qtsingleapplication.cpp
vendored
16
src/lib/3rdparty/qtsingleapplication.cpp
vendored
|
@ -47,7 +47,7 @@
|
|||
|
||||
#include "qtsingleapplication.h"
|
||||
#include "qtlocalpeer.h"
|
||||
#include <QtGui/QWidget>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
/*!
|
||||
|
@ -179,20 +179,6 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char**
|
|||
sysInit(appId);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Creates a QtSingleApplication object. The application identifier
|
||||
will be QCoreApplication::applicationFilePath(). \a argc, \a
|
||||
argv, and \a type are passed on to the QAppliation constructor.
|
||||
*/
|
||||
QtSingleApplication::QtSingleApplication(int &argc, char** argv, Type type)
|
||||
: QApplication(argc, argv, type)
|
||||
, peer(0)
|
||||
, actWin(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#if defined(Q_WS_X11)
|
||||
/*!
|
||||
Special constructor for X11, ref. the documentation of
|
||||
|
|
3
src/lib/3rdparty/qtsingleapplication.h
vendored
3
src/lib/3rdparty/qtsingleapplication.h
vendored
|
@ -45,7 +45,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QApplication>
|
||||
|
||||
class QtLocalPeer;
|
||||
|
||||
|
@ -72,7 +72,6 @@ class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication
|
|||
public:
|
||||
QtSingleApplication(int &argc, char** argv, bool GUIenabled = true);
|
||||
QtSingleApplication(const QString &id, int &argc, char** argv);
|
||||
QtSingleApplication(int &argc, char** argv, Type type);
|
||||
#if defined(Q_WS_X11)
|
||||
QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
||||
QtSingleApplication(Display* dpy, int &argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0);
|
||||
|
|
2
src/lib/3rdparty/squeezelabelv2.cpp
vendored
2
src/lib/3rdparty/squeezelabelv2.cpp
vendored
|
@ -20,6 +20,8 @@
|
|||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QKeyEvent>
|
||||
#include <QMimeData>
|
||||
#include <QDrag>
|
||||
#include <QMenu>
|
||||
|
||||
SqueezeLabelV2::SqueezeLabelV2(QWidget* parent)
|
||||
|
|
12
src/lib/3rdparty/stylehelper.cpp
vendored
12
src/lib/3rdparty/stylehelper.cpp
vendored
|
@ -29,13 +29,13 @@
|
|||
|
||||
#include "stylehelper.h"
|
||||
|
||||
#include <QtGui/QPixmapCache>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QPixmapCache>
|
||||
#include <QWidget>
|
||||
#include <QtCore/QRect>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPalette>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QPainter>
|
||||
#include <QApplication>
|
||||
#include <QPalette>
|
||||
#include <QStyleOption>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
// Clamps float color values within (0, 255)
|
||||
|
|
4
src/lib/3rdparty/stylehelper.h
vendored
4
src/lib/3rdparty/stylehelper.h
vendored
|
@ -32,8 +32,8 @@
|
|||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
#include <QtGui/QColor>
|
||||
#include <QtGui/QStyle>
|
||||
#include <QColor>
|
||||
#include <QStyle>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPalette;
|
||||
|
|
|
@ -131,7 +131,7 @@ AdBlockSubscription* AdBlockManager::addSubscription(const QString &title, const
|
|||
QString fileName = qz_filterCharsFromFilename(title.toLower()) + ".txt";
|
||||
QString filePath = qz_ensureUniqueFilename(mApp->currentProfilePath() + "adblock/" + fileName);
|
||||
|
||||
QByteArray data = QString("Title: %1\nUrl: %2\n[Adblock Plus 1.1.1]").arg(title, url).toAscii();
|
||||
QByteArray data = QString("Title: %1\nUrl: %2\n[Adblock Plus 1.1.1]").arg(title, url).toLatin1();
|
||||
|
||||
QFile file(filePath);
|
||||
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
|
@ -81,7 +81,7 @@ private:
|
|||
QList<AdBlockSubscription*> m_subscriptions;
|
||||
QStringList m_disabledRules;
|
||||
|
||||
QWeakPointer<AdBlockDialog> m_adBlockDialog;
|
||||
QPointer<AdBlockDialog> m_adBlockDialog;
|
||||
};
|
||||
|
||||
#endif // ADBLOCKMANAGER_H
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#define COMMANDLINEOPTIONS_H
|
||||
|
||||
#include <QPair>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <iostream>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
|
|
@ -866,7 +866,7 @@ QUrl MainApplication::userStyleSheet(const QString &filePath) const
|
|||
file.close();
|
||||
}
|
||||
|
||||
const QString &encodedStyle = userStyle.toAscii().toBase64();
|
||||
const QString &encodedStyle = userStyle.toLatin1().toBase64();
|
||||
const QString &dataString = QString("data:text/css;charset=utf-8;base64,%1").arg(encodedStyle);
|
||||
|
||||
return QUrl(dataString);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <QList>
|
||||
#include <QUrl>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "restoremanager.h"
|
||||
#include "qtsingleapplication.h"
|
||||
|
@ -164,7 +164,7 @@ private:
|
|||
DatabaseWriter* m_dbWriter;
|
||||
UserAgentManager* m_uaManager;
|
||||
|
||||
QList<QWeakPointer<QupZilla> > m_mainWindows;
|
||||
QList<QPointer<QupZilla> > m_mainWindows;
|
||||
|
||||
QString m_activeProfil;
|
||||
QString m_activeLanguage;
|
||||
|
|
|
@ -87,6 +87,10 @@
|
|||
#include <X11/Xatom.h>
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
#include "qwebkitversion.h"
|
||||
#endif
|
||||
|
||||
const QString QupZilla::VERSION = "1.3.5";
|
||||
const QString QupZilla::BUILDTIME = __DATE__" "__TIME__;
|
||||
const QString QupZilla::AUTHOR = "David Rosca";
|
||||
|
@ -1842,7 +1846,7 @@ void QupZilla::disconnectObjects()
|
|||
tab->view()->page()->disconnectObjects();
|
||||
}
|
||||
|
||||
foreach(const QWeakPointer<QWidget> &pointer, m_deleteOnCloseWidgets) {
|
||||
foreach(const QPointer<QWidget> &pointer, m_deleteOnCloseWidgets) {
|
||||
if (pointer) {
|
||||
pointer.data()->deleteLater();
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include <QMainWindow>
|
||||
#include <QUrl>
|
||||
#include "qwebkitversion.h"
|
||||
|
||||
#include "restoremanager.h"
|
||||
#include "qz_namespace.h"
|
||||
|
@ -265,11 +264,11 @@ private:
|
|||
|
||||
QLabel* m_privateBrowsing;
|
||||
AdBlockIcon* m_adblockIcon;
|
||||
QWeakPointer<WebInspectorDockWidget> m_webInspectorDock;
|
||||
QPointer<WebInspectorDockWidget> m_webInspectorDock;
|
||||
|
||||
BookmarksToolbar* m_bookmarksToolbar;
|
||||
TabWidget* m_tabWidget;
|
||||
QWeakPointer<SideBar> m_sideBar;
|
||||
QPointer<SideBar> m_sideBar;
|
||||
SideBarManager* m_sideBarManager;
|
||||
StatusBarMessage* m_statusBarMessage;
|
||||
NavigationBar* m_navigationBar;
|
||||
|
@ -294,7 +293,7 @@ private:
|
|||
bool m_navigationVisible;
|
||||
bool m_bookmarksToolBarVisible;
|
||||
|
||||
QList<QWeakPointer<QWidget> > m_deleteOnCloseWidgets;
|
||||
QList<QPointer<QWidget> > m_deleteOnCloseWidgets;
|
||||
};
|
||||
|
||||
#endif // QUPZILLA_H
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
#include <QWebFrame>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
AutoFillModel::AutoFillModel(QupZilla* mainClass, QObject* parent)
|
||||
: QObject(parent)
|
||||
, p_QupZilla(mainClass)
|
||||
|
@ -224,8 +228,11 @@ void AutoFillModel::completePage(WebPage* page)
|
|||
// Why not to use encodedQueryItems = QByteArrays ?
|
||||
// Because we need to filter "+" characters that must be spaces
|
||||
// (not real "+" characters "%2B")
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
QueryItems arguments = QUrlQuery(QUrl::fromEncoded("http://bla.com/?" + data)).queryItems();
|
||||
#else
|
||||
QueryItems arguments = QUrl::fromEncoded("http://bla.com/?" + data).queryItems();
|
||||
#endif
|
||||
for (int i = 0; i < arguments.count(); i++) {
|
||||
QString key = arguments.at(i).first;
|
||||
QString value = arguments.at(i).second;
|
||||
|
@ -345,7 +352,11 @@ QString AutoFillModel::getValueFromData(const QByteArray &data, QWebElement elem
|
|||
|
||||
QString value = element.evaluateJavaScript("this.value").toString();
|
||||
if (value.isEmpty()) {
|
||||
#if QT_VERSION >= 0x050000
|
||||
QueryItems queryItems = QUrlQuery(QUrl::fromEncoded("http://a.b/?" + data)).queryItems();
|
||||
#else
|
||||
QueryItems queryItems = QUrl::fromEncoded("http://a.b/?" + data).queryItems();
|
||||
#endif
|
||||
for (int i = 0; i < queryItems.count(); i++) {
|
||||
QueryItem item = queryItems.at(i);
|
||||
|
||||
|
@ -404,7 +415,11 @@ QByteArray AutoFillModel::convertWebKitFormBoundaryIfNecessary(const QByteArray
|
|||
|
||||
bool AutoFillModel::dataContains(const QByteArray &data, const QString &attributeName)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
QueryItems queryItems = QUrlQuery(QUrl::fromEncoded("http://a.b/?" + data)).queryItems();
|
||||
#else
|
||||
QueryItems queryItems = QUrl::fromEncoded("http://a.b/?" + data).queryItems();
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < queryItems.count(); i++) {
|
||||
QueryItem item = queryItems.at(i);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#ifndef AUTOFILLMODEL_H
|
||||
#define AUTOFILLMODEL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QPair>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
|
|
@ -169,7 +169,7 @@ void BookmarksManager::changeIcon()
|
|||
QIcon icon;
|
||||
|
||||
IconChooser chooser(this);
|
||||
icon = chooser.exec();
|
||||
icon = chooser.getIcon();
|
||||
|
||||
if (!icon.isNull()) {
|
||||
m_bookmarksModel->changeIcon(id, icon);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define BOOKMARKSMANAGER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "bookmarksmodel.h"
|
||||
#include "qz_namespace.h"
|
||||
|
@ -84,7 +84,7 @@ private:
|
|||
|
||||
bool m_isRefreshing;
|
||||
Ui::BookmarksManager* ui;
|
||||
QWeakPointer<QupZilla> p_QupZilla;
|
||||
QPointer<QupZilla> p_QupZilla;
|
||||
BookmarksModel* m_bookmarksModel;
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "mainapplication.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <QNetworkCookie>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "globalfunctions.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <QNetworkCookie>
|
||||
#include <QMessageBox>
|
||||
#include <QDateTime>
|
||||
#include <QShortcut>
|
||||
|
@ -153,7 +154,7 @@ void CookieManager::slotRefreshTable()
|
|||
ui->cookieTree->clear();
|
||||
|
||||
int counter = 0;
|
||||
QWeakPointer<CookieManager> guard = this;
|
||||
QPointer<CookieManager> guard = this;
|
||||
QHash<QString, QTreeWidgetItem*> hash;
|
||||
for (int i = 0; i < allCookies.count(); ++i) {
|
||||
const QNetworkCookie &cookie = allCookies.at(i);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QPoint>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
class QPixmap;
|
||||
|
||||
|
@ -48,7 +48,7 @@ private:
|
|||
Type m_notifType;
|
||||
QPoint m_position;
|
||||
|
||||
QWeakPointer<DesktopNotification> m_desktopNotif;
|
||||
QPointer<DesktopNotification> m_desktopNotif;
|
||||
quint32 m_uint;
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,12 @@
|
|||
#include <QWebHistory>
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QStandardPaths>
|
||||
#else
|
||||
#include <QDesktopServices>
|
||||
#endif
|
||||
|
||||
DownloadFileHelper::DownloadFileHelper(const QString &lastDownloadPath, const QString &downloadPath, bool useNativeDialog)
|
||||
: QObject()
|
||||
|
@ -165,12 +170,22 @@ void DownloadFileHelper::optionsDialogAccepted(int finish)
|
|||
dialog->selectFile(m_h_fileName);
|
||||
|
||||
QList<QUrl> urls;
|
||||
urls << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation))
|
||||
urls <<
|
||||
#if QT_VERSION >= 0x050000
|
||||
QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation))
|
||||
<< QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation))
|
||||
<< QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation))
|
||||
<< QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation))
|
||||
<< QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MusicLocation))
|
||||
<< QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
|
||||
#else
|
||||
QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation))
|
||||
<< QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))
|
||||
<< QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))
|
||||
<< QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation))
|
||||
<< QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation))
|
||||
<< QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation));
|
||||
#endif
|
||||
dialog->setSidebarUrls(urls);
|
||||
|
||||
dialog->show();
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define HISTORYMANAGER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
#include "historyview.h"
|
||||
|
@ -58,7 +58,7 @@ private:
|
|||
QupZilla* getQupZilla();
|
||||
|
||||
Ui::HistoryManager* ui;
|
||||
QWeakPointer<QupZilla> p_QupZilla;
|
||||
QPointer<QupZilla> p_QupZilla;
|
||||
};
|
||||
|
||||
#endif // HISTORYMANAGER_H
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
QT += core gui webkit sql network script
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
QT += webkitwidgets network widgets printsupport sql script
|
||||
} else {
|
||||
QT += core gui webkit sql network script
|
||||
}
|
||||
|
||||
TARGET = QupZilla
|
||||
TEMPLATE = lib
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "qzsettings.h"
|
||||
#include "colors.h"
|
||||
|
||||
#include <QMimeData>
|
||||
#include <QClipboard>
|
||||
#include <QTimer>
|
||||
#include <QContextMenuEvent>
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#include "tabbedwebview.h"
|
||||
#include "globalfunctions.h"
|
||||
|
||||
#include <QDrag>
|
||||
#include <QMimeData>
|
||||
#include <QApplication>
|
||||
#include <QContextMenuEvent>
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include "searchenginesdialog.h"
|
||||
#include "networkmanager.h"
|
||||
|
||||
#include <QMimeData>
|
||||
#include <QAbstractItemView>
|
||||
#include <QCompleter>
|
||||
#include <QStringListModel>
|
||||
#include <QMenu>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#ifndef WEBSEARCHBAR_H
|
||||
#define WEBSEARCHBAR_H
|
||||
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
#include "lineedit.h"
|
||||
|
@ -91,7 +91,7 @@ private:
|
|||
WebSearchBar_Button* m_buttonSearch;
|
||||
ButtonWithMenu* m_boxSearchType;
|
||||
SearchEnginesManager* m_searchManager;
|
||||
QWeakPointer<SearchEnginesDialog> m_searchDialog;
|
||||
QPointer<SearchEnginesDialog> m_searchDialog;
|
||||
|
||||
QAction* m_pasteAndGoAction;
|
||||
QAction* m_clearAction;
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <QLineEdit>
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QTextDocument>
|
||||
#include <QNetworkDiskCache>
|
||||
#include <QDir>
|
||||
#include <QSslSocket>
|
||||
|
@ -130,7 +129,7 @@ void NetworkManager::setSSLConfiguration(QNetworkReply* reply)
|
|||
{
|
||||
if (!reply->sslConfiguration().isNull()) {
|
||||
QSslCertificate cert = reply->sslConfiguration().peerCertificate();
|
||||
if (!cert.isValid() || reply->property("downReply").toBool()) {
|
||||
if (!qz_isCertificateValid(cert) || reply->property("downReply").toBool()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -269,7 +268,7 @@ void NetworkManager::authentication(QNetworkReply* reply, QAuthenticator* auth)
|
|||
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
|
||||
|
||||
label->setText(tr("A username and password are being requested by %1. "
|
||||
"The site says: \"%2\"").arg(reply->url().toEncoded(), Qt::escape(auth->realm())));
|
||||
"The site says: \"%2\"").arg(reply->url().toEncoded(), qz_escape(auth->realm())));
|
||||
formLa->addRow(label);
|
||||
|
||||
formLa->addRow(userLab, user);
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
#include <QNetworkRequest>
|
||||
#include <QMessageBox>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
AdBlockSchemeHandler::AdBlockSchemeHandler()
|
||||
: SchemeHandler()
|
||||
{
|
||||
|
@ -36,7 +40,12 @@ QNetworkReply* AdBlockSchemeHandler::createRequest(QNetworkAccessManager::Operat
|
|||
}
|
||||
|
||||
const QUrl &url = request.url();
|
||||
const QList<QPair<QString, QString> > queryItems = url.queryItems();
|
||||
const QList<QPair<QString, QString> > queryItems =
|
||||
#if QT_VERSION >= 0x050000
|
||||
QUrlQuery(url).queryItems();
|
||||
#else
|
||||
url.queryItems();
|
||||
#endif
|
||||
|
||||
QString subscriptionTitle;
|
||||
QString subscriptionUrl;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "settings.h"
|
||||
#include "iconprovider.h"
|
||||
|
||||
#include <QTextDocument>
|
||||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
#include <QSettings>
|
||||
|
@ -191,7 +190,7 @@ QString QupZillaSchemeReply::aboutPage()
|
|||
aPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png"));
|
||||
aPage.replace(QLatin1String("%BOX-BORDER%"), QLatin1String("qrc:html/box-border.png"));
|
||||
aPage.replace(QLatin1String("%ABOUT-IMG%"), QLatin1String("qrc:icons/other/about.png"));
|
||||
aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), Qt::escape(qz_readAllFileContents(":html/copyright")));
|
||||
aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), qz_escape(qz_readAllFileContents(":html/copyright")));
|
||||
|
||||
aPage.replace(QLatin1String("%TITLE%"), tr("About QupZilla"));
|
||||
aPage.replace(QLatin1String("%ABOUT-QUPZILLA%"), tr("About QupZilla"));
|
||||
|
@ -420,7 +419,7 @@ QString QupZillaSchemeReply::configPage()
|
|||
foreach(const Plugins::Plugin & plugin, availablePlugins) {
|
||||
PluginSpec spec = plugin.pluginSpec;
|
||||
pluginsString.append(QString("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td></tr>").arg(
|
||||
spec.name, spec.version, Qt::escape(spec.author), spec.description));
|
||||
spec.name, spec.version, qz_escape(spec.author), spec.description));
|
||||
}
|
||||
|
||||
if (pluginsString.isEmpty()) {
|
||||
|
@ -462,7 +461,7 @@ QString QupZillaSchemeReply::configPage()
|
|||
keyString = QLatin1String("\"empty\"");
|
||||
}
|
||||
|
||||
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, Qt::escape(keyString)));
|
||||
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, qz_escape(keyString)));
|
||||
}
|
||||
|
||||
settings->endGroup();
|
||||
|
|
|
@ -89,7 +89,7 @@ void EditSearchEngine::hideIconLabels()
|
|||
void EditSearchEngine::chooseIcon()
|
||||
{
|
||||
IconChooser chooser(this);
|
||||
QIcon icon = chooser.exec();
|
||||
QIcon icon = chooser.getIcon();
|
||||
|
||||
if (!icon.isNull()) {
|
||||
setIcon(icon);
|
||||
|
|
|
@ -48,6 +48,11 @@
|
|||
#include <qscriptvalue.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
\class OpenSearchEngine
|
||||
\brief A class representing a single search engine described in OpenSearch format
|
||||
|
@ -226,12 +231,22 @@ QUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const
|
|||
|
||||
QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_searchUrlTemplate).toUtf8());
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
QUrlQuery query(retVal);
|
||||
#endif
|
||||
if (m_searchMethod != QLatin1String("post")) {
|
||||
Parameters::const_iterator end = m_searchParameters.constEnd();
|
||||
Parameters::const_iterator i = m_searchParameters.constBegin();
|
||||
for (; i != end; ++i) {
|
||||
#if QT_VERSION >= 0x050000
|
||||
query.addQueryItem(i->first, parseTemplate(searchTerm, i->second));
|
||||
#else
|
||||
retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second));
|
||||
#endif
|
||||
}
|
||||
#if QT_VERSION >= 0x050000
|
||||
retVal.setQuery(query);
|
||||
#endif
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
@ -286,12 +301,22 @@ QUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const
|
|||
|
||||
QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_suggestionsUrlTemplate).toUtf8());
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
QUrlQuery query(retVal);
|
||||
#endif
|
||||
if (m_suggestionsMethod != QLatin1String("post")) {
|
||||
Parameters::const_iterator end = m_suggestionsParameters.constEnd();
|
||||
Parameters::const_iterator i = m_suggestionsParameters.constBegin();
|
||||
for (; i != end; ++i) {
|
||||
#if QT_VERSION >= 0x050000
|
||||
query.addQueryItem(i->first, parseTemplate(searchTerm, i->second));
|
||||
#else
|
||||
retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second));
|
||||
#endif
|
||||
}
|
||||
#if QT_VERSION >= 0x050000
|
||||
retVal.setQuery(query);
|
||||
#endif
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
#include <QMessageBox>
|
||||
#include <QWebElement>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
#define ENSURE_LOADED if (!m_settingsLoaded) loadSettings();
|
||||
|
||||
QIcon SearchEnginesManager::iconForSearchEngine(const QUrl &url)
|
||||
|
@ -224,7 +228,21 @@ void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView
|
|||
if (actionUrl.isRelative()) {
|
||||
actionUrl = view->url().resolved(actionUrl);
|
||||
}
|
||||
#if QT_VERSION >= 0x050000
|
||||
QUrlQuery query(actionUrl);
|
||||
query.addQueryItem(element.attribute("name"), "%s");
|
||||
|
||||
QWebElementCollection allInputs = formElement.findAll("input");
|
||||
foreach(QWebElement e, allInputs) {
|
||||
if (element == e || !e.hasAttribute("name")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
query.addQueryItem(e.attribute("name"), e.evaluateJavaScript("this.value").toString());
|
||||
}
|
||||
|
||||
actionUrl.setQuery(query);
|
||||
#else
|
||||
actionUrl.addQueryItem(element.attribute("name"), "%s");
|
||||
|
||||
QList<QPair<QByteArray, QByteArray> > queryItems;
|
||||
|
@ -242,6 +260,7 @@ void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView
|
|||
}
|
||||
|
||||
actionUrl.setEncodedQueryItems(queryItems + actionUrl.encodedQueryItems());
|
||||
#endif
|
||||
|
||||
SearchEngine engine;
|
||||
engine.name = view->title();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "iconprovider.h"
|
||||
#include "globalfunctions.h"
|
||||
|
||||
#include <QNetworkCookie>
|
||||
#include <QWebDatabase>
|
||||
#include <QWebSettings>
|
||||
#include <QNetworkDiskCache>
|
||||
|
|
|
@ -75,7 +75,7 @@ void IconChooser::searchIcon(const QString &string)
|
|||
}
|
||||
}
|
||||
|
||||
QIcon IconChooser::exec()
|
||||
QIcon IconChooser::getIcon()
|
||||
{
|
||||
QIcon icon;
|
||||
int status = QDialog::exec();
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
explicit IconChooser(QWidget* parent = 0);
|
||||
~IconChooser();
|
||||
|
||||
QIcon exec();
|
||||
QIcon getIcon();
|
||||
|
||||
private slots:
|
||||
void chooseFile();
|
||||
|
|
|
@ -25,9 +25,15 @@
|
|||
#include <QWebFrame>
|
||||
#include <QTimer>
|
||||
#include <QMovie>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QPushButton>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
#else
|
||||
#include <QtConcurrentRun>
|
||||
#endif
|
||||
|
||||
|
||||
PageScreen::PageScreen(WebView* view, QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::PageScreen)
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#ifndef REGISTERQAPPASSOCIATION_H
|
||||
#define REGISTERQAPPASSOCIATION_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
#include <QPair>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define SOURCEVIEWER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
|
@ -53,7 +53,7 @@ private slots:
|
|||
private:
|
||||
QBoxLayout* m_layout;
|
||||
PlainEditWithLines* m_sourceEdit;
|
||||
QWeakPointer<QWebFrame> m_frame;
|
||||
QPointer<QWebFrame> m_frame;
|
||||
QStatusBar* m_statusBar;
|
||||
|
||||
QString m_selectedHtml;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#define USERAGENTMANAGER_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
#include "plugininterface.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define SPEEDDIAL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
|
@ -97,7 +97,7 @@ private:
|
|||
int m_sizeOfSpeedDials;
|
||||
int m_sdcentered;
|
||||
|
||||
QList<QWeakPointer<QWebFrame> > m_webFrames;
|
||||
QList<QPointer<QWebFrame> > m_webFrames;
|
||||
QList<Page> m_webPages;
|
||||
|
||||
bool m_loaded;
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
#include "mainapplication.h"
|
||||
#include "plugininterface.h"
|
||||
#include "pluginlistdelegate.h"
|
||||
#include "globalfunctions.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QTextDocument>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
|
||||
|
@ -177,7 +177,7 @@ void PluginsManager::refresh()
|
|||
}
|
||||
item->setIcon(icon);
|
||||
|
||||
QString pluginInfo = QString("<b>%1</b> %2<br/><i>%3</i><br/>%4").arg(spec.name, spec.version, Qt::escape(spec.author), spec.info);
|
||||
QString pluginInfo = QString("<b>%1</b> %2<br/><i>%3</i><br/>%4").arg(spec.name, spec.version, qz_escape(spec.author), spec.info);
|
||||
item->setToolTip(pluginInfo);
|
||||
|
||||
item->setText(spec.name);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define PREFERENCES_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
|
@ -98,7 +98,7 @@ private:
|
|||
AutoFillManager* m_autoFillManager;
|
||||
PluginsManager* m_pluginsList;
|
||||
ThemeManager* m_themesManager;
|
||||
QWeakPointer<DesktopNotification> m_notification;
|
||||
QPointer<DesktopNotification> m_notification;
|
||||
|
||||
QString m_homepage;
|
||||
QString m_newTabUrl;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <QUrl>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QFormLayout>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QToolButton>
|
||||
#include <QInputDialog>
|
||||
|
@ -72,7 +72,7 @@ private:
|
|||
|
||||
Ui::RSSManager* ui;
|
||||
QToolButton* m_reloadButton;
|
||||
QWeakPointer<QupZilla> p_QupZilla;
|
||||
QPointer<QupZilla> p_QupZilla;
|
||||
};
|
||||
|
||||
#endif // RSSMANAGER_H
|
||||
|
|
|
@ -103,7 +103,7 @@ void RSSNotification::addRss()
|
|||
switch (ui->comboBox->itemData(index).toInt()) {
|
||||
case WebApplication: {
|
||||
const RssApp &app = m_rssApps.at(index);
|
||||
const QUrl &url = QUrl::fromEncoded(QString(app.address + QUrl::toPercentEncoding(m_url.toString())).toAscii());
|
||||
const QUrl &url = QUrl::fromEncoded(QString(app.address + QUrl::toPercentEncoding(m_url.toString())).toLatin1());
|
||||
|
||||
m_view->openUrlInNewTab(url, Qz::NT_SelectedTab);
|
||||
success = true;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <QMenu>
|
||||
|
||||
QHash<QString, QWeakPointer<SideBarInterface> > SideBarManager::s_sidebars;
|
||||
QHash<QString, QPointer<SideBarInterface> > SideBarManager::s_sidebars;
|
||||
|
||||
SideBar::SideBar(SideBarManager* manager, QupZilla* mainClass)
|
||||
: QWidget(mainClass)
|
||||
|
@ -134,7 +134,7 @@ void SideBarManager::refreshMenu()
|
|||
act->setShortcut(QKeySequence("Ctrl+H"));
|
||||
act->setData("History");
|
||||
|
||||
foreach(const QWeakPointer<SideBarInterface> &sidebar, s_sidebars) {
|
||||
foreach(const QPointer<SideBarInterface> &sidebar, s_sidebars) {
|
||||
if (!sidebar) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include <QHash>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
void sideBarRemoved(const QString &id);
|
||||
void closeSideBar();
|
||||
|
||||
static QHash<QString, QWeakPointer<SideBarInterface> > s_sidebars;
|
||||
static QHash<QString, QPointer<SideBarInterface> > s_sidebars;
|
||||
static void addSidebar(const QString &id, SideBarInterface* interface);
|
||||
static void removeSidebar(const QString &id);
|
||||
|
||||
|
@ -78,7 +78,7 @@ private:
|
|||
void updateActions();
|
||||
|
||||
QupZilla* p_QupZilla;
|
||||
QWeakPointer<SideBar> m_sideBar;
|
||||
QPointer<SideBar> m_sideBar;
|
||||
QMenu* m_menu;
|
||||
|
||||
QString m_activeBar;
|
||||
|
|
|
@ -18,15 +18,20 @@
|
|||
#include "certificateinfowidget.h"
|
||||
#include "ui_certificateinfowidget.h"
|
||||
#include "mainapplication.h"
|
||||
#include "globalfunctions.h"
|
||||
|
||||
#include <QSslCertificate>
|
||||
#include <QTextDocument>
|
||||
#include <QDateTime>
|
||||
|
||||
QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
QString commonName = cert.subjectInfo(QSslCertificate::CommonName).isEmpty() ? QString() : cert.subjectInfo(QSslCertificate::CommonName).at(0);
|
||||
QString organization = cert.subjectInfo(QSslCertificate::Organization).isEmpty() ? QString() : cert.subjectInfo(QSslCertificate::Organization).at(0);
|
||||
#else
|
||||
QString commonName = cert.subjectInfo(QSslCertificate::CommonName);
|
||||
QString organization = cert.subjectInfo(QSslCertificate::Organization);
|
||||
#endif
|
||||
|
||||
if (commonName.isEmpty()) {
|
||||
return clearCertSpecialSymbols(organization);
|
||||
|
@ -37,7 +42,7 @@ QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert)
|
|||
|
||||
QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string)
|
||||
{
|
||||
QString n = Qt::escape(string);
|
||||
QString n = qz_escape(string);
|
||||
|
||||
if (!n.contains(QLatin1String("\\"))) {
|
||||
return n;
|
||||
|
@ -285,6 +290,15 @@ QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string)
|
|||
return n;
|
||||
}
|
||||
|
||||
QString CertificateInfoWidget::clearCertSpecialSymbols(const QStringList &stringList)
|
||||
{
|
||||
if (stringList.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
return clearCertSpecialSymbols(stringList.at(0));
|
||||
}
|
||||
|
||||
QString CertificateInfoWidget::showCertInfo(const QString &string)
|
||||
{
|
||||
if (string.isEmpty()) {
|
||||
|
@ -295,6 +309,15 @@ QString CertificateInfoWidget::showCertInfo(const QString &string)
|
|||
}
|
||||
}
|
||||
|
||||
QString CertificateInfoWidget::showCertInfo(const QStringList &stringList)
|
||||
{
|
||||
if (stringList.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
return showCertInfo(stringList.at(0));
|
||||
}
|
||||
|
||||
CertificateInfoWidget::CertificateInfoWidget(const QSslCertificate &cert, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::CertificateInfoWidget)
|
||||
|
|
|
@ -35,8 +35,16 @@ public:
|
|||
explicit CertificateInfoWidget(const QSslCertificate &cert, QWidget* parent = 0);
|
||||
~CertificateInfoWidget();
|
||||
|
||||
// Qt5 compatibility
|
||||
// QSslCertificate::subjectInfo returns:
|
||||
// QString in Qt 4
|
||||
// QStringList in Qt 5
|
||||
//
|
||||
static QString showCertInfo(const QString &string);
|
||||
static QString showCertInfo(const QStringList &stringList);
|
||||
static QString clearCertSpecialSymbols(const QString &string);
|
||||
static QString clearCertSpecialSymbols(const QStringList &stringList);
|
||||
|
||||
static QString certificateItemText(const QSslCertificate &cert);
|
||||
|
||||
private:
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
* ============================================================ */
|
||||
#include "globalfunctions.h"
|
||||
|
||||
#include <QTextDocument>
|
||||
#include <QDateTime>
|
||||
#include <QByteArray>
|
||||
#include <QPixmap>
|
||||
#include <QPainter>
|
||||
|
@ -25,10 +27,15 @@
|
|||
#include <QDir>
|
||||
#include <QWidget>
|
||||
#include <QApplication>
|
||||
#include <QSslCertificate>
|
||||
#include <QDesktopWidget>
|
||||
#include <QUrl>
|
||||
#include <QIcon>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
QByteArray qz_pixmapToByteArray(const QPixmap &pix)
|
||||
{
|
||||
QByteArray bytes;
|
||||
|
@ -166,11 +173,19 @@ QString qz_urlEncodeQueryString(const QUrl &url)
|
|||
QString returnString = url.toString(QUrl::RemoveQuery | QUrl::RemoveFragment);
|
||||
|
||||
if (url.hasQuery()) {
|
||||
#if QT_VERSION >= 0x050000
|
||||
returnString += QLatin1Char('?') + url.query(QUrl::FullyEncoded);
|
||||
#else
|
||||
returnString += QLatin1Char('?') + url.encodedQuery();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (url.hasFragment()) {
|
||||
#if QT_VERSION >= 0x050000
|
||||
returnString += QLatin1Char('#') + url.fragment(QUrl::FullyEncoded);
|
||||
#else
|
||||
returnString += QLatin1Char('#') + url.encodedFragment();
|
||||
#endif
|
||||
}
|
||||
|
||||
returnString.replace(QLatin1Char(' '), QLatin1String("%20"));
|
||||
|
@ -342,6 +357,28 @@ QString QT_QUPZILLA_EXPORT qz_applyDirectionToPage(QString &pageContents)
|
|||
return pageContents;
|
||||
}
|
||||
|
||||
// Qt5 migration help functions
|
||||
bool QT_QUPZILLA_EXPORT qz_isCertificateValid(const QSslCertificate &cert)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
const QDateTime currentTime = QDateTime::currentDateTime();
|
||||
return currentTime >= cert.effectiveDate() &&
|
||||
currentTime <= cert.expiryDate() &&
|
||||
!cert.isBlacklisted();
|
||||
#else
|
||||
return cert.isValid();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString QT_QUPZILLA_EXPORT qz_escape(const QString &string)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return string.toHtmlEscaped();
|
||||
#else
|
||||
return qz_escape(string);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString qz_buildSystem()
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
class QSslCertificate;
|
||||
class QFontMetrics;
|
||||
class QPixmap;
|
||||
class QIcon;
|
||||
|
@ -56,6 +57,10 @@ QString QT_QUPZILLA_EXPORT qz_applyDirectionToPage(QString &pageContents);
|
|||
|
||||
QString QT_QUPZILLA_EXPORT qz_buildSystem();
|
||||
|
||||
// Qt5 migration help functions
|
||||
bool QT_QUPZILLA_EXPORT qz_isCertificateValid(const QSslCertificate &cert);
|
||||
QString QT_QUPZILLA_EXPORT qz_escape(const QString &string);
|
||||
|
||||
template <typename T>
|
||||
bool qz_listContainsIndex(const QList<T> &list, int index)
|
||||
{
|
||||
|
|
|
@ -25,7 +25,11 @@ HeaderView::HeaderView(QAbstractItemView* parent)
|
|||
, m_parent(parent)
|
||||
, m_menu(0)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
setSectionsMovable(true);
|
||||
#else
|
||||
setMovable(true);
|
||||
#endif
|
||||
setStretchLastSection(true);
|
||||
setDefaultAlignment(Qt::AlignLeft);
|
||||
setMinimumSectionSize(60);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "treewidget.h"
|
||||
#include "bookmarksmodel.h"
|
||||
|
||||
#include <QMimeData>
|
||||
#include <QMouseEvent>
|
||||
#include <QSqlDatabase>
|
||||
#include <QApplication>
|
||||
|
@ -455,7 +456,10 @@ void TreeWidget::setDragDropReceiver(bool enable, QObject* receiver)
|
|||
viewport()->setAcceptDrops(enable);
|
||||
setDropIndicatorShown(enable);
|
||||
if (enable) {
|
||||
// TODO: It won't probably work in Qt5
|
||||
#if QT_VERSION < 0x050000
|
||||
model()->setSupportedDragActions(Qt::CopyAction);
|
||||
#endif
|
||||
connect(this, SIGNAL(folderParentChanged(QString, bool, bool*)), receiver, SLOT(changeFolderParent(QString, bool, bool*)));
|
||||
connect(this, SIGNAL(bookmarkParentChanged(int, QString, QString, bool*)), receiver, SLOT(changeBookmarkParent(int, QString, QString, bool*)));
|
||||
connect(this, SIGNAL(linkWasDroped(QUrl, QString, QVariant, QString, bool*)), receiver, SLOT(bookmarkDropedLink(QUrl, QString, QVariant, QString, bool*)));
|
||||
|
|
|
@ -146,12 +146,11 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
|
|||
}
|
||||
|
||||
//SECURITY
|
||||
if (cert.isValid()) {
|
||||
if (qz_isCertificateValid(cert)) {
|
||||
ui->securityLabel->setText(tr("<b>Connection is Encrypted.</b>"));
|
||||
ui->certLabel->setText(tr("<b>Your connection to this page is secured with this certificate: </b>"));
|
||||
m_certWidget = new CertificateInfoWidget(cert);
|
||||
ui->certFrame->addWidget(m_certWidget);
|
||||
|
||||
}
|
||||
else {
|
||||
ui->securityLabel->setText(tr("<b>Connection Not Encrypted.</b>"));
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */
|
||||
#include "globalfunctions.h"
|
||||
#include "siteinfowidget.h"
|
||||
#include "ui_siteinfowidget.h"
|
||||
#include "qupzilla.h"
|
||||
|
@ -39,7 +40,7 @@ SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent)
|
|||
WebPage* webPage = view->page();
|
||||
QUrl url = view->url();
|
||||
|
||||
if (webPage->sslCertificate().isValid()) {
|
||||
if (qz_isCertificateValid(webPage->sslCertificate())) {
|
||||
ui->secureLabel->setText(tr("Your connection to this site is <b>secured</b>."));
|
||||
ui->secureIcon->setPixmap(QPixmap(":/icons/locationbar/accept.png"));
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "pluginproxy.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QMimeData>
|
||||
#include <QMouseEvent>
|
||||
#include <QStyleOption>
|
||||
#include <QApplication>
|
||||
|
@ -213,7 +214,6 @@ QSize TabBar::tabSizeHint(int index) const
|
|||
|
||||
if (maxWidthForTab < PINNED_TAB_WIDTH) {
|
||||
// FIXME: It overflows now
|
||||
|
||||
m_normalTabWidth = PINNED_TAB_WIDTH;
|
||||
if (index == currentIndex()) {
|
||||
size.setWidth(m_activeTabWidth);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <QMovie>
|
||||
#include <QMenu>
|
||||
#include <QMimeData>
|
||||
#include <QStackedWidget>
|
||||
#include <QMouseEvent>
|
||||
#include <QWebHistory>
|
||||
|
|
|
@ -55,7 +55,7 @@ void WebInspectorDockWidget::close()
|
|||
void WebInspectorDockWidget::show()
|
||||
{
|
||||
QWebPage* page = p_QupZilla->weView()->page();
|
||||
QWeakPointer<WebInspector> inspector = m_inspectors[page];
|
||||
QPointer<WebInspector> inspector = m_inspectors[page];
|
||||
|
||||
if (!inspector) {
|
||||
inspector = new WebInspector(this);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <QWebInspector>
|
||||
#include <QDockWidget>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
#include <QHash>
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
@ -56,9 +56,9 @@ public slots:
|
|||
|
||||
private:
|
||||
QupZilla* p_QupZilla;
|
||||
QHash<QWebPage*, QWeakPointer<WebInspector> > m_inspectors;
|
||||
QHash<QWebPage*, QPointer<WebInspector> > m_inspectors;
|
||||
|
||||
QWeakPointer<WebInspector> m_currentInspector;
|
||||
QPointer<WebInspector> m_currentInspector;
|
||||
};
|
||||
|
||||
#endif // WEBINSPECTORDOCKWIDGET_H
|
||||
|
|
|
@ -196,11 +196,11 @@ void WebPage::progress(int prog)
|
|||
{
|
||||
m_loadProgress = prog;
|
||||
|
||||
bool secStatus = sslCertificate().isValid();
|
||||
bool secStatus = qz_isCertificateValid(sslCertificate());
|
||||
|
||||
if (secStatus != m_secureStatus) {
|
||||
m_secureStatus = secStatus;
|
||||
emit privacyChanged(sslCertificate().isValid());
|
||||
emit privacyChanged(qz_isCertificateValid(sslCertificate()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ void WebPage::setSSLCertificate(const QSslCertificate &cert)
|
|||
|
||||
QSslCertificate WebPage::sslCertificate()
|
||||
{
|
||||
if (url().scheme() == QLatin1String("https") && m_sslCert.isValid()) {
|
||||
if (url().scheme() == QLatin1String("https") && qz_isCertificateValid(m_sslCert)) {
|
||||
return m_sslCert;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define WEBTAB_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
#include <QIcon>
|
||||
#include <QUrl>
|
||||
|
||||
|
@ -102,7 +102,7 @@ private:
|
|||
QupZilla* p_QupZilla;
|
||||
TabbedWebView* m_view;
|
||||
QVBoxLayout* m_layout;
|
||||
QWeakPointer<LocationBar> m_locationBar;
|
||||
QPointer<LocationBar> m_locationBar;
|
||||
|
||||
SavedTab m_savedTab;
|
||||
|
||||
|
|
|
@ -504,7 +504,7 @@ void WebView::searchSelectedText()
|
|||
SearchEngine engine = mApp->searchEnginesManager()->activeEngine();
|
||||
if (QAction* act = qobject_cast<QAction*>(sender())) {
|
||||
if (act->data().isValid()) {
|
||||
engine = qVariantValue<SearchEngine>(act->data());
|
||||
engine = act->data().value<SearchEngine>();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,7 @@ void WebView::searchSelectedTextInBackgroundTab()
|
|||
SearchEngine engine = mApp->searchEnginesManager()->activeEngine();
|
||||
if (QAction* act = qobject_cast<QAction*>(sender())) {
|
||||
if (act->data().isValid()) {
|
||||
engine = qVariantValue<SearchEngine>(act->data());
|
||||
engine = act->data().value<SearchEngine>();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
#include <QDateTime>
|
||||
#include <QTextStream>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QWebPage>
|
||||
#else
|
||||
#include "qwebkitversion.h"
|
||||
#endif
|
||||
|
||||
void qupzilla_signal_handler(int s)
|
||||
{
|
||||
switch (s) {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
QT += core gui webkit sql network script
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
QT += webkitwidgets network widgets printsupport sql script
|
||||
} else {
|
||||
QT += core gui webkit sql network script
|
||||
}
|
||||
|
||||
TARGET = qupzilla
|
||||
mac: TARGET = QupZilla
|
||||
|
|
|
@ -27,9 +27,14 @@ INCLUDEPATH += $$PWD/lib/3rdparty\
|
|||
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
QT *= webkit network
|
||||
DESTDIR = $$PWD/../bin/plugins/
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
QT *= webkitwidgets network
|
||||
} else {
|
||||
QT *= webkit network
|
||||
}
|
||||
|
||||
OBJECTS_DIR = build
|
||||
MOC_DIR = build
|
||||
RCC_DIR = build
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <QTime>
|
||||
#include <QHash>
|
||||
#include <QWebElement>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
class QKeyEvent;
|
||||
class QWebElement;
|
||||
|
@ -57,7 +57,7 @@ private:
|
|||
void makeAccessKeyLabel(const QChar &accessKey, const QWebElement &element);
|
||||
void handleAccessKey(QKeyEvent* event);
|
||||
|
||||
QWeakPointer<WebView> m_view;
|
||||
QPointer<WebView> m_view;
|
||||
|
||||
QList<QLabel*> m_accessKeyLabels;
|
||||
QHash<QChar, QWebElement> m_accessKeyNodes;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#ifndef AKN_PLUGIN_H
|
||||
#define AKN_PLUGIN_H
|
||||
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
#include "plugininterface.h"
|
||||
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
bool keyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event);
|
||||
|
||||
private:
|
||||
QWeakPointer<AKN_Settings> m_settings;
|
||||
QPointer<AKN_Settings> m_settings;
|
||||
AKN_Handler* m_handler;
|
||||
};
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
class QUrl;
|
||||
class QNetworkRequest;
|
||||
|
@ -68,7 +68,7 @@ private slots:
|
|||
private:
|
||||
QString m_settingsPath;
|
||||
QString m_bootstrap;
|
||||
QWeakPointer<GM_Settings> m_settings;
|
||||
QPointer<GM_Settings> m_settings;
|
||||
|
||||
QStringList m_disabledScripts;
|
||||
QList<GM_Script*> m_endScripts;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define MOUSEGESTURES_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
|
||||
class QMouseEvent;
|
||||
|
||||
|
@ -56,8 +56,8 @@ private slots:
|
|||
|
||||
private:
|
||||
QjtMouseGestureFilter* m_filter;
|
||||
QWeakPointer<MouseGesturesSettingsDialog> m_settings;
|
||||
QWeakPointer<WebView> m_view;
|
||||
QPointer<MouseGesturesSettingsDialog> m_settings;
|
||||
QPointer<WebView> m_view;
|
||||
};
|
||||
|
||||
#endif // MOUSEGESTURES_H
|
||||
|
|
|
@ -114,7 +114,7 @@ void PIM_Handler::populateWebViewMenu(QMenu* menu, WebView* view, const QWebHitT
|
|||
|
||||
QMenu* pimMenu = new QMenu(tr("Insert Personal Information"));
|
||||
pimMenu->setIcon(QIcon(":/PIM/data/PIM.png"));
|
||||
|
||||
|
||||
if (!m_allInfo[PI_FirstName].isEmpty() && !m_allInfo[PI_LastName].isEmpty()) {
|
||||
const QString fullname = m_allInfo[PI_FirstName] + " " + m_allInfo[PI_LastName];
|
||||
QAction* action = pimMenu->addAction(fullname, this, SLOT(pimInsert()));
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QWebHitTestResult>
|
||||
#include <QMenu>
|
||||
#include <QWeakPointer>
|
||||
#include <QPointer>
|
||||
#include <QHash>
|
||||
|
||||
class WebView;
|
||||
|
@ -81,8 +81,8 @@ private:
|
|||
QHash<PI_Type, QStringList> m_infoMatches;
|
||||
QHash<PI_Type, QString> m_translations;
|
||||
|
||||
QWeakPointer<PIM_Settings> m_settings;
|
||||
QWeakPointer<WebView> m_view;
|
||||
QPointer<PIM_Settings> m_settings;
|
||||
QPointer<WebView> m_view;
|
||||
QWebElement m_element;
|
||||
|
||||
QString m_settingsFile;
|
||||
|
|
Loading…
Reference in New Issue
Block a user