def saveProfile(self, settings=None):
        """ Writes the view settings to the persistent store
        """
        self._updateNonDefaultsForInspector(self.inspectorRegItem, self.inspector)

        if settings is None:
            settings = QtCore.QSettings()
        logger.debug("Writing settings to: {}".format(settings.group()))

        settings.beginGroup('cfg_inspectors')
        try:
            for key, nonDefaults in self._inspectorsNonDefaults.items():
                if nonDefaults:
                    settings.setValue(key, ctiDumps(nonDefaults))
                    logger.debug("Writing non defaults for {}: {}".format(key, nonDefaults))
        finally:
            settings.endGroup()

        self.configWidget.configTreeView.saveProfile("config_tree/header_state", settings)
        self.repoWidget.repoTreeView.saveProfile("repo_tree/header_state", settings)

        settings.setValue("geometry", self.saveGeometry())
        settings.setValue("state", self.saveState())

        identifier = self.inspectorRegItem.identifier if self.inspectorRegItem else ''
        settings.setValue("inspector", identifier)
Writes the view settings to the persistent store