void KMFolder::setUserWhoField( const QString& whoField, bool writeConfig ) { if ( mUserWhoField == whoField && !whoField.isEmpty() ) return; if ( whoField.isEmpty() ) { // default setting const KPIMIdentities::Identity & identity = kmkernel->identityManager()->identityForUoidOrDefault( mIdentity ); QString identityfcc, identitydrafts, identitytemplates; { /* KPIMIdentities::Identity::fcc(), KPIMIdentities::Identity::drafts() and KPIMIdentities::Identity::templates() using akonadi, so read values from config file directly */ const KConfig config( "emailidentities" ); const QStringList identities = config.groupList().filter( QRegExp( "^Identity #\\d+$" ) ); for ( QStringList::const_iterator group = identities.constBegin(); group != identities.constEnd(); ++group ) { const KConfigGroup configGroup( &config, *group ); if ( configGroup.readEntry( "uoid", 0U ) == identity.uoid() ) { identityfcc = configGroup.readEntry( "Fcc2", QString() ); identitydrafts = configGroup.readEntry( "Drafts2", QString() ); identitytemplates = configGroup.readEntry( "Templates2", QString() ); break; } } } if ( isSystemFolder() && folderType() != KMFolderTypeImap ) { // local system folders if ( this == kmkernel->inboxFolder() || this == kmkernel->trashFolder() ) mWhoField = "From"; if ( this == kmkernel->outboxFolder() || this == kmkernel->sentFolder() || this == kmkernel->templatesFolder() || this == kmkernel->draftsFolder() ) mWhoField = "To"; } else if ( identitydrafts == idString() || identitytemplates == idString() || identityfcc == idString() ) // drafts, templates or sent of the identity mWhoField = "To"; else mWhoField = "From"; } else if ( whoField == "From" || whoField == "To" ) // set the whoField according to the user-setting mWhoField = whoField; else { // this should not happen... kDebug() << "Illegal setting" << whoField << "for userWhoField!"; return; // don't use the value } mUserWhoField = whoField; if ( writeConfig ) { mStorage->writeConfig(); emit viewConfigChanged(); } }
BOOL TSHPath::IsSystemFolder(LPCTSTR pszPath, DWORD dwAttrb) { static TModuleProc2<BOOL,LPCTSTR,DWORD> isSystemFolder(GetModule(), IsSystemFolderStr); return isSystemFolder(pszPath,dwAttrb); }
QString KMFolder::label() const { if ( !mSystemLabel.isEmpty() ) return mSystemLabel; if ( !mLabel.isEmpty() ) return mLabel; if ( isSystemFolder() ) return i18n( name().toUtf8() ); return name(); }
bool KMFolder::isMoveable() const { return !isSystemFolder() && mStorage->isMoveable(); }