fix: correct property check logic

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe 2023-09-01 15:49:30 +08:00 committed by Comix
parent ca24d2d908
commit 94f7b3c01d
2 changed files with 3 additions and 2 deletions

View File

@ -333,13 +333,13 @@ QString ApplicationService::id() const noexcept
bool ApplicationService::x_Flatpak() const noexcept
{
auto val = findEntryValue(DesktopFileEntryKey, "X-flatpak", EntryValueType::String);
return val.isNull();
return !val.isNull();
}
bool ApplicationService::x_linglong() const noexcept
{
auto val = findEntryValue(DesktopFileEntryKey, "X-linglong", EntryValueType::String);
return val.isNull();
return !val.isNull();
}
qulonglong ApplicationService::installedTime() const noexcept

View File

@ -471,6 +471,7 @@ inline std::tuple<std::size_t, std::size_t, std::size_t> getFileTimeInfo(const Q
{
struct stat buf;
// TODO: use QFileInfo get timeInfo, and return a custom time structure.
if (auto ret = stat(file.absoluteFilePath().toLocal8Bit().constData(), &buf); ret == -1) {
qWarning() << "get file" << file.absoluteFilePath() << "state failed:" << std::strerror(errno);
return std::make_tuple(0, 0, 0);