Skip to content

Commit

Permalink
Unset LD_LIBRARY_PATH before open file (#1560)
Browse files Browse the repository at this point in the history
Co-authored-by: yangheran <[email protected]>
  • Loading branch information
feiniks and yangheran authored Aug 14, 2024
1 parent 4fff7eb commit e9a339a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/filebrowser/file-browser-dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,19 @@ void openFile(const QString& path)
g_setenv("QT_SCREEN_SCALE_FACTORS", "1", 1);
#endif

#ifdef Q_OS_LINUX
QByteArray ldPath = qgetenv("LD_LIBRARY_PATH");
qunsetenv("LD_LIBRARY_PATH");
#endif

::openInNativeExtension(path) || ::showInGraphicalShell(path);

#ifdef Q_OS_LINUX
if (!ldPath.isEmpty()) {
qputenv("LD_LIBRARY_PATH", ldPath);
}
#endif

#if defined(Q_OS_WIN32)
g_setenv("QT_SCREEN_SCALE_FACTORS", factors, 1);
#endif
Expand Down

0 comments on commit e9a339a

Please sign in to comment.