diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-15 09:52:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-15 09:52:58 +0000 |
commit | 913eb113dd70d059037424bfc6cf231dee896ac3 (patch) | |
tree | 077211c9dbf53b821259170cab683b33debd4323 /protocols/Skype | |
parent | 02fa05ac26b620ebf5a761f8f7b4244e54309607 (diff) |
code cleaning & standardization
git-svn-id: http://svn.miranda-ng.org/main/trunk@4952 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype')
-rw-r--r-- | protocols/Skype/src/skype_chat.cpp | 7 | ||||
-rw-r--r-- | protocols/Skype/src/skype_contacts.cpp | 6 | ||||
-rw-r--r-- | protocols/Skype/src/skype_skype.cpp | 8 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/account.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/account.h | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/contact.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/contact.h | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/group.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/group.h | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/message.cpp | 5 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/participant.cpp | 3 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/search.cpp | 14 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/search.h | 6 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/transfer.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/transfer.h | 2 |
15 files changed, 36 insertions, 39 deletions
diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp index e562e2a030..ab08abafcc 100644 --- a/protocols/Skype/src/skype_chat.cpp +++ b/protocols/Skype/src/skype_chat.cpp @@ -965,8 +965,7 @@ INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam GetDlgItemText(hwndDlg, IDC_CHAT_PASSWORD, pwd, SIZEOF(pwd));
GetDlgItemText(hwndDlg, IDC_CHAT_CONFIRMATION, cfn, SIZEOF(cfn));
- bool secured = (bool)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED);
-
+ BOOL secured = ::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED);
::EnableWindow(::GetDlgItem(hwndDlg, IDOK), secured && ::wcscmp(pwd, cfn) == 0);
}
break;
@@ -989,10 +988,10 @@ INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam GetDlgItemText(hwndDlg, IDC_CHAT_TOPIC, param->topic, SIZEOF(param->topic));
GetDlgItemText(hwndDlg, IDC_CHAT_GUIDLINE, param->guidline, SIZEOF(param->guidline));
- param->enableJoining = (bool)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_JOINING);
+ param->enableJoining = ::IsDlgButtonChecked(hwndDlg, IDC_CHAT_JOINING) != 0;
param->joinRank = ::SendMessage(::GetDlgItem(hwndDlg, IDC_CHAT_ROLES), CB_GETCURSEL, 0, 0) + 1;
- param->passwordProtection = (bool)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED);
+ param->passwordProtection = ::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED) != 0;
if (param->passwordProtection)
{
GetDlgItemText(hwndDlg, IDC_CHAT_PASSWORD, param->password, SIZEOF(param->password));
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 9264ca50af..12e4eb4b82 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -383,7 +383,7 @@ void __cdecl CSkypeProto::SearchBySidAsync(void* arg) CContactSearch::Ref search;
this->CreateIdentitySearch(::mir_u2a(sid), search);
search.fetch();
- search->SetProtoInfo(this, (HANDLE)SKYPE_SEARCH_BYSID);
+ search->SetProtoInfo((HANDLE)SKYPE_SEARCH_BYSID);
bool valid;
if (!search->IsValid(valid) || !valid || !search->Submit())
@@ -400,7 +400,7 @@ void __cdecl CSkypeProto::SearchByEmailAsync(void* arg) CContactSearch::Ref search;
this->CreateContactSearch(search);
search.fetch();
- search->SetProtoInfo(this, (HANDLE)SKYPE_SEARCH_BYEMAIL);
+ search->SetProtoInfo((HANDLE)SKYPE_SEARCH_BYEMAIL);
bool valid;
if (!search->AddEmailTerm(::mir_u2a(email), valid) || !valid || !search->Submit())
@@ -422,7 +422,7 @@ void __cdecl CSkypeProto::SearchByNamesAsync(void* arg) CContactSearch::Ref search;
this->CreateContactSearch(search);
search.fetch();
- search->SetProtoInfo(this, (HANDLE)SKYPE_SEARCH_BYNAMES);
+ search->SetProtoInfo((HANDLE)SKYPE_SEARCH_BYNAMES);
bool valid;
if (nick.length() != 0)
diff --git a/protocols/Skype/src/skype_skype.cpp b/protocols/Skype/src/skype_skype.cpp index 4c683a0fa3..65df7f98f7 100644 --- a/protocols/Skype/src/skype_skype.cpp +++ b/protocols/Skype/src/skype_skype.cpp @@ -2,17 +2,17 @@ CAccount* CSkypeProto::newAccount(int oid)
{
- return new CAccount(this, oid, this);
+ return new CAccount(oid, this);
}
CContactGroup* CSkypeProto::newContactGroup(int oid)
{
- return new CContactGroup(this, oid, this);
+ return new CContactGroup(oid, this);
}
CContact* CSkypeProto::newContact(int oid)
{
- return new CContact(this, oid, this);
+ return new CContact(oid, this);
}
CConversation* CSkypeProto::newConversation(int oid)
@@ -32,7 +32,7 @@ CMessage* CSkypeProto::newMessage(int oid) CTransfer* CSkypeProto::newTransfer(int oid)
{
- return new CTransfer(this, oid, this);
+ return new CTransfer(oid, this);
}
CContactSearch* CSkypeProto::newContactSearch(int oid)
diff --git a/protocols/Skype/src/skypekit/account.cpp b/protocols/Skype/src/skypekit/account.cpp index 995b070b72..8ec02e08e8 100644 --- a/protocols/Skype/src/skypekit/account.cpp +++ b/protocols/Skype/src/skypekit/account.cpp @@ -1,8 +1,8 @@ #include "..\skype.h"
#include "account.h"
-CAccount::CAccount(CSkypeProto *_ppro, unsigned int oid, SERootObject* root) :
- Account(oid, root),
+CAccount::CAccount(unsigned int oid, CSkypeProto* _ppro) :
+ Account(oid, _ppro),
ppro(_ppro)
{
}
diff --git a/protocols/Skype/src/skypekit/account.h b/protocols/Skype/src/skypekit/account.h index 3b2b7063a5..a7128598ee 100644 --- a/protocols/Skype/src/skypekit/account.h +++ b/protocols/Skype/src/skypekit/account.h @@ -5,12 +5,10 @@ class CAccount : public Account
{
public:
- typedef void (CSkypeProto::* OnAccountChanged)(int);
-
typedef DRef<CAccount, Account> Ref;
typedef DRefs<CAccount, Account> Refs;
- CAccount(CSkypeProto*, unsigned int oid, SERootObject* root);
+ CAccount(unsigned int oid, CSkypeProto*);
bool IsOnline();
bool SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result);
diff --git a/protocols/Skype/src/skypekit/contact.cpp b/protocols/Skype/src/skypekit/contact.cpp index 30be4b478c..07104e8dd7 100644 --- a/protocols/Skype/src/skypekit/contact.cpp +++ b/protocols/Skype/src/skypekit/contact.cpp @@ -1,8 +1,8 @@ #include "..\skype.h"
#include "contact.h"
-CContact::CContact(CSkypeProto* _ppro, unsigned int oid, SERootObject* root) :
- Contact(oid, root),
+CContact::CContact(unsigned int oid, CSkypeProto* _ppro) :
+ Contact(oid, _ppro),
proto(_ppro)
{
}
diff --git a/protocols/Skype/src/skypekit/contact.h b/protocols/Skype/src/skypekit/contact.h index d15c684815..4a79ba723d 100644 --- a/protocols/Skype/src/skypekit/contact.h +++ b/protocols/Skype/src/skypekit/contact.h @@ -8,7 +8,7 @@ public: typedef DRef<CContact, Contact> Ref;
typedef DRefs<CContact, Contact> Refs;
- CContact(CSkypeProto*, unsigned int oid, SERootObject* root);
+ CContact(unsigned int oid, CSkypeProto*);
SEString GetSid();
SEString GetNick();
diff --git a/protocols/Skype/src/skypekit/group.cpp b/protocols/Skype/src/skypekit/group.cpp index 3e708280ca..a75c43d371 100644 --- a/protocols/Skype/src/skypekit/group.cpp +++ b/protocols/Skype/src/skypekit/group.cpp @@ -1,8 +1,8 @@ #include "..\skype.h"
#include "group.h"
-CContactGroup::CContactGroup(CSkypeProto* _ppro, unsigned int oid, SERootObject* root) :
- ContactGroup(oid, root),
+CContactGroup::CContactGroup(unsigned int oid, CSkypeProto* _ppro) :
+ ContactGroup(oid, _ppro),
proto(_ppro)
{
}
diff --git a/protocols/Skype/src/skypekit/group.h b/protocols/Skype/src/skypekit/group.h index 92412fb59b..0443d203ea 100644 --- a/protocols/Skype/src/skypekit/group.h +++ b/protocols/Skype/src/skypekit/group.h @@ -10,7 +10,7 @@ public: typedef DRef<CContactGroup, ContactGroup> Ref;
typedef DRefs<CContactGroup, ContactGroup> Refs;
- CContactGroup(CSkypeProto*, unsigned int oid, SERootObject* root);
+ CContactGroup(unsigned int oid, CSkypeProto*);
private:
CSkypeProto* proto;
diff --git a/protocols/Skype/src/skypekit/message.cpp b/protocols/Skype/src/skypekit/message.cpp index 82011d8c0d..48afa08662 100644 --- a/protocols/Skype/src/skypekit/message.cpp +++ b/protocols/Skype/src/skypekit/message.cpp @@ -1,4 +1,7 @@ #include "..\skype.h"
#include "message.h"
-CMessage::CMessage(unsigned int oid, SERootObject* root) : Message(oid, root) { }
+CMessage::CMessage(unsigned int oid, SERootObject* root) :
+ Message(oid, root)
+{
+}
diff --git a/protocols/Skype/src/skypekit/participant.cpp b/protocols/Skype/src/skypekit/participant.cpp index 34832d084d..513f532a0f 100644 --- a/protocols/Skype/src/skypekit/participant.cpp +++ b/protocols/Skype/src/skypekit/participant.cpp @@ -1,7 +1,8 @@ #include "..\skype.h"
#include "participant.h"
-CParticipant::CParticipant(unsigned int oid, SERootObject* root) : Participant(oid, root)
+CParticipant::CParticipant(unsigned int oid, SERootObject* root) :
+ Participant(oid, root)
{
this->room = NULL;
}
diff --git a/protocols/Skype/src/skypekit/search.cpp b/protocols/Skype/src/skypekit/search.cpp index f6f035a3a1..f1b20563aa 100644 --- a/protocols/Skype/src/skypekit/search.cpp +++ b/protocols/Skype/src/skypekit/search.cpp @@ -1,9 +1,10 @@ #include "..\skype.h"
#include "search.h"
-CContactSearch::CContactSearch(unsigned int oid, SERootObject* root) : ContactSearch(oid, root)
+CContactSearch::CContactSearch(unsigned int oid, CSkypeProto* _ppro) :
+ ContactSearch(oid, _ppro),
+ proto(_ppro)
{
- this->proto = NULL;
}
void CContactSearch::OnChange(int prop)
@@ -23,8 +24,7 @@ void CContactSearch::OnChange(int prop) void CContactSearch::OnNewResult(const ContactRef &contact, const uint &rankValue)
{
- if (this->proto)
- proto->OnContactFinded(contact, this->hSearch);
+ proto->OnContactFinded(contact, this->hSearch);
}
void CContactSearch::BlockWhileSearch()
@@ -34,9 +34,3 @@ void CContactSearch::BlockWhileSearch() while (!this->isSeachFinished && !this->isSeachFailed)
Sleep(1);
}
-
-void CContactSearch::SetProtoInfo(CSkypeProto* proto, HANDLE hSearch)
-{
- this->proto = proto;
- this->hSearch = hSearch;
-}
diff --git a/protocols/Skype/src/skypekit/search.h b/protocols/Skype/src/skypekit/search.h index fa5819ccee..dde9a043e3 100644 --- a/protocols/Skype/src/skypekit/search.h +++ b/protocols/Skype/src/skypekit/search.h @@ -12,12 +12,14 @@ public: bool isSeachFinished;
bool isSeachFailed;
- CContactSearch(unsigned int oid, SERootObject* root);
+ CContactSearch(unsigned int oid, CSkypeProto* _ppro);
void OnChange(int prop);
void OnNewResult(const ContactRef &contact, const uint &rankValue);
- void SetProtoInfo(CSkypeProto* proto, HANDLE hSearch);
+ __forceinline void SetProtoInfo(HANDLE _hSearch) {
+ hSearch = _hSearch;
+ }
void BlockWhileSearch();
diff --git a/protocols/Skype/src/skypekit/transfer.cpp b/protocols/Skype/src/skypekit/transfer.cpp index 68eb985fd0..60a41bdcfe 100644 --- a/protocols/Skype/src/skypekit/transfer.cpp +++ b/protocols/Skype/src/skypekit/transfer.cpp @@ -1,8 +1,8 @@ #include "..\skype.h"
#include "transfer.h"
-CTransfer::CTransfer(CSkypeProto* _ppro, unsigned int oid, SERootObject* root) :
- Transfer(oid, root),
+CTransfer::CTransfer(unsigned int oid, CSkypeProto* _ppro) :
+ Transfer(oid, _ppro),
proto(_ppro)
{
}
diff --git a/protocols/Skype/src/skypekit/transfer.h b/protocols/Skype/src/skypekit/transfer.h index a9dbf709b6..f01d48d328 100644 --- a/protocols/Skype/src/skypekit/transfer.h +++ b/protocols/Skype/src/skypekit/transfer.h @@ -8,7 +8,7 @@ public: typedef DRef<CTransfer, Transfer> Ref;
typedef DRefs<CTransfer, Transfer> Refs;
- CTransfer(CSkypeProto*, unsigned int oid, SERootObject* p_root);
+ CTransfer(unsigned int oid, CSkypeProto*);
private:
CSkypeProto* proto;
|