Display the title from System.Title directly instead of extracting it from the path

This commit is contained in:
Alekhya Reddy 2020-04-08 18:16:40 -07:00
parent 42a54648a1
commit 549d68d3e8
3 changed files with 15 additions and 4 deletions

View file

@ -58,7 +58,7 @@ namespace Wox.Plugin.Indexer
workingDir = Path.GetDirectoryName(path);
Result r = new Result();
r.Title = Path.GetFileName(path);
r.Title = searchResult.Title;
r.SubTitle = path;
r.IcoPath = path;
r.Action = c =>

View file

@ -10,5 +10,9 @@ namespace Wox.Plugin.Indexer.SearchHelper
{
// Contains the Path of the file or folder
public string Path { get; set; }
// Contains the Title of the file or folder
public string Title { get; set; }
}
}

View file

@ -34,10 +34,17 @@ namespace Wox.Plugin.Indexer.SearchHelper
{
if(WDSResults.HasRows)
{
while (WDSResults.Read() && WDSResults.GetValue(0) != DBNull.Value)
while (WDSResults.Read())
{
var result = new SearchResult { Path = WDSResults.GetString(0) };
_Result.Add(result);
if(WDSResults.GetValue(0) != DBNull.Value && WDSResults.GetValue(1) != DBNull.Value)
{
var result = new SearchResult
{
Path = WDSResults.GetString(0),
Title = WDSResults.GetString(1)
};
_Result.Add(result);
}
}
}
}