Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Made a git class, still need todo:testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
mbos committed Oct 29, 2015
1 parent b2d0073 commit 1e1524f
Show file tree
Hide file tree
Showing 16 changed files with 283 additions and 1,170 deletions.
4 changes: 0 additions & 4 deletions .coverity/buildLog/logStatus

This file was deleted.

4 changes: 0 additions & 4 deletions .coverity/buildLog/projectsScope

This file was deleted.

This file was deleted.

This file was deleted.

Binary file removed .coverity/idir/emit/DESKTOP-6U34MAO/emit-db
Binary file not shown.
1 change: 0 additions & 1 deletion .coverity/idir/emit/DESKTOP-6U34MAO/emit-db.lock

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions .coverity/idir/emit/version

This file was deleted.

4 changes: 0 additions & 4 deletions .coverity/idir/projectsScope

This file was deleted.

764 changes: 0 additions & 764 deletions .coverity/idir/toolsOutput.txt

This file was deleted.

23 changes: 21 additions & 2 deletions Pass4Win/FileSystemInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ public void Search(string searchtext)
this.SearchList.Clear();
foreach (FileInfo tmpFileInfo in new DirectoryInfo(this.passWordStore).GetFiles("*.gpg", SearchOption.AllDirectories))
{
if(Regex.IsMatch(tmpFileInfo.Name, WildcardToRegex(searchtext), RegexOptions.IgnoreCase))
if(Regex.IsMatch(tmpFileInfo.Name, this.WildcardToRegex(searchtext), RegexOptions.IgnoreCase))
{
this.SearchList.Add(tmpFileInfo.FullName);
}
}
if (SearchList.Count == 0)
{
this.SearchList.Add("No Value");
}
}

/// <summary>
Expand Down Expand Up @@ -117,7 +121,22 @@ public TreeNode[] UpdateDirectoryTree(DirectoryInfo path)
/// </returns>
public List<string> UpdateDirectoryList(DirectoryInfo directoryInfo)
{
return (from ffile in directoryInfo.GetFiles() where !ffile.Name.StartsWith(".") where ffile.Extension.ToLower() == ".gpg" select Path.GetFileNameWithoutExtension(ffile.Name)).ToList();
List<string> list = new List<string>();
foreach (var ffile in directoryInfo.GetFiles())
{
if (!ffile.Name.StartsWith("."))
{
if (ffile.Extension.ToLower() == ".gpg")
{
list.Add(Path.GetFileNameWithoutExtension(ffile.Name));
}
}
}
if (list.Count == 0)
{
return null;
}
return list;
}

private string WildcardToRegex(string pattern)
Expand Down
Loading

0 comments on commit 1e1524f

Please sign in to comment.