summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystemmodel.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix return value error in _gtk_file_system_model_get_directoryTing-Wei Lan2015-07-061-1/+1
|
* Add a getter for the directory to file system modelMatthias Clasen2015-07-041-0/+9
| | | | | This will allow us to aovid reloading if the directory is unchanged.
* Use infos from search engine instead of getting them againMatthias Clasen2015-06-181-0/+17
| | | | | | | | | | | When the search engine provides hits with GFileInfo, use that to add the hits to the model directly, without going through another round of async get_info calls. To do this, we add a batched variant of the _gtk_file_system_model_update_file call that takes lists of GFiles and GFileInfos. Again, we can avoid repeated resorting that happens when the files are updated individually.
* file system model: Add batched insertionMatthias Clasen2015-06-181-0/+36
| | | | | | | Add a batched version of gtk_file_system_model_add_and_query_file that takes a list of files and avoids resorting the model for each individual insertion. The querying is still done one-file-at-a-time, so more optimization is certainly possible.
* Remove no longer needed in-tree editingwip/csoriano/gtkplacesidebar_bookmarksMatthias Clasen2015-04-101-48/+1
|
* GtkFileChooser: Don't crash if invisible files are deletedMatthias Clasen2014-12-111-1/+4
| | | | | | | | | | | | | | | | | This is a crash that has been around for a long time, as can be seen here: https://bugzilla.redhat.com/show_bug.cgi?id=1048388 https://bugzilla.redhat.com/show_bug.cgi?id=984375 https://bugzilla.redhat.com/show_bug.cgi?id=1159015 https://bugzilla.redhat.com/show_bug.cgi?id=1059187 https://bugzilla.redhat.com/show_bug.cgi?id=1122172 https://bugzilla.redhat.com/show_bug.cgi?id=1016895 https://bugzilla.redhat.com/show_bug.cgi?id=1133235 https://bugzilla.redhat.com/show_bug.cgi?id=1077500 https://bugzilla.redhat.com/show_bug.cgi?id=1054378 https://bugzilla.redhat.com/show_bug.cgi?id=1173212 Fix suggested by Benjamin Otte.
* Freeze file system model during editingEmmanuele Bassi2014-11-251-37/+44
| | | | | | | | | | | | | | | | | If a file system event arrives while GtkFileChooserWidget is asking the user to edit the name of a newly created folder, the file system model will drop the row with the editable cell, and the user will have to start from scratch. This makes creating new directories impossible inside a directory with a file currently being downloaded, for instance, and it's really unhelpful to the user because the editable row simply disappears. We already have a mechanism in place to freeze the file system model, so we can reuse it between the add_editable() and the remove_editable() calls. https://bugzilla.gnome.org/show_bug.cgi?id=729927
* Don't leak the queried file infoWilliam Jon McCann2014-02-211-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=554618
* docs: use Returns: consistentlyWilliam Jon McCann2014-02-191-4/+4
| | | | Instead of Return value:
* docs: use proper apostropheWilliam Jon McCann2014-02-071-1/+1
| | | | https://wiki.gnome.org/Design/OS/Typography
* docs: use proper quotesWilliam Jon McCann2014-02-051-9/+9
|
* docs: use #*-struct instead of <structname>William Jon McCann2014-01-271-3/+3
|
* all: Add names to timeoutsBastien Nocera2013-10-231-0/+1
| | | | | | | Add names to every timeout we setup, so it's easier to track their usage, and debug possible misbehaviour. https://bugzilla.gnome.org/show_bug.cgi?id=710651
* bgo#687196 - Fix model corruption during file removalbgo687196-filesystemmodel-crashFederico Mena Quintero2012-11-021-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | The main problem is that we were emitting the row-deleted signal for the model in the middle of the process that actually deletes the row from the model (remove the row from the array, update the model->file_lookup hash table, etc.). In the model's caller, one of the row-deleted callbacks was requesting an iter, which caused the model to revalidate itself - but it did this while it was in an inconsistent state. This led to an assertion failure later when the model resorted itself. The fix in remove_file() is like this: * The filteredness/visibility of the deleted node is not updated. The node will simply be gone; we don't need to update those values at all. * We invalidate just the node that is being deleted. * The model->file_lookup hash table is not completely nuked; instead, we carefully adjust its indices. * The row-deleted signal is only emitted at the very end, when deletion is complete and the model is consistent. Many thanks to William Hua for doing the detective work on this bug! Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Make freeze_updates() and thaw_updates() static functionsFederico Mena Quintero2012-11-011-18/+19
| | | | | | They were in the semi-public API of GtkFileSystemModel, but never actually used outside of it. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Comments on how the filtering and sorting processes workFederico Mena Quintero2012-11-011-1/+21
| | | | Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Remove argument to _gtk_file_system_model_update_file() that should not be ↵Federico Mena Quintero2012-10-311-7/+11
| | | | | | part of the internal API Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Rename gtk_tree_path_new_from_node() to tree_path_new_from_node()Federico Mena Quintero2012-10-311-7/+7
| | | | | | | | | This is a function internal to the file system model; let's not pollute the gtk_tree_path namespace. Also, make the 'i' variable into 'r' as it refers to a row index, not a file-array index (for consistency with the docs and the rest of the code). Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Emit row-changed notificationMatthias Clasen2012-07-151-1/+6
| | | | | Emit row-changed when the filteredness of a visible row changes in GtkFileSystemModel.
* Make computing and setting the visibility/filters atomic operationsFederico Mena Quintero2012-07-151-27/+26
| | | | | | | | This way we remove paired function calls (compute/set pairs), and also make it possible to avoid computing a filter twice, as setting the visibility depends on filteredness. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Make it clear that 'filtered' means 'filtered_out'Federico Mena Quintero2012-07-151-22/+23
| | | | | | | | | It bothers me that we call gtk_file_filter_filter(), then negate the result, and the return *that* from node_should_be_filtered(). So, rename 'filtered' throughout GtkFileSystemModel to 'filtered_out' to mean things that didn't pass the filter. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Remove superfluous check in node_set_filtered()Federico Mena Quintero2012-07-151-4/+0
| | | | | | | | This was a copy-paste leftover from node_set_visible(). Filters are not concerned with model freezes, so node_set_filtered() does not need to handle freezes, either. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Desensitize filtered folders when in folder selection modeWilliam Jon McCann2012-07-151-24/+85
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679333
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* filesystemmodel: Add a toggle for whether directories are filteredBenjamin Otte2011-12-161-10/+41
|
* filesystemmodel: Add a missing checkBenjamin Otte2011-10-031-0/+3
| | | | | Paths with depth > 1 should return FALSE instead of pretending the depth is 1.
* Ensure we always grab the gdk lock in async callbacksAlexander Larsson2011-03-281-0/+4
| | | | | | Async callbacks are delivered in idles, so we need to make sure we get the gdk lock before calling any gdk/gtk stuff. This was missing in a few places.
* bgo#614006 - GtkFileSystemModel - Make sure to generate node IDs are valid ↵Sergey Orlov2010-08-241-1/+4
| | | | | | | | | for new files When a file was inserted during the period that the editable row was active, the node IDs would not get updated correctly. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* gtk/: fully remove gtkalias hacksJavier Jardón2010-07-101-1/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=623845
* Revert "Add length to gtk_tree_path_get_indices"Colin Walters2010-06-281-1/+1
| | | | | | This reverts commit eebb16eb1af11c5327dd06b23df82f7528566739. Was an accidental commit.
* Add length to gtk_tree_path_get_indicesColin Walters2010-06-281-1/+1
| | | | | | The old version wasn't introspectable as it didn't have a length return parameter. Also, delete gtk_tree_path_get_indices_with_depth, since it's no longer needed.
* Can't select file on file browser after changing sort orderBenjamin Otte2010-06-281-1/+1
| | | | | | | The row values are 1-indexed not 0-indexed, this has to be taken into account when producing the new_order array. https://bugzilla.gnome.org/show_bug.cgi?id=621414
* filechooser: Fix a crash when removing filesBenjamin Otte2010-05-021-0/+1
| | | | | | | | | | | The file removal code was not properly clearing the file=>array index cache, so later lookups into that cache would return invalid array indexes. The easiest way to reproduce it is to create a directory with two files and deleting both of them. Reported-by: Javier Jardón <jjardon@gnome.org>
* Fix error case in filesystem modelBenjamin Otte2010-03-291-3/+5
| | | | | | | | | | We should not unref the model here, it might not even exist anymore. Instead check if it exists and only use it if it does. The unref was leftover from a previous fix in ba9f53397ff0b86ad56166c7fc91b4d499f7aefc. Spotted by Matthias Clasen in https://bugzilla.gnome.org/show_bug.cgi?id=614099
* [annotations] Add allow-noneJohan Dahlin2010-02-191-2/+2
| | | | | | | | This commit was created using a script that searched for all docstrings containing a parameter and the string 'or %NULL'. Gdk backends and demos excluded as they are not part of a public API https://bugzilla.gnome.org/show_bug.cgi?id=610474
* Don't keep the filesystem model alive while querying filesBenjamin Otte2009-11-021-14/+14
| | | | | | | | This allows disposing of the filesystemmodel while the file enumeration is still happening. As the filechooser does not disconnect its signals because it assumes it is the only owner of the model, this also prevents a SEGV when emitting the "load-finished" signal in that case.
* Fix thinkos in which fields get usedFederico Mena Quintero2009-10-151-3/+3
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Oops, it's gsize, not GSizeFederico Mena Quintero2009-10-151-1/+1
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* In set_filter(), handle the case where the new filter is the same as the old ↵Federico Mena Quintero2009-10-151-2/+7
| | | | | | filter Signed-off-by: Federico Mena Quintero <federico@novell.com>
* s/get_is_visible/iter_is_visible for clarityFederico Mena Quintero2009-10-151-4/+4
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Remove obsolete commentFederico Mena Quintero2009-10-151-2/+0
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Make the code match the docs in _gtk_file_system_model_clear_cache()Federico Mena Quintero2009-10-151-2/+2
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Free some missing fields in ::finalize()Federico Mena Quintero2009-10-151-0/+8
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Clarify variable names in gtk_file_system_model_sort()Federico Mena Quintero2009-10-151-11/+12
| | | | | | To comply with the i -> indexes; r -> rows convention. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Nothing to do for ref/unref_nodeFederico Mena Quintero2009-10-151-2/+2
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Clarify a couple of spots with commentsFederico Mena Quintero2009-10-151-2/+2
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Clarify array indexes vs. row numbersFederico Mena Quintero2009-10-151-60/+90
| | | | | | | | | There was some confusion between "index" as used for the model->files[] array, and node->index as used for our 1-based row numbers. Now we use "index" only for indices in the model->files[] array, and node->row for row numbers. Functions and variables are renamed to clarify whether they refer to indexes or rows. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Big comment on how GtkFileSystemModel worksFederico Mena Quintero2009-10-151-1/+65
| | | | | | Let's have some documentation on the idea behind this beast... Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Remove obsolete code to use a cached mime-typeFederico Mena Quintero2009-10-151-16/+10
| | | | | | | The non-standard "filechooser::mime-type" was a remnant of the recent-files code using a hand-built GFileInfo; now we just query the file info ourselves. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Fix thinko in node_should_be_visible()Federico Mena Quintero2009-10-151-1/+1
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>