mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
Add functions to manage a openRecent list to the configuration management code
This commit is contained in:
parent
65f2068dd6
commit
9d9ec41736
@ -57,4 +57,15 @@ void Configuration::load(QSettings * settings)
|
||||
if(!settings->contains(ADJUST_TO_FULL_SIZE))
|
||||
settings->setValue(ADJUST_TO_FULL_SIZE,false);
|
||||
*/
|
||||
}
|
||||
}
|
||||
void Configuration::updateOpenRecentList (QString path)
|
||||
{
|
||||
QStringList list = openRecentList();
|
||||
list.removeAll(path);
|
||||
list.prepend(path);
|
||||
while (list.length() > 5)
|
||||
{
|
||||
list.removeLast();
|
||||
}
|
||||
settings->setValue("recentFiles", list);
|
||||
}
|
@ -65,6 +65,10 @@ using namespace YACReader;
|
||||
YACReader::FitMode getFitMode() { return static_cast<YACReader::FitMode>(settings->value(FITMODE, YACReader::FitMode::FullPage).toInt()); }
|
||||
void setFitMode ( YACReader::FitMode fitMode ){ settings->setValue(FITMODE, static_cast<int>(fitMode)); }
|
||||
|
||||
//openRecent
|
||||
QStringList openRecentList() { return settings->value("recentFiles").toStringList(); }
|
||||
void updateOpenRecentList (QString path);
|
||||
|
||||
//Old fitmodes
|
||||
/*
|
||||
bool getAdjustToWidth() {return settings->value(FIT).toBool();}
|
||||
|
Loading…
x
Reference in New Issue
Block a user