From 06b2dc0ce6ec6dd4cb090c22e2f9f8521138146b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 6 May 2009 03:09:23 +0200 Subject: EBN Krazy fixes. 1st round.. --- src/application.cpp | 5 +++-- src/application.h | 4 ++-- src/autosaver.cpp | 5 +++-- src/autosaver.h | 20 ++++++++++++++------ src/bookmarks.h | 4 ++-- src/cookiejar.h | 14 ++++++++++---- src/download.cpp | 2 +- src/findbar.cpp | 9 +++++++-- src/findbar.h | 12 +++++++++--- src/history.cpp | 14 +++++++++++--- src/history.h | 14 ++++++++------ src/mainview.cpp | 4 ++-- src/mainwindow.cpp | 4 ++-- src/searchbar.cpp | 10 ++++++---- src/settings.cpp | 3 +-- src/webview.cpp | 2 +- 16 files changed, 82 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index ec24691e..32561847 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -45,8 +45,9 @@ #include // Qt Includes -#include -#include +#include +#include +#include QPointer Application::s_historyManager; diff --git a/src/application.h b/src/application.h index 61f4af81..a09e008f 100644 --- a/src/application.h +++ b/src/application.h @@ -23,8 +23,6 @@ #ifndef APPLICATION_H #define APPLICATION_H -// Qt Includes -#include // KDE Includes #include @@ -35,6 +33,8 @@ #include #include +// Qt Includes +#include // Forward Declarations class KIcon; diff --git a/src/autosaver.cpp b/src/autosaver.cpp index 25bf9016..c7da12f3 100644 --- a/src/autosaver.cpp +++ b/src/autosaver.cpp @@ -20,14 +20,15 @@ -// Local Includes +// Self Includes #include "autosaver.h" +#include "autosaver.moc" // KDE Includes #include // Qt Includes -#include +#include #define AUTOSAVE_IN 1000 * 3 // seconds diff --git a/src/autosaver.h b/src/autosaver.h index 8931da13..e0de8ea5 100644 --- a/src/autosaver.h +++ b/src/autosaver.h @@ -23,13 +23,21 @@ #ifndef AUTOSAVER_H #define AUTOSAVER_H -#include +// Qt Includes +#include +#include +#include + +// Forward Declarations +#include + +/** + * This class will call the save() slot on the parent object when the parent changes. + * It will wait several seconds after changed() to combining multiple changes and + * prevent continuous writing to disk. + * + */ -/* - This class will call the save() slot on the parent object when the parent changes. - It will wait several seconds after changed() to combining multiple changes and - prevent continuous writing to disk. - */ class AutoSaver : public QObject { Q_OBJECT diff --git a/src/bookmarks.h b/src/bookmarks.h index d7213cb7..38655133 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -209,7 +209,7 @@ signals: public slots: /** * @short Opens the context menu on given position - * @param point Point on whitch you want to open this menu + * @param point Point on which you want to open this menu */ void contextMenu(const QPoint &point); @@ -218,7 +218,7 @@ public slots: * Waits for signal that the group (or any of its children) with the address * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. * - * @param group bookmark group adress + * @param group bookmark group address * @param caller caller that modified the bookmarks * @see KBookmarkManager::changed */ diff --git a/src/cookiejar.h b/src/cookiejar.h index 27071b6d..6cd91782 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -119,7 +119,8 @@ class CookieModel : public QAbstractTableModel Q_OBJECT public: - CookieModel(CookieJar *jar, QObject *parent = 0); + explicit CookieModel(CookieJar *jar, QObject *parent = 0); + QVariant headerData(int section, Qt::Orientation orientation, int role) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; @@ -144,19 +145,24 @@ class CookiesDialog : public QDialog, public Ui_CookiesDialog Q_OBJECT public: - CookiesDialog(CookieJar *cookieJar, QWidget *parent = 0); + explicit CookiesDialog(CookieJar *cookieJar, QWidget *parent = 0); private: QSortFilterProxyModel *m_proxyModel; }; + +// ---------------------------------------------------------------------------------------------------------------------- + + class CookieExceptionsModel : public QAbstractTableModel { Q_OBJECT friend class CookiesExceptionsDialog; public: - CookieExceptionsModel(CookieJar *cookieJar, QObject *parent = 0); + explicit CookieExceptionsModel(CookieJar *cookieJar, QObject *parent = 0); + QVariant headerData(int section, Qt::Orientation orientation, int role) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; @@ -183,7 +189,7 @@ class CookiesExceptionsDialog : public QDialog, public Ui_CookiesExceptionsDialo Q_OBJECT public: - CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *parent = 0); + explicit CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *parent = 0); private slots: void block(); diff --git a/src/download.cpp b/src/download.cpp index 9489b270..9a5b7a3d 100644 --- a/src/download.cpp +++ b/src/download.cpp @@ -67,7 +67,7 @@ void DownloadManager::newDownload(const KUrl &srcUrl, const KUrl &destUrl) KSharedPtr mimeType = KMimeType::findByPath(srcUrl.prettyUrl()); QString typeText = KMimeType::extractKnownExtension(srcUrl.fileName()); - typeText += " (" + mimeType->name() + ")"; + typeText += " (" + mimeType->name() + ')'; int answer = KMessageBox::questionYesNoCancel(NULL, i18n("Download '%1'?\n""Type: %2", srcUrl.prettyUrl(), typeText), diff --git a/src/findbar.cpp b/src/findbar.cpp index 11d890c1..fd15546c 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -28,10 +28,15 @@ #include #include #include +#include // Qt Includes -#include - +#include +#include +#include +#include +#include +#include FindBar::FindBar(KXmlGuiWindow *mainwindow) : QWidget(mainwindow) diff --git a/src/findbar.h b/src/findbar.h index 15a82e1e..3fa148e1 100644 --- a/src/findbar.h +++ b/src/findbar.h @@ -22,14 +22,20 @@ #ifndef FINDBAR_H #define FINDBAR_H + // KDE Includes #include #include -#include // Qt Includes -#include -#include +#include +#include +#include + +// Forward Declarations +class KXmlGuiWindow; +class QKeyEvent; +class QString; class FindBar : public QWidget diff --git a/src/history.cpp b/src/history.cpp index afcb477a..544b1f90 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -36,9 +36,17 @@ #include // Qt Includes -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include diff --git a/src/history.h b/src/history.h index ecae00c3..b2af0891 100644 --- a/src/history.h +++ b/src/history.h @@ -48,8 +48,10 @@ class HistoryItem { public: HistoryItem() {} - HistoryItem(const QString &u, - const QDateTime &d = QDateTime(), const QString &t = QString()) + explicit HistoryItem(const QString &u, + const QDateTime &d = QDateTime(), + const QString &t = QString() + ) : title(t), url(u), dateTime(d) {} inline bool operator==(const HistoryItem &other) const @@ -159,7 +161,7 @@ public: UrlStringRole = Qt::UserRole + 4 }; - HistoryModel(HistoryManager *history, QObject *parent = 0); + explicit HistoryModel(HistoryManager *history, QObject *parent = 0); QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; @@ -185,7 +187,7 @@ class HistoryFilterModel : public QAbstractProxyModel Q_OBJECT public: - HistoryFilterModel(QAbstractItemModel *sourceModel, QObject *parent = 0); + explicit HistoryFilterModel(QAbstractItemModel *sourceModel, QObject *parent = 0); inline bool historyContains(const QString &url) const { @@ -236,7 +238,7 @@ class HistoryMenuModel : public QAbstractProxyModel Q_OBJECT public: - HistoryMenuModel(HistoryTreeModel *sourceModel, QObject *parent = 0); + explicit HistoryMenuModel(HistoryTreeModel *sourceModel, QObject *parent = 0); int columnCount(const QModelIndex &parent) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; QModelIndex mapFromSource(const QModelIndex & sourceIndex) const; @@ -328,7 +330,7 @@ class HistoryTreeModel : public QAbstractProxyModel Q_OBJECT public: - HistoryTreeModel(QAbstractItemModel *sourceModel, QObject *parent = 0); + explicit HistoryTreeModel(QAbstractItemModel *sourceModel, QObject *parent = 0); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; int columnCount(const QModelIndex &parent) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; diff --git a/src/mainview.cpp b/src/mainview.cpp index d4edeb19..5432fa51 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -213,7 +213,7 @@ void MainView::clear() // clear the line edit history for (int i = 0; i < m_urlBars->count(); ++i) { - /// TODO What exacly do we need to clear here? + /// TODO What exactly do we need to clear here? urlBar(i)->clearHistory(); urlBar(i)->clear(); } @@ -713,4 +713,4 @@ void MainView::mouseDoubleClickEvent(QMouseEvent *event) return; } KTabWidget::mouseDoubleClickEvent(event); -} \ No newline at end of file +} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 63de9853..7af04da0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -572,7 +572,7 @@ void MainWindow::slotPrivateBrowsing(bool enable) " webpages are not added to the history," " new cookies are not stored, current cookies cannot be accessed," \ " site icons will not be stored, session will not be saved, " \ - " and searches are not addded to the pop-up menu in the Google search box." \ + " and searches are not added to the pop-up menu in the Google search box." \ " Until you close the window, you can still click the Back and Forward buttons" \ " to return to the webpages you have opened."); @@ -591,7 +591,7 @@ void MainWindow::slotPrivateBrowsing(bool enable) settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false); MainWindow* win = Application::instance()->mainWindow(); - win->m_lastSearch = QString::null; + win->m_lastSearch.clear(); win->mainView()->clear(); } } diff --git a/src/searchbar.cpp b/src/searchbar.cpp index fad35748..685a8ec5 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -30,10 +30,12 @@ #include // Qt Includes -#include -#include -#include - +#include +#include +#include +#include +#include +#include SearchBar::SearchBar(QWidget *parent) : KLineEdit(parent) diff --git a/src/settings.cpp b/src/settings.cpp index 1e42413f..990db365 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -51,8 +51,7 @@ #include // Qt Includes -#include -#include +#include class Private diff --git a/src/webview.cpp b/src/webview.cpp index ae867d42..55ed4003 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -444,7 +444,7 @@ void WebView::loadFinished() { if (m_progress != 100) { - kWarning() << "Recieved finished signal while progress is still:" << progress() + kWarning() << "Received finished signal while progress is still:" << progress() << "Url:" << url(); } m_progress = 0; -- cgit v1.2.1