summaryrefslogtreecommitdiff
path: root/plugins/Msg_Export
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Msg_Export')
-rw-r--r--plugins/Msg_Export/src/main.cpp1
-rw-r--r--plugins/Msg_Export/src/options.cpp4
-rw-r--r--plugins/Msg_Export/src/stdafx.h1
-rw-r--r--plugins/Msg_Export/src/utils.cpp40
-rw-r--r--plugins/Msg_Export/src/utils.h1
5 files changed, 3 insertions, 44 deletions
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index 7f78b1eeb9..5b43b06505 100644
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -87,7 +87,6 @@ static int OnModuleLoaded(WPARAM, LPARAM)
int MainInit(WPARAM, LPARAM)
{
- bReadMirandaDirAndPath();
OnModuleLoaded(0, 0);
UpdateFileToColWidth();
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index e56c619679..47b81be3f8 100644
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -867,9 +867,9 @@ public:
void onClick_Debug(CCtrlButton*)
{
wstring sDebug = L"Debug information\r\nsDBPath :";
- sDebug += g_sDBPath;
+ sDebug += VARSW(L"%miranda_userdata%").get();
sDebug += L"\r\nsMirandaPath :";
- sDebug += g_sMirandaPath;
+ sDebug += VARSW(L"%miranda_path%").get();
sDebug += L"\r\nsDefaultFile :";
sDebug += g_sDefaultFile;
diff --git a/plugins/Msg_Export/src/stdafx.h b/plugins/Msg_Export/src/stdafx.h
index a914349564..528989ffa0 100644
--- a/plugins/Msg_Export/src/stdafx.h
+++ b/plugins/Msg_Export/src/stdafx.h
@@ -73,7 +73,6 @@ struct CMPlugin : public PLUGIN<CMPlugin>
};
extern MWindowList hInternalWindowList;
-extern wstring g_sDBPath, g_sMirandaPath;
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 69ca452030..97bae746d1 100644
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -34,12 +34,6 @@ wstring g_sExportDir;
// The default filename. Used if no other file name is specified in DB.
wstring g_sDefaultFile;
-// path used then %dbpath% is used in export file path
-wstring g_sDBPath = pszDbPathError;
-
-// path to miranda exe file used when to avoid relative paths
-wstring g_sMirandaPath = pszDbPathError;
-
// Used to store the width of the user name for a file.
// if a file contains events from many users the one user name
// may be shorter. so to make all event have the same first
@@ -224,47 +218,15 @@ wchar_t* GetMyOwnNick(MCONTACT hContact)
}
/////////////////////////////////////////////////////////////////////
-// Member Function : bReadMirandaDirAndPath
-// Type : Global
-// Parameters : None
-// Returns : void
-// Description : Used to set the internal path.
-// Handles the reading from the mirandaboot.ini to get the %dbpath%
-
-bool bReadMirandaDirAndPath()
-{
- wchar_t szDBPath[MAX_PATH], tmp[MAX_PATH];
- wcsncpy_s(szDBPath, pszDbPathError, _TRUNCATE);
- PathToAbsoluteW(L"miranda32.exe", tmp);
- g_sMirandaPath = tmp;
- g_sMirandaPath.erase(g_sMirandaPath.find_last_of(L"\\"));
- Profile_GetPathW(MAX_PATH, szDBPath);
- g_sDBPath = szDBPath;
- Profile_GetNameW(MAX_PATH, szDBPath);
- g_sDBPath.append(L"\\").append(szDBPath);
- g_sDBPath.erase(g_sDBPath.size() - 4);
- return true;
-}
-
-/////////////////////////////////////////////////////////////////////
// Member Function : ReplaceDBPath
// Type : Global
// Parameters : sRet - ?
void ReplaceDBPath(wstring &sRet)
{
- ReplaceAll(sRet, L"%dbpath%", g_sDBPath);
- // Try to figure out if it is a relative path ( ..\..\MsgExport\ )
- if (sRet.size() <= 2 || !(sRet[1] == ':' ||
- (sRet[0] == '\\' && sRet[1] == '\\'))) {
- // Relative path
- // we will prepend the mirande exe path to avoid problems
- // if the current directory changes ( User receives a file )
- sRet = g_sMirandaPath + sRet;
- }
+ ReplaceAll(sRet, L"%dbpath%", VARSW(L"%miranda_userdata%"));
}
-
/////////////////////////////////////////////////////////////////////
// Member Function : GetFilePathFromUser
// Type : Global
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h
index 2e10273cda..19a31de5b4 100644
--- a/plugins/Msg_Export/src/utils.h
+++ b/plugins/Msg_Export/src/utils.h
@@ -56,7 +56,6 @@ wstring __inline _DBGetStringW(MCONTACT hContact, const char *szModule, const ch
void UpdateFileToColWidth();
-bool bReadMirandaDirAndPath();
wstring GetFilePathFromUser(MCONTACT hContact);
void ReplaceDefines(MCONTACT hContact, wstring &sTarget);