Commit 81999942 authored by Rico Tzschichholz's avatar Rico Tzschichholz Committed by Michael Terry

Use GLib.List.copy_deep() instead of foreach/append

parent c7b2c762
Pipeline #52764 passed with stage
in 7 minutes and 31 seconds
......@@ -29,9 +29,7 @@ public class AssistantRestore : AssistantOperation
return this._restore_files;
}
set {
this._restore_files = null;
foreach (File f in value)
this._restore_files.append(f);
this._restore_files = value.copy_deep ((CopyFunc) Object.ref);
}
}
......
......@@ -207,9 +207,7 @@ public class AssistantRestoreMissing : AssistantRestore {
{
if (page == confirm_page) {
scan_queue = false;
restore_files_remaining = null;
foreach (File f in restore_files)
restore_files_remaining.append(f);
restore_files_remaining = restore_files.copy_deep ((CopyFunc) Object.ref);
}
else if (page == listfiles_page) {
list_dir_label.label = display_directory.get_parse_name();
......
......@@ -31,8 +31,7 @@ public class OperationRestore : Operation
return this._restore_files;
}
construct {
foreach (File f in value)
this._restore_files.append(f);
this._restore_files = value.copy_deep ((CopyFunc) Object.ref);
}
}
......
......@@ -73,10 +73,7 @@ public abstract class ToolJob : Object
return this._restore_files;
}
set {
// Deep copy
this._restore_files = null;
foreach (File f in value)
this._restore_files.append(f);
this._restore_files = value.copy_deep ((CopyFunc) Object.ref);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment