mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Remove remaining Qt 4 code
This commit is contained in:
parent
e604120f49
commit
cefe1bce54
@ -117,7 +117,7 @@ void NetworkManager::authentication(const QUrl &url, QAuthenticator *auth, QWidg
|
|||||||
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
|
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
|
||||||
|
|
||||||
label->setText(tr("A username and password are being requested by %1. "
|
label->setText(tr("A username and password are being requested by %1. "
|
||||||
"The site says: \"%2\"").arg(url.host(), QzTools::escape(auth->realm())));
|
"The site says: \"%2\"").arg(url.host(), auth->realm().toHtmlEscaped()));
|
||||||
|
|
||||||
formLa->addRow(label);
|
formLa->addRow(label);
|
||||||
formLa->addRow(userLab, user);
|
formLa->addRow(userLab, user);
|
||||||
|
@ -192,7 +192,7 @@ QString QupZillaSchemeReply::aboutPage()
|
|||||||
aPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png"));
|
aPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png"));
|
||||||
aPage.replace(QLatin1String("%BOX-BORDER%"), QLatin1String("qrc:html/box-border.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("%ABOUT-IMG%"), QLatin1String("qrc:icons/other/about.png"));
|
||||||
aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), QzTools::escape(QzTools::readAllFileContents(":html/copyright")));
|
aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), QzTools::readAllFileContents(":html/copyright").toHtmlEscaped());
|
||||||
|
|
||||||
aPage.replace(QLatin1String("%TITLE%"), tr("About QupZilla"));
|
aPage.replace(QLatin1String("%TITLE%"), tr("About QupZilla"));
|
||||||
aPage.replace(QLatin1String("%ABOUT-QUPZILLA%"), tr("About QupZilla"));
|
aPage.replace(QLatin1String("%ABOUT-QUPZILLA%"), tr("About QupZilla"));
|
||||||
@ -429,7 +429,7 @@ QString QupZillaSchemeReply::configPage()
|
|||||||
foreach (const Plugins::Plugin &plugin, availablePlugins) {
|
foreach (const Plugins::Plugin &plugin, availablePlugins) {
|
||||||
PluginSpec spec = plugin.pluginSpec;
|
PluginSpec spec = plugin.pluginSpec;
|
||||||
pluginsString.append(QString("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td></tr>").arg(
|
pluginsString.append(QString("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td></tr>").arg(
|
||||||
spec.name, spec.version, QzTools::escape(spec.author), spec.description));
|
spec.name, spec.version, spec.author.toHtmlEscaped(), spec.description));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pluginsString.isEmpty()) {
|
if (pluginsString.isEmpty()) {
|
||||||
@ -471,7 +471,7 @@ QString QupZillaSchemeReply::configPage()
|
|||||||
keyString = QLatin1String("\"empty\"");
|
keyString = QLatin1String("\"empty\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, QzTools::escape(keyString)));
|
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, keyString.toHtmlEscaped()));
|
||||||
}
|
}
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
@ -128,7 +128,7 @@ void PluginsManager::refresh()
|
|||||||
}
|
}
|
||||||
item->setIcon(icon);
|
item->setIcon(icon);
|
||||||
|
|
||||||
QString pluginInfo = QString("<b>%1</b> %2<br/><i>%3</i><br/>%4").arg(spec.name, spec.version, QzTools::escape(spec.author), spec.info);
|
QString pluginInfo = QString("<b>%1</b> %2<br/><i>%3</i><br/>%4").arg(spec.name, spec.version, spec.author.toHtmlEscaped(), spec.info);
|
||||||
item->setToolTip(pluginInfo);
|
item->setToolTip(pluginInfo);
|
||||||
|
|
||||||
item->setText(spec.name);
|
item->setText(spec.name);
|
||||||
|
@ -37,7 +37,7 @@ QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert)
|
|||||||
|
|
||||||
QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string)
|
QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string)
|
||||||
{
|
{
|
||||||
QString n = QzTools::escape(string);
|
QString n = string.toHtmlEscaped();
|
||||||
|
|
||||||
if (!n.contains(QLatin1String("\\"))) {
|
if (!n.contains(QLatin1String("\\"))) {
|
||||||
return n;
|
return n;
|
||||||
|
@ -39,10 +39,8 @@
|
|||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
#endif
|
|
||||||
#ifdef QZ_WS_X11
|
#ifdef QZ_WS_X11
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
@ -177,19 +175,11 @@ QString QzTools::urlEncodeQueryString(const QUrl &url)
|
|||||||
QString returnString = url.toString(QUrl::RemoveQuery | QUrl::RemoveFragment);
|
QString returnString = url.toString(QUrl::RemoveQuery | QUrl::RemoveFragment);
|
||||||
|
|
||||||
if (url.hasQuery()) {
|
if (url.hasQuery()) {
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
returnString += QLatin1Char('?') + url.query(QUrl::FullyEncoded);
|
returnString += QLatin1Char('?') + url.query(QUrl::FullyEncoded);
|
||||||
#else
|
|
||||||
returnString += QLatin1Char('?') + url.encodedQuery();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.hasFragment()) {
|
if (url.hasFragment()) {
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
returnString += QLatin1Char('#') + url.fragment(QUrl::FullyEncoded);
|
returnString += QLatin1Char('#') + url.fragment(QUrl::FullyEncoded);
|
||||||
#else
|
|
||||||
returnString += QLatin1Char('#') + url.encodedFragment();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
returnString.replace(QLatin1Char(' '), QLatin1String("%20"));
|
returnString.replace(QLatin1Char(' '), QLatin1String("%20"));
|
||||||
@ -800,28 +790,6 @@ bool QzTools::startExternalProcess(const QString &executable, const QString &arg
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Qt5 migration help functions
|
|
||||||
bool QzTools::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 QzTools::escape(const QString &string)
|
|
||||||
{
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
return string.toHtmlEscaped();
|
|
||||||
#else
|
|
||||||
return Qt::escape(string);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void QzTools::setWmClass(const QString &name, const QWidget* widget)
|
void QzTools::setWmClass(const QString &name, const QWidget* widget)
|
||||||
{
|
{
|
||||||
#ifdef QZ_WS_X11
|
#ifdef QZ_WS_X11
|
||||||
|
@ -82,10 +82,6 @@ public:
|
|||||||
|
|
||||||
static QString operatingSystem();
|
static QString operatingSystem();
|
||||||
|
|
||||||
// Qt5 migration help functions
|
|
||||||
static bool isCertificateValid(const QSslCertificate &cert);
|
|
||||||
static QString escape(const QString &string);
|
|
||||||
|
|
||||||
static void setWmClass(const QString &name, const QWidget* widget);
|
static void setWmClass(const QString &name, const QWidget* widget);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -119,7 +119,3 @@ bool AutoScrollPlugin::wheelEvent(const Qz::ObjectName &type, QObject *obj, QWhe
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(AutoScroll, AutoScrollPlugin)
|
|
||||||
#endif
|
|
||||||
|
@ -27,10 +27,7 @@ class AutoScrollPlugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AutoScrollPlugin();
|
explicit AutoScrollPlugin();
|
||||||
|
@ -494,7 +494,3 @@ QString FCM_Plugin::extractOriginFrom(const QString &path)
|
|||||||
|
|
||||||
return origin;
|
return origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(FlashCookieManagerPlugin, FCM_Plugin)
|
|
||||||
#endif
|
|
||||||
|
@ -44,10 +44,7 @@ class FCM_Plugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.FlashCookieManager")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.FlashCookieManager")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FCM_Plugin();
|
explicit FCM_Plugin();
|
||||||
|
@ -69,7 +69,3 @@ QTranslator* GnomeKeyringPlugin::getTranslator(const QString &locale)
|
|||||||
translator->load(locale, ":/gkp/locale/");
|
translator->load(locale, ":/gkp/locale/");
|
||||||
return translator;
|
return translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(GnomeKeyringPasswords, GnomeKeyringPlugin)
|
|
||||||
#endif
|
|
||||||
|
@ -26,10 +26,7 @@ class GnomeKeyringPlugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GnomeKeyringPasswords")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GnomeKeyringPasswords")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GnomeKeyringPlugin();
|
explicit GnomeKeyringPlugin();
|
||||||
|
@ -86,7 +86,3 @@ void GM_Plugin::showSettings(QWidget* parent)
|
|||||||
{
|
{
|
||||||
m_manager->showSettings(parent);
|
m_manager->showSettings(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(GreaseMonkey, GM_Plugin)
|
|
||||||
#endif
|
|
||||||
|
@ -27,10 +27,7 @@ class GM_Plugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GreaseMonkey")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GreaseMonkey")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GM_Plugin();
|
explicit GM_Plugin();
|
||||||
|
@ -104,7 +104,3 @@ bool MouseGesturesPlugin::mouseMove(const Qz::ObjectName &type, QObject* obj, QM
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(MouseGestures, MouseGesturesPlugin)
|
|
||||||
#endif
|
|
||||||
|
@ -25,10 +25,7 @@ class MouseGesturesPlugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.MouseGestures")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.MouseGestures")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MouseGesturesPlugin();
|
MouseGesturesPlugin();
|
||||||
|
@ -95,7 +95,3 @@ bool PIM_Plugin::keyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* e
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(PIM, PIM_Plugin)
|
|
||||||
#endif
|
|
||||||
|
@ -29,10 +29,7 @@ class PIM_Plugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.PIM")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.PIM")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PIM_Plugin();
|
PIM_Plugin();
|
||||||
|
@ -88,7 +88,3 @@ void StatusBarIconsPlugin::showSettings(QWidget* parent)
|
|||||||
SBI_SettingsDialog* dialog = new SBI_SettingsDialog(m_manager, parent);
|
SBI_SettingsDialog* dialog = new SBI_SettingsDialog(m_manager, parent);
|
||||||
dialog->open();
|
dialog->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(StatusBarIcons, StatusBarIconsPlugin)
|
|
||||||
#endif
|
|
||||||
|
@ -26,10 +26,7 @@ class StatusBarIconsPlugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.StatusBarIcons")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.StatusBarIcons")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StatusBarIconsPlugin();
|
explicit StatusBarIconsPlugin();
|
||||||
|
@ -189,7 +189,3 @@ QString TabManagerPlugin::settingsPath()
|
|||||||
{
|
{
|
||||||
return s_settingsPath;
|
return s_settingsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(TabManager, TabManagerPlugin)
|
|
||||||
#endif
|
|
||||||
|
@ -34,10 +34,7 @@ class TabManagerPlugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TabManagerPlugin")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TabManagerPlugin")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TabManagerPlugin();
|
explicit TabManagerPlugin();
|
||||||
|
@ -178,11 +178,3 @@ void TestPlugin::actionSlot()
|
|||||||
{
|
{
|
||||||
QMessageBox::information(m_view, tr("Hello"), tr("First plugin action works :-)"));
|
QMessageBox::information(m_view, tr("Hello"), tr("First plugin action works :-)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export plugin macro
|
|
||||||
// This macro has to be only in class derived from PluginInterface
|
|
||||||
// Don't call it in other files!
|
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(ExamplePlugin, TestPlugin)
|
|
||||||
#endif
|
|
||||||
|
@ -35,10 +35,7 @@ class TestPlugin : public QObject, public PluginInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TestPlugin();
|
explicit TestPlugin();
|
||||||
|
Loading…
Reference in New Issue
Block a user