GNOME Bugzilla – Bug 770586
General batch rename improvements
Last modified: 2016-09-22 09:34:08 UTC
Bug tracker for general code improvements for batch renaming
Created attachment 334413 [details] [review] batch-rename-utilities: 0 pad the track number Usually the track numbers are 0 padded by 2. Do that in batch renaming for familiarity.
Created attachment 334414 [details] [review] batch-rename-dialog.ui: make rows unselectable There is no point on select them, and it overrides background color when selecting conflicts.
Created attachment 334415 [details] [review] batch-rename-dialog: use constants
Created attachment 334416 [details] [review] dialog-batch-rename.c: increase row margin
Created attachment 334417 [details] [review] batch-rename-dialog.c: increase row margin
Attachment 334413 [details] pushed as cf7c8ac - batch-rename-utilities: 0 pad the track number Attachment 334414 [details] pushed as 122668b - batch-rename-dialog.ui: make rows unselectable Attachment 334415 [details] pushed as c015166 - batch-rename-dialog: use constants Attachment 334417 [details] pushed as bbf896e - batch-rename-dialog.c: increase row margin
Created attachment 334528 [details] [review] batch-rename-utilities: print warnings if query goes wrong
Comment on attachment 334528 [details] [review] batch-rename-utilities: print warnings if query goes wrong Attachment 334528 [details] pushed as 4fcca2e - batch-rename-utilities: print warnings if query goes wrong
Created attachment 334532 [details] [review] batch-rename-utilities: protect against null error
Comment on attachment 334532 [details] [review] batch-rename-utilities: protect against null error Attachment 334532 [details] pushed as cfa0d2c - batch-rename-utilities: protect against null error
Created attachment 334855 [details] [review] batch-rename-utilities: fix query limit error If there were too many files in batch renaming, the tracker query would give the following error: "parser stack overflow", because the limit for the expression tree depth was hit for the file name filter. The fix was to use a filter that doesn't expand that much in sql.
Review of attachment 334855 [details] [review]: Cool! Good to know a solution for this. Did Carlos Garnacho reviewed this? If so, it looks good to me afaics. Thanks!
Created attachment 334988 [details] [review] batch-rename-dialog: use GTask appropiately The Gtask has to finish only when all the internal async call are ready, doing the other way around is conceptually wrong and will cause problems if we rely on the task for checking the status of the general operation. For that implement a correct GTask handling, waitig with a mutex and condition for all async calls to be ready, and only then mark the task as finished.
Created attachment 334989 [details] [review] batch-rename-dialog: merge the general conflict check handling We were checking separately when a directory had different parents than just one. However having just one parent is a special case of having multiple parents. With the latest refactoring, we can merge the code now.
Attachment 334988 [details] pushed as 8195468 - batch-rename-dialog: use GTask appropiately Attachment 334989 [details] pushed as a534f94 - batch-rename-dialog: merge the general conflict check handling
Created attachment 335345 [details] [review] batch-rename-dialog: use array-for instead of if-elses We were doing the same for several items. Use and array and a for to iterate on them.
Created attachment 335346 [details] [review] batch-rename-dialog: use 4 spaces for identation
Created attachment 335347 [details] [review] batch-rename-dialog: major refactoring This is a refactoring that is difficult to split in several pieces. This patch implements the following changes: - Use loops instead of serie of if/elses. - Use enums and static arrays to define a static serie of tag types and properties. - Use enums for ordering and retrieval of properties of tags instead of searching. - Merge common code. - Extract common code in functions. - Mark for translation some strings. - Plug some leaks. - Fix some free-after-free. - Fix issue with condition for unavailable metadata, that was exacerbated with this refactoring.
Created attachment 335359 [details] [review] batch-rename-dialog: major refactoring This is a refactoring that is difficult to split in several pieces. This patch implements the following changes: - Use loops instead of serie of if/elses. - Use enums and static arrays to define a static serie of tag types and properties. - Use enums for ordering and retrieval of properties of tags instead of searching. - Merge common code. - Extract common code in functions. - Mark for translation some strings. - Plug some leaks. - Fix some free-after-free. - Fix issue with condition for unavailable metadata, that was exacerbated with this refactoring.
Attachment 335345 [details] pushed as a80acee - batch-rename-dialog: use array-for instead of if-elses Attachment 335346 [details] pushed as ac91c7c - batch-rename-dialog: use 4 spaces for identation Attachment 335359 [details] pushed as 6669377 - batch-rename-dialog: major refactoring
Created attachment 336021 [details] [review] nautilus-file: copy parameter data in batch renaming We need to have our own copy and ownership of the parameter data, if not later on when we do async operations the data might be already freed. This was making batch rename crash every time. This is to follow the common pattern of not transferring the ownership from caller to called.
Created attachment 336022 [details] [review] nautilus-file: plug leak
Attachment 336021 [details] pushed as a508adb - nautilus-file: copy parameter data in batch renaming Attachment 336022 [details] pushed as 95f7dd7 - nautilus-file: plug leak
Created attachment 336034 [details] [review] batch-rename-dialog: Monitor directories for changes If a new file is added to the directory (or directories, in search), then the batch rename dialog should check if there will be any conflicts involving the new added file(s). If a file is deleted, the dialog should update the list of files by removing that file from it. To do this, monitor the directories the files belong to and update the dialog when a file changes or gets deleted.
Created attachment 336066 [details] [review] batch-rename-dialog: remove unused vars
Created attachment 336067 [details] [review] batch-rename-utilities: fix variable type
Created attachment 336068 [details] [review] batch-rename-utilities: remove unused function
Attachment 336066 [details] pushed as d3af002 - batch-rename-dialog: remove unused vars Attachment 336067 [details] pushed as 1a1e78e - batch-rename-utilities: fix variable type Attachment 336068 [details] pushed as 46437aa - batch-rename-utilities: remove unused function