Commit Graph

64526 Commits

Author SHA1 Message Date
Benjamin Otte
a465592eee filterlistmodel: Change an annotation
We don't want clang to flip out.
2020-07-11 07:23:33 +02:00
Benjamin Otte
ce87b667fb testsuite: Add a cae with escaped Latin-1 code
This came up in recent g_uri_escape() discussions.
2020-07-11 07:23:33 +02:00
Matthias Clasen
1f84a943fe Add a 5th incremental sort model
This one uses a very simple iterative mergesort.
2020-07-11 07:23:33 +02:00
Benjamin Otte
9760fcf863 testsuite: Collect more statistics on models
* "max time"
   Reports the max time taken for all main loop iterations + initial
   set.
   This is useful to judge the performance of incremental search models.
 * "changes"
   Reports the sum of all changes during items-changed signal emissions.
   Uses MAX(added, removed) as the number to not double-count items that
   were moved.
   This is useful to judge the accuracy of the models by comparing the
   number among them.
2020-07-11 07:23:33 +02:00
Benjamin Otte
1a83ec0922 testsuite: Add more sorting tests 2020-07-11 06:16:51 +02:00
Benjamin Otte
c98cba6e40 Add a 4th sortmodel implementation
This one tracks the original positions on top of just the items so that
it can remove items.

It now takes twice as much memory but removes half of a million items in
50ms.
2020-07-09 22:29:36 +02:00
Matthias Clasen
4aafb9a7fa wip: incremental sort 2020-07-09 22:29:36 +02:00
Benjamin Otte
ff7ffe3ab9 testsuite: Add some sorting performance tests 2020-07-09 22:29:36 +02:00
Benjamin Otte
3cc97530f8 stringlist: Convert to array
Stringlists are usually built and then never modified, and accessing
items through an array is faster.
2020-07-09 22:29:36 +02:00
Benjamin Otte
8fbd4277e3 gtk: Add a 2nd sortmodel implementation
This is the dumbest possible sortmodel using an array:
Just grab all the items, put them in the array, qsort() the array.
2020-07-09 22:29:36 +02:00
Benjamin Otte
3d3200ed53 demo: Add faster sorters
This is just the existing sorters, but without the overhead of GObject
properties.
2020-07-09 22:29:36 +02:00
Benjamin Otte
7d9e7c973c xxx vector 2020-07-09 22:29:36 +02:00
Benjamin Otte
5be22fc3fe xxx: vector_set_size 2020-07-09 22:29:36 +02:00
Benjamin Otte
653d2299c7 sortlistmodel: Remove forgotten G_PARAM_CONSTRUCT_ONLY 2020-07-09 22:29:36 +02:00
Benjamin Otte
c94d69473e testsuite: Add some vector performance tests
They're not very conclusive though, because the testing isn't
fine-grained enough for these microbenchmarks.
2020-07-09 22:29:36 +02:00
Benjamin Otte
f6cdc491ad snapshot: Use GtkVector for the state stack 2020-07-09 22:29:36 +02:00
Benjamin Otte
f9214f8df3 vector: Add a bunch of new features
* GTK_VECTOR_BY_VALUE
   #define this to get GArrray-like behavior
 * gtk_vector_splice (v, 0, 0, NULL, 25)
   Adding items but passing NULL as the items will zero() them.
 * gtk_vector_set_size()
   A nicer way to call gtk_vector_splice()
2020-07-09 22:29:36 +02:00
Benjamin Otte
df8c087f1c icontheme: Use GtkVector 2020-07-09 22:29:36 +02:00
Benjamin Otte
2bc0cdef00 vector: Add null-termination 2020-07-09 22:29:36 +02:00
Benjamin Otte
56ed934149 snapshot: Port node list to vector 2020-07-09 22:29:36 +02:00
Benjamin Otte
b1bf81c1ef snapshot: Move structs into .c file
They aren't used anywhere else.
2020-07-09 22:29:36 +02:00
Benjamin Otte
723cf4f0a0 Remove preallocated array code
Now with GtkVector, we can use that one instead.
2020-07-09 22:29:36 +02:00
Benjamin Otte
b1fa5d8e07 main: Use a GtkVector 2020-07-09 22:29:36 +02:00
Benjamin Otte
2465bb533c cssselector: Use GtkVector 2020-07-09 22:29:36 +02:00
Benjamin Otte
0cadb3af04 Add GtkVector
This is a scary idea where you #define a bunch of preprocessor values
and then #include "gtkvectorimpl.c" and end up with a dynamic array for
that data type.
2020-07-09 22:29:36 +02:00
Benjamin Otte
d1a068e5b1 sorter: Remove a return_if_fail()
It's too expsensive.
2020-07-09 22:29:36 +02:00
Benjamin Otte
4d90846182 testsuite: Be more exhaustive
Create larger source models in tests, so that we hit the incremental
batch size more often and have a higher chance to expose bugs there.
2020-07-09 22:29:36 +02:00
Benjamin Otte
986f721938 filterlistmodel: Don't filter out every 513th element
Incremental filtering would skip every 513th element due to an
off-by-one error.

Test included
2020-07-09 22:29:36 +02:00
Daniel Șerbănescu
817da34f7e Update Romanian translation 2020-07-06 20:41:16 +00:00
Daniel Șerbănescu
8fa44fc3e6 Update Romanian translation 2020-07-06 20:38:44 +00:00
Jordi Mas
c7e94151b2 Update Catalan translation 2020-07-06 22:35:10 +02:00
Matthias Clasen
729ba44297 Merge branch 'wip/otte/filterlistmodel' into 'master'
Improve GtkFilterListModel

See merge request GNOME/gtk!2199
2020-07-06 15:42:44 +00:00
Matthias Clasen
2a2a6879c5 Merge branch 'file-chooser-api-cleanups' into 'master'
File chooser api cleanups

See merge request GNOME/gtk!2195
2020-07-06 15:41:56 +00:00
Matthias Clasen
e7b773b031 filechooser: Add a readonly :shortcut-folders property
This makes the shortcut folders list accessible in the
the inspector.
2020-07-06 11:03:48 -04:00
Matthias Clasen
57a225681c filechooser: Add gtk_file_chooser_get_shortcuts
Replace gtk_file_chooser_list_shortcuts with a new
api that returns a list model.

Update all callers.
2020-07-06 11:03:48 -04:00
Matthias Clasen
ea07a92366 filechooser: Add a readonly :filters property
This makes the filters list accessible in the
the inspector.
2020-07-06 11:03:48 -04:00
Matthias Clasen
76290e8ddb filechooser: Add gtk_file_chooser_get_filters
Replace gtk_file_chooser_list_filters with a new
api that returns a list model.

Update all callers.
2020-07-06 10:36:35 -04:00
Jordi Mas
26d83b1ab7 Update Catalan translation 2020-07-06 09:41:45 +02:00
Jordi Mas
2bba856206 Update Catalan translation 2020-07-06 08:54:41 +02:00
Benjamin Otte
bf3382a89e testsuite: Add more filterlistmodel tests
These ones try to be exhaustive and randomly catch weird cases.

As such, the tests are more complicated and harder to grasp.
Sorry.
2020-07-06 03:42:43 +02:00
Benjamin Otte
3162e25671 bitset: Fix typo: gtk_bitset_slice() => gtk_bitset_splice() 2020-07-06 03:42:43 +02:00
Benjamin Otte
3d931b4fe2 bitset: Don't overflow when splicing
Testcase added.
2020-07-06 03:42:43 +02:00
Matthias Clasen
fc770a383a gtk-demo: Use a progressbar in the words demo
This looks better and a bit more polished.
2020-07-06 03:42:43 +02:00
Matthias Clasen
62c385a9dd gtk-demo: No selection in the words demo
This demo is about filtering, not about selection,
so use a GtkNoSelection.
2020-07-06 03:42:43 +02:00
Matthias Clasen
7c4ad1a5c4 gtk-demo: Cosmetic fixes for the words demo
Set a window size, and don't put newlines in titles, left align and
ellipsize the label.
2020-07-06 03:42:43 +02:00
Benjamin Otte
ac524bb13a demo: Make words listview load async
And add an "Open" button (why are filechooser buttons such a catastrophe
that I can't make them smaller?).
2020-07-06 03:42:43 +02:00
Benjamin Otte
66fa9380b5 filterlistmodel: Look at type of change
This way we can avoid refiltering most of an already filtered list when
the change becomes more strict.
2020-07-06 03:42:43 +02:00
Benjamin Otte
b64eb6ca13 gtk-demo: Add incremental filtering to words demo 2020-07-06 03:42:43 +02:00
Benjamin Otte
9b2d8ac362 filterlistmodel: Add gtk_filter_list_model_get_pending()
This allows tracking if the model is busy filtering.
2020-07-06 03:42:43 +02:00
Benjamin Otte
2a90bc1a9b filterlistmodel: Add incremental filtering 2020-07-06 03:42:43 +02:00