mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 10:08:40 -05:00
Fix bug introduced by the first commit with list of images
This commit is contained in:
parent
063d2b8adb
commit
a24ef15ff5
1 changed files with 7 additions and 6 deletions
|
|
@ -152,8 +152,9 @@ class StartQT5(QMainWindow):
|
||||||
"Image files (*.png *.jpg *.jpeg *.PNG *.JPG *.JPEG)")
|
"Image files (*.png *.jpg *.jpeg *.PNG *.JPG *.JPEG)")
|
||||||
|
|
||||||
self.settings.setValue("fdstate", QVariant(fd.saveState()))
|
self.settings.setValue("fdstate", QVariant(fd.saveState()))
|
||||||
if images[0]:
|
images = images[0]
|
||||||
self.settings.setValue("directory", QVariant(path.dirname(images[0][0])))
|
if images:
|
||||||
|
self.settings.setValue("directory", QVariant(path.dirname(images[0])))
|
||||||
self.delegator([fullpath for fullpath in images])
|
self.delegator([fullpath for fullpath in images])
|
||||||
|
|
||||||
def recompress_files(self):
|
def recompress_files(self):
|
||||||
|
|
@ -172,16 +173,16 @@ class StartQT5(QMainWindow):
|
||||||
for fullpath in images:
|
for fullpath in images:
|
||||||
try: # recompress images already in the list
|
try: # recompress images already in the list
|
||||||
image = (i.image for i in self.imagelist
|
image = (i.image for i in self.imagelist
|
||||||
if i.image.fullpath == fullpath[0]).__next__()
|
if i.image.fullpath == fullpath).__next__()
|
||||||
if image.compressed:
|
if image.compressed:
|
||||||
image.reset()
|
image.reset()
|
||||||
image.recompression = True
|
image.recompression = True
|
||||||
delegatorlist.append(image)
|
delegatorlist.append(image)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
if not path.isdir(fullpath[0]):
|
if not path.isdir(fullpath):
|
||||||
self.add_image(fullpath[0], delegatorlist)
|
self.add_image(fullpath, delegatorlist)
|
||||||
else:
|
else:
|
||||||
self.walk(fullpath[0], delegatorlist)
|
self.walk(fullpath, delegatorlist)
|
||||||
|
|
||||||
self.update_table()
|
self.update_table()
|
||||||
self.thread.compress_file(delegatorlist, self.showapp, self.verbose,
|
self.thread.compress_file(delegatorlist, self.showapp, self.verbose,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue