svn path=/branches/kdepim/enterprise/kdepim/; revision=1032288
wilder-work
Thomas McGuire 17 years ago
parent 2bfce0cdd1
commit 71496d36e7
  1. 9
      distributionlistdialog.cpp
  2. 81
      encodingdetector.cpp
  3. 3
      headerstyle.cpp
  4. 6
      keyresolver.cpp
  5. 2
      khtmlparthtmlwriter.cpp
  6. 2
      kmcomposewin.cpp
  7. 4
      kmfolderdia.cpp
  8. 3
      kmfoldermaildir.cpp
  9. 2
      kmfoldermbox.cpp
  10. 1
      kmfoldersearch.cpp
  11. 4
      kmgroupware.cpp
  12. 13
      kmheaders.cpp
  13. 32
      kmmessage.cpp
  14. 2
      kmsearchpattern.cpp

@ -244,11 +244,14 @@ void DistributionListDialog::slotUser1()
// FIXME: Ask the user which resource to save to instead of the default
bool saveError = true;
KABC::Ticket *ticket = ab->requestSaveTicket( 0 /*default resource */ );
if ( ticket )
if ( ab->save( ticket ) )
if ( ticket ) {
if ( ab->save( ticket ) ) {
saveError = false;
else
}
else {
ab->releaseSaveTicket( ticket );
}
}
if ( saveError )
kdWarning(5006) << k_funcinfo << " Couldn't save new addresses in the distribution list just created to the address book" << endl;

@ -729,87 +729,6 @@ static QCString automaticDetectionForWesternEuropean( const unsigned char* ptr,
return "";
}
// Other browsers allow comments in the head section, so we need to also.
// It's important not to look for tags inside the comments.
static void skipComment(const char *&ptr, const char *pEnd)
{
const char *p = ptr;
// Allow <!-->; other browsers do.
if (*p=='>')
{
p++;
}
else
{
while (p!=pEnd)
{
if (*p=='-')
{
// This is the real end of comment, "-->".
if (p[1]=='-' && p[2]=='>')
{
p += 3;
break;
}
// This is the incorrect end of comment that other browsers allow, "--!>".
if (p[1] == '-' && p[2] == '!' && p[3] == '>')
{
p += 4;
break;
}
}
p++;
}
}
ptr=p;
}
// Returns the position of the encoding string.
static int findXMLEncoding(const QCString &str, int &encodingLength)
{
int len = str.length();
int pos = str.find("encoding");
if (pos == -1)
return -1;
pos += 8;
// Skip spaces and stray control characters.
while (pos<len && str[pos]<=' ')
++pos;
//Bail out if nothing after
// Skip equals sign.
if (pos>=len || str[pos] != '=')
return -1;
++pos;
// Skip spaces and stray control characters.
while (pos<len && str[pos]<=' ')
++pos;
//Bail out if nothing after
if (pos >= len)
return -1;
// Skip quotation mark.
char quoteMark = str[pos];
if (quoteMark != '"' && quoteMark != '\'')
return -1;
++pos;
// Find the trailing quotation mark.
int end=pos;
while (end<len && str[end]!=quoteMark)
++end;
if (end>=len)
return -1;
encodingLength = end-pos;
return pos;
}
bool EncodingDetector::errorsIfUtf8 (const char* data, int length)
{
if (d->m_codec->mibEnum()!=MibUtf8)

@ -118,6 +118,7 @@ namespace KMail {
QString BriefHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
const QString & vCardName, bool printing, bool topLevel ) const {
Q_UNUSED( topLevel );
if ( !message ) return QString::null;
if ( !strategy )
strategy = HeaderStrategy::brief();
@ -216,6 +217,7 @@ namespace KMail {
QString PlainHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
const QString & vCardName, bool printing, bool topLevel ) const {
Q_UNUSED( topLevel );
if ( !message ) return QString::null;
if ( !strategy )
strategy = HeaderStrategy::rich();
@ -416,6 +418,7 @@ namespace KMail {
QString FancyHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
const QString & vCardName, bool printing, bool topLevel ) const {
Q_UNUSED( topLevel );
if ( !message ) return QString::null;
if ( !strategy )
strategy = HeaderStrategy::rich();

@ -1056,9 +1056,10 @@ Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool& signingRequested, bool& en
result = resolveEncryptionKeys( signingRequested );
if ( result != Kpgp::Ok )
return result;
if ( signingRequested )
if ( encryptionRequested )
if ( signingRequested ) {
if ( encryptionRequested ) {
result = resolveSigningKeysForEncryption();
}
else {
result = resolveSigningKeysForSigningOnly();
if ( result == Kpgp::Failure ) {
@ -1066,6 +1067,7 @@ Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool& signingRequested, bool& en
return Kpgp::Ok;
}
}
}
return result;
}

@ -49,7 +49,7 @@ namespace KMail {
KHtmlPartHtmlWriter::KHtmlPartHtmlWriter( KHTMLPart * part,
QObject * parent, const char * name )
: QObject( parent, name ), HtmlWriter(),
mHtmlPart( part ), mState( Ended ), mHtmlTimer( 0, "mHtmlTimer" )
mHtmlPart( part ), mHtmlTimer( 0, "mHtmlTimer" ), mState( Ended )
{
assert( part );
connect( &mHtmlTimer, SIGNAL(timeout()), SLOT(slotWriteNextHtmlChunk()) );

@ -4384,7 +4384,7 @@ void KMComposeWin::slotSendNow() {
//----------------------------------------------------------------------------
bool KMComposeWin::checkRecipientNumber() const
{
int thresHold = GlobalSettings::self()->recipientThreshold();
uint thresHold = GlobalSettings::self()->recipientThreshold();
if ( mCheckForRecipients &&
GlobalSettings::self()->tooManyRecipients() &&
mRecipientsEditor->recipients().count() > thresHold ) {

@ -663,11 +663,11 @@ bool FolderDiaGeneralTab::save()
folder->setIconPaths( "", "" );
}
}
if ( folder->useCustomIcons() &&
if ( folder->useCustomIcons() && (
(( mNormalIconButton->icon() != folder->normalIconPath() ) &&
( !mNormalIconButton->icon().isEmpty())) ||
(( mUnreadIconButton->icon() != folder->unreadIconPath() ) &&
( !mUnreadIconButton->icon().isEmpty())) ) {
( !mUnreadIconButton->icon().isEmpty())) ) ) {
folder->setIconPaths( mNormalIconButton->icon(), mUnreadIconButton->icon() );
}

@ -224,6 +224,7 @@ int KMFolderMaildir::create()
//-----------------------------------------------------------------------------
void KMFolderMaildir::reallyDoClose(const char* owner)
{
Q_UNUSED( owner );
if (mAutoCreateIndex)
{
updateIndex();
@ -743,7 +744,7 @@ void KMFolderMaildir::readFileHeaderIntern(const QString& dir, const QString& fi
}
// Is this a long header line?
if (inHeader && line[0] == '\t' || line[0] == ' ')
if (inHeader && ( line[0] == '\t' || line[0] == ' ' ) )
{
int i = 0;
while (line[i] == '\t' || line[i] == ' ')

@ -94,6 +94,7 @@ KMFolderMbox::~KMFolderMbox()
//-----------------------------------------------------------------------------
int KMFolderMbox::open(const char *owner)
{
Q_UNUSED( owner );
int rc = 0;
mOpenCount++;
@ -258,6 +259,7 @@ int KMFolderMbox::create()
//-----------------------------------------------------------------------------
void KMFolderMbox::reallyDoClose(const char* owner)
{
Q_UNUSED( owner );
if (mAutoCreateIndex)
{
if (KMFolderIndex::IndexOk != indexStatus()) {

@ -547,6 +547,7 @@ void KMFolderSearch::sync()
void KMFolderSearch::reallyDoClose(const char* owner)
{
Q_UNUSED( owner );
if (mAutoCreateIndex) {
if (mSearch)
mSearch->write(location());

@ -55,8 +55,8 @@ bool vPartFoundAndDecoded( KMMessage* msg, QString& s )
s = QString::fromUtf8( msg->bodyDecoded() );
return true;
} else if( DwMime::kTypeMultipart == msg->type() &&
(DwMime::kSubtypeMixed == msg->subtype() ) ||
(DwMime::kSubtypeAlternative == msg->subtype() ))
( (DwMime::kSubtypeMixed == msg->subtype() ) ||
(DwMime::kSubtypeAlternative == msg->subtype() ) ))
{
// kdDebug(5006) << "KMGroupware looking for TNEF data" << endl;
DwBodyPart* dwPart = msg->findDwBodyPart( DwMime::kTypeApplication,

@ -1920,8 +1920,8 @@ void KMHeaders::findUnreadAux( HeaderItem*& item,
if (!msgBase) continue;
if (msgBase->isUnread() || msgBase->isNew())
foundUnreadMessage = true;
if (!onlyNew && (msgBase->isUnread() || msgBase->isNew())
|| onlyNew && msgBase->isNew())
if ( ( !onlyNew && (msgBase->isUnread() || msgBase->isNew()) )
|| ( onlyNew && msgBase->isNew() ) )
lastUnread = newItem;
if (newItem == item) break;
newItem = static_cast<HeaderItem*>(newItem->itemBelow());
@ -1952,11 +1952,14 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept
if (!item)
return -1;
if ( !acceptCurrent )
if (aDirNext)
if ( !acceptCurrent ) {
if (aDirNext) {
item = static_cast<HeaderItem*>(item->itemBelow());
else
}
else {
item = static_cast<HeaderItem*>(item->itemAbove());
}
}
}
pitem = item;

@ -1364,25 +1364,27 @@ static const int numMdnMessageBoxes
static int requestAdviceOnMDN( const char * what ) {
for ( int i = 0 ; i < numMdnMessageBoxes ; ++i )
if ( !qstrcmp( what, mdnMessageBoxes[i].dontAskAgainID ) )
for ( int i = 0 ; i < numMdnMessageBoxes ; ++i ) {
if ( !qstrcmp( what, mdnMessageBoxes[i].dontAskAgainID ) ) {
if ( mdnMessageBoxes[i].canDeny ) {
const KCursorSaver saver( QCursor::ArrowCursor );
int answer = QMessageBox::information( 0,
i18n("Message Disposition Notification Request"),
i18n( mdnMessageBoxes[i].text ),
i18n("&Ignore"), i18n("Send \"&denied\""), i18n("&Send") );
return answer ? answer + 1 : 0 ; // map to "mode" in createMDN
const KCursorSaver saver( QCursor::ArrowCursor );
int answer = QMessageBox::information( 0,
i18n("Message Disposition Notification Request"),
i18n( mdnMessageBoxes[i].text ),
i18n("&Ignore"), i18n("Send \"&denied\""), i18n("&Send") );
return answer ? answer + 1 : 0 ; // map to "mode" in createMDN
} else {
const KCursorSaver saver( QCursor::ArrowCursor );
int answer = QMessageBox::information( 0,
i18n("Message Disposition Notification Request"),
i18n( mdnMessageBoxes[i].text ),
i18n("&Ignore"), i18n("&Send") );
return answer ? answer + 2 : 0 ; // map to "mode" in createMDN
const KCursorSaver saver( QCursor::ArrowCursor );
int answer = QMessageBox::information( 0,
i18n("Message Disposition Notification Request"),
i18n( mdnMessageBoxes[i].text ),
i18n("&Ignore"), i18n("&Send") );
return answer ? answer + 2 : 0 ; // map to "mode" in createMDN
}
}
}
kdWarning(5006) << "didn't find data for message box \""
<< what << "\"" << endl;
<< what << "\"" << endl;
return 0;
}

@ -280,7 +280,7 @@ bool KMSearchRuleString::matches( const DwString & aStr, KMMessage & msg,
start += headerLen;
size_t stop = aStr.find( '\n', start );
char ch = '\0';
while ( stop != DwString::npos && ( ch = aStr.at( stop + 1 ) ) == ' ' || ch == '\t' )
while ( stop != DwString::npos && ( ( ch = aStr.at( stop + 1 ) ) == ' ' || ch == '\t' ) )
stop = aStr.find( '\n', stop + 1 );
const int len = stop == DwString::npos ? aStr.length() - start : stop - start ;
const QCString codedValue( aStr.data() + start, len + 1 );

Loading…
Cancel
Save