Replace a delete/insert by an insert-or-replace SQL statement.

Minor code clean-up for #9210.
Use glib API for dt_util_is_dir_empty() implementation.

Continued work for #9732.
When leaving the darkroom do not loose history items.

If some history are selected (for comparing with a snapshot for example) we
do not want to loose history above the selected point when leaving the
darkroom.

This adds some safety.
add an initialize_store called before export

unused at this point, will be used by lua
lua : add a new callback to lua storage before any store happens

this is undocumented (but marked as such) because auto-generated
doc is not stable right now

the new function has the following prototype :
* storage : the storage object used
* format : the format object used
* images : a table of images to be exported
* quality : boolean, true if high quality export
* extra : the extra data table used by all export callbacks
returns : the list of images to export or nil.
  if nil (or no returned value) the original list will be used
  if an empty table is returned, no image will be exported,
  but finalize will still be called
Create a unique index for presets.

This ensure that the insert-or-replace will do the right thing and
will avoid creating duplicate presets.
[l10n] Swedish update, 1 new string
Revert "When leaving the darkroom do not loose history items."

This reverts commit c669bfbe6150a80471cf1243d58179b9e0d19091.

It's the wrong fix for a real problem. Instead of changing people's
history stack we need to introduce a "pointer" (an uint) pointing to the
selected item of the stack and store that in xmp and database.
Update French translation.
Revert documentation change for preview with focusdectect.
nothing should ever be bold and italic
(cherry picked from commit 1f4902cd74d68f620ee7cd9300ef576dbef094c6)
styles: tooltips need markup escaped
(cherry picked from commit 2d260a0f1d76a5c064c1a99a5f53f990c501d874)
Merge branch 'master' of https://github.com/darktable-org/darktable