diff options
Diffstat (limited to 'plugins/UserInfoEx/src/ex_import')
7 files changed, 46 insertions, 51 deletions
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index efb32e0efc..023f551096 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -227,7 +227,7 @@ BYTE CExImContactBase::fromIni(LPSTR& row) HCONTACT CExImContactBase::toDB()
{
// create new contact if none exists
- if (_hContact == INVALID_HANDLE_VALUE && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) {
+ if (_hContact == (HCONTACT)INVALID_HANDLE_VALUE && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) {
PROTOACCOUNT* pszAccount = 0;
if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) {
//account does not exist
@@ -521,7 +521,7 @@ BYTE CExImContactBase::isHandle(HCONTACT hContact) * param: none
* return: handle if successful, INVALID_HANDLE_VALUE otherwise
**/
-HANDLE CExImContactBase::findHandle()
+HCONTACT CExImContactBase::findHandle()
{
for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
if (isHandle(hContact)) {
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index c9bb3fee24..e248c1d2a7 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -23,34 +23,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HANDLE CListFindGroup(LPCSTR pszGroup);
-class CExImContactBase {
- BYTE compareUID(DBVARIANT *dbv);
+class CExImContactBase
+{
+ BYTE compareUID(DBVARIANT *dbv);
protected:
- LPSTR _pszNick; // utf8 encoded
- LPSTR _pszDisp; // utf8 encoded
- LPSTR _pszGroup; // utf8 encoded
- LPSTR _pszAMPro;
- LPSTR _pszProto;
- LPSTR _pszProtoOld;
- LPSTR _pszUIDKey;
- DWORD _dbvUIDHash;
- DBVARIANT _dbvUID;
- HCONTACT _hContact;
- BYTE _isNewContact; // is this contact a new one?
-
- HANDLE findHandle();
+ LPSTR _pszNick; // utf8 encoded
+ LPSTR _pszDisp; // utf8 encoded
+ LPSTR _pszGroup; // utf8 encoded
+ LPSTR _pszAMPro;
+ LPSTR _pszProto;
+ LPSTR _pszProtoOld;
+ LPSTR _pszUIDKey;
+ DWORD _dbvUIDHash;
+ DBVARIANT _dbvUID;
+ HCONTACT _hContact;
+ BYTE _isNewContact; // is this contact a new one?
+
+ HCONTACT findHandle();
public:
CExImContactBase();
~CExImContactBase();
-// __inline LPCSTR disp() const { return mir_strcmp(_pszDisp,"")? _pszDisp : NULL; }
-// __inline LPCSTR group() const { return mir_strcmp(_pszGroup,"")? _pszGroup : NULL; }
-// __inline LPCSTR nick() const { return mir_strcmp(_pszNick,"")? _pszNick : NULL; }
-// __inline LPCSTR proto() const { return mir_strcmp(_pszProto,"")? _pszProto : NULL; }
-// __inline LPCSTR ampro() const { return mir_strcmp(_pszAMPro,"")? _pszAMPro : NULL; }
-// __inline LPCSTR uidk() const { return mir_strcmp(_pszUIDKey,"")? _pszUIDKey : NULL; }
__inline DBVARIANT& uid() { return _dbvUID; }
__inline HCONTACT handle() const { return _hContact; }
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 8aa92d5285..1bef0889b8 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -207,7 +207,7 @@ int CExImContactXML::Export(FILE *xmlfile, DB::CEnumList* pModules) if (!xmlfile)
return ERROR_INVALID_PARAMS;
- if (_hContact == INVALID_HANDLE_VALUE)
+ if (_hContact == (HCONTACT)INVALID_HANDLE_VALUE)
return ERROR_INVALID_CONTACT;
if (!CreateXmlElement())
@@ -510,7 +510,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) CExImContactXML vSub(_pXmlFile);
if (vSub = xSub) {
// identify metacontact by the first valid subcontact in xmlfile
- if (_hContact == INVALID_HANDLE_VALUE && vSub.handle() != INVALID_HANDLE_VALUE) {
+ if (_hContact == (HCONTACT)INVALID_HANDLE_VALUE && vSub.handle() != (HCONTACT)INVALID_HANDLE_VALUE) {
HCONTACT hMeta = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)vSub.handle(), NULL);
if (hMeta != NULL) {
_hContact = hMeta;
@@ -520,7 +520,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) }
}
// if no handle was found, this is a new meta contact
- _isNewContact = _hContact == INVALID_HANDLE_VALUE;
+ _isNewContact = _hContact == (HCONTACT)INVALID_HANDLE_VALUE;
}
// entry is a default contact
else {
@@ -588,7 +588,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) int CExImContactXML::ImportContact()
{
// create the contact if not yet exists
- if (toDB() != INVALID_HANDLE_VALUE) {
+ if (toDB() != (HCONTACT)INVALID_HANDLE_VALUE) {
_hEvent = NULL;
// count settings and events and init progress dialog
@@ -736,7 +736,7 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact) return err;
// check if contact is subcontact of the desired meta contact
- if ((HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)_hContact, NULL) != pMetaContact->handle()) {
+ if ((HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)_hContact, NULL) != pMetaContact->handle()) {
// add contact to the metacontact (this service returns TRUE if successful)
err = CallService(MS_MC_ADDTOMETA, (WPARAM)_hContact, (LPARAM)pMetaContact->handle());
if (err == FALSE) {
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index 3ddfbe0f93..acd8410463 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -303,7 +303,7 @@ static HCONTACT ImportFindContact(HCONTACT hContact, LPSTR &strBuf, BYTE bCanCre CExImContactBase vcc;
vcc.fromIni(strBuf);
- if (vcc.handle() != INVALID_HANDLE_VALUE) {
+ if (vcc.handle() != (HCONTACT)INVALID_HANDLE_VALUE) {
//if (vcc.isHandle(hContact))
// return hContact;
return vcc.handle();
@@ -452,11 +452,11 @@ int SvcExImINI_Import(HCONTACT hContact, LPCSTR pszFileName) numLines++;
// contact was found and imported
- if (hContact != INVALID_HANDLE_VALUE && hNewContact != INVALID_HANDLE_VALUE)
+ if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && hNewContact != (HCONTACT)INVALID_HANDLE_VALUE)
break;
// importing settings is only valid vor the main menu item
- if (hContact == INVALID_HANDLE_VALUE) {
+ if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
if (!strncmp(strBuf, "SETTINGS:", 9)) {
*szModule = 0;
hNewContact = NULL;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 824c4c0fd1..0cea3cff25 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -854,7 +854,7 @@ BYTE CVCardFileVCF::Open(HCONTACT hContact, LPCSTR pszFileName, LPCSTR pszMode) {
if (!(_pFile = fopen(pszFileName, pszMode)))
return FALSE;
- if ((_hContact = hContact) == INVALID_HANDLE_VALUE)
+ if ((_hContact = hContact) == (HCONTACT)INVALID_HANDLE_VALUE)
return FALSE;
if (!(_pszBaseProto = DB::Contact::Proto(_hContact)))
return FALSE;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index c4664b0975..245c28e016 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -139,7 +139,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) }
else {
// other export mode
- _hContactToWorkOn = INVALID_HANDLE_VALUE;
+ _hContactToWorkOn = (HCONTACT)INVALID_HANDLE_VALUE;
#ifdef _DEBUG
LARGE_INTEGER freq, t1, t2;
@@ -265,8 +265,8 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) switch (result) {
case ERROR_OK:
// init contact class and import if matches the user desires
- if (_hContactToWorkOn == INVALID_HANDLE_VALUE || vContact.handle() == _hContactToWorkOn) {
- result = vContact.Import(_hContactToWorkOn != INVALID_HANDLE_VALUE);
+ if (_hContactToWorkOn == (HCONTACT)INVALID_HANDLE_VALUE || vContact.handle() == _hContactToWorkOn) {
+ result = vContact.Import(_hContactToWorkOn != (HCONTACT)INVALID_HANDLE_VALUE);
switch (result) {
case ERROR_OK:
_numContactsDone++;
@@ -295,7 +295,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) if (pszNick) mir_free(pszNick);
}
// import owner contact
- else if (_hContactToWorkOn == INVALID_HANDLE_VALUE && !mir_stricmp(xContact->Value(), XKEY_OWNER) && (vContact = xContact)) {
+ else if (_hContactToWorkOn == (HCONTACT)INVALID_HANDLE_VALUE && !mir_stricmp(xContact->Value(), XKEY_OWNER) && (vContact = xContact)) {
result = vContact.Import();
switch (result) {
case ERROR_OK:
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h index 382fdb6dde..cbc64d761d 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h @@ -29,24 +29,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CFileXml {
friend class CExImContactXML;
- DWORD _numContactsTodo;
- DWORD _numContactsDone;
- DWORD _numSettingsTodo;
- DWORD _numSettingsDone;
- DWORD _numEventsTodo;
- DWORD _numEventsDone;
- DWORD _numEventsDuplicated;
+ DWORD _numContactsTodo;
+ DWORD _numContactsDone;
+ DWORD _numSettingsTodo;
+ DWORD _numSettingsDone;
+ DWORD _numEventsTodo;
+ DWORD _numEventsDone;
+ DWORD _numEventsDuplicated;
- HANDLE _hContactToWorkOn; // contact to ex/import (NULL=owner|INVALID_HANDLE_VALUE=all|HADNLE=one user)
+ HCONTACT _hContactToWorkOn; // contact to ex/import (NULL=owner|INVALID_HANDLE_VALUE=all|HADNLE=one user)
- WORD _wExport;
+ WORD _wExport;
- CProgress _progress;
+ CProgress _progress;
- int ImportOwner(TiXmlElement* xmlContact);
- int ImportContacts(TiXmlElement* xmlParent);
+ int ImportOwner(TiXmlElement* xmlContact);
+ int ImportContacts(TiXmlElement* xmlParent);
- DWORD CountContacts(TiXmlElement* xmlParent);
+ DWORD CountContacts(TiXmlElement* xmlParent);
/*
int ExportOwner(FILE *xmlfile, BYTE bExportEvents);
@@ -56,8 +56,8 @@ class CFileXml { public:
CFileXml();
- int Import(HCONTACT hContact, LPCSTR pszFileName);
- int Export(lpExImParam ExImContact, LPCSTR pszFileName);
+ int Import(HCONTACT hContact, LPCSTR pszFileName);
+ int Export(lpExImParam ExImContact, LPCSTR pszFileName);
};
#endif /* _SVC_FILEXML_INCLUDED_ */
\ No newline at end of file |