code: def loadProfile(self, profile, inspectorFullName=None):
          
          settings = QtCore.QSettings()
          logger.info("Reading profile {!r} from: {}".format(profile, settings.fileName()))
  
          self._profile = profile
          profGroupName = self.profileGroupName(profile)
  
          # Instantiate windows from groups
          settings.beginGroup(profGroupName)
          try:
              for windowGroupName in settings.childGroups():
                  if windowGroupName.startswith('window'):
                      settings.beginGroup(windowGroupName)
                      try:
                          self.addNewMainWindow(settings=settings)
                      finally:
                          settings.endGroup()
          finally:
              settings.endGroup()
  
          if inspectorFullName is not None:
              windows = [win for win in self._mainWindows
                         if win.inspectorFullName == inspectorFullName]
              if len(windows) == 0:
                  logger.info("Creating window for inspector: {!r}".format(inspectorFullName))
                  try:
                      win = self.addNewMainWindow(inspectorFullName=inspectorFullName)
                  except KeyError:
                      logger.warn("No inspector found with ID: {}".format(inspectorFullName))
              else:
                  for win in windows:
                      win.raise_()
  
          if len(self.mainWindows) == 0:
              logger.info("No open windows in profile (creating one).")
              self.addNewMainWindow(inspectorFullName=DEFAULT_INSPECTOR)
docs: Reads the persistent program settings for the current profile.
  
              If inspectorFullName is given, a window with this inspector will be created if it wasn't
              already created in the profile. All windows with this inspector will be raised.