Support permission change reports of borg diff

This commit is contained in:
Hofer-Julian 2019-08-26 21:39:47 +02:00 committed by GitHub
parent d770763c96
commit f103d78af1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -44,7 +44,14 @@ class DiffResult(DiffResultBase, DiffResultUI):
size = line_splitted[0][1:]
unit = line_splitted[1]
if line_splitted[1] not in ['directory', 'link']:
if line_splitted[0].startswith("["):
size = 0
change_type = line[:line.find(line_splitted[3])]
full_path = line[line.find(line_splitted[3]):]
dir, name = os.path.split(full_path)
# add to nested dict of folders to find nested dirs.
d = get_dict_from_list(nested_file_list, full_path.split('/'))
elif line_splitted[1] not in ['directory', 'link']:
if unit == 'B':
size = int(size)
elif unit == 'kB':
@ -213,7 +220,7 @@ class TreeModel(QAbstractItemModel):
return QVariant(QColor(Qt.red))
elif item.itemData[1] == 'added':
return QVariant(QColor(Qt.green))
elif item.itemData[1] == 'modified':
elif item.itemData[1] == 'modified' or item.itemData[1].startswith('['):
return QVariant(QColor(Qt.darkYellow))
if role == Qt.DisplayRole: