diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-12 19:40:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-12 19:40:25 +0300 |
commit | a152440377a65b9ea4246f33b9e176a09161cf67 (patch) | |
tree | 77eb35ec0511c7ce5e93ca9daf2721cf6e9cb2c2 | |
parent | 3fe5f97dcd7c8ef8deabc32a83f5075df13bc8d2 (diff) |
useless function DbEvent_GetString removed
-rw-r--r-- | include/m_database.h | 13 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 245664 -> 245744 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 242736 -> 242852 bytes | |||
-rw-r--r-- | plugins/Dbx_sqlite/src/dbevents.cpp | 2 | ||||
-rw-r--r-- | plugins/IEView/src/HTMLBuilder.cpp | 12 | ||||
-rw-r--r-- | src/mir_app/src/db_events.cpp | 18 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 |
8 files changed, 16 insertions, 33 deletions
diff --git a/include/m_database.h b/include/m_database.h index 31b232ca90..3fa9e4e570 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -195,10 +195,6 @@ struct DBEVENTINFO return (flags & (DBEF_SENT | DBEF_READ)) != 0;
}
- wchar_t* getString(const char *str) const {
- return (flags & DBEF_UTF) ? mir_utf8decodeW(str) : mir_a2u(str);
- }
-
bool __forceinline operator==(const DBEVENTINFO &e) {
return (timestamp == e.timestamp && eventType == e.eventType && cbBlob == e.cbBlob && (flags & DBEF_SENT) == (e.flags & DBEF_SENT));
}
@@ -540,13 +536,6 @@ EXTERN_C MIR_APP_DLL(wchar_t*) DbEvent_GetTextW(DBEVENTINFO *dbei, int codepage) EXTERN_C MIR_APP_DLL(HICON) DbEvent_GetIcon(DBEVENTINFO *dbei, int flags);
/////////////////////////////////////////////////////////////////////////////////////////
-// Converts the event's string to wchar_t* depending on the event's format
-// returns wchar_t* - the converted string
-// Caller must free the result using mir_free
-
-EXTERN_C MIR_APP_DLL(wchar_t*) DbEvent_GetString(DBEVENTINFO *dbei, const char *str);
-
-/////////////////////////////////////////////////////////////////////////////////////////
// Database events
/////////////////////////////////////////////////////////////////////////////////////////
@@ -695,6 +684,8 @@ namespace DB ~EventInfo();
__forceinline operator bool() const { return bValid; }
+
+ wchar_t* getString(const char *str) const;
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 14ee34e3ee..2b977a54b5 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 96081e3827..65574852bc 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 6e91e33f98..36350ebeb0 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -40,7 +40,7 @@ void CDbxSQLite::InitEvents() GetEvent(hEvent, &dbei);
const char *p = (const char*)dbei.pBlob + sizeof(uint32_t);
- DB::FILE_BLOB blob(DbEvent_GetString(&dbei, p), DbEvent_GetString(&dbei, p + mir_strlen(p) + 1));
+ DB::FILE_BLOB blob(dbei.getString(p), dbei.getString(p + mir_strlen(p) + 1));
blob.write(dbei);
EditEvent(hEvent, &dbei);
}
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index aeab02c14f..2711b7da90 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -238,25 +238,19 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) eventData->iType = IEED_EVENT_STATUSCHANGE;
}
else if (dbei.eventType == EVENTTYPE_FILE) {
- DB::FILE_BLOB blob(dbei);
- eventData->szText.w = mir_wstrdup(blob.getName());
- /*if (*descr != '\0') {
- CMStringW tmp(FORMAT, L"%s (%s)", eventData->szText.w, ptrW(DbEvent_GetString(&dbei, descr)).get());
- mir_free((void*)eventData->szText.w);
- eventData->szText.w = tmp.Detach();
- }*/
+ eventData->szText.w = DbEvent_GetTextW(&dbei, newEvent.codepage);
eventData->iType = IEED_EVENT_FILE;
}
else if (dbei.eventType == EVENTTYPE_AUTHREQUEST) {
// blob is: uin(uint32_t), hContact(uint32_t), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
eventData->szText.w = mir_wstrdup(TranslateT(" requested authorization"));
- eventData->szNick.w = DbEvent_GetString(&dbei, (char *)dbei.pBlob + 8);
+ eventData->szNick.w = dbei.getString((char *)dbei.pBlob + 8);
eventData->iType = IEED_EVENT_SYSTEM;
}
else if (dbei.eventType == EVENTTYPE_ADDED) {
//blob is: uin(uint32_t), hContact(uint32_t), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
eventData->szText.w = mir_wstrdup(TranslateT(" was added."));
- eventData->szNick.w = DbEvent_GetString(&dbei, (char *)dbei.pBlob + 8);
+ eventData->szNick.w = dbei.getString((char *)dbei.pBlob + 8);
eventData->iType = IEED_EVENT_SYSTEM;
}
else { // custom event
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp index 263706d844..fefc83ba02 100644 --- a/src/mir_app/src/db_events.cpp +++ b/src/mir_app/src/db_events.cpp @@ -254,16 +254,6 @@ MIR_APP_DLL(HICON) DbEvent_GetIcon(DBEVENTINFO *dbei, int flags) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(wchar_t*) DbEvent_GetString(DBEVENTINFO *dbei, const char *str)
-{
- if (dbei->flags & DBEF_UTF)
- return mir_utf8decodeW(str);
-
- return mir_a2u(str);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
DB::EventInfo::EventInfo(MEVENT hEvent, bool bFetchBlob)
{
memset(this, 0, sizeof(*this));
@@ -283,6 +273,14 @@ DB::EventInfo::~EventInfo() mir_free(pBlob);
}
+wchar_t* DB::EventInfo::getString(const char *str) const
+{
+ if (flags & DBEF_UTF)
+ return mir_utf8decodeW(str);
+
+ return mir_a2u(str);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// File blob helper
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index c1d9a5682b..d586c688c3 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -205,7 +205,6 @@ Srmm_ModifyIcon @280 Srmm_RemoveIcon @281
ExtraIcon_AddIcon @282
DbEvent_GetIcon @283
-DbEvent_GetString @284
DbEvent_GetTextA @285
DbEvent_GetTextW @286
DbEvent_GetType @287
@@ -849,3 +848,4 @@ Chat_IsMuted @941 NONAME ?SetEventJson@MDatabaseCommon@@UAGHIPBDPAUDBVARIANT@@@Z @964 NONAME
?getSize@FILE_BLOB@DB@@QBEIXZ @965 NONAME
?getTransferred@FILE_BLOB@DB@@QBEIXZ @966 NONAME
+?getString@EventInfo@DB@@QBEPA_WPBD@Z @967 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 1ad0ea4d87..0d86eeb01a 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -205,7 +205,6 @@ Srmm_ModifyIcon @280 Srmm_RemoveIcon @281
ExtraIcon_AddIcon @282
DbEvent_GetIcon @283
-DbEvent_GetString @284
DbEvent_GetTextA @285
DbEvent_GetTextW @286
DbEvent_GetType @287
@@ -849,3 +848,4 @@ Chat_IsMuted @941 NONAME ?SetEventJson@MDatabaseCommon@@UEAAHIPEBDPEAUDBVARIANT@@@Z @964 NONAME
?getSize@FILE_BLOB@DB@@QEBAIXZ @965 NONAME
?getTransferred@FILE_BLOB@DB@@QEBAIXZ @966 NONAME
+?getString@EventInfo@DB@@QEBAPEA_WPEBD@Z @967 NONAME
|