25 m_settingsGroup(settingsGroup),
43 for (
int i = 0; i < 100; ++i) {
44 QString key = QString(
"recent-%1").arg(i);
45 QString name = settings.value(key,
"").toString();
46 if (name ==
"")
break;
48 else settings.setValue(key,
"");
61 QString key = QString(
"recent-%1").arg(i);
64 settings.setValue(key, name);
82 std::vector<QString> names;
95 for (
int i = 0; i < int(
m_names.size()); ++i) {
105 std::deque<QString> newnames;
106 newnames.push_back(name);
107 for (
int i = 0; i < int(
m_names.size()); ++i) {
108 if (
m_names[i] == name)
continue;
109 newnames.push_back(
m_names[i]);
121 static QRegExp schemeRE(
"^[a-zA-Z]{2,5}://");
122 static QRegExp tempRE(
"[\\/][Tt]e?mp[\\/]");
123 if (schemeRE.indexIn(name) == 0) {
126 QString absPath = QFileInfo(name).absoluteFilePath();
127 if (tempRE.indexIn(absPath) != -1) {
std::deque< QString > m_names
void addFile(QString name)
Add a name that is known to be either a file path or a URL.
static Preferences * getInstance()
bool getOmitTempsFromRecentFiles() const
void add(QString name)
Add a name that should be treated as a literal string.
std::vector< QString > getRecent() const
RecentFiles(QString settingsGroup="RecentFiles", int maxCount=10)
Construct a RecentFiles object that saves and restores in the given QSettings group and truncates whe...