Permalink
Browse files

Renamed DetectedLocationPathHolder.fill_dir_path to FullDirPath for c…

…onsistency
  • Loading branch information...
sanmadjack committed Jun 16, 2013
1 parent be35cc3 commit 71e0ba7e078b2b50d3f9ae5addb48f3074062d1d
@@ -21,7 +21,7 @@ protected APCAnalyzer(CustomGameEntry game, RunWorkerCompletedEventHandler when_
if (path.EV == EnvironmentVariable.VirtualStore) {
string drive = Path.GetPathRoot(path.full_dir_path);
string drive = Path.GetPathRoot(path.FullDirPath);
string new_path = Path.Combine(drive, path.Path);
this.path = Core.locations.interpretPath(new_path).getMostAccurateLocation();
}
@@ -56,10 +56,10 @@ protected APCAnalyzer(CustomGameEntry game, RunWorkerCompletedEventHandler when_
ProgressHandler.max += 4;
outputLine();
outputLine("Path: ");
outputPath(path.full_dir_path);
outputPath(path.FullDirPath);
outputLine();
try {
scanForScumm(path.full_dir_path);
scanForScumm(path.FullDirPath);
} catch (Exception ex) {
outputLine("Error while attempting to cehck for ScummVM path entries:");
recordException(ex);
@@ -68,7 +68,7 @@ protected APCAnalyzer(CustomGameEntry game, RunWorkerCompletedEventHandler when_
TranslatingProgressHandler.setTranslatedMessage("DumpingFolder");
ProgressHandler.value++;
outputLine(Environment.NewLine + "Folder Dump: ");
travelFolder(path.full_dir_path);
travelFolder(path.FullDirPath);
} catch (Exception ex) {
outputLine("Error while attempting to search the save folder:");
recordException(ex);
@@ -138,7 +138,7 @@ public class ArchiveID : AIdentifier {
DetectedLocationPathHolder loc = first_file.OriginalLocation;
OriginalLocation = loc.full_dir_path;
OriginalLocation = loc.FullDirPath;
OriginalEV = loc.EV;
OriginalRelativePath = loc.Path;
}
@@ -12,7 +12,7 @@ public CustomGameVersion(GameSaveInfo.Game parent, DirectoryInfo location, strin
DetectedLocationPathHolder loc = locs.getMostAccurateLocation();
if (loc.EV == EnvironmentVariable.VirtualStore) {
string drive = Path.GetPathRoot(loc.full_dir_path);
string drive = Path.GetPathRoot(loc.FullDirPath);
string new_path = Path.Combine(drive, loc.Path);
loc = Core.locations.interpretPath(new_path).getMostAccurateLocation();
}
@@ -235,7 +235,7 @@ public class GameEntry : AModelItem<GameID> {
get {
ObservableCollection<string> return_me = new ObservableCollection<string>();
foreach (DetectedLocationPathHolder add_me in DetectedLocations) {
return_me.Add(add_me.full_dir_path);
return_me.Add(add_me.FullDirPath);
}
return return_me;
}
@@ -251,11 +251,12 @@ public class GameEntry : AModelItem<GameID> {
public bool Detect() {
// detect_override = rnd.Next(0, 2) == 0;
List<DetectedLocationPathHolder> interim = new List<DetectedLocationPathHolder>();
List<DetectedLocationPathHolder> interim = new List<DetectedLocationPathHolder>();
List<ALocation> locations = AllLocations;
if (this.id.OS != null && this.id.OS.StartsWith("PS"))
if (this.id.Name == "HalfLife2Deathmatch")
System.Console.Out.Write("");
foreach (ALocation location in locations) {
@@ -272,7 +273,7 @@ public class GameEntry : AModelItem<GameID> {
if (!parent_game.DetectionAttempted)
parent_game.Detect();
foreach (DetectedLocationPathHolder check_me in parent_game.DetectedLocations) {
string path = location.modifyPath(check_me.full_dir_path);
string path = location.modifyPath(check_me.FullDirPath);
interim.AddRange(Core.locations.interpretPath(path));
}
} else {
@@ -296,7 +297,7 @@ public class GameEntry : AModelItem<GameID> {
continue;
}
foreach (Identifier identifier in version.Identifiers) {
if (identifier.FindMatching(check_me.full_dir_path).Count > 0) {
if (identifier.FindMatching(check_me.FullDirPath).Count > 0) {
DetectedLocations.Add(check_me);
break;
}
@@ -305,7 +306,7 @@ public class GameEntry : AModelItem<GameID> {
_detected_paths_string = new StringBuilder();
foreach (DetectedLocationPathHolder location in DetectedLocations) {
_detected_paths_string.AppendLine(location.full_dir_path);
_detected_paths_string.AppendLine(location.FullDirPath);
}
NotifyPropertyChanged("IsDetected");
@@ -52,7 +52,7 @@ public APlaystationLocationHandler()
DetectedLocations interim = getPaths(id as LocationPath);
List<DetectedLocationPathHolder> return_me = new List<DetectedLocationPathHolder>();
foreach (DetectedLocationPathHolder path in interim) {
DirectoryInfo test = new DirectoryInfo(path.full_dir_path);
DirectoryInfo test = new DirectoryInfo(path.FullDirPath);
if (test.GetDirectories(id.ToString()).Length > 0) {
path.owner = null;
@@ -69,7 +69,7 @@ public APlaystationLocationHandler()
DetectedLocations interim = getPaths(id as LocationPath);
List<DetectedLocationPathHolder> return_me = new List<DetectedLocationPathHolder>();
foreach (DetectedLocationPathHolder path in interim) {
DirectoryInfo test = new DirectoryInfo(path.full_dir_path);
DirectoryInfo test = new DirectoryInfo(path.FullDirPath);
if (test.GetFiles(id.ToString()).Length > 0) {
path.owner = null;
return_me.Add(path);
@@ -59,7 +59,7 @@ public AScummVMLocationHandler()
foreach (string user in Locations.Keys) {
if (get_me.Name != "scummvm" && Locations[user].ContainsKey("scummvm")) {
foreach (DetectedLocationPathHolder path in loadLocations(Locations[user]["scummvm"], get_me, user)) {
DirectoryInfo info = new DirectoryInfo(path.full_dir_path);
DirectoryInfo info = new DirectoryInfo(path.FullDirPath);
if (info.GetFiles(get_me.Name + "*").Length > 0) {
return_me.Add(path);
}
@@ -93,7 +93,7 @@ public AScummVMLocationHandler()
//}
protected bool filterLocation(DetectedLocationPathHolder loc, ScummVM scumm, string user) {
DirectoryInfo dir = new DirectoryInfo(loc.full_dir_path);
DirectoryInfo dir = new DirectoryInfo(loc.FullDirPath);
string pattern = scumm.Name + "*";
if (dir.GetFiles(pattern).Length > 0) {
loc.owner = user;
@@ -15,7 +15,7 @@ public class DetectedLocations : Dictionary<string, DetectedLocationPathHolder>,
public void Add(DetectedLocationPathHolder path) {
// This compares the environment variables to ensure that the most accurate location gets used when the same path is entered twice
string key = path.full_dir_path;
string key = path.FullDirPath;
if (this.ContainsKey(key)) {
DetectedLocationPathHolder other = this[key];
if (path.EV > other.EV)
@@ -8,7 +8,7 @@ public class DetectedFile : DetectedLocationPathHolder, IEquatable<DetectedFile>
// }
public DetectedLocationPathHolder OriginalLocation { get; protected set; }
public DetectedFile(DetectedLocationPathHolder location, string path, string name, string type)
: base(location, location.full_dir_path, location.owner) {
: base(location, location.FullDirPath, location.owner) {
OriginalLocation = location;
this.Path = path;
@@ -32,11 +32,11 @@ public DetectedFile(DetectedLocationPathHolder location, string path, string nam
// Gets the full path, including file name
public string full_file_path {
get {
if (full_dir_path != null) {
if (FullDirPath != null) {
if (Name != null && Name != "") {
return System.IO.Path.Combine(full_dir_path, Name);
return System.IO.Path.Combine(FullDirPath, Name);
} else {
return full_dir_path;
return FullDirPath;
}
} else {
return null;
@@ -50,7 +50,7 @@ public class DetectedFiles : DictionaryList<string, DetectedFile> {
private static List<DetectedFile> GatherFiles(Exclude save, DetectedLocationPathHolder location, Regex reg) {
List<DetectedFile> files = new List<DetectedFile>();
foreach (string file in save.FindMatching(location.full_dir_path)) {
foreach (string file in save.FindMatching(location.FullDirPath)) {
string name = Path.GetFileName(file);
string path = file.Substring(0, file.Length - name.Length).Trim(Path.DirectorySeparatorChar);
@@ -41,7 +41,7 @@ public DetectedLocationPathHolder(EnvironmentVariable ev, string absolute_root,
// Gets the full absolute path of the folfer
public string full_dir_path {
public string FullDirPath {
get {
if (AbsoluteRoot != null && AbsoluteRoot != "") {
if (Path == null || Path == "") {
@@ -57,7 +57,7 @@ public DetectedLocationPathHolder(EnvironmentVariable ev, string absolute_root,
public bool Exists {
get {
return Directory.Exists(full_dir_path);
return Directory.Exists(FullDirPath);
}
}
@@ -120,13 +120,13 @@ public DetectedLocationPathHolder(EnvironmentVariable ev, string absolute_root,
public void delete() {
try {
DirectoryInfo info = new DirectoryInfo(full_dir_path);
DirectoryInfo info = new DirectoryInfo(FullDirPath);
if (info.Exists) {
info.Attributes = FileAttributes.Normal;
info.Delete(true);
}
} catch (Exception e) {
throw new Translator.TranslateableException("DeleteError", e, full_dir_path);
throw new Translator.TranslateableException("DeleteError", e, FullDirPath);
}
}
}
@@ -140,7 +140,7 @@ public class Monitor : ANotifyingObject {
_status = game.Name + " updating " + Path.Combine(this_file.Path, this_file.Name);
NotifyPropertyChanged("Status");
if (this_file.full_dir_path == null)
if (this_file.FullDirPath == null)
continue;
Archive archive = Archives.GetArchive(game, this_file);
@@ -8,7 +8,7 @@ public class MonitorPath : FileSystemWatcher {
public new DetectedLocationPathHolder Path { get; protected set; }
public GameEntry Game { get; protected set; }
public MonitorPath(GameEntry game, DetectedLocationPathHolder path)
: base(path.full_dir_path, "*") {
: base(path.FullDirPath, "*") {
this.Path = path;
this.Game = game;
@@ -51,7 +51,7 @@ public RestoreProgramHandler(Archive archive, ALocationsHandler loc)
// Checks if the provided path is the original archive path
if (location is DetectedLocationPathHolder) {
DetectedLocationPathHolder loc = location as DetectedLocationPathHolder;
if (archive.id.OriginalLocation != null && archive.id.OriginalLocation.ToLower() == loc.full_dir_path.ToLower()) {
if (archive.id.OriginalLocation != null && archive.id.OriginalLocation.ToLower() == loc.FullDirPath.ToLower()) {
loc.MatchesOriginalPath = true;
}
}
@@ -77,7 +77,7 @@ public RestoreProgramHandler(Archive archive, ALocationsHandler loc)
// If the present path is a real, detected path
DetectedLocationPathHolder path = path_candidates[i] as DetectedLocationPathHolder;
// We compare the absolute paths
if (path.full_dir_path.ToLower() == loc.full_dir_path.ToLower()) {
if (path.FullDirPath.ToLower() == loc.FullDirPath.ToLower()) {
// If it's two real, detected paths that are the same location, we compare EVs
if (loc.EV > path.EV) {
// If the new EV is better, then we replace the old one
@@ -254,7 +254,7 @@ public RestoreProgramHandler(Archive archive, ALocationsHandler loc)
// This adds a fake VirtualStore folder, just in case
if (Core.locations.uac_enabled) {
DetectedLocationPathHolder temp = new DetectedLocationPathHolder(location, Core.locations.getFolder(EnvironmentVariable.LocalAppData, location.owner), location.owner);
temp.ReplacePath(Path.Combine("VirtualStore", location.full_dir_path.Substring(3)));
temp.ReplacePath(Path.Combine("VirtualStore", location.FullDirPath.Substring(3)));
temp.EV = EnvironmentVariable.LocalAppData;
addPathCandidate(temp);
}
@@ -441,7 +441,7 @@ public RestoreProgramHandler(Archive archive, ALocationsHandler loc)
target = loc.ManualPath;
} else if (path is DetectedLocationPathHolder) {
DetectedLocationPathHolder loc = path as DetectedLocationPathHolder;
target = loc.full_dir_path;
target = loc.FullDirPath;
} else {
target = Core.locations.getAbsolutePath(path, user);
}
@@ -34,7 +34,7 @@ public ManualArchiveWindow(GameEntry new_game, IWindow owner)
// rootCombo.Items.Add(file.Value.owner);
//else
// rootCombo.Items.Add("Global");
rootCombo.Items.Add(file.full_dir_path);
rootCombo.Items.Add(file.FullDirPath);
}
if (rootCombo.Items.Contains(Environment.UserName))
rootCombo.SelectedIndex = rootCombo.Items.IndexOf(Environment.UserName);
@@ -80,7 +80,7 @@ public ManualArchiveWindow(GameEntry new_game, IWindow owner)
// This gets every detected save file
foreach (DetectedFile save in saves) {
// This tests if the save is from the currently selected root folder
if (save.AbsoluteRoot == game.DetectedLocations[rootCombo.SelectedItem.ToString()].full_dir_path) {
if (save.AbsoluteRoot == game.DetectedLocations[rootCombo.SelectedItem.ToString()].FullDirPath) {
string path = Path.Combine(save.Path, save.Name);
file_tree.addFile(new List<string>(path.Split(Path.DirectorySeparatorChar)), save);
// Splits the path into folders
@@ -26,7 +26,7 @@ public PCAnalyzer(CustomGameEntry game, RunWorkerCompletedEventHandler when_done
LocationPath parse_me = new LocationPath(EnvironmentVariable.LocalAppData, "VirtualStore");
virtual_path = Path.Combine(Core.locations.getAbsoluteRoot(parse_me, user), "VirtualStore");
virtual_path = Path.Combine(virtual_path, path.full_dir_path.Substring(3));
virtual_path = Path.Combine(virtual_path, path.FullDirPath.Substring(3));
if (Directory.Exists(virtual_path))
travelFolder(virtual_path);
@@ -85,7 +85,7 @@ public PCAnalyzer(CustomGameEntry game, RunWorkerCompletedEventHandler when_done
value.value = check_me;
if (look_here.GetValue(check_me) != null) {
value.data = look_here.GetValue(check_me).ToString();
if (value.data.Length >= path.full_dir_path.Length && path.full_dir_path.ToLower() == value.data.Substring(0, path.full_dir_path.Length).ToLower()) {
if (value.data.Length >= path.FullDirPath.Length && path.FullDirPath.ToLower() == value.data.Substring(0, path.FullDirPath.Length).ToLower()) {
outputLine(Environment.NewLine + "Key:" + value.key);
outputLine("Value: " + value.value);
output("Data: ");
@@ -138,7 +138,7 @@ public PCAnalyzer(CustomGameEntry game, RunWorkerCompletedEventHandler when_done
foreach (FileInfo shortcut in new DirectoryInfo(look_here).GetFiles("*.lnk")) {
try {
link = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(shortcut.FullName);
if (link.TargetPath.Length >= path.full_dir_path.Length && path.full_dir_path.ToLower() == link.TargetPath.Substring(0, path.full_dir_path.Length).ToLower()) {
if (link.TargetPath.Length >= path.FullDirPath.Length && path.FullDirPath.ToLower() == link.TargetPath.Substring(0, path.FullDirPath.Length).ToLower()) {
this.outputPath(shortcut.FullName);
this.outputPath(link.TargetPath);
}

0 comments on commit 71e0ba7

Please sign in to comment.