From 7fdce14cd488e25e8e32e34098fbe9f5cb3021b7 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sun, 25 Nov 2012 12:51:05 +0000 Subject: - Xfire: forgotten fix git-svn-id: http://svn.miranda-ng.org/main/trunk@2479 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/searching4games.cpp | 5 ++-- protocols/Xfire/src/variables.cpp | 48 ++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 4 deletions(-) (limited to 'protocols/Xfire') 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 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; +} -- cgit v1.2.3