summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-05 19:25:49 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-05 19:25:49 +0000
commit4895fb61e1e1538ca039fcf803f2829cdf3371c2 (patch)
tree4c80edeefb95df3aeeb58c060ae5a88d8388ea15
parentd770f3eb807b9b1c9f844a005179f93893183133 (diff)
Tox: more correct way to register folders
git-svn-id: http://svn.miranda-ng.org/main/trunk@12332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Tox/Tox_12.vcxproj1
-rw-r--r--protocols/Tox/Tox_12.vcxproj.filters3
-rw-r--r--protocols/Tox/src/main.cpp3
-rw-r--r--protocols/Tox/src/tox_events.cpp7
-rw-r--r--protocols/Tox/src/tox_folders.cpp8
-rw-r--r--protocols/Tox/src/tox_profile.cpp2
-rw-r--r--protocols/Tox/src/tox_proto.h9
7 files changed, 15 insertions, 18 deletions
diff --git a/protocols/Tox/Tox_12.vcxproj b/protocols/Tox/Tox_12.vcxproj
index 31c52283a9..9afe2be779 100644
--- a/protocols/Tox/Tox_12.vcxproj
+++ b/protocols/Tox/Tox_12.vcxproj
@@ -232,7 +232,6 @@ copy docs\tox.ini "$(SolutionDir)$(Configuration)64\Plugins" /y</Command>
<ClCompile Include="src\tox_avatars.cpp" />
<ClCompile Include="src\tox_events.cpp" />
<ClCompile Include="src\tox_chatrooms.cpp" />
- <ClCompile Include="src\tox_folders.cpp" />
<ClCompile Include="src\tox_icons.cpp" />
<ClCompile Include="src\tox_menus.cpp" />
<ClCompile Include="src\tox_messages.cpp" />
diff --git a/protocols/Tox/Tox_12.vcxproj.filters b/protocols/Tox/Tox_12.vcxproj.filters
index 526b86f4ff..d04033b672 100644
--- a/protocols/Tox/Tox_12.vcxproj.filters
+++ b/protocols/Tox/Tox_12.vcxproj.filters
@@ -143,9 +143,6 @@
<ClCompile Include="src\tox_icons.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\tox_folders.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
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);