@ -421,7 +421,17 @@ void AntiSpamWizard::accept()
classHamFilterActions - > append ( classHamFilterAction ) ;
}
}
KMSearchPattern * classHamFilterPattern = classHamFilter - > pattern ( ) ;
for ( QList < SpamToolConfig > : : iterator it = mToolList . begin ( ) ;
it ! = mToolList . end ( ) ; + + it ) {
if ( mInfoPage - > isProgramSelected ( ( * it ) . getVisibleName ( ) )
& & ( * it ) . useBayesFilter ( ) & & ! ( * it ) . isDetectionOnly ( ) )
{
KMFilterAction * classHamFilterAction = dict . value ( " filter app " ) - > create ( ) ;
classHamFilterAction - > argsFromString ( ( * it ) . getNoSpamCmd ( ) ) ;
classHamFilterActions - > append ( classHamFilterAction ) ;
}
}
KMSearchPattern * classHamFilterPattern = classHamFilter - > pattern ( ) ;
if ( replaceExistingFilters )
classHamFilterPattern - > setName ( i18n ( " Classify as NOT spam " ) ) ;
else
@ -654,15 +664,15 @@ void AntiSpamWizard::sortFilterOnExistance(
AntiSpamWizard : : SpamToolConfig : : SpamToolConfig ( QString toolId ,
int configVersion , int prio , QString name , QString exec ,
QString url , QString filter , QString detection , QString spam , QString ham ,
QString header , QString pattern , QString pattern2 , QString serverPattern ,
bool detectionOnly , bool regExp , bool bayesFilter , bool tristateDetection ,
WizardMode type )
QString noSpam , QString header , QString pattern , QString pattern2 ,
QString serverPattern , bool detectionOnly , bool regExp , bool bayesFilter ,
bool tristateDetection , WizardMode type )
: mId ( toolId ) , mVersion ( configVersion ) , mPrio ( prio ) ,
mVisibleName ( name ) , mExecutable ( exec ) , mWhatsThisText ( url ) ,
mFilterName ( filter ) , mDetectCmd ( detection ) , mSpamCmd ( spam ) ,
mHamCmd ( ham ) , mDetectionHeader ( header ) , mDetectionPattern ( pattern ) ,
mDetectionPattern2 ( pattern2 ) , mServerPattern ( serverPattern ) ,
mDetectionOnly ( detectionOnly ) ,
mHamCmd ( ham ) , mNoSpamCmd ( noSpam ) , mDetectionHeader ( header ) ,
mDetectionPattern ( pattern ) , mDetectionPattern2 ( pattern2 ) ,
mServerPattern ( serverPattern ) , mDetectionOnly ( detectionOnly ) ,
mUseRegExp ( regExp ) , mSupportsBayesFilter ( bayesFilter ) ,
mSupportsUnsure ( tristateDetection ) , mType ( type )
{
@ -748,6 +758,7 @@ AntiSpamWizard::SpamToolConfig
QString detectCmd = configGroup . readEntry ( " PipeCmdDetect " ) ;
QString spamCmd = configGroup . readEntry ( " ExecCmdSpam " ) ;
QString hamCmd = configGroup . readEntry ( " ExecCmdHam " ) ;
QString noSpamCmd = configGroup . readEntry ( " PipeCmdNoSpam " ) ;
QString header = configGroup . readEntry ( " DetectionHeader " ) ;
QString pattern = configGroup . readEntry ( " DetectionPattern " ) ;
QString pattern2 = configGroup . readEntry ( " DetectionPattern2 " ) ;
@ -757,7 +768,7 @@ AntiSpamWizard::SpamToolConfig
bool supportsBayes = configGroup . readEntry ( " SupportsBayes " , false ) ;
bool supportsUnsure = configGroup . readEntry ( " SupportsUnsure " , false ) ;
return SpamToolConfig ( id , version , prio , name , executable , url ,
filterName , detectCmd , spamCmd , hamCmd ,
filterName , detectCmd , spamCmd , hamCmd , noSpamCmd ,
header , pattern , pattern2 , serverPattern ,
detectionOnly , useRegExp ,
supportsBayes , supportsUnsure , mMode ) ;
@ -772,6 +783,7 @@ AntiSpamWizard::SpamToolConfig AntiSpamWizard::ConfigReader::createDummyConfig()
" spamassassin -L " ,
" sa-learn -L --spam --no-rebuild --single " ,
" sa-learn -L --ham --no-rebuild --single " ,
" spamassassin -d " ,
" X-Spam-Flag " , " yes " , " " , " " ,
false , false , true , false , AntiSpam ) ;
}