🎨 Unified file listener logic (#17134)

This commit is contained in:
Jeffrey Chen 2026-03-04 22:33:35 +08:00 committed by GitHub
parent ba733eedfd
commit 26c378a820
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 462 additions and 191 deletions

View file

@ -432,7 +432,7 @@ func InstalledThemes(keyword string) (ret []*bazaar.Theme) {
}
func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bool) error {
closeThemeWatchers()
CloseWatchThemes()
installPath := filepath.Join(util.ThemesPath, themeName)
err := bazaar.InstallTheme(repoURL, repoHash, installPath, Conf.System.ID)
@ -458,7 +458,7 @@ func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bo
}
func UninstallBazaarTheme(themeName string) error {
closeThemeWatchers()
CloseWatchThemes()
installPath := filepath.Join(util.ThemesPath, themeName)
err := bazaar.UninstallTheme(installPath)
@ -580,3 +580,8 @@ func getSearchKeywords(query string) (ret []string) {
}
return
}
// isBuiltInTheme 通过包名或目录名判断是否为内置主题
func isBuiltInTheme(name string) bool {
return "daylight" == name || "midnight" == name
}