diff options
author | adjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-05-12 17:14:09 +0000 |
---|---|---|
committer | adjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-05-12 17:14:09 +0000 |
commit | e3ded2f37091e1fc8c8f988fb98c21020fee2261 (patch) | |
tree | 64ec1c62ea19b679de294844f23a052001f9765f | |
parent | updated CMakeLists.txt (diff) | |
download | rekonq-e3ded2f37091e1fc8c8f988fb98c21020fee2261.tar.xz |
Last krazy issues fixed
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@967142 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | src/bookmarks.cpp | 1 | ||||
-rw-r--r-- | src/history.cpp | 8 | ||||
-rw-r--r-- | src/history.h | 2 | ||||
-rw-r--r-- | src/mainview.h | 2 | ||||
-rw-r--r-- | src/mainwindow.cpp | 11 | ||||
-rw-r--r-- | src/networkaccessmanager.cpp | 35 | ||||
-rw-r--r-- | src/settings.cpp | 7 | ||||
-rw-r--r-- | src/webview.cpp | 2 |
8 files changed, 40 insertions, 28 deletions
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index c7f4da98..eb500985 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -275,4 +275,3 @@ KAction* BookmarkProvider::bookmarkToolBarAction() bookmarkToolBarAction->setShortcutConfigurable(false); return bookmarkToolBarAction; } - diff --git a/src/history.cpp b/src/history.cpp index 2bab72d8..fac13b48 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -124,7 +124,7 @@ void HistoryManager::setHistory(const QList<HistoryItem> &history, bool loadedAn } else { - m_lastSavedUrl = QString(); + m_lastSavedUrl.clear(); m_saveTimer->changeOccurred(); } emit historyReset(); @@ -174,7 +174,7 @@ void HistoryManager::checkForExpired() break; HistoryItem item = m_history.takeLast(); // remove from saved file also - m_lastSavedUrl = QString(); + m_lastSavedUrl.clear(); emit entryRemoved(item); } @@ -254,7 +254,7 @@ void HistoryManager::setHistoryLimit(int limit) void HistoryManager::clear() { m_history.clear(); - m_lastSavedUrl = QString(); + m_lastSavedUrl.clear(); m_saveTimer->changeOccurred(); m_saveTimer->saveIfNeccessary(); historyReset(); @@ -341,7 +341,7 @@ void HistoryManager::load() // If we had to sort re-write the whole history sorted if (needToSort) { - m_lastSavedUrl = QString(); + m_lastSavedUrl.clear(); m_saveTimer->changeOccurred(); } } diff --git a/src/history.h b/src/history.h index 1bc1aa91..7b3cbec9 100644 --- a/src/history.h +++ b/src/history.h @@ -397,7 +397,7 @@ signals: void openUrl(const KUrl &url); public: - HistoryDialog(QWidget *parent = 0, HistoryManager *history = 0); + explicit HistoryDialog(QWidget *parent = 0, HistoryManager *history = 0); private slots: void customContextMenuRequested(const QPoint &pos); diff --git a/src/mainview.h b/src/mainview.h index d3d4948d..16d450d3 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -152,7 +152,7 @@ private slots: void windowCloseRequested(); /** - * This functions move tab informations "from index to index" + * This functions move tab info "from index to index" * * @param fromIndex the index from which we move * diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5ffaa208..adc6fc87 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -68,6 +68,7 @@ #include <QtCore/QRect> #include <QtCore/QSize> #include <QtCore/QList> +#include <QtCore/QPointer> #include <QtGui/QWidget> #include <QtGui/QVBoxLayout> @@ -497,12 +498,13 @@ void MainWindow::slotPreferences() return; // we didn't find an instance of this dialog, so lets create it - SettingsDialog *s = new SettingsDialog(this); + QPointer<SettingsDialog> s = new SettingsDialog(this); // keep us informed when the user changes settings connect(s, SIGNAL(settingsChanged(const QString&)), this, SLOT(slotUpdateBrowser())); s->exec(); + delete s; } @@ -571,9 +573,13 @@ void MainWindow::printRequested(QWebFrame *frame) { QPrinter printer; - QPrintDialog *dialog = KdePrint::createPrintDialog(&printer, this); + QPointer<QPrintDialog> dialog = KdePrint::createPrintDialog(&printer, this); if (dialog->exec() != QDialog::Accepted) + { + delete dialog; return; + } + delete dialog; frame->print(&printer); } @@ -946,4 +952,3 @@ QAction *MainWindow::actionByName(const QString name) return new QAction(this); // return empty object instead of NULL pointer } - diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index deae42dd..0de1dde0 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -39,13 +39,16 @@ #include <KStandardDirs> // Qt Includes -#include <QDialog> -#include <QStyle> -#include <QTextDocument> -#include <QAuthenticator> -#include <QNetworkProxy> -#include <QNetworkReply> -#include <QSslError> +#include <QtCore/QPointer> + +#include <QtGui/QDialog> +#include <QtGui/QStyle> +#include <QtGui/QTextDocument> + +#include <QtNetwork/QAuthenticator> +#include <QtNetwork/QNetworkProxy> +#include <QtNetwork/QNetworkReply> +#include <QtNetwork/QSslError> NetworkAccessManager::NetworkAccessManager(QObject *parent) @@ -97,14 +100,14 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent { MainWindow *mainWindow = Application::instance()->mainWindow(); - KDialog dialog(mainWindow, Qt::Sheet); - dialog.setButtons(KDialog::Ok | KDialog::Cancel); + QPointer<KDialog> dialog = new KDialog(mainWindow, Qt::Sheet); + dialog->setButtons(KDialog::Ok | KDialog::Cancel); Ui::passwordWidget passwordWidget; QWidget widget; passwordWidget.setupUi(&widget); - dialog.setMainWidget(&widget); + dialog->setMainWidget(&widget); passwordWidget.iconLabel->setText(QString()); passwordWidget.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32)); @@ -115,11 +118,12 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent passwordWidget.introLabel->setText(introMessage); passwordWidget.introLabel->setWordWrap(true); - if (dialog.exec() == QDialog::Accepted) + if (dialog->exec() == QDialog::Accepted) { auth->setUser(passwordWidget.userNameLineEdit->text()); auth->setPassword(passwordWidget.passwordLineEdit->text()); } + delete dialog; } @@ -127,14 +131,14 @@ void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &prox { MainWindow *mainWindow = Application::instance()->mainWindow(); - KDialog dialog(mainWindow, Qt::Sheet); - dialog.setButtons(KDialog::Ok | KDialog::Cancel); + QPointer<KDialog> dialog = new KDialog(mainWindow, Qt::Sheet); + dialog->setButtons(KDialog::Ok | KDialog::Cancel); Ui::proxyWidget proxyWdg; QWidget widget; proxyWdg.setupUi(&widget); - dialog.setMainWidget(&widget); + dialog->setMainWidget(&widget); proxyWdg.iconLabel->setText(QString()); proxyWdg.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32)); @@ -143,11 +147,12 @@ void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &prox proxyWdg.introLabel->setText(introMessage); proxyWdg.introLabel->setWordWrap(true); - if (dialog.exec() == QDialog::Accepted) + if (dialog->exec() == QDialog::Accepted) { auth->setUser(proxyWdg.userNameLineEdit->text()); auth->setPassword(proxyWdg.passwordLineEdit->text()); } + delete dialog; } diff --git a/src/settings.cpp b/src/settings.cpp index bf1f2e38..d3da6dbc 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -51,6 +51,7 @@ #include <KUrl> // Qt Includes +#include <QtCore/QPointer> #include <QtGui/QWidget> @@ -190,15 +191,17 @@ void SettingsDialog::saveSettings() void SettingsDialog::showCookies() { - CookiesDialog *dialog = new CookiesDialog(Application::cookieJar(), this); + QPointer<CookiesDialog> dialog = new CookiesDialog(Application::cookieJar(), this); dialog->exec(); + delete dialog; } void SettingsDialog::showExceptions() { - CookiesExceptionsDialog *dialog = new CookiesExceptionsDialog(Application::cookieJar(), this); + QPointer<CookiesExceptionsDialog> dialog = new CookiesExceptionsDialog(Application::cookieJar(), this); dialog->exec(); + delete dialog; } diff --git a/src/webview.cpp b/src/webview.cpp index 4ae3986f..055f2f7d 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -143,7 +143,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r // should be nothing.. default: - kDebug() << "Default NON existant case.."; + kDebug() << "Default NON extant case.."; break; } |