diff -r 8c5296fe3056 -r 8a68afaf1ba2 eric7/Tools/TRPreviewer.py --- a/eric7/Tools/TRPreviewer.py Wed Jun 15 09:44:07 2022 +0200 +++ b/eric7/Tools/TRPreviewer.py Thu Jun 16 18:28:59 2022 +0200 @@ -8,11 +8,12 @@ """ import os +import pathlib import contextlib from PyQt6.QtCore import ( - QDir, QTimer, QFileInfo, pyqtSignal, QEvent, QSize, QTranslator, QObject, - Qt, QCoreApplication + QDir, QTimer, pyqtSignal, QEvent, QSize, QTranslator, QObject, Qt, + QCoreApplication ) from PyQt6.QtGui import QKeySequence, QAction from PyQt6.QtWidgets import ( @@ -138,10 +139,10 @@ filenames, self.filesToLoad = (self.filesToLoad[:], []) first = True for fn in filenames: - fi = QFileInfo(fn) - if fi.suffix().lower() == 'ui': + fpath = pathlib.Path(fn) + if fpath.suffix.lower() == '.ui': self.preview.loadWidget(fn) - elif fi.suffix().lower() == 'qm': + elif fpath.suffix.lower() == '.qm': self.translations.add(fn, first) first = False