Disabling history in Settings → Configure → Advanced → History
does not prevent showing and populating File → Open Recent.
The last target directory for Copy/Move/Link To dialog does not check
for history option too.
This patch only saves/restores file history if the option is enabled
and hides the menu entry if disabled.
BUG: 332853
BUG: 391527
Depends on D11280