+void ApplicationWindow::UpdateMRUActionList(void)
+{
+ QStringList mruFilePaths = settings.value("recentFiles").toStringList();
+
+ int mruSize = (mruFilePaths.size() <= MRU_MAX ? mruFilePaths.size() : MRU_MAX);
+
+ for(int i=0; i<mruSize; i++)
+ {
+ QString filename = QFileInfo(mruFilePaths.at(i)).fileName();
+ mruAct.at(i)->setText(filename);
+ mruAct.at(i)->setData(mruFilePaths.at(i));
+ mruAct.at(i)->setVisible(true);
+ }
+
+ for(int i=mruSize; i<MRU_MAX; i++)
+ mruAct.at(i)->setVisible(false);
+}
+
+void ApplicationWindow::AdjustMRU(const QString & filePath)
+{
+ documentName = filePath;
+ setWindowFilePath(documentName);
+
+ QStringList mruFilePaths = settings.value("recentFiles").toStringList();
+ mruFilePaths.removeAll(filePath);
+ mruFilePaths.prepend(filePath);
+
+ while (mruFilePaths.size() > MRU_MAX)
+ mruFilePaths.removeLast();
+
+ settings.setValue("recentFiles", mruFilePaths);
+
+ UpdateMRUActionList();
+}