summaryrefslogtreecommitdiff
path: root/src/nautilus-file-operations.c
Commit message (Collapse)AuthorAgeFilesLines
* file-operations: don't auto-escape semicolonignapk2020-07-131-1/+1
| | | | | | | | | Nowadays fat filesystems are usually mounted with vfat driver that supports long filenames, which allow semicolon. Since there is no easy way to determine which driver was used and msdos is a corner case, make the assumption so the character is not auto-escaped when not necessary.
* file-operations: auto-escape filenames on fuseblk mountsignapk2020-07-131-0/+5
| | | | | | | | | | | Currently when copying files that have reserved characters in their names to NTFS or exFAT filesystems mounted using FUSE, the process will fail. The fuseblk filesystem type could be of any type in theory, but in practice is usually NTFS or exFAT, so make the assumption in pragmatic way to solve this issue. Closes #1343
* file-operations: auto-escape filenames on native ntfs mountsignapk2020-07-121-0/+1
| | | | | | | | | | | Currently when copying to NTFS filesystem files that have reserved characters in their names, the process will fail. There is already code in place to handle this situation for FAT by replacing invalid characters with underscores, so handle this situation in similar fashion for NTFS as well. Closes #1343
* file-operations: Add newly created files to RecentSachin Daluja2020-05-101-0/+1
| | | | | | When a new file is created, add it to the Recent files store. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1357
* dbus-manager: add ask_confirmation parameter to EmptyTrashAlberts Muktupāvels2020-04-061-1/+2
| | | | https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/504
* dbus-manager: add and implement FileOperations2 interfaceAlberts Muktupāvels2020-04-061-99/+233
| | | | | | | | | | Add new version of FileOperations interface. This versions adds PlatformData argument to all methods. Currently supported arguments are parent-handle and timestamp. This change is necessary for proper focus handling. https://gitlab.gnome.org/GNOME/nautilus/merge_requests/504
* general: Run uncrustify scriptOndrej Holy2020-04-051-24/+24
| | | | | There are some style issue since the last run. Let's run it again before enabling style-check CI job.
* file-operations: Mark certain buttons as destructive actionsAlexey Chernyshov2020-03-091-2/+5
| | | | | | | | Marks 'Empty Trash' and 'Delete All' buttons as destructive actions which have special appearance making them consistent with other destructive actions. Fixes #969
* file-operations: Honor umask when creating new filesOndrej Holy2020-03-061-1/+1
| | | | | | | | | | | | | File creation mask should be honored when creating new files from templates as it is when creating new folders, or dragging raw data. But it is not because G_FILE_COPY_NONE flag is specified when creating new files from templates. Let's use G_FILE_COPY_TARGET_DEFAULT_PERMS flag to ensure that file creation mask is honored in this case as well. Just note that this behavior is not wanted when copying in general (although it is also honored by "cp" cmd in this case) as it might have some unexpected consequences as discussed on: https://bugzilla.gnome.org/show_bug.cgi?id=167102
* file-operations: Fix conflict dialog for google-driveOndrej Holy2020-02-041-1/+73
| | | | | | | | | | | | | | | Conflict dialog doesn't work properly for google-drive files, because G_IO_ERROR_EXISTS can be returned even if a destination file based on a basename of a source file doesn't exists. This happens when a destination directory already contains some file with the same display_name as the source file has. Usually, display_name is based on filename, but google-drive is not traditional filesystem and uses unique IDs for files. Although, google-drive supports multiple files with the same display_bane in one folder, the copy and move operations behave traditionally and tries to overwrite existing files with the same title. Let's base the destination file on display_name for google-drive to fix issues with the conflict dialog. See: https://gitlab.gnome.org/GNOME/gvfs/merge_requests/58
* nautilus-file-operations: Prevent change permission on container directoryCarlo Lobrano2019-08-261-29/+43
| | | | | | | | | | Changing permission for *Enclosed Files* also changes current folder (container) directory permissions. This change skips the container directory and changes only the permissions of the contents to match the UI text. Closes #810
* file: replace eel_ref_str with GRefStringJordan Petridis2019-02-221-0/+1
| | | | | | | | | | | | | | | | | glib now offers a reference counted api. This allows us to replace a lot of legacy code and get rid of eel_ref_str. GRefString [1] is almost a drop-in replacement. nautilus-file-operations.c was indirectly depending upon eel/eel-string.h from nautilus-file-private.h and thus a new include was added. This bumps the minimum version of glib to 2.58 Close #781 https://gitlab.gnome.org/GNOME/nautilus/issues/781 [1] https://developer.gnome.org/glib/stable/glib-Reference-counted-strings.html
* general: Null-initialize auto pointersErnestas Kulik2018-10-311-1/+1
| | | | | It’s not done in some places. After this commit, there still might be some missing, but this is all I gathered in a short amount of time.
* Undo/redo, search tests, test library and moreAlexandru Fazakas2018-08-281-34/+28
|
* dbus-manager: Drop copy file operationCarlos Soriano2018-08-071-41/+0
| | | | | | | | | It was truly unreliable and not working clearly. We have a more powerful and simpler API with CopyURIs, so there is no point to have this one. This commits drops the DBus API. Note that the DBus version is not bumped, I believe this DBus API is not used by any external service given how broken was it.
* file-operations: Don't crash if source file not present on creationCarlos Soriano2018-08-071-19/+17
| | | | | | | | | | | | | | When creating a file it was checking if the file already exists, and if so it tried to give a new name based on the original file that was being duplicated from which is the case for the regular copy/paste and the template creation. However, creating a file is not only about duplicating from another one, it also can come from creating a folder, that although in the UI it prevents doing so, it can still be done through the dbus operation. Fix that by checking whether there is an actual source file, and if not, use the name provided as base name.
* file-utilities: Deduplicate max filename querying codeAntónio Fernandes2018-08-021-53/+3
| | | | | | | | | | | A method to query maximum filename length has been introduced by commit a5520fd8930910ffa686232f3fc92325fe47c64e However, Ernestas has noticed that another implementation was already present in nautilus-file-operations.c This commit will replace both with a file-utilities function, which takes ideas from both implementations.
* file-operations: Fix undo copy criticalsAlexandru Fazakas2018-07-301-1/+1
| | | | | This is a follow-up to commit e9f039e1 which fixes all introduced criticals and sets the undo information properly.
* file-operations: Fix undo-duplicate criticalAlexandru Fazakas2018-07-261-13/+13
|
* test: Add trash-or-delete testAlexandru Fazakas2018-07-201-38/+106
| | | | | This patch adds trash_or_delete synchronous alternative and a test including both of these functionalities.
* test: Add copy operations unit testAlexandru Fazakas2018-07-201-36/+89
| | | | | This patch adds both a sync alternative to the copy operations and a test for it.
* test: Add file-operations-move testAlexandru Fazakas2018-07-161-61/+107
| | | | | This patch includes the addition of the sync alternative to the file-operations-move function and a test for it.
* general: Stop setting WM classErnestas Kulik2018-05-281-2/+0
| | | | | | | According to GTK+ docs, this should be the same for all windows of an application, and GTK+ defaults to doing that itself. However, there is a slight issue in that the properties window sets a custom window icon that isn’t reset instantaneously after closing the dialog.
* file-operations: Remove unused operationErnestas Kulik2018-05-121-131/+0
| | | | | Since launching desktop files is no longer possible, the operation to mark them as trusted goes unused.
* general: Remove NautilusLinkCarlos Soriano2018-05-091-1/+0
| | | | | | | | | It was used for desktop files, netscape url links and other links. However this is not really useful anymore with the desktop gone, so it makes sense to remove it from Nautilus and have a big clean up. This also was one of the blockers for the backend rework.
* file-view: Add unmount notificationXiaoguang Wang2018-04-261-0/+6
| | | | | | | Unmounting disk from file view context menu shows notification same as unmounting from sidebar. https://gitlab.gnome.org/GNOME/nautilus/issues/379
* Change show_error_dialog() to show_dialog()George Mocanu2018-04-231-6/+8
| | | | | Changed show_error_dialog() to show_dialog() so that multiple dialog types can be used.
* Revert "Merge remote-tracking branch 'upstream/master'"Carlos Soriano2018-04-231-8/+6
| | | This reverts commit 1f4bd55d1b9d5f701f2df8d1be7466df85a8669a
* Change show_error_dialog() to show_dialog()George Mocanu2018-04-231-6/+8
| | | | | Changed show_error_dialog() to show_dialog() so that multiple dialog types can be used.
* Merge branch 'firstContribution' into 'master'Carlos Soriano2018-03-141-2/+2
|\ | | | | | | | | Removing the "approximately" See merge request GNOME/nautilus!105
| * file-operations.c: remove "approximately" from the copy/delete/transfer dialogMichael Roth2018-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Currently the copy/delete/transfer dialog includes the word "approximately" in the execution time estimation part of the dialog However, it is quite obvious that the time estimation is just "approximate", so the word itself is unnecessary. Currently there are issues with the dialog size not offering enough space for the time estimation string, thus removing the redundant word might be a solution.
* | general: don’t shadow variablesErnestas Kulik2018-03-011-6/+15
| | | | | | | | | | | | | | Shadowing variables is error-prone, since one might mean to refer to a variable that was declared earlier, but has the same name. Additionally, being more strict about variable scoping can help make the code more readable.
* | general: truncate messages used in dialogsErnestas Kulik2018-02-271-5/+26
| | | | | | | | | | | | | | | | This is most notably a problem with paths that are approaching PATH_MAX in length. Cairo surface creation fails due to its internal size limit being reached and GTK+ promptly crashes after trying to dereference a null pointer. Besides, the window can get ridiculously long even if Nautilus doesn’t crash.
* | file-operations: don’t add label to container twiceErnestas Kulik2018-02-271-1/+0
|/ | | | Oversight from 490a6cbeb8684b7293d426ef0b139502c288fed0.
* general: Run uncrustifyCarlos Soriano2018-02-131-23/+23
|
* general: Fix some details from the desktop removalCarlos Soriano2018-01-021-2/+2
| | | | Basically unused vars, etc.
* Merge branch 'wip/ernestask/long-live-the-desktop' into 'master'Carlos Soriano2018-01-021-243/+7
|\ | | | | | | | | | | | | remove the desktop Closes #158 See merge request GNOME/nautilus!46
| * general: remove desktop supportErnestas Kulik2018-01-021-243/+7
| |
* | file-operations: Remove unused #includeAntónio Fernandes2018-01-021-1/+0
|/ | | | | | Commit 490a6cbeb8684b7293d426ef0b139502c288fed0 removed the only use of eel/eel-gtk-extensions.h on this file, so we can remove #include line too.
* file-operations: Port error details inlineAlexandru Fazakas2017-12-211-2/+12
| | | | | | | | | | | As the eel_gtk_message_dialog_set_details_label function is only used once, we can safely remove it and do everything inside of nautilus-file-operations.c. Thus, we deleted the eel function and we do everything inside the do_run_simple_dialog function and remove the function header from the header file. We add the label straight into the content_area of the dialog box. https://bugzilla.gnome.org/show_bug.cgi?id=598671
* file-operations: forbid more characters in FATErnestas Kulik2017-11-291-1/+1
| | | | | | ‘\’ and ‘|’ aren’t allowed in both 8.3 and long file names. https://bugzilla.gnome.org/show_bug.cgi?id=771364
* file-operations: ignore extensions when duplicating foldersAntónio Fernandes2017-11-021-49/+87
| | | | | | | | | | | | | If a file named "foo.bar" is duplicated, the copy is named "foo (copy).bar", keeping the extension at the end. However, this is applying to folders too, where we don't need to worry about keeping extesions at the end. The result is unexpected. Therefore, ignore extension if the duplicating item is a folder, except if the folder already has a copy tag before a dot, such as "dir (copy).dir". Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=696451
* Revert "file-operations: forbid more characters in FAT"Ernestas Kulik2017-09-031-1/+1
| | | | This reverts commit f4292a57f321a1727ee6a2bdf765f14524c464eb.
* file-operations: forbid more characters in FATErnestas Kulik2017-09-031-1/+1
| | | | | | ‘\’ and ‘|’ aren’t allowed in both 8.3 and long file names. https://bugzilla.gnome.org/show_bug.cgi?id=771364
* file-operations: fail when overwriting directory with fileErnestas Kulik2017-08-281-113/+30
| | | | | | | | | | GIO documentation (and therefore code) mandates that copies and moves of files over directories should fail, but Nautilus has support for such (possibly dangerous) operations even to this day. This commit works with the assumption that whatever backend happens to be used, it will fail as expected and not overwrite the directory. https://bugzilla.gnome.org/show_bug.cgi?id=773671
* file-operations: deduplicate codeErnestas Kulik2017-05-301-73/+35
| | | | | | | Some duplicate code can be removed by refactoring mark_desktop_file_executable(). https://bugzilla.gnome.org/show_bug.cgi?id=782658
* file-operations: duplicate: use automatic cleanupErnestas Kulik2017-05-151-5/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=782650
* file-operations: set_permissions_recursive: use automatic cleanupErnestas Kulik2017-05-151-2/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=782650
* file-operations: empty_trash: use automatic cleanupErnestas Kulik2017-05-151-2/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=782650
* file-operations: mark_desktop_file_executable: use automatic cleanupErnestas Kulik2017-05-151-2/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=782650