summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-18 13:21:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-18 13:21:39 +0000
commit6f8ff613bd81e4592173e9039ec0dc6f01ce5e6b (patch)
treeb2889bbf91a505107d1cf2c3b907f853451be586 /plugins/DbEditorPP/src
parent1bb9a86b26d3a9964844d42fa25690ce0a028258 (diff)
dbeditor++ - unified project
git-svn-id: http://svn.miranda-ng.org/main/trunk@14244 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP/src')
-rw-r--r--plugins/DbEditorPP/src/copymodule.cpp2
-rw-r--r--plugins/DbEditorPP/src/deletemodule.cpp2
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp2
-rw-r--r--plugins/DbEditorPP/src/findwindow.cpp2
-rw-r--r--plugins/DbEditorPP/src/icons.cpp2
-rw-r--r--plugins/DbEditorPP/src/main.cpp9
-rw-r--r--plugins/DbEditorPP/src/main_window.cpp2
-rw-r--r--plugins/DbEditorPP/src/modsettingenum.cpp4
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp4
-rw-r--r--plugins/DbEditorPP/src/options.cpp2
-rw-r--r--plugins/DbEditorPP/src/renamemodule.cpp2
-rw-r--r--plugins/DbEditorPP/src/settinglist.cpp27
-rw-r--r--plugins/DbEditorPP/src/settingsdlg.cpp2
-rw-r--r--plugins/DbEditorPP/src/stdafx.cxx (renamed from plugins/DbEditorPP/src/stdafx.cpp)2
-rw-r--r--plugins/DbEditorPP/src/stdafx.h (renamed from plugins/DbEditorPP/src/headers.h)3
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp6
16 files changed, 30 insertions, 43 deletions
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp
index cd88af3515..12e68246c5 100644
--- a/plugins/DbEditorPP/src/copymodule.cpp
+++ b/plugins/DbEditorPP/src/copymodule.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
void copyModule(const char *module, MCONTACT hContactFrom, MCONTACT hContactTo)
{
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp
index 98d4075949..c7625ad235 100644
--- a/plugins/DbEditorPP/src/deletemodule.cpp
+++ b/plugins/DbEditorPP/src/deletemodule.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
volatile BOOL working;
static HWND hwnd2Delete = NULL;
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index 61278154f4..37fc728f24 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
TCHAR *GetFilter()
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp
index 3e65b5c02c..235cf0f6ea 100644
--- a/plugins/DbEditorPP/src/findwindow.cpp
+++ b/plugins/DbEditorPP/src/findwindow.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp
index 9492738125..e29a84d89d 100644
--- a/plugins/DbEditorPP/src/icons.cpp
+++ b/plugins/DbEditorPP/src/icons.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
int dbeIcons[] = {
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index 5a4e023bd8..0ddb715f5d 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
HINSTANCE hInst = NULL;
@@ -15,6 +15,8 @@ MCONTACT hRestore;
extern HWND hwnd2watchedVarsWindow;
+#pragma comment(lib, "shlwapi.lib")
+
//========================
// MirandaPluginInfo
//========================
@@ -320,12 +322,9 @@ int setNumericValue(MCONTACT hContact, const char *module, const char *setting,
int IsRealUnicode(TCHAR *value)
{
-#ifdef _UNICODE
BOOL nonascii = 0;
WideCharToMultiByte(Langpack_GetDefaultCodePage(), WC_NO_BEST_FIT_CHARS, value, -1, NULL, 0, NULL, &nonascii);
return nonascii;
-#endif
- return 0;
}
@@ -496,7 +495,7 @@ int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxle
GetValue(hContact, szProto, "FirstName", name, SIZEOF(name));
- int len = mir_tstrlen(name);
+ int len = (int)mir_tstrlen(name);
if (len + 2 < SIZEOF(name)) {
if (len)
mir_tstrncat(name, _T(" "), SIZEOF(name));
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp
index ea5f75dc60..d7bf3bbaa0 100644
--- a/plugins/DbEditorPP/src/main_window.cpp
+++ b/plugins/DbEditorPP/src/main_window.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
HWND hwnd2mainWindow;
diff --git a/plugins/DbEditorPP/src/modsettingenum.cpp b/plugins/DbEditorPP/src/modsettingenum.cpp
index 332df43032..b6d90ff1b1 100644
--- a/plugins/DbEditorPP/src/modsettingenum.cpp
+++ b/plugins/DbEditorPP/src/modsettingenum.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
void FreeModuleSettingLL(ModuleSettingLL *msll)
@@ -168,7 +168,7 @@ int EnumResidentSettings(const char *module, ModuleSettingLL *msll)
if (!m_lResidentSettings.getCount()) return 0;
if (m_lResidentModules.getIndex((char*)module) == -1) return 0;
- int len = mir_strlen(module);
+ int len = (int)mir_strlen(module);
int cnt = 0;
for (int i = 0; i < m_lResidentSettings.getCount(); i++) {
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index 5aaf0b7616..1611cd0c71 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
HWND hwnd2Tree = 0;
@@ -37,7 +37,7 @@ int doContacts(HTREEITEM contactsRoot, ModuleSettingLL *modlist, MCONTACT hSelec
HTREEITEM contact;
ModuleTreeInfoStruct *lParam;
int itemscount = 0;
- int i = 0, icon = 0;
+ int icon = 0;
HTREEITEM hItem = 0;
SetWindowText(hwnd2mainWindow, TranslateT("Loading contacts..."));
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp
index d53cd27050..3736751f94 100644
--- a/plugins/DbEditorPP/src/options.cpp
+++ b/plugins/DbEditorPP/src/options.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/DbEditorPP/src/renamemodule.cpp b/plugins/DbEditorPP/src/renamemodule.cpp
index fca6c7d3cc..000f283c3a 100644
--- a/plugins/DbEditorPP/src/renamemodule.cpp
+++ b/plugins/DbEditorPP/src/renamemodule.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
int renameModule(MCONTACT hContact, const char *oldName, const char *newName)
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp
index f815ebbbbf..015971a737 100644
--- a/plugins/DbEditorPP/src/settinglist.cpp
+++ b/plugins/DbEditorPP/src/settinglist.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
SettingListInfo info = {0};
@@ -242,37 +242,32 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident
break;
case DBVT_ASCIIZ:
- {
lvi.iImage = IMAGE_STRING;
ListView_SetItem(hwnd2List, &lvi);
ListView_SetItemTextA(hwnd2List, index, 1, dbv->pszVal);
- length = mir_strlen(dbv->pszVal) + 1;
+ length = (int)mir_strlen(dbv->pszVal) + 1;
mir_sntprintf(data, _T("0x%04X (%u)"), length, length);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
- }
+
case DBVT_WCHAR:
- {
lvi.iImage = IMAGE_UNICODE;
ListView_SetItem(hwnd2List, &lvi);
- length = mir_wstrlen(dbv->pwszVal) + 1;
- ptrT str(mir_u2t(dbv->pwszVal));
- ListView_SetItemText(hwnd2List, index, 1, str);
+ length = (int)mir_wstrlen(dbv->pwszVal) + 1;
+ ListView_SetItemText(hwnd2List, index, 1, dbv->pwszVal);
mir_sntprintf(data, _T("0x%04X (%u)"), length, length);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
- }
+
case DBVT_UTF8:
- {
lvi.iImage = IMAGE_UNICODE;
ListView_SetItem(hwnd2List, &lvi);
- length = mir_strlen(dbv->pszVal) + 1;
- ptrT str(mir_utf8decodeT(dbv->pszVal));
- ListView_SetItemText(hwnd2List, index, 1, str);
+ length = (int)mir_strlen(dbv->pszVal) + 1;
+ ListView_SetItemText(hwnd2List, index, 1, ptrT(mir_utf8decodeT(dbv->pszVal)));
mir_sntprintf(data, _T("0x%04X (%u)"), length, length);
ListView_SetItemText(hwnd2List, index, 3, data);
break;
- }
+
case DBVT_DELETED:
// ListView_DeleteItem(hwnd2List, index);
return;
@@ -490,7 +485,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM
int i = 0;
if (dbv.type == DBVT_BLOB) {
- res = WriteBlobFromString(info.hContact, info.module, info.setting, szValue, mir_strlen(szValue));
+ res = WriteBlobFromString(info.hContact, info.module, info.setting, szValue, (int)mir_strlen(szValue));
break;
}
@@ -556,7 +551,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM
case _T('\"'):
case _T('\''):
{
- int nlen = mir_tstrlen(value);
+ size_t nlen = mir_tstrlen(value);
int sh = 0;
if (nlen > 3) {
if (value[nlen - 1] == value[0]) {
diff --git a/plugins/DbEditorPP/src/settingsdlg.cpp b/plugins/DbEditorPP/src/settingsdlg.cpp
index 334e1c8a80..246678306d 100644
--- a/plugins/DbEditorPP/src/settingsdlg.cpp
+++ b/plugins/DbEditorPP/src/settingsdlg.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
int saveAsType(HWND hwnd, int original)
{
diff --git a/plugins/DbEditorPP/src/stdafx.cpp b/plugins/DbEditorPP/src/stdafx.cxx
index 7e0216078c..0c766ea07f 100644
--- a/plugins/DbEditorPP/src/stdafx.cpp
+++ b/plugins/DbEditorPP/src/stdafx.cxx
@@ -15,4 +15,4 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "headers.h" \ No newline at end of file
+#include "stdafx.h"
diff --git a/plugins/DbEditorPP/src/headers.h b/plugins/DbEditorPP/src/stdafx.h
index 3f8c5b6c1a..d1827fb6c1 100644
--- a/plugins/DbEditorPP/src/headers.h
+++ b/plugins/DbEditorPP/src/stdafx.h
@@ -4,9 +4,6 @@
// Includes
//=====================================================
-#define _CRT_SECURE_NO_WARNINGS
-#define _CRT_NONSTDC_NO_DEPRECATE
-
#include <tchar.h>
#include <Windows.h>
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index 3b4f9a3c9b..b9bc71cefd 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -1,4 +1,4 @@
-#include "headers.h"
+#include "stdafx.h"
HWND hwnd2watchedVarsWindow = NULL;
@@ -372,14 +372,10 @@ void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting)
int timeout = db_get_b(NULL, modname, "PopupDelay", 3);
TCHAR name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE];
- int res = 0;
-
GetContactName(hContact, NULL, name, SIZEOF(name));
// 2nd line
int type = GetValue(hContact, module, setting, value, SIZEOF(value));
-// if (!type) value = _T("NULL");
-
mir_sntprintf(text, TranslateT("Database Setting Changed: \nModule: \"%s\", Setting: \"%s\"\nNew Value (%s): \"%s\""), _A2T(module), _A2T(setting), DBVType(type), value);
POPUPDATAT ppd = { 0 };