mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Merge branch 'qt5' into develop
Conflicts: README.md qtlib/about_box.py qtlib/reg.py qtlib/reg_demo_dialog.py qtlib/reg_submit_dialog.py
This commit is contained in:
@@ -211,7 +211,7 @@ def copy_packages(packages_names, dest, create_links=False, extra_ignores=None):
|
||||
shutil.copy(source_path, dest_path)
|
||||
|
||||
def copy_qt_plugins(folder_names, dest): # This is only for Windows
|
||||
from PyQt4.QtCore import QLibraryInfo
|
||||
from PyQt5.QtCore import QLibraryInfo
|
||||
qt_plugin_dir = QLibraryInfo.location(QLibraryInfo.PluginsPath)
|
||||
def ignore(path, names):
|
||||
if path == qt_plugin_dir:
|
||||
@@ -450,7 +450,7 @@ def collect_stdlib_dependencies(script, dest_folder, extra_deps=None):
|
||||
delete_files_with_pattern(op.join(dest_folder, 'distutils'), '*.exe')
|
||||
|
||||
def fix_qt_resource_file(path):
|
||||
# pyrcc4 under Windows, if the locale is non-english, can produce a source file with a date
|
||||
# pyrcc5 under Windows, if the locale is non-english, can produce a source file with a date
|
||||
# containing accented characters. If it does, the encoding is wrong and it prevents the file
|
||||
# from being correctly frozen by cx_freeze. To work around that, we open the file, strip all
|
||||
# comments, and save.
|
||||
|
||||
@@ -61,8 +61,8 @@ try:
|
||||
|
||||
except ImportError:
|
||||
try:
|
||||
from PyQt4.QtCore import QUrl
|
||||
from PyQt4.QtGui import QDesktopServices
|
||||
from PyQt5.QtCore import QUrl, QStandardPaths
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
def _open_path(path):
|
||||
url = QUrl.fromLocalFile(str(path))
|
||||
QDesktopServices.openUrl(url)
|
||||
@@ -72,10 +72,10 @@ except ImportError:
|
||||
|
||||
def _special_folder_path(special_folder, appname=None):
|
||||
if special_folder == SpecialFolder.Cache:
|
||||
qtfolder = QDesktopServices.CacheLocation
|
||||
qtfolder = QStandardPaths.CacheLocation
|
||||
else:
|
||||
qtfolder = QDesktopServices.DataLocation
|
||||
return str(QDesktopServices.storageLocation(qtfolder))
|
||||
qtfolder = QStandardPaths.DataLocation
|
||||
return QStandardPaths.standardLocations(qtfolder)[0]
|
||||
|
||||
except ImportError:
|
||||
# We're either running tests, and these functions don't matter much or we're in a really
|
||||
|
||||
@@ -59,7 +59,7 @@ def get_locale_name(lang):
|
||||
|
||||
#--- Qt
|
||||
def install_qt_trans(lang=None):
|
||||
from PyQt4.QtCore import QCoreApplication, QTranslator, QLocale
|
||||
from PyQt5.QtCore import QCoreApplication, QTranslator, QLocale
|
||||
if not lang:
|
||||
lang = str(QLocale.system().name())[:2]
|
||||
localename = get_locale_name(lang)
|
||||
@@ -116,7 +116,7 @@ def install_gettext_trans_under_qt(base_folder, lang=None):
|
||||
# So, we install the gettext locale, great, but we also should try to install qt_*.qm if
|
||||
# available so that strings that are inside Qt itself over which I have no control are in the
|
||||
# right language.
|
||||
from PyQt4.QtCore import QCoreApplication, QTranslator, QLocale, QLibraryInfo
|
||||
from PyQt5.QtCore import QCoreApplication, QTranslator, QLocale, QLibraryInfo
|
||||
if not lang:
|
||||
lang = str(QLocale.system().name())[:2]
|
||||
localename = get_locale_name(lang)
|
||||
|
||||
Reference in New Issue
Block a user