From cc3d5628fade322f81abad8715d3d2ab031bc8b6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 Nov 2017 21:25:53 +0300 Subject: fixes #1044 --- plugins/SmileyAdd/src/options.cpp | 4 ++-- plugins/SmileyAdd/src/smileys.cpp | 19 ++++++------------- plugins/SmileyAdd/src/smileys.h | 1 - plugins/SmileyAdd/src/version.h | 6 +++--- 4 files changed, 11 insertions(+), 19 deletions(-) (limited to 'plugins/SmileyAdd') diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index b0fd12b50b..780c06c131 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -482,9 +482,9 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) wchar_t filter[512], *pfilter; mir_wstrcpy(filter, TranslateT("Smiley packs")); - mir_wstrcat(filter, L" (*.msl;*.asl;*.xep)"); + mir_wstrcat(filter, L" (*.msl;*.asl)"); pfilter = filter + mir_wstrlen(filter) + 1; - mir_wstrcpy(pfilter, L"*.msl;*.asl;*.xep"); + mir_wstrcpy(pfilter, L"*.msl;*.asl"); pfilter = pfilter + mir_wstrlen(pfilter) + 1; mir_wstrcpy(pfilter, TranslateT("All files")); mir_wstrcat(pfilter, L" (*.*)"); diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 3839c51951..21e879f87e 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -328,7 +328,7 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW & CMStringW modpath; pathToAbsolute(filename, modpath); - // Load xep file + // Load file int fh = _wopen(modpath.c_str(), _O_BINARY | _O_RDONLY); if (fh == -1) { if (!noerr) { @@ -350,7 +350,7 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW & // Allocate file buffer char *buf = new char[flen + sizeof(wchar_t)]; - // Read xep file in + // Read file in int len = _read(fh, buf, flen); *(wchar_t*)(buf + len) = 0; @@ -368,16 +368,6 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW & delete[] buf; - bool res = LoadSmileyFileMSL(tbuf, onlyInfo, modpath); - - if (errorFound) - ReportError(TranslateT("There were problems loading smiley pack (it should be corrected).\nSee network log for details.")); - - return res; -} - -bool SmileyPackType::LoadSmileyFileMSL(CMStringW &tbuf, bool onlyInfo, CMStringW &modpath) -{ CMStringW pathstr, packstr; { MRegexp16 pathsplit(L"(.*\\\\)(.*)\\.|$"); @@ -482,7 +472,6 @@ bool SmileyPackType::LoadSmileyFileMSL(CMStringW &tbuf, bool onlyInfo, CMStringW ReplaceAllSpecials(dat->m_TriggerText, dat->m_ToolText); } - bool noerr; if (resname.IsEmpty()) { dat->SetHidden(true); dat->SetText(true); @@ -509,6 +498,10 @@ bool SmileyPackType::LoadSmileyFileMSL(CMStringW &tbuf, bool onlyInfo, CMStringW m_VisibleCount = m_SmileyList.getCount(); m_SmileyList.splice(hiddenSmileys); AddTriggersToSmileyLookup(); + + if (errorFound) + ReportError(TranslateT("There were problems loading smiley pack (it should be corrected).\nSee network log for details.")); + return true; } diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index b0f1371d8e..6eca91c18b 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -182,7 +182,6 @@ private: void AddTriggersToSmileyLookup(void); void ReplaceAllSpecials(const CMStringW &Input, CMStringW &Output); - bool LoadSmileyFileMSL(CMStringW &tbuf, bool onlyInfo, CMStringW &modpath); public: SmileyPackType(); diff --git a/plugins/SmileyAdd/src/version.h b/plugins/SmileyAdd/src/version.h index 084efc5042..8d5a256e61 100644 --- a/plugins/SmileyAdd/src/version.h +++ b/plugins/SmileyAdd/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 -#define __MINOR_VERSION 2 -#define __RELEASE_NUM 4 -#define __BUILD_NUM 2 +#define __MINOR_VERSION 3 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 1 #include -- cgit v1.2.3