def METHOD_NAME(self, value):
    settings = QSettings()
    if self._values:
        idx = self._indexOf(self._values, value)
        if idx >= 0:
            self._values = self._values[:idx] + self._values[(idx+1):]
            self._values.insert(0, value)
        else:
            self._values.insert(0, value)
            max_files = settings.value(self._max_recent_key, type=int)
            if not max_files:
                max_files = self._max_val
                settings.setValue(self._max_recent_key, max_files)
            if len(self._values) >= max_files:
                self._values.pop()
    else:
        self._values = [value]
    settings.setValue(self._recent_key, self._values)
    return self._values