summaryrefslogtreecommitdiff
path: root/src/nautilus-file-utilities.c
Commit message (Collapse)AuthorAgeFilesLines
* general: Fix style for updated version of uncrustifyCorey Berla2023-01-121-9/+9
| | | | | The updated version of uncrustify didn't like this style, the new style doesn't look great either.
* eel: remove eel-glib-extensions.hPeter Eisenmann2022-12-231-1/+0
| | | | | Replace the eel_boolean_bit typedef with a plain guint and remove all includes.
* file-utilities: Remove unused functionBenjamin Otte2022-12-131-20/+0
| | | | | | | | | In gtk3 Nautilus used to construct the uri-list. nautilus_uri_to_native_uri() was used to ensure that apps that didn't have gvfs access could access the dropped file. Now gtk4 constructs the uri-list, so a similar process is handled on the gtk side. Related: #2632
* file-utilities: Fix leak and use macrosIgnacy Kuchciński2022-08-301-4/+2
|
* file-utilities: Add ability to check for installed schemaCorey Berla2022-07-141-0/+28
| | | | | | | | | | | Now that we are bringing the gnome-user-share extension into Nautilus itself, we need the ability to check if gnome-user-share is installed. GNOME Settings does this by checking the schema. Let's use the same code that Settings uses. This doesn't work within sandboxes, so if we are sandboxed always return TRUE;
* general: Uniformize case code styleAntónio Fernandes2021-07-111-0/+2
| | | | | | | | There are a few non-braced single-statement in the final cases, which have gone unnoticed until detected by a recent uncrustify update. Let's add the missing braces around single-statements even if it's the last case.
* file-utilities: Drop nautilus_file_system_is_remoteAntónio Fernandes2021-01-251-18/+0
| | | | | | | | | | | | | | | | It compares the filesystem type identifier with a hardcoded list of remote types introduced in 2015.[0] The filesystem::remote attribute has been introduced[1] to handle this, and we have been using it[2], but kept the hardcoded list in order to workaround issues with GLocalFile not setting this attribute correctly. Now that these issues have been fixed[3], we can finally drop it. [0] d3e1a71c6377343af5d61d6ded7bc4f53dfeaf53 [1] https://gitlab.gnome.org/GNOME/glib/-/commit/e57355b055217b067cd1a71340f7ea47e51d4aae [2] 99f55748ef69a68df86b9a039998ee576d59b898 [3] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1534
* file-utilities: Do not use default location instead of rootOndrej Holy2020-12-191-10/+0
| | | | | | | | | | | The default location (i.e. g_mount_get_default_location) should be used when opening mounted, but we should not use it instead of the root button in the path bar. Because it is currently impossible to navigate to parent folders if default location is set. Let's change nautilus_get_mounted_mount_for_root logic and return mount only for root path so we can see the real root in the path bar. https://gitlab.gnome.org/GNOME/nautilus/issues/1319
* file-utilities: Don't block main thread to restore from trashAntónio Fernandes2020-09-211-3/+4
| | | | | | | | | | | | | | | | | The sync variants of file operations have been introduced for use in integration tests. The async operations have been suffixed _async(). However, likely by mistake, in the restore from trash operation, the call has been appended _sync rather than _async. [1] This blocks the main thread until the operation task finishes, causing a dead lock when the operation thread needs the main thread to show a conflict dialog. This happens when restoring a file from trash if a new file with the same name already exists in the original location. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/790 [1] commit ab31018cdaeb1c592e1c46402c5ae1facc503151
* general: Run uncrustify scriptOndrej Holy2020-04-051-3/+3
| | | | | There are some style issue since the last run. Let's run it again before enabling style-check CI job.
* file-utilities: Handle x-content/ostree-repository as softwarePhilip Withnall2020-03-091-1/+5
| | | | | | | | | | | | | It’s been added to shared-mime-info alongside `x-content/unix-software`: https://gitlab.freedesktop.org/xdg/shared-mime-info/merge_requests/22. This tweaks the existing string, and adds a new string, to differentiate the two, since `x-content/unix-software` typically refers to executables on a USB stick, ready to run. `x-content/ostree-repository` typically refers to flatpak apps or OS updates on a USB stick ready to install from there onto your system. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* file-utilities: Add missing else statementErnestas Kulik2018-10-091-0/+1
| | | | | a9c446afe262b7989bc17ef1f9ab19931db8dede inadvertently removed it and that is causing leaks that don’t make sense at first.
* search-engine: Query file system to determine remotenessErnestas Kulik2018-09-251-0/+18
| | | | | | | | | | | Querying the file cache in is_recursive_search() does not guarantee that the file system field will be populated with a value, and somehow results in data races, in turn resulting in random crashes/file list corruption. Hopefully fixes https://gitlab.gnome.org/GNOME/nautilus/issues/640, closes https://gitlab.gnome.org/GNOME/nautilus/issues/632 and resolves https://gitlab.gnome.org/GNOME/nautilus/issues/602
* Undo/redo, search tests, test library and moreAlexandru Fazakas2018-08-281-3/+1
|
* file-utilities: Deduplicate max filename querying codeAntónio Fernandes2018-08-021-0/+51
| | | | | | | | | | | 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-utilities: Use proper switch/case code styleCarlos Soriano2018-07-261-1/+12
|
* nautilus-query-editor: set query recursive option as it isMarco Trevisan (Treviño)2018-07-261-13/+24
| | | | | | Just use settings_search_get_recursive_for_location to prompt to the user what's going to happen, although this might not be 100% certain, if a sub-dir is actually a network-mounted folder.
* query: add local recursive flag for local only searchesMarco Trevisan (Treviño)2018-07-261-12/+8
| | | | This will allow to have a more fine grained experience
* query: Add flags for recursive search typesMarco Trevisan (Treviño)2018-07-261-12/+17
| | | | | | | | | | | | | Use a list of cases to define when the recursive search should be done, instead of a simple true/false boolean. A part from the self-explanatory cases `ALWAYS` and `NEVER`, the `IF_INDEXED` option permits to any search engine that uses an indexed-search to return results from subfolders of the search location. One case we want to address, is the shell-search provider, that should not perform recursive searches, but it could return values from subfolders of the user home if the search is executed by search engines like tracker.
* test: Add file-operations-move testAlexandru Fazakas2018-07-161-1/+1
| | | | | This patch includes the addition of the sync alternative to the file-operations-move function and a test for it.
* general: Provide search information on the view itselfCarlos Soriano2018-07-141-0/+26
| | | | | | | | | | | | | With the new search bar design, the search information displayed under they query editor was not working properly. Instead, the new design says that the information should be displayed in the view itself, as a top banner. This work implements the new design and fixes several issues of sizing due to the wrong position of the search information label. Closes https://gitlab.gnome.org/GNOME/nautilus/issues/403
* nautilus-file-utilities: Add GVolumeMonitor auto cleanupWong Heung Sang2018-06-021-1/+1
| | | | | | | | | | | | | In nautilus_get_mounted_mount_for_root g_volume_monitor_get is called without cleanup We need cleanup or auto cleanup for GVolumeMonitor g_autoptr is added for auto cleanup Closes https://gitlab.gnome.org/GNOME/nautilus/issues/471
* general: Remove remaining desktop-file-related codeErnestas Kulik2018-05-121-34/+0
|
* Replace eel_show_warning_dialog()George Mocanu2018-04-231-4/+5
| | | | | | | | | | We need to move away from using eel and port most functionalities inside nautilus. Replaced the usage of eel_show_warning_dialog() with the show_dialog() alternative. https://gitlab.gnome.org/GNOME/nautilus/issues/331
* Revert "Merge remote-tracking branch 'upstream/master'"Carlos Soriano2018-04-231-5/+4
| | | This reverts commit 1f4bd55d1b9d5f701f2df8d1be7466df85a8669a
* Replace eel_show_warning_dialog()George Mocanu2018-04-231-4/+5
| | | | | | | | | | We need to move away from using eel and port most functionalities inside nautilus. Replaced the usage of eel_show_warning_dialog() with the show_dialog() alternative. https://gitlab.gnome.org/GNOME/nautilus/issues/331
* file-utilities: Remove leftovers of desktop removalAntónio Fernandes2018-03-231-1/+0
| | | | | | | Since commit 74dd9c9f72002d482c898a704bb5b95655e35e08, this function is undefined and this constant is unused. Let's drop them.
* file-utils: Remove obsolete API for desktop dirAntónio Fernandes2018-03-231-59/+0
| | | | | | | | | | | | | None of this is currently used. Also, since the desktop_is_home_dir setting was removed in commit 5ab3050f22da718264a35e61ada4be1a386a6e2d, the desktop dir is always XDG_DESKTOP_DIR. Thanks to that, we can simply use this instead: nautilus_file_is_user_special_directory (file, G_USER_DIRECTORY_DESKTOP) Therefore, remove the obsolete API.
* file-utilities: Create parents along with config dirErnestas Kulik2018-03-211-1/+1
| | | | | While under normal circumstances one could expect XDG_CONFIG_HOME to exist, in rare cases (e.g. test environments), it might not.
* files-view: ensure starred directory type is registeredErnestas Kulik2018-03-031-0/+6
| | | | | | Since 9ec2be563527a6821625b33a896c2478728a0a3c removed the only call to nautilus_starred_directory_get_type(), the extension isn’t registered and starred:/// does not load.
* files-view: don't strip extension when compressing foldersRahul Verma2018-02-221-28/+68
| | | | | | | | | | | | | If a file named "Project 1.4" is compressed, the dialog will propose a truncated name for the archive ("Project 1"). However, this applies to folders too, where we don't need to worry about extensions. Therefore, the extension should be ignored if the item to be compressed is a folder. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/115
* general: Run uncrustifyCarlos Soriano2018-02-131-1/+2
|
* general: Rename from 'favorite' to 'starred'Carlos Soriano2018-02-131-3/+3
| | | | | | | | It was a mix of both terms, given that tracker uses 'favorite' but we use 'starred' in the UI. Since the part that interact with tracker is minimal, is better to be consistent with the UI. This renames 'favorite' to 'starred' except the tracker queries.
* bookmark-list: Disable bookmarking recent:// and trash://António Fernandes2018-01-041-0/+19
| | | | | | | | | | | These locations are listed in the sidebar already. Bookmarking duplicates them. We already disable bookmarking Home, Favories, XDG User Firs, and Other Locations. Do the same thing for Recent and Trash. As a side effect, this will disable bookmarking child folders inside Trash. Fixes: #189
* general: remove desktop supportErnestas Kulik2018-01-021-57/+1
|
* file-utilities: rework common prefix computationErnestas Kulik2017-12-231-5/+46
| | | | | | | | | | | | | | | | | Currently, the process for getting the common prefix of a list of file names is a tad too greedy: 1. Find the common prefix of all the strings. 2. Strip the extension from the prefix. 3. Strip trailing punctuation. Step 2 may strip dots if there’s trailing whitespace and step 3 may strip useful punctuation (e.g. parentheses). This commit reworks the process as such: 1. Strip the extension from all the file names. 2. Find the common prefix of all the strings. 3. Trim trailing whitespace. Fixes #174.
* Add favorite filesAlexandru Pandelea2017-11-051-1/+17
| | | | | | | Add option to make files Favorite, by either toggling a star in the list view, or from the context menu. https://bugzilla.gnome.org/show_bug.cgi?id=786039
* Prefer local (file://) URIs than native ones (smb:// for example).Colin Leroy2017-10-121-0/+21
| | | | | | This allows drag and dropping files from network shares in Thunar to other applications that don't handle native URIs (Claws Mail, Chromium, Firefox...)
* Fix translator commentsPiotr Drąg2017-01-281-2/+2
| | | | They need to be exactly one line above a string to show up in .po files.
* general: format code with newer UncrustifyCarlos Soriano2016-11-301-3/+3
| | | | | Some issues were fixed, and now we can rerun Uncrustify to format correctly more part of the code.
* general: rework clipboard handlingCarlos Soriano2016-09-291-0/+17
| | | | | | | | | | | | | | | | | | | | | | | We were using a custom clipboard monitor, due to some old behaviour in 2004 where not all X servers supported XFIXES, which allows to monitor global clipboard changes between processes, which are needed in Nautilus for copy, paste and link operations, and their availability check. Since Nautilus was a single process, it was working for most of the time. However recently we split the desktop in a different process, so we were not able to correctly set the GDK action for clipboard, since we were relying on sharing the same clipboard in the same process. In order to fix this, this patch reworks the clipboard handling to a more modern way, using the owner-changed signal present in XFIXES. This fixes the clipboard changing between the desktop and Nautilus and interproccess clipboard handling, fixes small corner cases, and in the way this patch makes the code design and ownership of clipboard more clearer. https://bugzilla.gnome.org/show_bug.cgi?id=771046
* nautilus-toolbar: disable bookmark on 'Other Locations'Mohammed Sadiq2016-09-211-0/+9
| | | | | | | | | | 'Other locations' is already listed in the sidebar. So there is no need for allowing the user to bookmark 'Other Locations'. This commit makes the bookmark button in toolbar insensitive for 'Other Locations'. https://bugzilla.gnome.org/show_bug.cgi?id=771163
* general: initialize smart pointers to NULLRazvan Chitu2016-08-301-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=770609
* general: run uncrustifyCarlos Soriano2016-08-291-806/+939
| | | | | | | | And make the style of Nautilus the same for all files. Hopefully we can fix all the style issues we can find in the next days, so expect a little of movement on this. https://bugzilla.gnome.org/show_bug.cgi?id=770564
* Implement batch renamingAlexandru Pandelea2016-08-291-0/+16
| | | | | | | | | | | | | | | | | | | | | Renaming multiple files at once has been a missing feature in Nautilus for a long time. This patch implements that feature in the following way: This operation is launched in the same way as the rename one, when the selection has more than one file. When the batch renaming is launched, a dialog is shown, offering two modes. In the first mode, the user can use metadata (if available), numbering and original file name tags to create the new names. Between the tags, there also can be written normal text, which will be added in the new names. If numbering is used, the order of the files can be modified by using several criteria. In the second mode, the user can replace an existing part of the name. https://bugzilla.gnome.org/show_bug.cgi?id=768311
* file-utilities: refactor ensure_unique_file_nameRazvan Chitu2016-08-231-41/+29
| | | | | | | The function works with strings instead of GFiles. Replace it with a function that generates unique files in a directory using GFiles. https://bugzilla.gnome.org/show_bug.cgi?id=768646
* files-view: change "New Folder /w Selection" to offer a nameNeil Herald2016-07-101-0/+54
| | | | | | | | | | | | | New Folder with Selection currently doesn't offer a folder name. It would be better if it suggested a folder name based on the files that are selected. With this change, it now looks for a common filename prefix of the selected files, and pre-populates the folder name entry with that. If no common prefix is found that is greater than 3 characters long, the folder name entry will be left blank. https://bugzilla.gnome.org/show_bug.cgi?id=747907
* general: merge libnautilus-private to srcwip/csoriano/private-to-srcCarlos Soriano2016-04-251-0/+1181
And fix make distcheck. Although libnautilus-private seem self contained, it was actually depending on the files on src/ for dnd. Not only that, but files in libnautilus-private also were depending on dnd files, which you can guess it's wrong. Before the desktop split, this was working because the files were distributed, but now was a problem since we reestructured the code, and now nautilus being a library make distcheck stop working. First solution was try to fix this inter dependency of files, but at some point I realized that there was no real point on splitting some of those files, because for example, is perfectly fine for dnd to need to access the window functions, and it's perfectly fine for the widgets in the private library to need to access to all dnd functions. So seems to me the private library of nautilus is somehow an artificial split, which provides more problems than solutions. We needed libnautilus-private to have a private library that we could isolate from extensions, but I don't think it worth given the problems it provides, and also, this not so good logical split. Right now, since with the desktop split we created a libnautilus to be used by the desktop part of nautilus, extensions have access to all the API of nautilus. We will think in future how this can be handled if we want. So for now, merge the libnautilus-private into src, and let's rethink a better logic to split the code and the private parts of nautilus than what we had. Thanks a lot to Rafael Fonseca for helping in get this done. https://bugzilla.gnome.org/show_bug.cgi?id=765543