feat: add support for external plugins and enhance plugin management
This commit is contained in:
@@ -5,7 +5,7 @@ pub mod linux;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, PluginName, ResultId, ResultTitle, Score, SearchResult};
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, ResultId, ResultTitle, Score, SearchResult};
|
||||
|
||||
use crate::frecency::FrecencyStore;
|
||||
|
||||
@@ -144,7 +144,7 @@ pub(crate) fn humanize_category(s: &str) -> String {
|
||||
|
||||
#[async_trait]
|
||||
impl Plugin for AppsPlugin {
|
||||
fn name(&self) -> PluginName {
|
||||
fn name(&self) -> &str {
|
||||
"apps"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use async_trait::async_trait;
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, PluginName, ResultId, ResultTitle, Score, SearchResult};
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, ResultId, ResultTitle, Score, SearchResult};
|
||||
|
||||
pub struct CalcPlugin;
|
||||
|
||||
@@ -26,7 +26,7 @@ fn should_eval(query: &str) -> bool {
|
||||
|
||||
#[async_trait]
|
||||
impl Plugin for CalcPlugin {
|
||||
fn name(&self) -> PluginName {
|
||||
fn name(&self) -> &str {
|
||||
"calc"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use async_trait::async_trait;
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, PluginName, ResultId, ResultTitle, Score, SearchResult};
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, ResultId, ResultTitle, Score, SearchResult};
|
||||
|
||||
pub struct CmdPlugin;
|
||||
|
||||
@@ -17,7 +17,7 @@ impl Default for CmdPlugin {
|
||||
|
||||
#[async_trait]
|
||||
impl Plugin for CmdPlugin {
|
||||
fn name(&self) -> PluginName {
|
||||
fn name(&self) -> &str {
|
||||
"cmd"
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ mod platform;
|
||||
use std::path::Path;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, PluginName, ResultId, ResultTitle, Score, SearchResult};
|
||||
use k_launcher_kernel::{LaunchAction, Plugin, ResultId, ResultTitle, Score, SearchResult};
|
||||
|
||||
pub struct FilesPlugin;
|
||||
|
||||
@@ -32,7 +32,7 @@ fn expand_query(query: &str) -> Option<String> {
|
||||
|
||||
#[async_trait]
|
||||
impl Plugin for FilesPlugin {
|
||||
fn name(&self) -> PluginName {
|
||||
fn name(&self) -> &str {
|
||||
"files"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user