mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3509 from Flow-Launcher/mainvm_more_log
Add more debug log info for query
This commit is contained in:
commit
e4ecea096b
1 changed files with 15 additions and 0 deletions
|
|
@ -1215,10 +1215,14 @@ namespace Flow.Launcher.ViewModel
|
||||||
{
|
{
|
||||||
_updateSource?.Cancel();
|
_updateSource?.Cancel();
|
||||||
|
|
||||||
|
App.API.LogDebug(ClassName, $"Start query with text: <{QueryText}>");
|
||||||
|
|
||||||
var query = await ConstructQueryAsync(QueryText, Settings.CustomShortcuts, Settings.BuiltinShortcuts);
|
var query = await ConstructQueryAsync(QueryText, Settings.CustomShortcuts, Settings.BuiltinShortcuts);
|
||||||
|
|
||||||
if (query == null) // shortcut expanded
|
if (query == null) // shortcut expanded
|
||||||
{
|
{
|
||||||
|
App.API.LogDebug(ClassName, $"Clear query results");
|
||||||
|
|
||||||
// Hide and clear results again because running query may show and add some results
|
// Hide and clear results again because running query may show and add some results
|
||||||
Results.Visibility = Visibility.Collapsed;
|
Results.Visibility = Visibility.Collapsed;
|
||||||
Results.Clear();
|
Results.Clear();
|
||||||
|
|
@ -1233,6 +1237,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App.API.LogDebug(ClassName, $"Start query with ActionKeyword <{query.ActionKeyword}> and RawQuery <{query.RawQuery}>");
|
||||||
|
|
||||||
_updateSource = new CancellationTokenSource();
|
_updateSource = new CancellationTokenSource();
|
||||||
|
|
||||||
ProgressBarVisibility = Visibility.Hidden;
|
ProgressBarVisibility = Visibility.Hidden;
|
||||||
|
|
@ -1253,6 +1259,9 @@ namespace Flow.Launcher.ViewModel
|
||||||
|
|
||||||
var plugins = PluginManager.ValidPluginsForQuery(query);
|
var plugins = PluginManager.ValidPluginsForQuery(query);
|
||||||
|
|
||||||
|
var validPluginNames = plugins.Select(x => $"<{x.Metadata.Name}>");
|
||||||
|
App.API.LogDebug(ClassName, $"Valid <{plugins.Count}> plugins: {string.Join(" ", validPluginNames)}");
|
||||||
|
|
||||||
if (plugins.Count == 1)
|
if (plugins.Count == 1)
|
||||||
{
|
{
|
||||||
PluginIconPath = plugins.Single().Metadata.IcoPath;
|
PluginIconPath = plugins.Single().Metadata.IcoPath;
|
||||||
|
|
@ -1321,6 +1330,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
// Local function
|
// Local function
|
||||||
async Task QueryTaskAsync(PluginPair plugin, CancellationToken token)
|
async Task QueryTaskAsync(PluginPair plugin, CancellationToken token)
|
||||||
{
|
{
|
||||||
|
App.API.LogDebug(ClassName, $"Wait for querying plugin <{plugin.Metadata.Name}>");
|
||||||
|
|
||||||
if (searchDelay)
|
if (searchDelay)
|
||||||
{
|
{
|
||||||
var searchDelayTime = plugin.Metadata.SearchDelayTime ?? Settings.SearchDelayTime;
|
var searchDelayTime = plugin.Metadata.SearchDelayTime ?? Settings.SearchDelayTime;
|
||||||
|
|
@ -1359,6 +1370,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
|
|
||||||
if (token.IsCancellationRequested) return;
|
if (token.IsCancellationRequested) return;
|
||||||
|
|
||||||
|
App.API.LogDebug(ClassName, $"Update results for plugin <{plugin.Metadata.Name}>");
|
||||||
|
|
||||||
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, plugin.Metadata, query,
|
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, plugin.Metadata, query,
|
||||||
token, reSelect)))
|
token, reSelect)))
|
||||||
{
|
{
|
||||||
|
|
@ -1448,6 +1461,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
{
|
{
|
||||||
if (_lastQuery?.ActionKeyword != query?.ActionKeyword)
|
if (_lastQuery?.ActionKeyword != query?.ActionKeyword)
|
||||||
{
|
{
|
||||||
|
App.API.LogDebug(ClassName, $"Remove old results");
|
||||||
|
|
||||||
Results.Clear();
|
Results.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue