Cleanedup logic n fixed comment
This commit is contained in:
parent
d23a8606f0
commit
ccd29988ff
@ -99,14 +99,9 @@ class Grid:
|
|||||||
def generateDirectoryGrid(self, dirPath, files):
|
def generateDirectoryGrid(self, dirPath, files):
|
||||||
# NOTE: We'll be passing pixbuf after retreval to keep Icon.py file more
|
# NOTE: We'll be passing pixbuf after retreval to keep Icon.py file more
|
||||||
# universaly usable. We can just remove get_pixbuf to get a gtk.Image type
|
# universaly usable. We can just remove get_pixbuf to get a gtk.Image type
|
||||||
storageQue = []
|
|
||||||
for file in files:
|
for file in files:
|
||||||
image = Icon(self.settings).createIcon(dirPath, file)
|
image = Icon(self.settings).createIcon(dirPath, file)
|
||||||
|
|
||||||
if len(storageQue) > 0:
|
|
||||||
for dataSet in storageQue:
|
|
||||||
self.toWorkPool.append(dataSet)
|
|
||||||
|
|
||||||
self.toWorkPool.append([image.get_pixbuf(), file])
|
self.toWorkPool.append([image.get_pixbuf(), file])
|
||||||
self.threadLock = False
|
self.threadLock = False
|
||||||
self.gtkLock = True
|
self.gtkLock = True
|
||||||
@ -122,13 +117,13 @@ class Grid:
|
|||||||
for dataSet in self.toWorkPool:
|
for dataSet in self.toWorkPool:
|
||||||
self.store.append(dataSet)
|
self.store.append(dataSet)
|
||||||
|
|
||||||
if len(self.store) == len(files): # Vonfirm processed all files and cleanup
|
if len(self.store) == len(files): # Confirm processed all files and cleanup
|
||||||
self.gtkLock = False
|
self.gtkLock = False
|
||||||
self.threadLock = False
|
self.threadLock = False
|
||||||
self.toWorkPool.clear()
|
self.toWorkPool.clear()
|
||||||
return False
|
return False
|
||||||
# Check again when idle. If nothing else is updating
|
# Check again when idle; If nothing else is updating, this function
|
||||||
# this function gets called immediatly so we play hot potato
|
# gets called immediatly. So, we play hot potato by passing lock to Thread
|
||||||
else:
|
else:
|
||||||
self.toWorkPool.clear()
|
self.toWorkPool.clear()
|
||||||
self.gtkLock = False
|
self.gtkLock = False
|
||||||
|
@ -99,14 +99,9 @@ class Grid:
|
|||||||
def generateDirectoryGrid(self, dirPath, files):
|
def generateDirectoryGrid(self, dirPath, files):
|
||||||
# NOTE: We'll be passing pixbuf after retreval to keep Icon.py file more
|
# NOTE: We'll be passing pixbuf after retreval to keep Icon.py file more
|
||||||
# universaly usable. We can just remove get_pixbuf to get a gtk.Image type
|
# universaly usable. We can just remove get_pixbuf to get a gtk.Image type
|
||||||
storageQue = []
|
|
||||||
for file in files:
|
for file in files:
|
||||||
image = Icon(self.settings).createIcon(dirPath, file)
|
image = Icon(self.settings).createIcon(dirPath, file)
|
||||||
|
|
||||||
if len(storageQue) > 0:
|
|
||||||
for dataSet in storageQue:
|
|
||||||
self.toWorkPool.append(dataSet)
|
|
||||||
|
|
||||||
self.toWorkPool.append([image.get_pixbuf(), file])
|
self.toWorkPool.append([image.get_pixbuf(), file])
|
||||||
self.threadLock = False
|
self.threadLock = False
|
||||||
self.gtkLock = True
|
self.gtkLock = True
|
||||||
@ -122,13 +117,13 @@ class Grid:
|
|||||||
for dataSet in self.toWorkPool:
|
for dataSet in self.toWorkPool:
|
||||||
self.store.append(dataSet)
|
self.store.append(dataSet)
|
||||||
|
|
||||||
if len(self.store) == len(files): # Vonfirm processed all files and cleanup
|
if len(self.store) == len(files): # Confirm processed all files and cleanup
|
||||||
self.gtkLock = False
|
self.gtkLock = False
|
||||||
self.threadLock = False
|
self.threadLock = False
|
||||||
self.toWorkPool.clear()
|
self.toWorkPool.clear()
|
||||||
return False
|
return False
|
||||||
# Check again when idle. If nothing else is updating
|
# Check again when idle; If nothing else is updating, this function
|
||||||
# this function gets called immediatly so we play hot potato
|
# gets called immediatly. So, we play hot potato by passing lock to Thread
|
||||||
else:
|
else:
|
||||||
self.toWorkPool.clear()
|
self.toWorkPool.clear()
|
||||||
self.gtkLock = False
|
self.gtkLock = False
|
||||||
|
Loading…
Reference in New Issue
Block a user