refact: change implementation of UpdateApplicationInfo

adjust the way of get XDG_DATA_DIRS.

Signed-off-by: ComixHe <heyuming@deepin.org>
Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
ComixHe
2023-08-11 17:46:46 +08:00
committed by Comix
parent 5183716873
commit 2fa74e40e5
10 changed files with 179 additions and 169 deletions

View File

@ -17,8 +17,8 @@ public:
{
auto curDir = QDir::current();
QString path{curDir.absolutePath() + "/data/desktopExample.desktop"};
ParseError err;
auto file = DesktopFile::searchDesktopFile(path, err);
DesktopErrorCode err;
auto file = DesktopFile::searchDesktopFileByPath(path, err);
if (!file.has_value()) {
qWarning() << "search " << path << "failed:" << err;
return;
@ -54,7 +54,7 @@ TEST_F(TestDesktopEntry, prase)
ASSERT_TRUE(in.open(QFile::ExistingOnly | QFile::ReadOnly | QFile::Text));
QTextStream fs{&in};
auto err = entry.parse(fs);
ASSERT_EQ(err, ParseError::NoError);
ASSERT_EQ(err, DesktopErrorCode::NoError);
auto group = entry.group("Desktop Entry");
ASSERT_TRUE(group);