emailuis/nmailuiengine/src/nmuiengine.cpp
changeset 65 478bc57ad291
parent 59 16ed8d08d0b1
child 66 084b5b1f02a7
equal deleted inserted replaced
59:16ed8d08d0b1 65:478bc57ad291
  1155     else {
  1155     else {
  1156         indicator.deactivate(syncIndicatorName, QVariant());
  1156         indicator.deactivate(syncIndicatorName, QVariant());
  1157 	}
  1157 	}
  1158 }
  1158 }
  1159 
  1159 
       
  1160 /*!
       
  1161     Gets the signature for the given mailbox.
       
  1162 
       
  1163     \param mailboxId The mailbox id whose signature is asked.
       
  1164 	\param signature The reference to the signature string pointer. NULL if no signature.
       
  1165 */
       
  1166 int NmUiEngine::getSignature(const NmId &mailboxId, QString *&signature)
       
  1167 {
       
  1168     NM_FUNCTION;
       
  1169     
       
  1170     int retVal(NmNoError);
       
  1171     
       
  1172     // Get the plugin interface.
       
  1173     NmDataPluginInterface *pluginInterface =
       
  1174         mPluginFactory->interfaceInstance(mailboxId);
       
  1175 
       
  1176     if (pluginInterface) {
       
  1177         retVal = pluginInterface->getSignature(mailboxId, signature);
       
  1178     }
       
  1179     
       
  1180     return retVal;
       
  1181 }
  1160 
  1182 
  1161 /*!
  1183 /*!
  1162     Emits signals based on message events coming from plugins.
  1184     Emits signals based on message events coming from plugins.
  1163     Currently only NmMessageDeleted is handled.
  1185     Currently only NmMessageDeleted is handled.
  1164 */
  1186 */
  1273     if ( connectState == Disconnected && errorCode!= NmNoError ) {
  1295     if ( connectState == Disconnected && errorCode!= NmNoError ) {
  1274         NmOperationCompletionEvent event={NoOp, errorCode, mailboxId, 0, 0};
  1296         NmOperationCompletionEvent event={NoOp, errorCode, mailboxId, 0, 0};
  1275         emit operationCompleted(event);
  1297         emit operationCompleted(event);
  1276     }
  1298     }
  1277 }
  1299 }
  1278 
       
  1279 /*!
       
  1280     returns full mailbox id from plain account id
       
  1281 */
       
  1282 NmId NmUiEngine::getPluginIdByMailboxId(quint32 accountId)
       
  1283 {
       
  1284     NM_FUNCTION;
       
  1285 
       
  1286     NmId fullId = NULL;
       
  1287     fullId.setId32(accountId);
       
  1288     QList<NmId> mailboxList;
       
  1289     if(mDataManager){
       
  1290         mDataManager->listMailboxIds(mailboxList);
       
  1291         for(int i=0;i<mailboxList.count();i++){
       
  1292             if(mailboxList.at(i).id32() == accountId)
       
  1293                 fullId.setPluginId32(mailboxList.at(i).pluginId32());
       
  1294             }
       
  1295         }
       
  1296     return fullId;
       
  1297 }