From 9abec1c8dddc2cdb5f362a7ecb9ce9bf1cd00831 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 15 Oct 2018 10:11:53 -0500 Subject: [PATCH] Check (and set) metadata::trusted instead of metadata::trust. --- debian/changelog | 6 ++++++ ...dd-metadata-for-trusting-executables.patch | 20 +++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index a0883db..8339a39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libfm-qt (0.13.1-5ubuntu7) UNRELEASED; urgency=medium + + * Check (and set) metadata::trusted instead of metadata::trust. + + -- Simon Quigley Mon, 15 Oct 2018 10:11:30 -0500 + libfm-qt (0.13.1-5ubuntu6) cosmic; urgency=medium * Update symbols from build logs. diff --git a/debian/patches/add-metadata-for-trusting-executables.patch b/debian/patches/add-metadata-for-trusting-executables.patch index 6ea96ac..138da3f 100644 --- a/debian/patches/add-metadata-for-trusting-executables.patch +++ b/debian/patches/add-metadata-for-trusting-executables.patch @@ -1,7 +1,7 @@ Description: Support adding metadata for trusting executables. -Author: Tsu Jan +Author: Tsu Jan Applied-Upstream: https://github.com/lxqt/libfm-qt/pull/242/commits/9c2f00c2e22b8054bcaedad89ef74f0432b9f7fe -Last-Update: 2018-10-06 +Last-Update: 2018-10-15 --- a/src/core/basicfilelauncher.cpp +++ b/src/core/basicfilelauncher.cpp @@ -176,7 +176,7 @@ bool BasicFileLauncher::launchDesktopEnt @@ -30,7 +30,7 @@ Last-Update: 2018-10-06 "id::filesystem," - "metadata::emblems"; + "metadata::emblems," -+ "metadata::trust"; ++ "metadata::trusted"; FileInfo::FileInfo() { // FIXME: initialize numeric data members @@ -49,8 +49,8 @@ Last-Update: 2018-10-06 +bool FileInfo::isTrustable() const { + if(isExecutableType()) { + /* to avoid GIO assertion warning: */ -+ if(g_file_info_get_attribute_type(inf_.get(), "metadata::trust") == G_FILE_ATTRIBUTE_TYPE_STRING) { -+ if(const auto data = g_file_info_get_attribute_string(inf_.get(), "metadata::trust")) { ++ if(g_file_info_get_attribute_type(inf_.get(), "metadata::trusted") == G_FILE_ATTRIBUTE_TYPE_STRING) { ++ if(const auto data = g_file_info_get_attribute_string(inf_.get(), "metadata::trusted")) { + return (strcmp(data, "true") == 0); + } + } @@ -60,16 +60,16 @@ Last-Update: 2018-10-06 + +void FileInfo::setTrustable(bool trust) const { + if(!isExecutableType()) { -+ return; // "metadata::trust" is only for executables ++ return; // "metadata::trusted" is only for executables + } + GObjectPtr info {g_file_info_new()}; // used to set only this attribute + if(trust) { -+ g_file_info_set_attribute_string(info.get(), "metadata::trust", "true"); -+ g_file_info_set_attribute_string(inf_.get(), "metadata::trust", "true"); ++ g_file_info_set_attribute_string(info.get(), "metadata::trusted", "true"); ++ g_file_info_set_attribute_string(inf_.get(), "metadata::trusted", "true"); + } + else { -+ g_file_info_set_attribute(info.get(), "metadata::trust", G_FILE_ATTRIBUTE_TYPE_INVALID, nullptr); -+ g_file_info_set_attribute(inf_.get(), "metadata::trust", G_FILE_ATTRIBUTE_TYPE_INVALID, nullptr); ++ g_file_info_set_attribute(info.get(), "metadata::trusted", G_FILE_ATTRIBUTE_TYPE_INVALID, nullptr); ++ g_file_info_set_attribute(inf_.get(), "metadata::trusted", G_FILE_ATTRIBUTE_TYPE_INVALID, nullptr); + } + g_file_set_attributes_from_info(path().gfile().get(), + info.get(),