diff options
author | George Hazan <ghazan@miranda.im> | 2018-08-29 13:21:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-08-29 13:21:54 +0300 |
commit | 10a09ce7de1c3b87a99db2089399246fb44b71b4 (patch) | |
tree | fc69f4baaec666beb92aa6bfb0408098f81cc5be /src | |
parent | fbfab572c944aba6e68531f7a6f20e0dad81eebb (diff) |
fix for more friendly conversion of file transfer events into text
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/db_events.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp index fb1dd02cb6..827069de90 100644 --- a/src/mir_app/src/db_events.cpp +++ b/src/mir_app/src/db_events.cpp @@ -166,12 +166,17 @@ static INT_PTR DbEventGetTextWorker(DBEVENTINFO *dbei, int codepage, int datatyp char *buf = LPSTR(dbei->pBlob) + sizeof(DWORD);
ptrW tszFileName(getEventString(dbei, buf));
ptrW tszDescription(getEventString(dbei, buf));
- ptrW &ptszText = (mir_wstrlen(tszDescription) == 0) ? tszFileName : tszDescription;
+ CMStringW wszText(tszFileName);
+ if (mir_wstrlen(tszDescription) > 0) {
+ wszText.Append(L": ");
+ wszText.Append(tszDescription);
+ }
+
switch (datatype) {
case DBVT_WCHAR:
- return (INT_PTR)ptszText.detach();
+ return (INT_PTR)wszText.Detach();
case DBVT_ASCIIZ:
- return (INT_PTR)mir_u2a(ptszText);
+ return (INT_PTR)mir_u2a(wszText);
}
return 0;
}
|