summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-11-25 12:51:05 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-11-25 12:51:05 +0000
commit7fdce14cd488e25e8e32e34098fbe9f5cb3021b7 (patch)
tree6ff1eb448d80fb15cbadff8a3ceff51c2d61390b
parent4ae40c20b76552877e2007763dc6b61c1475401a (diff)
- Xfire: forgotten fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@2479 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Xfire/src/searching4games.cpp5
-rw-r--r--protocols/Xfire/src/variables.cpp48
2 files changed, 49 insertions, 4 deletions
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp
index b40a607990..27348bc926 100644
--- a/protocols/Xfire/src/searching4games.cpp
+++ b/protocols/Xfire/src/searching4games.cpp
@@ -27,7 +27,7 @@
#include "stdafx.h"
#include "baseProtocol.h"
#include "Xfire_gamelist.h"
-
+#include "variables.h"
#include <string>
using std::string;
@@ -244,8 +244,7 @@ void Scan4Games( LPVOID lparam )
mir_forkthread(ShowSearchDialog,&hwnd);
}
- FoldersGetCustomPath( XFireWorkingFolder, inipath, 1024, "" );
- strcat(inipath,"\\");
+ strcpy(inipath, XFireGetFoldersPath ("IniFile"));
strcat(inipath,"xfire_games.ini");
//erstmal db säubern
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp
index 5527c06100..07724b21c2 100644
--- a/protocols/Xfire/src/variables.cpp
+++ b/protocols/Xfire/src/variables.cpp
@@ -165,4 +165,50 @@ char* Varmyxfirevoice(ARGUMENTSINFO *ai)
}
return mir_strdup("");
-} \ No newline at end of file
+}
+
+char* XFireGetFoldersPath(char * pathtype)
+{// Get XFire folder path
+extern HANDLE XFireWorkingFolder;
+extern HANDLE XFireIconFolder;
+extern HANDLE XFireAvatarFolder;
+ char path[1024] = "";
+ if (ServiceExists(MS_FOLDERS_REGISTER_PATH)){
+ if (pathtype == "Avatar"){
+ FoldersGetCustomPath(XFireAvatarFolder, path, 1024, "" );}
+ if (pathtype == "IniFile"){
+ FoldersGetCustomPath(XFireWorkingFolder, path, 1024, "" );}
+ if (pathtype == "IconsFile"){
+ FoldersGetCustomPath(XFireIconFolder, path, 1024, "" );}
+ strcat(path,"\\");
+ return path;
+ }
+ else {
+/******BASE********/
+ char BaseFolder[MAX_PATH]= "";
+ char CurProfileF[MAX_PATH] = "";
+ char CurProfile[MAX_PATH] = "";
+ CallService(MS_DB_GETPROFILEPATH, (WPARAM) MAX_PATH, (LPARAM)BaseFolder);
+ strcat(BaseFolder, "\\");
+ CallService(MS_DB_GETPROFILENAME, (WPARAM) MAX_PATH, (LPARAM)CurProfileF);
+ int i;
+ for (i = MAX_PATH; 5; i--){
+ if (CurProfileF[i] == 't' && CurProfileF[i-3] == '.'){
+ i = i-3;
+ break;
+ }
+ }
+ memcpy(CurProfile, CurProfileF, i);
+ strcat(BaseFolder, CurProfile);
+ strcat(BaseFolder, "\\");
+ strcat(BaseFolder, "XFire");
+ strcat(BaseFolder, "\\");
+/*******BASE********/
+ if (pathtype == "Avatar"){
+ strcat(BaseFolder, "Avatars");
+ strcat(BaseFolder, "\\");
+ }
+ strcat(path, BaseFolder);
+ }
+ return path;
+}