mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Build a Qt resource file containing the icon themes generated from the actual image files
Loading from a resource file should be considerably faster
This commit is contained in:
parent
62c8a0dcfb
commit
bffaacd3c2
@ -133,10 +133,10 @@
|
||||
},
|
||||
{
|
||||
"name": "rcc_backend",
|
||||
"sources": "calibre/gui2/rcc/rcc.cpp",
|
||||
"headers": "calibre/gui2/rcc/rcc.h",
|
||||
"sip_files": "calibre/gui2/rcc/rcc.sip",
|
||||
"inc_dirs": "calibre/gui2/rcc",
|
||||
"sources": "calibre/utils/rcc/rcc.cpp",
|
||||
"headers": "calibre/utils/rcc/rcc.h",
|
||||
"sip_files": "calibre/utils/rcc/rcc.sip",
|
||||
"inc_dirs": "calibre/utils/rcc",
|
||||
"qt_modules": ["-gui"]
|
||||
},
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ class GUI(Command):
|
||||
description = 'Compile all GUI forms'
|
||||
PATH = os.path.join(Command.SRC, __appname__, 'gui2')
|
||||
QRC = os.path.join(Command.RESOURCES, 'images.qrc')
|
||||
RCC = os.path.join(Command.RESOURCES, 'icons.rcc')
|
||||
|
||||
def add_options(self, parser):
|
||||
parser.add_option('--summary', default=False, action='store_true',
|
||||
@ -52,6 +53,10 @@ class GUI(Command):
|
||||
for root, _, files2 in os.walk('images'):
|
||||
for name in files2:
|
||||
sources.append(os.path.join(root, name))
|
||||
if self.newer(self.RCC, sources):
|
||||
self.info('Creating icon theme resource file')
|
||||
from calibre.utils.rcc import compile_icon_dir_as_themes
|
||||
compile_icon_dir_as_themes('images', self.RCC)
|
||||
if self.newer(self.QRC, sources):
|
||||
self.info('Creating images.qrc')
|
||||
for s in sources:
|
||||
|
Loading…
x
Reference in New Issue
Block a user