mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
[Code] Made all helper functions static.
This commit is contained in:
parent
90a6b79050
commit
9f2de4b73a
@ -58,7 +58,7 @@
|
||||
|
||||
// Version for Qt < 4.8 has one issue, it will wrongly
|
||||
// count .co.uk (and others) as second-level domain
|
||||
QString toSecondLevelDomain(const QUrl &url)
|
||||
static QString toSecondLevelDomain(const QUrl &url)
|
||||
{
|
||||
#if QT_VERSION >= 0x040800
|
||||
const QString &topLevelDomain = url.topLevelDomain();
|
||||
|
@ -28,7 +28,8 @@
|
||||
|
||||
//#define COOKIE_DEBUG
|
||||
|
||||
bool blockThirdParty(QString string, QString domain)
|
||||
#if QTWEBKIT_TO_2_3
|
||||
static bool blockThirdParty(QString string, QString domain)
|
||||
{
|
||||
if (string.isEmpty()) {
|
||||
// Some cookies have empty domain() ... bug?
|
||||
@ -45,8 +46,9 @@ bool blockThirdParty(QString string, QString domain)
|
||||
|
||||
return !domain.endsWith(string);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool matchDomain(const QString &domain, const QString &filter)
|
||||
static bool matchDomain(const QString &domain, const QString &filter)
|
||||
{
|
||||
// According to RFC 6265
|
||||
|
||||
@ -63,7 +65,7 @@ bool matchDomain(const QString &domain, const QString &filter)
|
||||
return (index > 0 && filter[0] == QLatin1Char('.'));
|
||||
}
|
||||
|
||||
int listContainsDomain(const QStringList &list, const QString &domain)
|
||||
static int listContainsDomain(const QStringList &list, const QString &domain)
|
||||
{
|
||||
if (domain.isEmpty()) {
|
||||
return -1;
|
||||
@ -136,7 +138,7 @@ bool CookieJar::rejectCookie(const QString &domain, const QNetworkCookie &cookie
|
||||
}
|
||||
}
|
||||
|
||||
// This feature is now natively in QtWebKit in Qt 5
|
||||
// This feature is now natively in QtWebKit 2.3
|
||||
#if QTWEBKIT_TO_2_3
|
||||
if (m_blockThirdParty) {
|
||||
bool result = blockThirdParty(cookieDomain, domain);
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <QDateTime>
|
||||
#include <QTimer>
|
||||
|
||||
QString dateTimeToString(const QDateTime &dateTime)
|
||||
static QString dateTimeToString(const QDateTime &dateTime)
|
||||
{
|
||||
const QDateTime ¤t = QDateTime::currentDateTime();
|
||||
if (current.date() == dateTime.date()) {
|
||||
|
@ -132,7 +132,7 @@ void LocationCompleterDelegate::paint(QPainter* painter, const QStyleOptionViewI
|
||||
}
|
||||
}
|
||||
|
||||
bool sizeBiggerThan(const QString &s1, const QString &s2)
|
||||
static bool sizeBiggerThan(const QString &s1, const QString &s2)
|
||||
{
|
||||
return s1.size() > s2.size();
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ LocationCompleterModel::LocationCompleterModel(QObject* parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool countBiggerThan(const QStandardItem* i1, const QStandardItem* i2)
|
||||
static bool countBiggerThan(const QStandardItem* i1, const QStandardItem* i2)
|
||||
{
|
||||
return i1->data(LocationCompleterModel::CountRole).toInt() >
|
||||
i2->data(LocationCompleterModel::CountRole).toInt();
|
||||
|
@ -48,12 +48,17 @@
|
||||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
|
||||
QString fileNameForCert(const QSslCertificate &cert)
|
||||
static QString fileNameForCert(const QSslCertificate &cert)
|
||||
{
|
||||
QString certFileName = CertificateInfoWidget::certificateItemText(cert);
|
||||
certFileName.remove(QLatin1Char(' '));
|
||||
certFileName.append(QLatin1String(".crt"));
|
||||
certFileName = qz_filterCharsFromFilename(certFileName);
|
||||
|
||||
while (certFileName.startsWith(QLatin1Char('.'))) {
|
||||
certFileName = certFileName.mid(1);
|
||||
}
|
||||
|
||||
return certFileName;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <QTimer>
|
||||
#include <QSettings>
|
||||
|
||||
QString authorString(const char* name, const QString &mail)
|
||||
static QString authorString(const char* name, const QString &mail)
|
||||
{
|
||||
return QString("%1 <<a href=\"mailto:%2\">%2</a>>").arg(QString::fromUtf8(name), mail);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user