Pull from trunk

This commit is contained in:
Kovid Goyal 2010-09-22 16:17:27 -06:00
commit 3c4e3beb63

View File

@ -456,6 +456,10 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
parent = os.path.dirname(spath) parent = os.path.dirname(spath)
if len(os.listdir(parent)) == 0: if len(os.listdir(parent)) == 0:
self.rmtree(parent, permanent=True) self.rmtree(parent, permanent=True)
'''
This is commented out as it can lead to book file loss if the second
rename fails. This makes it not worthwhile, IMO.
curpath = self.library_path curpath = self.library_path
c1, c2 = current_path.split('/'), path.split('/') c1, c2 = current_path.split('/'), path.split('/')
if not self.is_case_sensitive and len(c1) == len(c2): if not self.is_case_sensitive and len(c1) == len(c2):
@ -487,6 +491,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
else: else:
os.rename(tempname, os.path.join(curpath, newseg)) os.rename(tempname, os.path.join(curpath, newseg))
curpath = os.path.join(curpath, newseg) curpath = os.path.join(curpath, newseg)
'''
def add_listener(self, listener): def add_listener(self, listener):
''' '''