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()));
|
||||
|
||||
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(userLab, user);
|
||||
|
@ -192,7 +192,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%"), 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("%ABOUT-QUPZILLA%"), tr("About QupZilla"));
|
||||
@ -429,7 +429,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, QzTools::escape(spec.author), spec.description));
|
||||
spec.name, spec.version, spec.author.toHtmlEscaped(), spec.description));
|
||||
}
|
||||
|
||||
if (pluginsString.isEmpty()) {
|
||||
@ -471,7 +471,7 @@ QString QupZillaSchemeReply::configPage()
|
||||
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();
|
||||
|
@ -128,7 +128,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, 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->setText(spec.name);
|
||||
|
@ -37,7 +37,7 @@ QString CertificateInfoWidget::certificateItemText(const QSslCertificate &cert)
|
||||
|
||||
QString CertificateInfoWidget::clearCertSpecialSymbols(const QString &string)
|
||||
{
|
||||
QString n = QzTools::escape(string);
|
||||
QString n = string.toHtmlEscaped();
|
||||
|
||||
if (!n.contains(QLatin1String("\\"))) {
|
||||
return n;
|
||||
|
@ -39,10 +39,8 @@
|
||||
#include <QSysInfo>
|
||||
#include <QProcess>
|
||||
#include <QMessageBox>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
#ifdef QZ_WS_X11
|
||||
#include <QX11Info>
|
||||
#include <xcb/xcb.h>
|
||||
@ -177,19 +175,11 @@ QString QzTools::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"));
|
||||
@ -800,28 +790,6 @@ bool QzTools::startExternalProcess(const QString &executable, const QString &arg
|
||||
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)
|
||||
{
|
||||
#ifdef QZ_WS_X11
|
||||
|
@ -82,10 +82,6 @@ public:
|
||||
|
||||
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);
|
||||
|
||||
template <typename T>
|
||||
|
@ -119,7 +119,3 @@ bool AutoScrollPlugin::wheelEvent(const Qz::ObjectName &type, QObject *obj, QWhe
|
||||
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit AutoScrollPlugin();
|
||||
|
@ -494,7 +494,3 @@ QString FCM_Plugin::extractOriginFrom(const QString &path)
|
||||
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.FlashCookieManager")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit FCM_Plugin();
|
||||
|
@ -69,7 +69,3 @@ QTranslator* GnomeKeyringPlugin::getTranslator(const QString &locale)
|
||||
translator->load(locale, ":/gkp/locale/");
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GnomeKeyringPasswords")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit GnomeKeyringPlugin();
|
||||
|
@ -86,7 +86,3 @@ void GM_Plugin::showSettings(QWidget* 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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.GreaseMonkey")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit GM_Plugin();
|
||||
|
@ -104,7 +104,3 @@ bool MouseGesturesPlugin::mouseMove(const Qz::ObjectName &type, QObject* obj, QM
|
||||
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.MouseGestures")
|
||||
#endif
|
||||
|
||||
public:
|
||||
MouseGesturesPlugin();
|
||||
|
@ -95,7 +95,3 @@ bool PIM_Plugin::keyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* e
|
||||
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.PIM")
|
||||
#endif
|
||||
|
||||
public:
|
||||
PIM_Plugin();
|
||||
|
@ -88,7 +88,3 @@ void StatusBarIconsPlugin::showSettings(QWidget* parent)
|
||||
SBI_SettingsDialog* dialog = new SBI_SettingsDialog(m_manager, parent);
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.StatusBarIcons")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit StatusBarIconsPlugin();
|
||||
|
@ -189,7 +189,3 @@ QString TabManagerPlugin::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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TabManagerPlugin")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit TabManagerPlugin();
|
||||
|
@ -178,11 +178,3 @@ void TestPlugin::actionSlot()
|
||||
{
|
||||
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_INTERFACES(PluginInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit TestPlugin();
|
||||
|
Loading…
Reference in New Issue
Block a user