code: def import_setting(file_path, qsettings=None):
      
      with open(file_path, 'r') as f:
          inasafe_settings = json.load(f)
  
      if not qsettings:
          qsettings = QSettings()
  
      # Clear the previous setting
      qsettings.beginGroup('inasafe')
      qsettings.remove('')
      qsettings.endGroup()
  
      for key, value in list(inasafe_settings.items()):
          set_setting(key, value, qsettings=qsettings)
  
      return inasafe_settings
docs: Import InaSAFE's setting from a file.
  
      :param file_path: The file to read the imported setting.
      :type file_path: basestring
  
      :param qsettings: A custom QSettings to use. If it's not defined, it will
          use the default one.
      :type qsettings: qgis.PyQt.QtCore.QSettings
  
      :returns: A dictionary of the imported settings.
      :rtype: dict