Commit d03cd838 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Added convenience function getMostRecentItem to common/RecentFiles.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17414 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ec866c00
......@@ -110,6 +110,11 @@ QStringList getRecentItems(const QString &propName) {
return OpenFlipperSettings().value(propName, QStringList()).toStringList();
}
QString getMostRecentItem(const QString &propName) {
QStringList sl = OpenFlipperSettings().value(propName, QStringList()).toStringList();
if (sl.empty()) return QString();
return sl[0];
}
}
}
......
......@@ -95,6 +95,13 @@ namespace Options {
DLLEXPORT
QStringList getRecentItems(const QString &propName);
/**
* Get the most recent item out of a list of recent items.
* Returns an empty string if no recent item exists.
*/
DLLEXPORT
QString getMostRecentItem(const QString &propName);
/**
* Update combo box text. At the same time, store text in recent items list.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment