Fix second audit findings and restore crash detection dialog
This commit is contained in:
@@ -446,14 +446,14 @@ pub fn generate_catalog(db: &Database) -> Result<String, AppStreamError> {
|
||||
xml.push_str(" </categories>\n");
|
||||
}
|
||||
|
||||
// Provide hint about source
|
||||
xml.push_str(" <metadata>\n");
|
||||
xml.push_str(" <value key=\"managed-by\">driftwood</value>\n");
|
||||
// Provide hint about source (AppStream spec uses <custom> for key-value data)
|
||||
xml.push_str(" <custom>\n");
|
||||
xml.push_str(" <value key=\"Driftwood::managed-by\">driftwood</value>\n");
|
||||
xml.push_str(&format!(
|
||||
" <value key=\"appimage-path\">{}</value>\n",
|
||||
" <value key=\"Driftwood::appimage-path\">{}</value>\n",
|
||||
xml_escape(&record.path),
|
||||
));
|
||||
xml.push_str(" </metadata>\n");
|
||||
xml.push_str(" </custom>\n");
|
||||
|
||||
xml.push_str(" </component>\n");
|
||||
}
|
||||
@@ -467,8 +467,7 @@ pub fn generate_catalog(db: &Database) -> Result<String, AppStreamError> {
|
||||
pub fn install_catalog(db: &Database) -> Result<PathBuf, AppStreamError> {
|
||||
let catalog_xml = generate_catalog(db)?;
|
||||
|
||||
let catalog_dir = dirs::data_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("~/.local/share"))
|
||||
let catalog_dir = crate::config::data_dir_fallback()
|
||||
.join("swcatalog")
|
||||
.join("xml");
|
||||
|
||||
@@ -484,8 +483,7 @@ pub fn install_catalog(db: &Database) -> Result<PathBuf, AppStreamError> {
|
||||
|
||||
/// Remove the AppStream catalog from the local swcatalog directory.
|
||||
pub fn uninstall_catalog() -> Result<(), AppStreamError> {
|
||||
let catalog_path = dirs::data_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("~/.local/share"))
|
||||
let catalog_path = crate::config::data_dir_fallback()
|
||||
.join("swcatalog")
|
||||
.join("xml")
|
||||
.join("driftwood.xml");
|
||||
@@ -500,8 +498,7 @@ pub fn uninstall_catalog() -> Result<(), AppStreamError> {
|
||||
|
||||
/// Check if the AppStream catalog is currently installed.
|
||||
pub fn is_catalog_installed() -> bool {
|
||||
let catalog_path = dirs::data_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("~/.local/share"))
|
||||
let catalog_path = crate::config::data_dir_fallback()
|
||||
.join("swcatalog")
|
||||
.join("xml")
|
||||
.join("driftwood.xml");
|
||||
|
||||
Reference in New Issue
Block a user