[Bug 243605] Connection error dialog pops up too often
Thomas McGuire
mcguire at kde.org
Fri Dec 24 23:02:14 GMT 2010
https://bugs.kde.org/show_bug.cgi?id=243605
Thomas McGuire <mcguire at kde.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Thomas McGuire <mcguire kde org> 2010-12-25 00:02:11 ---
commit 4fcd35e51a0857ef0f4886e9b98e4ceeb7608cb6
branch master
Author: Thomas McGuire <mcguire at kde.org>
Date: Fri Dec 24 23:43:46 2010 +0100
Don't check mail while the error dialog is shown.
With interval check enabled, the user would see 12 error boxes stacked
over each other after one hour otherwise.
I never liked this dialog and am tempted to remove it altogether,
actually.
BUG: 243605
diff --git a/resources/pop3/pop3resource.cpp b/resources/pop3/pop3resource.cpp
index 066c1db..68dad58 100644
--- a/resources/pop3/pop3resource.cpp
+++ b/resources/pop3/pop3resource.cpp
@@ -47,7 +47,8 @@ POP3Resource::POP3Resource( const QString &id )
mAskAgain( false ),
mIntervalTimer( new QTimer( this ) ),
mTestLocalInbox( false ),
- mWallet( 0 )
+ mWallet( 0 ),
+ mErrorDialogShown( false )
{
setNeedsNetwork( true );
Settings::self()->setResourceId( identifier() );
@@ -84,7 +85,7 @@ void POP3Resource::updateIntervalTimer()
void POP3Resource::intervalCheckTriggered()
{
Q_ASSERT( mState == Idle );
- if (isOnline()) {
+ if ( isOnline() && !mErrorDialogShown ) {
kDebug() << "Starting interval mail check.";
startMailCheck();
mIntervalCheckInProgress = true;
@@ -522,6 +523,7 @@ void POP3Resource::loginJobResult( KJob *job )
// FIXME: "The server refused the supplied username and password." is not
correct! The server might
// not even be online, there might be a connection problem etc
+ mErrorDialogShown = true;
int i = KMessageBox::questionYesNoCancelWId( winIdForDialogs(),
i18n( "The server refused the supplied
username and password. "
"Do you want to go to the settings,
have another attempt "
@@ -530,6 +532,7 @@ void POP3Resource::loginJobResult( KJob *job )
i18n( "Could Not Authenticate" ),
KGuiItem( i18n( "Settings" ) ),
KGuiItem( i18nc( "Input username/password
manually and not store them", "Single Input" ) ) );
+ mErrorDialogShown = false;
if ( i == KMessageBox::Yes ) {
configure( winIdForDialogs() );
return;
@@ -995,7 +998,7 @@ void POP3Resource::startMailCheck()
void POP3Resource::retrieveCollections()
{
- if ( mState == Idle ) {
+ if ( mState == Idle && !mErrorDialogShown ) {
startMailCheck();
}
else {
diff --git a/resources/pop3/pop3resource.h b/resources/pop3/pop3resource.h
index 14aba20..b594a28 100644
--- a/resources/pop3/pop3resource.h
+++ b/resources/pop3/pop3resource.h
@@ -143,6 +143,7 @@ class POP3Resource : public Akonadi::ResourceBase,
bool mSavePassword;
bool mTestLocalInbox;
KWallet::Wallet *mWallet;
+ bool mErrorDialogShown;
// Maps IDs on the server to message sizes on the server
QMap<int,int> mIdsToSizeMap;
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Kdepim-bugs
mailing list