refact: remove static env instance

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-29 18:22:47 +08:00
committed by Comix
parent d00cd17f2e
commit f2d5b7b307
2 changed files with 36 additions and 44 deletions

View File

@ -18,7 +18,7 @@ public:
env = qgetenv("XDG_DATA_DIRS");
auto curDir = QDir::current();
QByteArray fakeXDG = (curDir.absolutePath() + QDir::separator() + "data").toLocal8Bit();
qputenv("XDG_DATA_DIRS", fakeXDG);
ASSERT_TRUE(qputenv("XDG_DATA_DIRS", fakeXDG)) ;
DesktopErrorCode err;
auto file = DesktopFile::searchDesktopFileById("deepin-editor", err);
if (!file.has_value()) {