From d4b702756e673463c9fc008bc6e5931aac6a9011 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 16 Dec 2009 01:50:36 +0000 Subject: * gcc4.4 compilation fixes * kmail crash issues resolved * automake updates git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1062791 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/Makefile.am | 1 + kmail/accountmanager.cpp | 29 +++++++++++++++++++++++++++++ kmail/avscripts/kmail_clamav.sh | 2 +- kmail/configuredialog.cpp | 10 ++++++++++ kmail/editorwatcher.cpp | 18 +----------------- kmail/kmail-3.5-filter-icons.pl | 22 ++++++++++++++++++++++ kmail/kmail.upd | 4 ++++ kmail/kmstartup.cpp | 1 + 8 files changed, 69 insertions(+), 18 deletions(-) create mode 100644 kmail/kmail-3.5-filter-icons.pl (limited to 'kmail') diff --git a/kmail/Makefile.am b/kmail/Makefile.am index ea566c45..5938c3df 100644 --- a/kmail/Makefile.am +++ b/kmail/Makefile.am @@ -209,6 +209,7 @@ update_SCRIPTS = upgrade-transport.pl kmail-pgpidentity.pl \ kmail-3.3b1-misc.pl \ kmail-3.4-misc.pl \ kmail-3.4.1-update-status-filters.pl \ + kmail-3.5-filter-icons.pl \ kmail-3.5-trigger-flag-migration.pl confdir = $(kde_confdir) diff --git a/kmail/accountmanager.cpp b/kmail/accountmanager.cpp index c27432ae..54a1b416 100644 --- a/kmail/accountmanager.cpp +++ b/kmail/accountmanager.cpp @@ -18,6 +18,7 @@ #include "kmfiltermgr.h" #include "globalsettings.h" +#include #include #include #include @@ -190,6 +191,34 @@ void AccountManager::processNextCheck( bool _newMail ) return; } + if ( curAccount->type() == "imap" || curAccount->type() == "cachedimap" || curAccount->type() == "pop" ) + { + // Check with the network status daemon whether the network is available + const int NetWorkStatusUnknown = 1; + const int NetWorkStatusOnline = 8; + QCString replyType; + QByteArray params; + QByteArray reply; + + QDataStream stream( params, IO_WriteOnly ); + stream << static_cast( curAccount )->host(); + + if ( kapp->dcopClient()->call( "kded", "networkstatus", "status(QString)", + params, replyType, reply ) && ( replyType == "int" ) ) + { + int result; + QDataStream stream2( reply, IO_ReadOnly ); + stream2 >> result; + kdDebug() << k_funcinfo << "networkstatus status = " << result << endl; + // if it's not unknown (no networks announced by network control apps), and not offline, give up now + if ( ( result != NetWorkStatusUnknown ) && ( result != NetWorkStatusOnline ) ) + { + emit checkedMail( false, mInteractive, mTotalNewInFolder ); + return; + } + } + } + connect( curAccount, SIGNAL( finishedCheck( bool, CheckStatus ) ), this, SLOT( processNextCheck( bool ) ) ); diff --git a/kmail/avscripts/kmail_clamav.sh b/kmail/avscripts/kmail_clamav.sh index b6227b39..f8492621 100755 --- a/kmail/avscripts/kmail_clamav.sh +++ b/kmail/avscripts/kmail_clamav.sh @@ -35,7 +35,7 @@ export TEMPFILE cat > $TEMPFILE # check for a running daemon -if [ "`ps -eo comm|grep clamd`" = "clamd" ]; then +if ps -eo comm | grep -q clamd ; then chmod a+r $TEMPFILE CLAMCOMANDO="clamdscan --stdout --no-summary " else diff --git a/kmail/configuredialog.cpp b/kmail/configuredialog.cpp index 321a374c..032d1f9f 100644 --- a/kmail/configuredialog.cpp +++ b/kmail/configuredialog.cpp @@ -1222,6 +1222,16 @@ void AccountsPage::ReceivingTab::slotAddAccount() { return; } + if ( accountType == "cachedimap" ) + { + KMessageBox::information(this, " WARNING:\n\n It is possible to lose your e-mail with a Disconnected IMAP account if you do not use it correctly. The purposes of Disconnected IMAP are to minimize bandwidth usage, to allow the user to decide when the client communicates with the server, and to keep a local copy of all e-mails.\n\n When using Disconnected IMAP, all changes (such as writing new e-mails, deleting e-mails, and moving e-mails between folders or accounts) are only made on the client until the user synchronizes the client with the server by using the Check Mail command when there is a network connection available.\n\n These are the commands that affect client-server syncronization:\n F5 synchronizes the current folder.\n Ctrl+L (Check Mail) synchronizes all folders in all accounts.\n Refresh Local IMAP Cache discards all local changes in the current folder.\n\n If you make changes that affect more than one folder or account, you should usually use Ctrl+L to make sure all of your changes are committed to the mail server. ", + NULL, "dimap-warning", 0 + + + ); + + } + KMAccount *account = kmkernel->acctMgr()->create( QString::fromLatin1( accountType ) ); if ( !account ) { diff --git a/kmail/editorwatcher.cpp b/kmail/editorwatcher.cpp index 9e1bb150..e9fec660 100644 --- a/kmail/editorwatcher.cpp +++ b/kmail/editorwatcher.cpp @@ -39,27 +39,11 @@ #elif HAVE_INOTIFY #include #include -#include +#include #include #include // Linux kernel headers are documented to not compile #define _S390_BITOPS_H -#include - -static inline int inotify_init (void) -{ - return syscall (__NR_inotify_init); -} - -static inline int inotify_add_watch (int fd, const char *name, __u32 mask) -{ - return syscall (__NR_inotify_add_watch, fd, name, mask); -} - -static inline int inotify_rm_watch (int fd, __u32 wd) -{ - return syscall (__NR_inotify_rm_watch, fd, wd); -} #endif using namespace KMail; diff --git a/kmail/kmail-3.5-filter-icons.pl b/kmail/kmail-3.5-filter-icons.pl new file mode 100644 index 00000000..cc0ff11c --- /dev/null +++ b/kmail/kmail-3.5-filter-icons.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl -w + +use strict; + +# This script updates some configuration keys + +# read the whole config file +my $currentGroup = ""; +my %configFile; +while ( <> ) { + chomp; # eat the trailing '\n' + next if ( /^$/ ); # skip empty lines + next if ( /^\#/ ); # skip comments + if ( /^\[/ ) { # group begin + $currentGroup = $_; + next; + } elsif ( $currentGroup =~ /^\[Filter #[0-9]+\]$/ && /^Icon=/ ) { + my ($key,$value) = split /=/; + print "# DELETE $currentGroup$key\n${currentGroup}\nIcon=mail_spam\n" if $value eq "mark_as_spam"; + print "# DELETE $currentGroup$key\n${currentGroup}\nIcon=mail_ham\n" if $value eq "mark_as_ham"; + } +} diff --git a/kmail/kmail.upd b/kmail/kmail.upd index 698cf87b..150393ba 100644 --- a/kmail/kmail.upd +++ b/kmail/kmail.upd @@ -158,6 +158,10 @@ Key=list-font,list-unread-font Id=3.4.1 File=kmailrc Script=kmail-3.4.1-update-status-filters.pl,perl +# Update icon names for spam/ham filters +Id=3.5-filter-icons +File=kmailrc +Script=kmail-3.5-filter-icons.pl,perl # Remove the stored size so that we get a reasonable default now that we have 2 columns in the folder selection dialog Id=3.5.4 File=kmailrc diff --git a/kmail/kmstartup.cpp b/kmail/kmstartup.cpp index d1967a3e..5daf4ed0 100644 --- a/kmail/kmstartup.cpp +++ b/kmail/kmstartup.cpp @@ -116,6 +116,7 @@ void checkConfigUpdates() { "3.4a", "3.4b", "3.4.1", + "3.5-filter-icons", "3.5.4", "3.5.7-imap-flag-migration" }; -- cgit v1.2.3