From kde-commits Fri Apr 01 06:51:32 2005 From: Mart Kelder Date: Fri, 01 Apr 2005 06:51:32 +0000 To: kde-commits Subject: KDE_3_4_BRANCH: kdepim/korn Message-Id: <20050401065132.CC669490 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111233830830949 CVS commit by mkelder: Backport: this fixes various bugs in the run-command part. * It executes the command only if new mails arrives instead if the number of mails change * It writes the configuration to the right entry point in the config file * It doesn't always override the box settings any more. BUGS:102468 M +10 -5 accountmanager.cpp 1.2.2.1 M +2 -2 kornaccountcfgimpl.cpp 1.1.2.2 M +2 -2 kornboxcfgimpl.cpp 1.3.2.1 M +1 -3 maildrop.cpp 1.17.2.1 --- kdepim/korn/accountmanager.cpp #1.2:1.2.2.1 @@ -215,12 +215,17 @@ void AccountManager::slotChanged( int co Dropinfo *info = _dropInfo->find( mailDrop ).data(); info->newMessages = count > info->msgnr || ( count == info->msgnr && info->newMessages ); - info->msgnr = count; - if( info->msgnr - info->reset < 0 ) - info->reset = 0; + if( count > info->msgnr ) + { if( !mailDrop->soundFile().isEmpty() ) playSound( mailDrop->soundFile() ); if( !mailDrop->newMailCmd().isEmpty() ) runCommand( mailDrop->newMailCmd() ); + } + + info->msgnr = count; + if( info->msgnr - info->reset < 0 ) + info->reset = 0; + setCount( totalMessages(), hasNewMessages() && totalMessages() > 0 ); setTooltip( getTooltip() ); --- kdepim/korn/kornaccountcfgimpl.cpp #1.1.2.1:1.1.2.2 @@ -90,5 +90,5 @@ void KornAccountCfgImpl::readConfig( KCo this->chUseBox->setChecked( _config->readBoolEntry( "boxsettings", true ) ); - this->edRunCommand->setURL( _config->readEntry( "command", "" ) ); + this->edRunCommand->setURL( _config->readEntry( "newcommand", "" ) ); this->edPlaySound->setURL( _config->readEntry( "sound", "" ) ); this->chPassivePopup->setChecked( _config->readBoolEntry( "passivepopup", false ) ); @@ -140,5 +140,5 @@ void KornAccountCfgImpl::writeConfig() _config->writeEntry( "boxsettings", this->chUseBox->isChecked() ); - _config->writeEntry( "command", this->edRunCommand->url() ); + _config->writeEntry( "newcommand", this->edRunCommand->url() ); _config->writeEntry( "sound", this->edPlaySound->url() ); _config->writeEntry( "passivepopup", this->chPassivePopup->isChecked() ); --- kdepim/korn/kornboxcfgimpl.cpp #1.3:1.3.2.1 @@ -137,5 +137,5 @@ void KornBoxCfgImpl::readEventConfig() this->edNewRun->setURL( _config->readEntry( "newcommand", "" ) ); - this->edNewRun->setURL( _config->readEntry( "sound", "" ) ); + this->edPlaySound->setURL( _config->readEntry( "sound", "" ) ); this->chShowPassive->setChecked( _config->readBoolEntry( "passivepopup", false ) ); this->chPassiveDate->setChecked( _config->readBoolEntry( "passivedate", false ) ); @@ -208,5 +208,5 @@ void KornBoxCfgImpl::writeEventConfig( K config->writeEntry( "newcommand", this->edNewRun->url() ); - config->writeEntry( "sound", this->edNewRun->url() ); + config->writeEntry( "sound", this->edPlaySound->url() ); config->writeEntry( "passivepopup", this->chShowPassive->isChecked() ); config->writeEntry( "passivedate", this->chPassiveDate->isChecked() ); --- kdepim/korn/maildrop.cpp #1.17:1.17.2.1 @@ -87,6 +87,4 @@ bool KMailDrop::readConfigGroup(const KC _caption = c.readEntry(fu(CaptionConfigKey)); _clickCmd = c.readPathEntry(fu(ClickConfigKey)); - _nMailCmd = c.readPathEntry(fu(NewMailConfigKey)); - _soundFile = c.readPathEntry(fu(SoundFileConfigKey)); _style = Style(c.readUnsignedNumEntry(fu(DisplayStyleConfigKey), Plain)); _bgColour = c.readColorEntry(fu(BgColourConfigKey), &QApplication::palette().active().background());