61 #include "RecentFiles.hh"
69 void addRecentFile(QString _file,
DataType _type) {
78 for (
int i = 0 ; i < recentFiles.size() ; ++i)
79 if ( _file == recentFiles[i] && type == recentTypes[i] ){
80 recentFiles.removeAt(i);
81 recentTypes.removeAt(i);
86 recentFiles.pop_back();
87 recentTypes.pop_back();
90 recentFiles.push_front(_file);
91 recentTypes.push_front(type);
97 void rememberRecentItem(
const QString &propName,
const QString &itemName,
const int RECENT_ITEMS_MAX_SIZE) {
102 int position = recentItems.indexOf(QRegExp(QRegExp::escape(itemName)));
103 if (position != -1) recentItems.removeAt(position);
106 if (recentItems.size() >= RECENT_ITEMS_MAX_SIZE) recentItems.removeLast();
109 recentItems.push_front(itemName);
115 QStringList getRecentItems(
const QString &propName) {
119 QString getMostRecentItem(
const QString &propName) {
121 if (sl.empty())
return QString();
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
DLLEXPORT QString typeName(DataType _id)
Get the name of a type with given id.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...