summaryrefslogtreecommitdiff
path: root/plugins/MobileState
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-02-06 10:33:05 +0000
committerRobert Pösel <robyer@seznam.cz>2015-02-06 10:33:05 +0000
commitfe0585c1d7bf0a04a1106ee54a01aa3be2453cb3 (patch)
tree9904e4813c3485e33b6a3e72cfe816ad66333a9a /plugins/MobileState
parent582e8409f7da6e9e511b4568668e88e6657dcfcd (diff)
MobileState: Tiny code cleanup; version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12020 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MobileState')
-rw-r--r--plugins/MobileState/mobilestate_10.vcxproj4
-rw-r--r--plugins/MobileState/mobilestate_10.vcxproj.filters6
-rw-r--r--plugins/MobileState/mobilestate_12.vcxproj4
-rw-r--r--plugins/MobileState/mobilestate_12.vcxproj.filters4
-rw-r--r--plugins/MobileState/src/main.cpp17
-rw-r--r--plugins/MobileState/src/version.h18
6 files changed, 25 insertions, 28 deletions
diff --git a/plugins/MobileState/mobilestate_10.vcxproj b/plugins/MobileState/mobilestate_10.vcxproj
index 501b84fd13..c9e03372fd 100644
--- a/plugins/MobileState/mobilestate_10.vcxproj
+++ b/plugins/MobileState/mobilestate_10.vcxproj
@@ -188,11 +188,11 @@
<ClInclude Include="src\clients.h" />
<ClInclude Include="src\commonheaders.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="src\Version.h" />
+ <ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\mobilestate.rc" />
- <ResourceCompile Include="res\Version.rc" />
+ <ResourceCompile Include="res\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/plugins/MobileState/mobilestate_10.vcxproj.filters b/plugins/MobileState/mobilestate_10.vcxproj.filters
index 88024c1c1a..95a5a94861 100644
--- a/plugins/MobileState/mobilestate_10.vcxproj.filters
+++ b/plugins/MobileState/mobilestate_10.vcxproj.filters
@@ -29,10 +29,10 @@
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\Version.h">
+ <ClInclude Include="src\clients.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\clients.h">
+ <ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
@@ -40,7 +40,7 @@
<ResourceCompile Include="res\mobilestate.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
- <ResourceCompile Include="res\Version.rc">
+ <ResourceCompile Include="res\version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
diff --git a/plugins/MobileState/mobilestate_12.vcxproj b/plugins/MobileState/mobilestate_12.vcxproj
index 2f32b3ce90..500dd9663c 100644
--- a/plugins/MobileState/mobilestate_12.vcxproj
+++ b/plugins/MobileState/mobilestate_12.vcxproj
@@ -191,11 +191,11 @@
<ClInclude Include="src\clients.h" />
<ClInclude Include="src\commonheaders.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="src\Version.h" />
+ <ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\mobilestate.rc" />
- <ResourceCompile Include="res\Version.rc" />
+ <ResourceCompile Include="res\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/plugins/MobileState/mobilestate_12.vcxproj.filters b/plugins/MobileState/mobilestate_12.vcxproj.filters
index 88024c1c1a..ef3556d46c 100644
--- a/plugins/MobileState/mobilestate_12.vcxproj.filters
+++ b/plugins/MobileState/mobilestate_12.vcxproj.filters
@@ -29,7 +29,7 @@
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\Version.h">
+ <ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\clients.h">
@@ -40,7 +40,7 @@
<ResourceCompile Include="res\mobilestate.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
- <ResourceCompile Include="res\Version.rc">
+ <ResourceCompile Include="res\version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp
index 417343c3be..86c51de58b 100644
--- a/plugins/MobileState/src/main.cpp
+++ b/plugins/MobileState/src/main.cpp
@@ -54,15 +54,13 @@ bool hasMobileClient(MCONTACT hContact, LPARAM)
{
char *proto = GetContactProto(hContact);
- DBVARIANT dbv;
- if (!db_get_ts(hContact, proto, "MirVer", &dbv)) {
- TCHAR *client = _tcslwr(NEWTSTR_ALLOCA(dbv.ptszVal));
- db_free(&dbv);
-
+ ptrT client(db_get_tsa(hContact, proto, "MirVer"));
+ if (client) {
for (size_t i = 0; i < SIZEOF(clients); i++)
if (_tcsstr(client, clients[i]))
return true;
}
+
return false;
}
@@ -80,15 +78,14 @@ int ExtraIconsApply(WPARAM wParam, LPARAM lParam)
}
int onContactSettingChanged(WPARAM wParam, LPARAM lParam)
-{
- DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+{
char *proto = GetContactProto(wParam);
if (!proto)
return 0;
- if (!mir_strcmp(cws->szModule, proto))
- if (!mir_strcmp(cws->szSetting, "MirVer"))
- ExtraIconsApply(wParam, 1);
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if (!mir_strcmp(cws->szModule, proto) && !mir_strcmp(cws->szSetting, "MirVer"))
+ ExtraIconsApply(wParam, 1);
return 0;
}
diff --git a/plugins/MobileState/src/version.h b/plugins/MobileState/src/version.h
index 729237f265..ffca7bc806 100644
--- a/plugins/MobileState/src/version.h
+++ b/plugins/MobileState/src/version.h
@@ -1,14 +1,14 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
-#define __RELEASE_NUM 1
-#define __BUILD_NUM 4
+#define __RELEASE_NUM 1
+#define __BUILD_NUM 5
#include <stdver.h>
-#define __PLUGIN_NAME "Mobile state"
-#define __FILENAME "MobileState.dll"
-#define __DESCRIPTION "Plugin shows mobile icon in contact list next to contacts which are using mobile client."
-#define __AUTHOR "Robert P\xf6" "sel"
-#define __AUTHOREMAIL "robyer@seznam.cz"
-#define __AUTHORWEB "http://miranda-ng.org/p/MobileState/"
-#define __COPYRIGHT "© 2012-15 Robert P\xf6" "sel"
+#define __PLUGIN_NAME "Mobile state"
+#define __FILENAME "MobileState.dll"
+#define __DESCRIPTION "Plugin shows mobile icon in contact list next to contacts which are using mobile client."
+#define __AUTHOR "Robert P\xf6" "sel"
+#define __AUTHOREMAIL "robyer@seznam.cz"
+#define __AUTHORWEB "http://miranda-ng.org/p/MobileState/"
+#define __COPYRIGHT "© 2012-15 Robert P\xf6" "sel"