summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-06-08 21:10:58 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-06-08 21:10:58 +0000
commit00c46f24d60c9de29293bef608f34114392822d2 (patch)
tree23710e2cecfcea4df55587b2210de62acb4eeb7e
parent038f6cc65778c17300ce5c62bb25723f7fa16714 (diff)
MirandaG15:
- Minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@14068 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MirandaG15/src/CChatScreen.cpp6
-rw-r--r--plugins/MirandaG15/src/CContactList.cpp8
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp2
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDList.h3
-rw-r--r--plugins/MirandaG15/src/LCDFramework/misc.cpp8
5 files changed, 12 insertions, 15 deletions
diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp
index b4cc5b8a6d..51c6a85b92 100644
--- a/plugins/MirandaG15/src/CChatScreen.cpp
+++ b/plugins/MirandaG15/src/CChatScreen.cpp
@@ -455,9 +455,9 @@ void CChatScreen::AddIncomingMessage(tstring strMessage,tm *time,bool bIRC)
EScrollMode eMode;
switch(CConfig::GetIntSetting(SESSION_AUTOSCROLL))
{
- case SESSION_AUTOSCROLL_NONE: eMode = SCROLL_NONE; break;
case SESSION_AUTOSCROLL_FIRST: eMode = SCROLL_MESSAGE; break;
case SESSION_AUTOSCROLL_LAST: eMode = SCROLL_LINE; break;
+ default: eMode = SCROLL_NONE;
}
m_TextLog.SetAutoscrollMode(eMode);
@@ -756,10 +756,8 @@ void CChatScreen::OnLCDButtonRepeated(int iButton)
if(iButton < 2)
{
bool bRes = false;
- if(iButton == LGLCDBUTTON_BUTTON0 || iButton == LGLCDBUTTON_UP) {
+ if(iButton == LGLCDBUTTON_BUTTON0) {
bRes = m_TextLog.ScrollUp();
- } else if(iButton == LGLCDBUTTON_BUTTON1 || iButton == LGLCDBUTTON_DOWN) {
- bRes = m_TextLog.ScrollDown();
}
if(bRes && CConfig::GetBoolSetting(SESSION_SCROLL_MAXIMIZED))
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp
index 7b99448c12..fdaacbbe85 100644
--- a/plugins/MirandaG15/src/CContactList.cpp
+++ b/plugins/MirandaG15/src/CContactList.cpp
@@ -1003,14 +1003,14 @@ void CContactList::InitializeGroupObjects()
int res = 0;
CContactListGroup *pGroup = NULL;
- MCONTACT hContact = db_find_first();
+
HANDLE hMetaContact = NULL;
char *szProto = NULL;
- while(hContact != NULL)
+ for(MCONTACT hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact))
{
tstring strGroup = GetContactGroupPath(hContact);
szProto = GetContactProto(hContact);
- if(szProto && db_get_b(NULL,"MetaContacts","Enabled",1) && !mir_strcmpi(szProto,"MetaContacts"))
+ if(szProto && db_get_b(NULL,META_PROTO,"Enabled",1) && !mir_strcmpi(szProto,META_PROTO))
{
tstring strName = CAppletManager::GetContactDisplayname(hContact);
tstring strPath = _T("");
@@ -1037,8 +1037,6 @@ void CContactList::InitializeGroupObjects()
if(!db_mc_isSub(hContact))
ChangeGroupObjectCounters(strGroup,1);
}
-
- hContact = db_find_next(hContact);
}
}
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp
index eb3f2bf513..00a91a2706 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp
@@ -994,7 +994,7 @@ void CLCDConnectionLogitech::SetKBDBacklight(EKBDBrightness eBrightness)
HidD_SetFeature(m_hHIDDeviceHandle, data, m_HIDCapabilities.FeatureReportByteLength);
- free(data);
+ delete[] data;
}
void CLCDConnectionLogitech::SetVolumeWheelHook(bool bEnable)
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDList.h b/plugins/MirandaG15/src/LCDFramework/CLCDList.h
index 80a6b246cf..8afe19e995 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDList.h
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDList.h
@@ -373,7 +373,8 @@ public:
}
delete *iter;
m_Entrys.erase(iter);
- m_pRoot->UpdateEntryCount();
+ if (m_pRoot)
+ m_pRoot->UpdateEntryCount();
return;
}
}
diff --git a/plugins/MirandaG15/src/LCDFramework/misc.cpp b/plugins/MirandaG15/src/LCDFramework/misc.cpp
index c553124893..d4a491f446 100644
--- a/plugins/MirandaG15/src/LCDFramework/misc.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/misc.cpp
@@ -40,7 +40,7 @@ toWideString( const char* pStr , int len )
return L"" ;
//ASSERT_PTR( pStr ) ;
- ASSERT( len >= 0 || len == -1 , _T("Invalid string length: ") << len ) ;
+ ASSERT( len >= 0 || len == -1);
// figure out how many wide characters we are going to get
int nChars = MultiByteToWideChar( CP_ACP , 0 , pStr , len , NULL , 0 ) ;
@@ -65,7 +65,7 @@ string
toNarrowString( const wchar_t* pStr , int len )
{
//ASSERT_PTR( pStr ) ;
- ASSERT( len >= 0 || len == -1 , _T("Invalid string length: ") << len ) ;
+ ASSERT( len >= 0 || len == -1) ;
// figure out how many narrow characters we are going to get
int nChars = WideCharToMultiByte( CP_ACP , 0 ,
@@ -113,14 +113,14 @@ tstring Utf8_Decode(const char *str)
{
tstring strRes = _T("");
- int i, len;
+ int i;
char *p;
WCHAR *wszTemp = NULL;
if (str == NULL)
return strRes;
- len = mir_strlen(str);
+ size_t len = mir_strlen(str);
if ((wszTemp = (WCHAR *) malloc(sizeof(TCHAR) * (len + 2))) == NULL)
return strRes;