Clean up search engine

Notable changes:
1. Prevent excessive engine module imports.
2. Replace trivial usage of `join()`.
3. Keep the output text sorted whenever possible.
4. Close handles properly.
5. Print error to stderr, not stdout.
6. Report search job exit code.
7. Print exception message to stderr if exception was thrown when
   running a search job.
8. Utilize XML library to build XML data
   And use 2 spaces as indentation.

PR #21098.
This commit is contained in:
Chocobo1
2024-07-22 16:51:57 +08:00
committed by GitHub
parent 3c5baac150
commit 69a829dfb0
4 changed files with 168 additions and 198 deletions

View File

@@ -367,14 +367,14 @@ QString SearchPluginManager::categoryFullName(const QString &categoryName)
const QHash<QString, QString> categoryTable
{
{u"all"_s, tr("All categories")},
{u"movies"_s, tr("Movies")},
{u"tv"_s, tr("TV shows")},
{u"music"_s, tr("Music")},
{u"games"_s, tr("Games")},
{u"anime"_s, tr("Anime")},
{u"software"_s, tr("Software")},
{u"books"_s, tr("Books")},
{u"games"_s, tr("Games")},
{u"movies"_s, tr("Movies")},
{u"music"_s, tr("Music")},
{u"pictures"_s, tr("Pictures")},
{u"books"_s, tr("Books")}
{u"software"_s, tr("Software")},
{u"tv"_s, tr("TV shows")}
};
return categoryTable.value(categoryName);
}