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 /src/networkaccessmanager.cpp | |
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
Diffstat (limited to 'src/networkaccessmanager.cpp')
-rw-r--r-- | src/networkaccessmanager.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
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; } |