1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-06-30 23:46:35 +00:00

files-view: Make logic order look intentional

The selection check is done after the emission of delayed singals which
may change it, as per commit 09f4546d50.

However, nowadays we have a habit of combining declaration and
assingment into a single statement. So, during future hacking, one
might be tempted to move the assignments into the declaration lines,
effectively reverting that commit.

Let's keep declaration and assingment together but after that call,
and also add a comment to make it clear this order is intentional.
This commit is contained in:
António Fernandes 2024-06-04 23:03:55 +01:00
parent e5e53ea2c9
commit c960cfa439

View File

@ -4485,13 +4485,12 @@ static void
display_pending_files (NautilusFilesView *view)
{
NautilusFilesViewPrivate *priv = nautilus_files_view_get_instance_private (view);
g_autoptr (GtkBitset) selection = NULL;
gboolean no_selection = FALSE;
search_transition_emit_delayed_signals_if_pending (view);
selection = gtk_selection_model_get_selection (GTK_SELECTION_MODEL (priv->model));
no_selection = gtk_bitset_is_empty (selection);
/* Get selection after delayed signals are emitted. */
g_autoptr (GtkBitset) selection = gtk_selection_model_get_selection (GTK_SELECTION_MODEL (priv->model));
gboolean no_selection = gtk_bitset_is_empty (selection);
process_pending_files (view);