diff options
Diffstat (limited to 'plugins/Msg_Export/src')
-rw-r--r-- | plugins/Msg_Export/src/utils.cpp | 11 | ||||
-rw-r--r-- | plugins/Msg_Export/src/utils.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 97bae746d1..8544154802 100644 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -184,11 +184,11 @@ int nContactDeleted(WPARAM hContact, LPARAM) if (g_enDeleteAction == eDANothing)
return 0;
- wstring sFilePath = GetFilePathFromUser(hContact);
+ wstring sFilePath = GetFilePathFromUser(hContact, true);
// Test if there is another user using this file
for (auto &hOtherContact : Contacts())
- if (hContact != hOtherContact && sFilePath == GetFilePathFromUser(hOtherContact))
+ if (hContact != hOtherContact && sFilePath == GetFilePathFromUser(hOtherContact, true))
return 0; // we found another contact abort mission :-)
// Test to see if there is a file to delete
@@ -241,8 +241,12 @@ static bool CompareNoExt(const wstring &s1, const wstring &s2) return t1 == t2;
}
-wstring GetFilePathFromUser(MCONTACT hContact)
+wstring GetFilePathFromUser(MCONTACT hContact, bool bIgnoreRename)
{
+ wstring sPrevFileName = _DBGetStringW(hContact, MODULENAME, "PrevFileName", L"");
+ if (!sPrevFileName.empty() && bIgnoreRename)
+ return sPrevFileName;
+
wstring sFilePath = g_sExportDir + _DBGetStringW(hContact, MODULENAME, "FileName", g_sDefaultFile.c_str());
if (g_bUseJson)
sFilePath += L".json";
@@ -257,7 +261,6 @@ wstring GetFilePathFromUser(MCONTACT hContact) ReplaceDBPath(sFilePath);
// Previous file name check to see if it has changed !!
- wstring sPrevFileName = _DBGetStringW(hContact, MODULENAME, "PrevFileName", L"");
if (!CompareNoExt(sNoDBPath, sPrevFileName)) {
if (!sPrevFileName.empty()) {
ReplaceDBPath(sPrevFileName);
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h index 19a31de5b4..c39b0770ae 100644 --- a/plugins/Msg_Export/src/utils.h +++ b/plugins/Msg_Export/src/utils.h @@ -56,7 +56,7 @@ wstring __inline _DBGetStringW(MCONTACT hContact, const char *szModule, const ch void UpdateFileToColWidth();
-wstring GetFilePathFromUser(MCONTACT hContact);
+wstring GetFilePathFromUser(MCONTACT hContact, bool bIgnoreRename = false);
void ReplaceDefines(MCONTACT hContact, wstring &sTarget);
void ReplaceTimeVariables(wstring &sRet);
|