Use Path.Combine where appropriate

This commit is contained in:
peter 2012-03-12 04:44:26 +00:00
parent ccc9fdf672
commit 1d111ce0ff
2 changed files with 49 additions and 47 deletions

View File

@ -1,4 +1,6 @@
namespace BizHawk.MultiClient using System.IO;
namespace BizHawk.MultiClient
{ {
public class Config public class Config
{ {
@ -46,71 +48,71 @@
public string LastRomPath = "."; public string LastRomPath = ".";
public string BasePath = "."; public string BasePath = ".";
public string BaseNES = ".\\NES"; public string BaseNES = Path.Combine(".", "NES");
public string PathNESROMs = "."; public string PathNESROMs = ".";
public string PathNESSavestates = ".\\State"; public string PathNESSavestates = Path.Combine(".", "State");
public string PathNESSaveRAM = ".\\SaveRAM"; public string PathNESSaveRAM = Path.Combine(".", "SaveRAM");
public string PathNESScreenshots = ".\\Screenshots"; public string PathNESScreenshots = Path.Combine(".", "Screenshots");
public string PathNESCheats = ".\\Cheats"; public string PathNESCheats = Path.Combine(".", "Cheats");
public string PathNESPalette = ".\\Palettes"; public string PathNESPalette = Path.Combine(".", "Palettes");
public string BaseSMS = ".\\SMS"; public string BaseSMS = Path.Combine(".", "SMS");
public string PathSMSROMs = "."; public string PathSMSROMs = ".";
public string PathSMSSavestates = ".\\State"; public string PathSMSSavestates = Path.Combine(".", "State");
public string PathSMSSaveRAM = ".\\SaveRAM"; public string PathSMSSaveRAM = Path.Combine(".", "SaveRAM");
public string PathSMSScreenshots = ".\\Screenshots"; public string PathSMSScreenshots = Path.Combine(".", "Screenshots");
public string PathSMSCheats = ".\\Cheats"; public string PathSMSCheats = Path.Combine(".", "Cheats");
public string BaseGG = ".\\Game Gear"; public string BaseGG = Path.Combine(".", "Game Gear");
public string PathGGROMs = "."; public string PathGGROMs = ".";
public string PathGGSavestates = ".\\State"; public string PathGGSavestates = Path.Combine(".", "State");
public string PathGGSaveRAM = ".\\SaveRAM"; public string PathGGSaveRAM = Path.Combine(".", "SaveRAM");
public string PathGGScreenshots = ".\\Screenshots"; public string PathGGScreenshots = Path.Combine(".", "Screenshots");
public string PathGGCheats = ".\\Cheats"; public string PathGGCheats = Path.Combine(".", "Cheats");
public string BaseSG = ".\\SG-1000"; public string BaseSG = Path.Combine(".", "SG-1000");
public string PathSGROMs = "."; public string PathSGROMs = ".";
public string PathSGSavestates = ".\\State"; public string PathSGSavestates = Path.Combine(".", "State");
public string PathSGSaveRAM = ".\\SaveRAM"; public string PathSGSaveRAM = Path.Combine(".", "SaveRAM");
public string PathSGScreenshots = ".\\Screenshots"; public string PathSGScreenshots = Path.Combine(".", "Screenshots");
public string PathSGCheats = ".\\Cheats"; public string PathSGCheats = Path.Combine(".", "Cheats");
public string BaseGenesis = ".\\Genesis"; public string BaseGenesis = Path.Combine(".", "Genesis");
public string PathGenesisROMs = "."; public string PathGenesisROMs = ".";
public string PathGenesisSavestates = ".\\State"; public string PathGenesisSavestates = Path.Combine(".", "State");
public string PathGenesisSaveRAM = ".\\SaveRAM"; public string PathGenesisSaveRAM = Path.Combine(".", "SaveRAM");
public string PathGenesisScreenshots = ".\\Screenshots"; public string PathGenesisScreenshots = Path.Combine(".", "Screenshots");
public string PathGenesisCheats = ".\\Cheats"; public string PathGenesisCheats = Path.Combine(".", "Cheats");
public string BasePCE = ".\\PC Engine"; public string BasePCE = Path.Combine(".", "PC Engine");
public string PathPCEROMs = "."; public string PathPCEROMs = ".";
public string PathPCESavestates = ".\\State"; public string PathPCESavestates = Path.Combine(".", "State");
public string PathPCESaveRAM = ".\\SaveRAM"; public string PathPCESaveRAM = Path.Combine(".", "SaveRAM");
public string PathPCEScreenshots = ".\\Screenshots"; public string PathPCEScreenshots = Path.Combine(".", "Screenshots");
public string PathPCECheats = ".\\Cheats"; public string PathPCECheats = Path.Combine(".", "Cheats");
public string BaseGameboy = ".\\Gameboy"; public string BaseGameboy = Path.Combine(".", "Gameboy");
public string PathGBROMs = "."; public string PathGBROMs = ".";
public string PathGBSavestates = ".\\State"; public string PathGBSavestates = Path.Combine(".", "State");
public string PathGBSaveRAM = ".\\SaveRAM"; public string PathGBSaveRAM = Path.Combine(".", "SaveRAM");
public string PathGBScreenshots = ".\\Screenshots"; public string PathGBScreenshots = Path.Combine(".", "Screenshots");
public string PathGBCheats = ".\\Cheats"; public string PathGBCheats = Path.Combine(".", "Cheats");
public string BaseTI83 = ".\\TI83"; public string BaseTI83 = Path.Combine(".", "TI83");
public string PathTI83ROMs = "."; public string PathTI83ROMs = ".";
public string PathTI83Savestates = ".\\State"; public string PathTI83Savestates = Path.Combine(".", "State");
public string PathTI83SaveRAM = ".\\SaveRAM"; public string PathTI83SaveRAM = Path.Combine(".", "SaveRAM");
public string PathTI83Screenshots = ".\\Screenshots"; public string PathTI83Screenshots = Path.Combine(".", "Screenshots");
public string PathTI83Cheats = ".\\Cheats"; public string PathTI83Cheats = Path.Combine(".", "Cheats");
public string MoviesPath = ".\\Movies"; public string MoviesPath = Path.Combine(".", "Movies");
public string LuaPath = ".\\Lua"; public string LuaPath = Path.Combine(".", "Lua");
public string WatchPath = "."; public string WatchPath = ".";
public string AVIPath = "."; public string AVIPath = ".";
//BIOS Paths //BIOS Paths
public string PathPCEBios = ".\\PCECDBios.pce"; //TODO: better default filename public string PathPCEBios = Path.Combine(".", "PCECDBios.pce"); //TODO: better default filename
public string FFMpegPath = "%exe%/ffmpeg.exe"; public string FFMpegPath = "%exe%/ffmpeg.exe";

View File

@ -91,7 +91,7 @@ namespace BizHawk.MultiClient
//we could background thread this later instead if we wanted to be real clever //we could background thread this later instead if we wanted to be real clever
NES.BootGodDB.GetDatabaseBytes = () => NES.BootGodDB.GetDatabaseBytes = () =>
{ {
using (HawkFile NesCartFile = new HawkFile(PathManager.GetExeDirectoryAbsolute() + "\\NesCarts.7z").BindFirst()) using (HawkFile NesCartFile = new HawkFile(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "NesCarts.7z")).BindFirst())
return Util.ReadAllBytes(NesCartFile.GetStream()); return Util.ReadAllBytes(NesCartFile.GetStream());
}; };
Global.MainForm = this; Global.MainForm = this;
@ -104,7 +104,7 @@ namespace BizHawk.MultiClient
Console.WriteLine("{0} - {1} ({2})", ci.FriendlyName, ci.Version, ci.ClassName); Console.WriteLine("{0} - {1} ({2})", ci.FriendlyName, ci.Version, ci.ClassName);
} }
Database.LoadDatabase(PathManager.GetExeDirectoryAbsolute() + "\\gamedb.txt"); Database.LoadDatabase(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb.txt"));
SyncPresentationMode(); SyncPresentationMode();