Fix a bug in exportSettings() and importSettings()

- The bug was caused by not checking first whether the file name
  returned by the dialogs was empty or not.