diff options
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r-- | protocols/Tox/src/main.cpp | 3 | ||||
-rw-r--r-- | protocols/Tox/src/tox_events.cpp | 7 | ||||
-rw-r--r-- | protocols/Tox/src/tox_folders.cpp | 8 | ||||
-rw-r--r-- | protocols/Tox/src/tox_profile.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 9 |
5 files changed, 15 insertions, 14 deletions
diff --git a/protocols/Tox/src/main.cpp b/protocols/Tox/src/main.cpp index fedd47ccc0..ffc0e5aafb 100644 --- a/protocols/Tox/src/main.cpp +++ b/protocols/Tox/src/main.cpp @@ -52,7 +52,8 @@ extern "C" int __declspec(dllexport) Load(void) CToxProto::InitIcons();
CToxProto::InitMenus();
- CToxProto::InitFolders();
+
+ HookEvent(ME_SYSTEM_MODULESLOADED, &CToxProto::OnModulesLoaded);
return 0;
}
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp index 87c688c593..fb1ce6ba43 100644 --- a/protocols/Tox/src/tox_events.cpp +++ b/protocols/Tox/src/tox_events.cpp @@ -1,5 +1,12 @@ #include "common.h"
+int CToxProto::OnModulesLoaded(WPARAM, LPARAM)
+{
+ hProfileFolderPath = FoldersRegisterCustomPathT("Tox", Translate("Profiles folder"), MIRANDA_USERDATAT);
+
+ return 0;
+}
+
int CToxProto::OnContactDeleted(MCONTACT hContact, LPARAM)
{
if (!IsOnline())
diff --git a/protocols/Tox/src/tox_folders.cpp b/protocols/Tox/src/tox_folders.cpp deleted file mode 100644 index a082aeb1b4..0000000000 --- a/protocols/Tox/src/tox_folders.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "common.h"
-
-HANDLE CToxProto::hProfileFolderPath = NULL;
-
-void CToxProto::InitFolders()
-{
- hProfileFolderPath = FoldersRegisterCustomPathT("Tox", Translate("Profiles folder"), MIRANDA_USERDATAT);
-}
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 9d1d446099..7ac4516cde 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -1,5 +1,7 @@ #include "common.h"
+HANDLE CToxProto::hProfileFolderPath;
+
std::tstring CToxProto::GetToxProfilePath()
{
return GetToxProfilePath(m_tszUserName);
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 9932a74aca..fc6e089f84 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -71,8 +71,8 @@ public: static void InitMenus();
static void UninitMenus();
- // folders
- static void InitFolders();
+ // events
+ static int OnModulesLoaded(WPARAM, LPARAM);
private:
Tox *tox;
@@ -83,6 +83,8 @@ private: bool isTerminated, isConnected;
CTransferList transfers;
+ static HANDLE hProfileFolderPath;
+
// tox profile
std::tstring GetToxProfilePath();
static std::tstring CToxProto::GetToxProfilePath(const TCHAR *accountName);
@@ -141,9 +143,6 @@ private: int OnInitStatusMenu();
- // folders
- static HANDLE hProfileFolderPath;
-
//services
INT_PTR __cdecl CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam);
|