1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Some optimalizations

This commit is contained in:
nowrep 2011-04-24 09:08:53 +02:00
parent a8add4a5b3
commit cd4763d2d9
6 changed files with 13 additions and 13 deletions

View File

@ -204,7 +204,7 @@ void TabWidget::actionChangeIndex()
} }
} }
int TabWidget::addView(QUrl url, QString title, OpenUrlIn openIn, bool selectLine) int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool selectLine)
{ {
if (url.isEmpty()) if (url.isEmpty())
url = m_urlOnNewTab; url = m_urlOnNewTab;

View File

@ -46,7 +46,7 @@ public:
void savePinnedTabs(); void savePinnedTabs();
void restorePinnedTabs(); void restorePinnedTabs();
void setTabText(int index, const QString& text); void setTabText(int index, const QString &text);
void loadSettings(); void loadSettings();
inline TabBar* getTabBar() { return m_tabBar; } inline TabBar* getTabBar() { return m_tabBar; }
@ -56,7 +56,7 @@ public:
public slots: public slots:
void closeTab(int index=-1); void closeTab(int index=-1);
int addView(QUrl url = QUrl(), QString title = tr("New tab"), OpenUrlIn openIn = NewTab, bool selectLine = false); int addView(QUrl url = QUrl(), const QString &title = tr("New tab"), OpenUrlIn openIn = NewTab, bool selectLine = false);
void reloadTab(int index) { weView(index)->reload(); } void reloadTab(int index) { weView(index)->reload(); }
void reloadAllTabs(); void reloadAllTabs();
void stopTab(int index) { weView(index)->stop(); } void stopTab(int index) { weView(index)->stop(); }

View File

@ -60,7 +60,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply* reply)
qDebug() << "WebPage::UnsupportedContent error" << reply->errorString(); qDebug() << "WebPage::UnsupportedContent error" << reply->errorString();
} }
void WebPage::setSSLCertificate(QSslCertificate cert) void WebPage::setSSLCertificate(const QSslCertificate &cert)
{ {
// if (cert != m_SslCert) -- crashing on linux :-| // if (cert != m_SslCert) -- crashing on linux :-|
m_SslCert = cert; m_SslCert = cert;
@ -140,7 +140,7 @@ void WebPage::addAdBlockRule(const QString &filter, const QUrl &url)
m_adBlockedEntries.append(entry); m_adBlockedEntries.append(entry);
} }
bool WebPage::extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output) bool WebPage::extension(const Extension &extension, const ExtensionOption* option, ExtensionReturn* output)
{ {
if (extension == ChooseMultipleFilesExtension) if (extension == ChooseMultipleFilesExtension)
return QWebPage::extension(extension, option, output); return QWebPage::extension(extension, option, output);

View File

@ -45,11 +45,11 @@ public:
void populateNetworkRequest(QNetworkRequest &request); void populateNetworkRequest(QNetworkRequest &request);
~WebPage(); ~WebPage();
void setSSLCertificate(QSslCertificate cert); void setSSLCertificate(const QSslCertificate &cert);
QSslCertificate sslCertificate(); QSslCertificate sslCertificate();
QString userAgentForUrl(const QUrl &url) const; QString userAgentForUrl(const QUrl &url) const;
bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); } bool supportsExtension(const Extension &extension) const { return (extension == ErrorPageExtension); }
bool extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output); bool extension(const Extension &extension, const ExtensionOption* option, ExtensionReturn* output);
void addAdBlockRule(const QString &filter, const QUrl &url); void addAdBlockRule(const QString &filter, const QUrl &url);
QList<AdBlockedEntry> adBlockedEntries() { return m_adBlockedEntries; } QList<AdBlockedEntry> adBlockedEntries() { return m_adBlockedEntries; }

View File

@ -182,7 +182,7 @@ void WebView::stopAnimation()
} }
} }
void WebView::setIp(QHostInfo info) void WebView::setIp(const QHostInfo &info)
{ {
if (info.addresses().isEmpty()) if (info.addresses().isEmpty())
return; return;
@ -695,7 +695,7 @@ void WebView::closeTab()
} }
} }
void WebView::load(QUrl url) void WebView::load(const QUrl &url)
{ {
if (url.toString().startsWith("javascript:")) { if (url.toString().startsWith("javascript:")) {
page()->mainFrame()->evaluateJavaScript(url.toString()); page()->mainFrame()->evaluateJavaScript(url.toString());

View File

@ -46,7 +46,7 @@ public:
int getLoading() { return m_progress; } int getLoading() { return m_progress; }
void zoomReset(); void zoomReset();
void load(QUrl url); void load(const QUrl &url);
QUrl url() const; QUrl url() const;
QString title() const; QString title() const;
void reload(); void reload();
@ -56,7 +56,7 @@ public:
QIcon siteIcon(); QIcon siteIcon();
void addNotification(QWidget* notif); void addNotification(QWidget* notif);
bool hasRss() { return !m_rss.isEmpty(); } bool hasRss() { return !m_rss.isEmpty(); }
QList<QPair<QString,QString> > getRss() { return m_rss; } QList<QPair<QString,QString> > getRss() { return m_rss; } //FIXME: Make RSS as struct
static QUrl guessUrlFromString(const QString &string); static QUrl guessUrlFromString(const QString &string);
static bool isUrlValid(const QUrl &url); static bool isUrlValid(const QUrl &url);
@ -99,7 +99,7 @@ private slots:
void getFocus(const QUrl &urla); void getFocus(const QUrl &urla);
void showInspector(); void showInspector();
void stopAnimation(); void stopAnimation();
void setIp(QHostInfo info); void setIp(const QHostInfo &info);
void checkRss(); void checkRss();
void slotIconChanged(); void slotIconChanged();