-rw-r--r-- | kabc/addressbook.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 4c4ae09..8487ff3 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -907,342 +907,353 @@ Addressee AddressBook::findByUid( const QString &uid ) | |||
907 | return Addressee(); | 907 | return Addressee(); |
908 | } | 908 | } |
909 | void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool isSubset ) | 909 | void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool isSubset ) |
910 | { | 910 | { |
911 | //qDebug("AddressBook::preExternSync "); | 911 | //qDebug("AddressBook::preExternSync "); |
912 | AddressBook::Iterator it; | 912 | AddressBook::Iterator it; |
913 | for ( it = begin(); it != end(); ++it ) { | 913 | for ( it = begin(); it != end(); ++it ) { |
914 | (*it).setID( csd, (*it).externalUID() ); | 914 | (*it).setID( csd, (*it).externalUID() ); |
915 | (*it).computeCsum( csd ); | 915 | (*it).computeCsum( csd ); |
916 | } | 916 | } |
917 | mergeAB( aBook ,csd, isSubset ); | 917 | mergeAB( aBook ,csd, isSubset ); |
918 | } | 918 | } |
919 | void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) | 919 | void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) |
920 | { | 920 | { |
921 | //qDebug("AddressBook::postExternSync "); | 921 | //qDebug("AddressBook::postExternSync "); |
922 | AddressBook::Iterator it; | 922 | AddressBook::Iterator it; |
923 | for ( it = begin(); it != end(); ++it ) { | 923 | for ( it = begin(); it != end(); ++it ) { |
924 | //qDebug("check uid %s ", (*it).uid().latin1() ); | 924 | //qDebug("check uid %s ", (*it).uid().latin1() ); |
925 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || | 925 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || |
926 | (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM || | 926 | (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM || |
927 | (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) { | 927 | (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) { |
928 | Addressee ad = aBook->findByUid( ( (*it).uid() )); | 928 | Addressee ad = aBook->findByUid( ( (*it).uid() )); |
929 | if ( ad.isEmpty() ) { | 929 | if ( ad.isEmpty() ) { |
930 | qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); | 930 | qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); |
931 | } else { | 931 | } else { |
932 | (*it).setIDStr(":"); | 932 | (*it).setIDStr(":"); |
933 | if ( setID ) { | 933 | if ( setID ) { |
934 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) | 934 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) |
935 | ad.setID( csd, (*it).externalUID() ); | 935 | ad.setID( csd, (*it).externalUID() ); |
936 | } else | 936 | } else |
937 | ad.setID( csd, (*it).uid() ); | 937 | ad.setID( csd, (*it).uid() ); |
938 | (*it).computeCsum( csd ); | 938 | (*it).computeCsum( csd ); |
939 | ad.setCsum( csd, (*it).getCsum( csd ) ); | 939 | ad.setCsum( csd, (*it).getCsum( csd ) ); |
940 | //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() ); | 940 | //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() ); |
941 | aBook->insertAddressee( ad , false); | 941 | aBook->insertAddressee( ad , false); |
942 | } | 942 | } |
943 | } | 943 | } |
944 | } | 944 | } |
945 | } | 945 | } |
946 | 946 | ||
947 | bool AddressBook::containsExternalUid( const QString& uid ) | 947 | bool AddressBook::containsExternalUid( const QString& uid ) |
948 | { | 948 | { |
949 | Iterator it; | 949 | Iterator it; |
950 | for ( it = begin(); it != end(); ++it ) { | 950 | for ( it = begin(); it != end(); ++it ) { |
951 | if ( uid == (*it).externalUID( ) ) | 951 | if ( uid == (*it).externalUID( ) ) |
952 | return true; | 952 | return true; |
953 | } | 953 | } |
954 | return false; | 954 | return false; |
955 | } | 955 | } |
956 | Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) | 956 | Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) |
957 | { | 957 | { |
958 | Iterator it; | 958 | Iterator it; |
959 | for ( it = begin(); it != end(); ++it ) { | 959 | for ( it = begin(); it != end(); ++it ) { |
960 | if ( uid == (*it).getID( profile ) ) | 960 | if ( uid == (*it).getID( profile ) ) |
961 | return (*it); | 961 | return (*it); |
962 | } | 962 | } |
963 | return Addressee(); | 963 | return Addressee(); |
964 | } | 964 | } |
965 | void AddressBook::mergeAB( AddressBook *aBook, const QString& profile , bool isSubset ) | 965 | void AddressBook::mergeAB( AddressBook *aBook, const QString& profile , bool isSubset ) |
966 | { | 966 | { |
967 | Iterator it; | 967 | Iterator it; |
968 | Addressee ad; | 968 | Addressee ad; |
969 | for ( it = begin(); it != end(); ++it ) { | 969 | for ( it = begin(); it != end(); ++it ) { |
970 | ad = aBook->findByExternUid( (*it).externalUID(), profile ); | 970 | ad = aBook->findByExternUid( (*it).externalUID(), profile ); |
971 | if ( !ad.isEmpty() ) { | 971 | if ( !ad.isEmpty() ) { |
972 | (*it).mergeContact( ad ,isSubset); | 972 | (*it).mergeContact( ad ,isSubset); |
973 | } | 973 | } |
974 | } | 974 | } |
975 | #if 0 | 975 | #if 0 |
976 | // test only | 976 | // test only |
977 | for ( it = begin(); it != end(); ++it ) { | 977 | for ( it = begin(); it != end(); ++it ) { |
978 | 978 | ||
979 | qDebug("uid %s ", (*it).uid().latin1()); | 979 | qDebug("uid %s ", (*it).uid().latin1()); |
980 | } | 980 | } |
981 | #endif | 981 | #endif |
982 | } | 982 | } |
983 | 983 | ||
984 | #if 0 | 984 | #if 0 |
985 | Addressee::List AddressBook::getExternLastSyncAddressees() | 985 | Addressee::List AddressBook::getExternLastSyncAddressees() |
986 | { | 986 | { |
987 | Addressee::List results; | 987 | Addressee::List results; |
988 | 988 | ||
989 | Iterator it; | 989 | Iterator it; |
990 | for ( it = begin(); it != end(); ++it ) { | 990 | for ( it = begin(); it != end(); ++it ) { |
991 | if ( (*it).uid().left( 19 ) == "last-syncAddressee-" ) { | 991 | if ( (*it).uid().left( 19 ) == "last-syncAddressee-" ) { |
992 | if ( (*it).familyName().left(4) == "!E: " ) | 992 | if ( (*it).familyName().left(4) == "!E: " ) |
993 | results.append( *it ); | 993 | results.append( *it ); |
994 | } | 994 | } |
995 | } | 995 | } |
996 | 996 | ||
997 | return results; | 997 | return results; |
998 | } | 998 | } |
999 | #endif | 999 | #endif |
1000 | void AddressBook::resetTempSyncStat() | 1000 | void AddressBook::resetTempSyncStat() |
1001 | { | 1001 | { |
1002 | Iterator it; | 1002 | Iterator it; |
1003 | for ( it = begin(); it != end(); ++it ) { | 1003 | for ( it = begin(); it != end(); ++it ) { |
1004 | (*it).setTempSyncStat ( SYNC_TEMPSTATE_INITIAL ); | 1004 | (*it).setTempSyncStat ( SYNC_TEMPSTATE_INITIAL ); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | QStringList AddressBook:: uidList() | 1009 | QStringList AddressBook:: uidList() |
1010 | { | 1010 | { |
1011 | QStringList results; | 1011 | QStringList results; |
1012 | Iterator it; | 1012 | Iterator it; |
1013 | for ( it = begin(); it != end(); ++it ) { | 1013 | for ( it = begin(); it != end(); ++it ) { |
1014 | results.append( (*it).uid() ); | 1014 | results.append( (*it).uid() ); |
1015 | } | 1015 | } |
1016 | return results; | 1016 | return results; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | 1019 | ||
1020 | Addressee::List AddressBook::allAddressees() | 1020 | Addressee::List AddressBook::allAddressees() |
1021 | { | 1021 | { |
1022 | return d->mAddressees; | 1022 | return d->mAddressees; |
1023 | 1023 | ||
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | Addressee::List AddressBook::findByName( const QString &name ) | 1026 | Addressee::List AddressBook::findByName( const QString &name ) |
1027 | { | 1027 | { |
1028 | Addressee::List results; | 1028 | Addressee::List results; |
1029 | 1029 | ||
1030 | Iterator it; | 1030 | Iterator it; |
1031 | for ( it = begin(); it != end(); ++it ) { | 1031 | for ( it = begin(); it != end(); ++it ) { |
1032 | if ( name == (*it).realName() ) { | 1032 | if ( name == (*it).realName() ) { |
1033 | results.append( *it ); | 1033 | results.append( *it ); |
1034 | } | 1034 | } |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | return results; | 1037 | return results; |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | Addressee::List AddressBook::findByEmail( const QString &email ) | 1040 | Addressee::List AddressBook::findByEmail( const QString &email ) |
1041 | { | 1041 | { |
1042 | Addressee::List results; | 1042 | Addressee::List results; |
1043 | QStringList mailList; | 1043 | QStringList mailList; |
1044 | 1044 | ||
1045 | Iterator it; | 1045 | Iterator it; |
1046 | for ( it = begin(); it != end(); ++it ) { | 1046 | for ( it = begin(); it != end(); ++it ) { |
1047 | mailList = (*it).emails(); | 1047 | mailList = (*it).emails(); |
1048 | for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { | 1048 | for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { |
1049 | if ( email == (*ite) ) { | 1049 | if ( email == (*ite) ) { |
1050 | results.append( *it ); | 1050 | results.append( *it ); |
1051 | } | 1051 | } |
1052 | } | 1052 | } |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | return results; | 1055 | return results; |
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | Addressee::List AddressBook::findByCategory( const QString &category ) | 1058 | Addressee::List AddressBook::findByCategory( const QString &category ) |
1059 | { | 1059 | { |
1060 | Addressee::List results; | 1060 | Addressee::List results; |
1061 | 1061 | ||
1062 | Iterator it; | 1062 | Iterator it; |
1063 | for ( it = begin(); it != end(); ++it ) { | 1063 | for ( it = begin(); it != end(); ++it ) { |
1064 | if ( (*it).hasCategory( category) ) { | 1064 | if ( (*it).hasCategory( category) ) { |
1065 | results.append( *it ); | 1065 | results.append( *it ); |
1066 | } | 1066 | } |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | return results; | 1069 | return results; |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | void AddressBook::dump() const | 1072 | void AddressBook::dump() const |
1073 | { | 1073 | { |
1074 | kdDebug(5700) << "AddressBook::dump() --- begin ---" << endl; | 1074 | kdDebug(5700) << "AddressBook::dump() --- begin ---" << endl; |
1075 | 1075 | ||
1076 | ConstIterator it; | 1076 | ConstIterator it; |
1077 | for( it = begin(); it != end(); ++it ) { | 1077 | for( it = begin(); it != end(); ++it ) { |
1078 | (*it).dump(); | 1078 | (*it).dump(); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | kdDebug(5700) << "AddressBook::dump() --- end ---" << endl; | 1081 | kdDebug(5700) << "AddressBook::dump() --- end ---" << endl; |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | QString AddressBook::identifier() | 1084 | QString AddressBook::identifier() |
1085 | { | 1085 | { |
1086 | QStringList identifier; | 1086 | QStringList identifier; |
1087 | 1087 | ||
1088 | 1088 | ||
1089 | KRES::Manager<Resource>::ActiveIterator it; | 1089 | KRES::Manager<Resource>::ActiveIterator it; |
1090 | for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { | 1090 | for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { |
1091 | if ( !(*it)->identifier().isEmpty() ) | 1091 | if ( !(*it)->identifier().isEmpty() ) |
1092 | identifier.append( (*it)->identifier() ); | 1092 | identifier.append( (*it)->identifier() ); |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | return identifier.join( ":" ); | 1095 | return identifier.join( ":" ); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | Field::List AddressBook::fields( int category ) | 1098 | Field::List AddressBook::fields( int category ) |
1099 | { | 1099 | { |
1100 | if ( d->mAllFields.isEmpty() ) { | 1100 | if ( d->mAllFields.isEmpty() ) { |
1101 | d->mAllFields = Field::allFields(); | 1101 | d->mAllFields = Field::allFields(); |
1102 | } | 1102 | } |
1103 | 1103 | ||
1104 | if ( category == Field::All ) return d->mAllFields; | 1104 | if ( category == Field::All ) return d->mAllFields; |
1105 | 1105 | ||
1106 | Field::List result; | 1106 | Field::List result; |
1107 | Field::List::ConstIterator it; | 1107 | Field::List::ConstIterator it; |
1108 | for( it = d->mAllFields.begin(); it != d->mAllFields.end(); ++it ) { | 1108 | for( it = d->mAllFields.begin(); it != d->mAllFields.end(); ++it ) { |
1109 | if ( (*it)->category() & category ) result.append( *it ); | 1109 | if ( (*it)->category() & category ) result.append( *it ); |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | return result; | 1112 | return result; |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | bool AddressBook::addCustomField( const QString &label, int category, | 1115 | bool AddressBook::addCustomField( const QString &label, int category, |
1116 | const QString &key, const QString &app ) | 1116 | const QString &key, const QString &app ) |
1117 | { | 1117 | { |
1118 | if ( d->mAllFields.isEmpty() ) { | 1118 | if ( d->mAllFields.isEmpty() ) { |
1119 | d->mAllFields = Field::allFields(); | 1119 | d->mAllFields = Field::allFields(); |
1120 | } | 1120 | } |
1121 | //US QString a = app.isNull() ? KGlobal::instance()->instanceName() : app; | 1121 | //US QString a = app.isNull() ? KGlobal::instance()->instanceName() : app; |
1122 | QString a = app.isNull() ? KGlobal::getAppName() : app; | 1122 | QString a = app.isNull() ? KGlobal::getAppName() : app; |
1123 | 1123 | ||
1124 | QString k = key.isNull() ? label : key; | 1124 | QString k = key.isNull() ? label : key; |
1125 | 1125 | ||
1126 | Field *field = Field::createCustomField( label, category, k, a ); | 1126 | Field *field = Field::createCustomField( label, category, k, a ); |
1127 | 1127 | ||
1128 | if ( !field ) return false; | 1128 | if ( !field ) return false; |
1129 | 1129 | ||
1130 | d->mAllFields.append( field ); | 1130 | d->mAllFields.append( field ); |
1131 | 1131 | ||
1132 | return true; | 1132 | return true; |
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | QDataStream &KABC::operator<<( QDataStream &s, const AddressBook &ab ) | 1135 | QDataStream &KABC::operator<<( QDataStream &s, const AddressBook &ab ) |
1136 | { | 1136 | { |
1137 | if (!ab.d) return s; | 1137 | if (!ab.d) return s; |
1138 | 1138 | ||
1139 | return s << ab.d->mAddressees; | 1139 | return s << ab.d->mAddressees; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | QDataStream &KABC::operator>>( QDataStream &s, AddressBook &ab ) | 1142 | QDataStream &KABC::operator>>( QDataStream &s, AddressBook &ab ) |
1143 | { | 1143 | { |
1144 | if (!ab.d) return s; | 1144 | if (!ab.d) return s; |
1145 | 1145 | ||
1146 | s >> ab.d->mAddressees; | 1146 | s >> ab.d->mAddressees; |
1147 | 1147 | ||
1148 | return s; | 1148 | return s; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | bool AddressBook::addResource( Resource *resource ) | 1151 | bool AddressBook::addResource( Resource *resource ) |
1152 | { | 1152 | { |
1153 | if ( !resource->open() ) { | 1153 | if ( !resource->open() ) { |
1154 | kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; | 1154 | kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; |
1155 | return false; | 1155 | return false; |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | resource->setAddressBook( this ); | 1158 | resource->setAddressBook( this ); |
1159 | 1159 | ||
1160 | d->mManager->add( resource ); | 1160 | d->mManager->add( resource ); |
1161 | return true; | 1161 | return true; |
1162 | } | 1162 | } |
1163 | void AddressBook::removeResources() | ||
1164 | { | ||
1165 | //remove all possible resources. This should cleanup the configfile. | ||
1166 | QPtrList<KABC::Resource> mResources = resources(); | ||
1167 | |||
1168 | QPtrListIterator<KABC::Resource> it(mResources); | ||
1169 | for ( ; it.current(); ++it ) { | ||
1170 | KABC::Resource *res = it.current(); | ||
1171 | removeResource(res); | ||
1172 | } | ||
1173 | } | ||
1163 | 1174 | ||
1164 | bool AddressBook::removeResource( Resource *resource ) | 1175 | bool AddressBook::removeResource( Resource *resource ) |
1165 | { | 1176 | { |
1166 | resource->close(); | 1177 | resource->close(); |
1167 | 1178 | ||
1168 | if ( resource == standardResource() ) | 1179 | if ( resource == standardResource() ) |
1169 | d->mManager->setStandardResource( 0 ); | 1180 | d->mManager->setStandardResource( 0 ); |
1170 | 1181 | ||
1171 | resource->setAddressBook( 0 ); | 1182 | resource->setAddressBook( 0 ); |
1172 | 1183 | ||
1173 | d->mManager->remove( resource ); | 1184 | d->mManager->remove( resource ); |
1174 | return true; | 1185 | return true; |
1175 | } | 1186 | } |
1176 | 1187 | ||
1177 | QPtrList<Resource> AddressBook::resources() | 1188 | QPtrList<Resource> AddressBook::resources() |
1178 | { | 1189 | { |
1179 | QPtrList<Resource> list; | 1190 | QPtrList<Resource> list; |
1180 | 1191 | ||
1181 | // qDebug("AddressBook::resources() 1"); | 1192 | // qDebug("AddressBook::resources() 1"); |
1182 | 1193 | ||
1183 | KRES::Manager<Resource>::ActiveIterator it; | 1194 | KRES::Manager<Resource>::ActiveIterator it; |
1184 | for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) | 1195 | for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) |
1185 | list.append( *it ); | 1196 | list.append( *it ); |
1186 | 1197 | ||
1187 | return list; | 1198 | return list; |
1188 | } | 1199 | } |
1189 | 1200 | ||
1190 | /*US | 1201 | /*US |
1191 | void AddressBook::setErrorHandler( ErrorHandler *handler ) | 1202 | void AddressBook::setErrorHandler( ErrorHandler *handler ) |
1192 | { | 1203 | { |
1193 | delete d->mErrorHandler; | 1204 | delete d->mErrorHandler; |
1194 | d->mErrorHandler = handler; | 1205 | d->mErrorHandler = handler; |
1195 | } | 1206 | } |
1196 | */ | 1207 | */ |
1197 | 1208 | ||
1198 | void AddressBook::error( const QString& msg ) | 1209 | void AddressBook::error( const QString& msg ) |
1199 | { | 1210 | { |
1200 | /*US | 1211 | /*US |
1201 | if ( !d->mErrorHandler ) // create default error handler | 1212 | if ( !d->mErrorHandler ) // create default error handler |
1202 | d->mErrorHandler = new ConsoleErrorHandler; | 1213 | d->mErrorHandler = new ConsoleErrorHandler; |
1203 | 1214 | ||
1204 | if ( d->mErrorHandler ) | 1215 | if ( d->mErrorHandler ) |
1205 | d->mErrorHandler->error( msg ); | 1216 | d->mErrorHandler->error( msg ); |
1206 | else | 1217 | else |
1207 | kdError(5700) << "no error handler defined" << endl; | 1218 | kdError(5700) << "no error handler defined" << endl; |
1208 | */ | 1219 | */ |
1209 | kdDebug(5700) << "msg" << endl; | 1220 | kdDebug(5700) << "msg" << endl; |
1210 | qDebug(msg); | 1221 | qDebug(msg); |
1211 | } | 1222 | } |
1212 | 1223 | ||
1213 | void AddressBook::deleteRemovedAddressees() | 1224 | void AddressBook::deleteRemovedAddressees() |
1214 | { | 1225 | { |
1215 | Addressee::List::Iterator it; | 1226 | Addressee::List::Iterator it; |
1216 | for ( it = d->mRemovedAddressees.begin(); it != d->mRemovedAddressees.end(); ++it ) { | 1227 | for ( it = d->mRemovedAddressees.begin(); it != d->mRemovedAddressees.end(); ++it ) { |
1217 | Resource *resource = (*it).resource(); | 1228 | Resource *resource = (*it).resource(); |
1218 | if ( resource && !resource->readOnly() && resource->isOpen() ) | 1229 | if ( resource && !resource->readOnly() && resource->isOpen() ) |
1219 | resource->removeAddressee( *it ); | 1230 | resource->removeAddressee( *it ); |
1220 | } | 1231 | } |
1221 | 1232 | ||
1222 | d->mRemovedAddressees.clear(); | 1233 | d->mRemovedAddressees.clear(); |
1223 | } | 1234 | } |
1224 | 1235 | ||
1225 | void AddressBook::setStandardResource( Resource *resource ) | 1236 | void AddressBook::setStandardResource( Resource *resource ) |
1226 | { | 1237 | { |
1227 | // qDebug("AddressBook::setStandardResource 1"); | 1238 | // qDebug("AddressBook::setStandardResource 1"); |
1228 | d->mManager->setStandardResource( resource ); | 1239 | d->mManager->setStandardResource( resource ); |
1229 | } | 1240 | } |
1230 | 1241 | ||
1231 | Resource *AddressBook::standardResource() | 1242 | Resource *AddressBook::standardResource() |
1232 | { | 1243 | { |
1233 | return d->mManager->standardResource(); | 1244 | return d->mManager->standardResource(); |
1234 | } | 1245 | } |
1235 | 1246 | ||
1236 | KRES::Manager<Resource> *AddressBook::resourceManager() | 1247 | KRES::Manager<Resource> *AddressBook::resourceManager() |
1237 | { | 1248 | { |
1238 | return d->mManager; | 1249 | return d->mManager; |
1239 | } | 1250 | } |
1240 | 1251 | ||
1241 | void AddressBook::cleanUp() | 1252 | void AddressBook::cleanUp() |
1242 | { | 1253 | { |
1243 | KRES::Manager<Resource>::ActiveIterator it; | 1254 | KRES::Manager<Resource>::ActiveIterator it; |
1244 | for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { | 1255 | for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { |
1245 | if ( !(*it)->readOnly() && (*it)->isOpen() ) | 1256 | if ( !(*it)->readOnly() && (*it)->isOpen() ) |
1246 | (*it)->cleanUp(); | 1257 | (*it)->cleanUp(); |
1247 | } | 1258 | } |
1248 | } | 1259 | } |