refact: ApplicationService ctor and some member functions

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-20 18:25:59 +08:00
committed by Comix
parent 0e7d84f61d
commit 920594d6e5
10 changed files with 229 additions and 204 deletions

View File

@ -45,7 +45,7 @@ TEST_F(TestDesktopEntry, desktopFile)
auto curDir = QDir::current();
QString path{curDir.absolutePath() + QDir::separator() + "data" + QDir::separator() + "applications" + QDir::separator() +
"deepin-editor.desktop"};
EXPECT_EQ(exampleFile->filePath().toStdString(), path.toStdString());
EXPECT_EQ(exampleFile->fileSource().toStdString(), path.toStdString());
EXPECT_EQ(exampleFile->desktopId().toStdString(), "deepin-editor");
}
@ -54,7 +54,7 @@ TEST_F(TestDesktopEntry, prase)
const auto &exampleFile = file();
ASSERT_FALSE(exampleFile.isNull());
DesktopEntry entry;
QFile in{exampleFile->filePath()};
QFile in{exampleFile->fileSource()};
ASSERT_TRUE(in.open(QFile::ExistingOnly | QFile::ReadOnly | QFile::Text));
QTextStream fs{&in};
auto err = entry.parse(fs);