Summary: | check what server supports crashes, if no server is specified | ||
---|---|---|---|
Product: | [Applications] kmail | Reporter: | Florian Loitsch <kmail> |
Component: | general | Assignee: | Till Adam <adam> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | kollix |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Florian Loitsch
2004-01-20 21:58:40 UTC
Subject: Re: New: check what server supports crashes, if no server is specified
On Tuesday 20 January 2004 21:58, Florian Loitsch wrote:
> kmail crashes, if i go into the security-settings (when creating a new
> account), and "check what server supports", if i forgot to add the
> hostname. i'm sorry i can't give any more detailed information, as kmail
> doesn't even start currently (due to some other bug) [and please don't take
> this wrong].
Thanks a lot for taking the time to report this, Florian. The culprit is the
code below from kmservertest.cpp
132 void KMServerTest::slotSlaveResult(KIO::Slave *aSlave, int error,
133 const QString &)
134 {
135 if (aSlave != mSlave) return;
136 if (error != KIO::ERR_SLAVE_DIED && mSlave)
137 {
138 KIO::Scheduler::disconnectSlave(mSlave);
139 mSlave = 0;
140 }
141 if (!mSSL) {
142 mSSL = true;
143 if ( error )
144 mList.clear();
145 else
146 mList.append("NORMAL-CONNECTION");
147 startOffSlave();
148 } else {
149 if (!error) mList.append("SSL");
150
151 // if (mList.isEmpty())
152 // mJob->showErrorDialog( 0L );
153
154 mJob = 0;
155
156 emit capabilities(mList);
157 emit capabilities(mList, mAuthNone, mAuthSSL, mAuthTLS);
158 }
159 }
The commented out line 152 causes the crash because mJob is deleted as part of
the disconnectSlave() from 138. Should we get the error string from the job
and display a dialog ourselves? How about something that maybe gives the user
a clue to check if there is a valid server/port entered?
Well, first of all the [Check what the server supports] button should be disabled as long as no server name has been entered. Or alternatively a message box "You didn't enter a server name" should be shown. Since the latter isn't desirable in KDE 3.2 (new string) we should do the first for KDE 3.2. Subject: KDE_3_2_BRANCH: kdepim/kmail CVS commit by tilladam: Don't attempt to check what the server supports if there is no server or no port specified. In HEAD we'll pop up a dialog informing the user to specify them. CCMAIL: 73067@bugs.kde.org M +4 -0 accountdialog.cpp 1.138.2.1 --- kdepim/kmail/accountdialog.cpp #1.138:1.138.2.1 @@ -1238,4 +1238,6 @@ void AccountDialog::slotImapEncryptionCh void AccountDialog::slotCheckPopCapabilities() { + if ( mPop.hostEdit->text().isEmpty() || mPop.portEdit->text().isEmpty() ) + return; delete mServerTest; mServerTest = new KMServerTest("pop3", mPop.hostEdit->text(), @@ -1249,4 +1251,6 @@ void AccountDialog::slotCheckPopCapabili void AccountDialog::slotCheckImapCapabilities() { + if ( mImap.hostEdit->text().isEmpty() || mImap.portEdit->text().isEmpty() ) + return; delete mServerTest; mServerTest = new KMServerTest("imap", mImap.hostEdit->text(), The crash is now avoided, but not fixed. Re-assigning to myself so I remember to fix it properly. *** Bug 72498 has been marked as a duplicate of this bug. *** Subject: kdepim/kmail CVS commit by tilladam: Don't try to show an error dialog on a job that has been deleted by a disconnected slave. Ok'd by Marc. CCMAIL: 73067-done@bugs.kde.org M +0 -3 kmservertest.cpp 1.22 --- kdepim/kmail/kmservertest.cpp #1.21:1.22 @@ -149,7 +149,4 @@ void KMServerTest::slotSlaveResult(KIO:: if (!error) mList.append("SSL"); - if (mList.isEmpty()) - mJob->showErrorDialog( 0L ); - mJob = 0; |