1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
--- kdepim/kmail/attachmentlistview.cpp 2005/07/26 18:54:59 438982
+++ kdepim/kmail/attachmentlistview.cpp 2006/04/15 06:51:13 530022
@@ -92,7 +92,7 @@
QBuffer serNumBuffer( serNums );
serNumBuffer.open( IO_ReadOnly );
QDataStream serNumStream( &serNumBuffer );
- unsigned long serNum;
+ Q_UINT32 serNum;
KMFolder *folder = 0;
int idx;
QPtrList<KMMsgBase> messageList;
--- kdepim/kmail/kmedit.cpp 2006/02/20 11:40:20 511574
+++ kdepim/kmail/kmedit.cpp 2006/04/15 06:51:13 530022
@@ -144,7 +144,7 @@
QBuffer serNumBuffer(serNums);
serNumBuffer.open(IO_ReadOnly);
QDataStream serNumStream(&serNumBuffer);
- unsigned long serNum;
+ Q_UINT32 serNum;
KMFolder *folder = 0;
int idx;
QPtrList<KMMsgBase> messageList;
--- kdepim/kmail/kmkernel.cpp 2006/04/09 09:53:18 527760
+++ kdepim/kmail/kmkernel.cpp 2006/04/09 09:53:52 527761
@@ -1463,6 +1463,9 @@
void KMKernel::readConfig()
{
+ //Needed here, since this function is also called when the configuration
+ //changes, and the static variables should be updated then - IOF
+ KMMessage::readConfig();
}
void KMKernel::cleanupImapFolders()
--- kdepim/kmail/kmmsgbase.cpp 2006/01/11 14:34:42 496941
+++ kdepim/kmail/kmmsgbase.cpp 2006/04/15 13:05:11 530119
@@ -870,7 +870,7 @@
char *l;
for ( l = latin.data(); *l; ++l ) {
- if ( ( *l & 0xE0 == 0 ) || ( *l & 0x80 ) )
+ if ( ( ( *l & 0xE0 ) == 0 ) || ( *l & 0x80 ) )
// *l is control character or 8-bit char
break;
}
--- kdepim/kmail/kmmsgdict.cpp 2005/07/26 18:54:59 438982
+++ kdepim/kmail/kmmsgdict.cpp 2006/04/15 13:05:11 530119
@@ -205,7 +205,16 @@
}
KMFolderIndex* folder = static_cast<KMFolderIndex*>( msg->storage() );
- if (folder && index == -1)
+ if ( !folder ) {
+ kdDebug(5006) << "KMMsgDict::insert: Cannot insert the message, "
+ << "null pointer to storage. Requested serial: " << msgSerNum
+ << endl;
+ kdDebug(5006) << " Message info: Subject: " << msg->subject() << ", To: "
+ << msg->toStrip() << ", Date: " << msg->dateStr() << endl;
+ return 0;
+ }
+
+ if (index == -1)
index = folder->find(msg);
// Should not happen, indicates id file corruption
@@ -241,7 +250,16 @@
const KMMsgBase *msg, int index)
{
KMFolderIndex* folder = static_cast<KMFolderIndex*>( msg->storage() );
- if ( folder && index == -1 )
+ if ( !folder ) {
+ kdDebug(5006) << "KMMsgDict::replace: Cannot replace the message serial "
+ << "number, null pointer to storage. Requested serial: " << msgSerNum
+ << endl;
+ kdDebug(5006) << " Message info: Subject: " << msg->subject() << ", To: "
+ << msg->toStrip() << ", Date: " << msg->dateStr() << endl;
+ return;
+ }
+
+ if ( index == -1 )
index = folder->find( msg );
remove( msgSerNum );
--- kdepim/kmail/renamejob.cpp 2005/12/10 04:41:02 487311
+++ kdepim/kmail/renamejob.cpp 2006/04/15 13:05:11 530119
@@ -59,11 +59,13 @@
mNewName( newName ), mNewFolder( 0 )
{
mStorageTempOpened = 0;
- mOldName = storage->name();
- if ( storage->folderType() == KMFolderTypeImap ) {
- mOldImapPath = static_cast<KMFolderImap*>(storage)->imapPath();
- } else if ( storage->folderType() == KMFolderTypeCachedImap ) {
- mOldImapPath = static_cast<KMFolderCachedImap*>(storage)->imapPath();
+ if ( storage ) {
+ mOldName = storage->name();
+ if ( storage->folderType() == KMFolderTypeImap ) {
+ mOldImapPath = static_cast<KMFolderImap*>(storage)->imapPath();
+ } else if ( storage->folderType() == KMFolderTypeCachedImap ) {
+ mOldImapPath = static_cast<KMFolderCachedImap*>(storage)->imapPath();
+ }
}
}
--- kdepim/kmail/configuredialog_p.h 2005/08/19 15:04:44 450950
+++ kdepim/kmail/configuredialog_p.h 2006/04/01 23:19:36 525407
@@ -715,8 +715,7 @@
void slotOutlookCompatibleClicked();
private:
- //virtual void doLoadFromGlobalSettings();
- virtual void doLoadOther();
+ virtual void doLoadFromGlobalSettings();
//FIXME virtual void doResetToDefaultsOther();
private:
--- kdepim/kmail/replyphrases.kcfg 2006/04/09 09:53:18 527760
+++ kdepim/kmail/replyphrases.kcfg 2006/04/09 09:53:52 527761
@@ -20,17 +20,14 @@
<entry name="PhraseForward" type="String" key="phrase-forward">
<label></label>
<whatsthis></whatsthis>
- <default>Forwarded Message</default>
</entry>
<entry name="PhraseReplySender" type="String" key="phrase-reply">
<label></label>
<whatsthis></whatsthis>
- <default>On %D, you wrote:</default>
</entry>
<entry name="PhraseReplyAll" type="String" key="phrase-reply-all">
<label></label>
<whatsthis></whatsthis>
- <default>On %D, %F wrote:</default>
</entry>
</group>
--- kdepim/kmail/kmfolder.cpp 2005/12/06 21:29:44 486141
+++ kdepim/kmail/kmfolder.cpp 2006/04/18 20:41:15 531267
@@ -84,12 +84,6 @@
}
}
- // trigger from here, since it needs a fully constructed FolderStorage
- if ( mExportsSernums )
- mStorage->registerWithMessageDict();
- if ( !mHasIndex )
- mStorage->setAutoCreateIndex( false );
-
if ( aParent ) {
connect( mStorage, SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ),
aParent->manager(), SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ) );
@@ -133,8 +127,16 @@
this, SLOT( slotContentsTypeChanged( KMail::FolderContentsType ) ) );
//FIXME: Centralize all the readConfig calls somehow - Zack
+ // Meanwhile, readConfig must be done before registerWithMessageDict, since
+ // that one can call writeConfig in some circumstances - David
mStorage->readConfig();
+ // trigger from here, since it needs a fully constructed FolderStorage
+ if ( mExportsSernums )
+ mStorage->registerWithMessageDict();
+ if ( !mHasIndex )
+ mStorage->setAutoCreateIndex( false );
+
if ( mId == 0 && aParent )
mId = aParent->manager()->createId();
}
--- kdepim/kmail/configuredialog.cpp 2006/01/21 12:34:03 500799
+++ kdepim/kmail/configuredialog.cpp 2006/05/03 08:46:45 536841
@@ -2276,7 +2276,7 @@
const QString encoding = KGlobal::charsets()->encodingForName(*it);
if ( encoding == "iso-8859-15" )
indexOfLatin9 = i;
- if( false && encoding == currentEncoding )
+ if( encoding == currentEncoding )
{
mCharsetCombo->setCurrentItem( i );
found = true;
@@ -3348,15 +3348,12 @@
mAttachWordsListEditor, SLOT(setEnabled(bool)) );
}
-void ComposerPage::AttachmentsTab::doLoadOther() {
- KConfigGroup composer( KMKernel::config(), "Composer" );
-
+void ComposerPage::AttachmentsTab::doLoadFromGlobalSettings() {
mOutlookCompatibleCheck->setChecked(
- composer.readBoolEntry( "outlook-compatible-attachments", false ) );
+ GlobalSettings::self()->outlookCompatibleAttachments() );
mMissingAttachmentDetectionCheck->setChecked(
- composer.readBoolEntry( "showForgottenAttachmentWarning", true ) );
- QStringList attachWordsList =
- composer.readListEntry( "attachment-keywords" );
+ GlobalSettings::self()->showForgottenAttachmentWarning() );
+ QStringList attachWordsList = GlobalSettings::self()->attachmentKeywords();
if ( attachWordsList.isEmpty() ) {
// default value
attachWordsList << QString::fromLatin1("attachment")
@@ -3371,13 +3368,12 @@
}
void ComposerPage::AttachmentsTab::save() {
- KConfigGroup composer( KMKernel::config(), "Composer" );
- composer.writeEntry( "outlook-compatible-attachments",
- mOutlookCompatibleCheck->isChecked() );
- composer.writeEntry( "showForgottenAttachmentWarning",
- mMissingAttachmentDetectionCheck->isChecked() );
- composer.writeEntry( "attachment-keywords",
- mAttachWordsListEditor->stringList() );
+ GlobalSettings::self()->setOutlookCompatibleAttachments(
+ mOutlookCompatibleCheck->isChecked() );
+ GlobalSettings::self()->setShowForgottenAttachmentWarning(
+ mMissingAttachmentDetectionCheck->isChecked() );
+ GlobalSettings::self()->setAttachmentKeywords(
+ mAttachWordsListEditor->stringList() );
}
void ComposerPageAttachmentsTab::slotOutlookCompatibleClicked()
--- kdepim/kmail/antispamwizard.cpp 2005/12/30 00:15:02 492457
+++ kdepim/kmail/antispamwizard.cpp 2006/05/06 09:14:35 537923
@@ -502,7 +502,7 @@
while ( account ) {
if ( account->type() == "pop" || account->type().contains( "imap" ) ) {
const NetworkAccount * n = dynamic_cast<const NetworkAccount*>( account );
- if ( n->host().lower().contains( pattern.lower() ) ) {
+ if ( n && n->host().lower().contains( pattern.lower() ) ) {
mInfoPage->addAvailableTool( (*it).getVisibleName() );
found = true;
}
--- kdepim/kmail/kmmessage.cpp 2006/03/16 12:47:35 519171
+++ kdepim/kmail/kmmessage.cpp 2006/05/06 09:14:35 537923
@@ -2667,7 +2667,7 @@
parts.removeLast();
}
- if (part->Body().Message() &&
+ if (part && part->Body().Message() &&
part->Body().Message()->Body().FirstBodyPart())
{
part = part->Body().Message()->Body().FirstBodyPart();
--- kdepim/kmail/kmreaderwin.cpp 2006/02/20 20:15:05 511744
+++ kdepim/kmail/kmreaderwin.cpp 2006/05/06 09:14:35 537923
@@ -371,7 +371,7 @@
if( dataNode->parentNode() && !weAreReplacingTheRootNode ) {
kdDebug(5006) << "dataNode is NOT replacing the root node: Store the headers." << endl;
resultingData += headers->AsString().c_str();
- } else if( weAreReplacingTheRootNode && part->hasHeaders() ){
+ } else if( weAreReplacingTheRootNode && part && part->hasHeaders() ){
kdDebug(5006) << "dataNode replace the root node: Do NOT store the headers but change" << endl;
kdDebug(5006) << " the Message's headers accordingly." << endl;
kdDebug(5006) << " old Content-Type = " << rootHeaders.ContentType().AsString().c_str() << endl;
--- kdepim/kmail/kmsender.cpp 2006/03/20 17:51:08 520754
+++ kdepim/kmail/kmsender.cpp 2006/05/06 09:14:35 537923
@@ -373,12 +373,14 @@
KMessageBox::information(0, i18n("Critical error: "
"Unable to process sent mail (out of space?)"
"Moving failing message to \"sent-mail\" folder."));
- sentFolder->moveMsg(mCurrentMsg);
- sentFolder->close();
+ if ( sentFolder ) {
+ sentFolder->moveMsg(mCurrentMsg);
+ sentFolder->close();
+ }
cleanup();
return;
case 1:
- if (sentFolder->moveMsg(mCurrentMsg) != 0)
+ if ( sentFolder && sentFolder->moveMsg(mCurrentMsg) != 0 )
{
KMessageBox::error(0, i18n("Moving the sent message \"%1\" from the "
"\"outbox\" to the \"sent-mail\" folder failed.\n"
--- kdepim/kmail/objecttreeparser.cpp 2005/12/16 16:18:58 488973
+++ kdepim/kmail/objecttreeparser.cpp 2006/05/06 09:14:35 537923
@@ -92,6 +92,7 @@
#include <qbuffer.h>
#include <qpixmap.h>
#include <qpainter.h>
+#include <qregexp.h>
// other headers
#include <memory>
@@ -277,7 +278,7 @@
<< node->typeString() << '/' << node->subTypeString()
<< ')' << endl;
- if ( !bpf->process( this, node, processResult ) )
+ if ( bpf && !bpf->process( this, node, processResult ) )
defaultHandling( node, processResult );
}
node->setProcessed( true, false );
@@ -765,30 +766,21 @@
//static
bool ObjectTreeParser::containsExternalReferences( const QCString & str )
{
- int httpPos = str.find( "\"http:", 0, true );
- int httpsPos = str.find( "\"https:", 0, true );
+ QRegExp httpRegExp("(\\\"|\\\'|url\\s*\\(\\s*)http[s]?:");
+ int httpPos = str.find( httpRegExp, 0 );
- while ( httpPos >= 0 || httpsPos >= 0 ) {
- // pos = index of next occurrence of "http: or "https: whichever comes first
- int pos = ( httpPos < httpsPos )
- ? ( ( httpPos >= 0 ) ? httpPos : httpsPos )
- : ( ( httpsPos >= 0 ) ? httpsPos : httpPos );
+ while ( httpPos >= 0 ) {
// look backwards for "href"
- if ( pos > 5 ) {
- int hrefPos = str.findRev( "href", pos - 5, true );
+ if ( httpPos > 5 ) {
+ int hrefPos = str.findRev( "href", httpPos - 5, true );
// if no 'href' is found or the distance between 'href' and '"http[s]:'
// is larger than 7 (7 is the distance in 'href = "http[s]:') then
// we assume that we have found an external reference
- if ( ( hrefPos == -1 ) || ( pos - hrefPos > 7 ) )
+ if ( ( hrefPos == -1 ) || ( httpPos - hrefPos > 7 ) )
return true;
}
// find next occurrence of "http: or "https:
- if ( pos == httpPos ) {
- httpPos = str.find( "\"http:", httpPos + 6, true );
- }
- else {
- httpsPos = str.find( "\"https:", httpsPos + 7, true );
- }
+ httpPos = str.find( httpRegExp, httpPos + 6 );
}
return false;
}
|