feat: add mimeManager Service

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-09-20 18:29:42 +08:00
committed by black-desk
parent 8970298ad0
commit f63741b023
25 changed files with 1282 additions and 296 deletions

View File

@ -18,8 +18,8 @@ public:
env = qgetenv("XDG_DATA_DIRS");
auto curDir = QDir::current();
QByteArray fakeXDG = (curDir.absolutePath() + QDir::separator() + "data").toLocal8Bit();
ASSERT_TRUE(qputenv("XDG_DATA_DIRS", fakeXDG)) ;
DesktopErrorCode err;
ASSERT_TRUE(qputenv("XDG_DATA_DIRS", fakeXDG));
ParserError err;
auto file = DesktopFile::searchDesktopFileById("deepin-editor", err);
if (!file.has_value()) {
qWarning() << "search failed:" << err;
@ -58,7 +58,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, DesktopErrorCode::NoError);
ASSERT_EQ(err, ParserError::NoError);
auto group = entry.group("Desktop Entry");
ASSERT_TRUE(group);