diff options
Diffstat (limited to 'addon/doxywizard')
-rwxr-xr-x | addon/doxywizard/doxywizard.cpp | 16 | ||||
-rwxr-xr-x | addon/doxywizard/doxywizard.h | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index a15f64c..492912b 100755 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -374,14 +374,16 @@ void MainWindow::loadSettings() } } - for (int i=0;i<MAX_RECENT_FILES;i++) + /* due to prepend use list in reversed order */ + for (int i=MAX_RECENT_FILES;i>=0;i--) { QString entry = m_settings.value(QString().sprintf("recent/config%d",i)).toString(); if (!entry.isEmpty() && QFileInfo(entry).exists()) { - addRecentFile(entry); + addRecentFileList(entry); } } + updateRecentFile(); } @@ -408,6 +410,11 @@ void MainWindow::selectRunTab() void MainWindow::addRecentFile(const QString &fileName) { + addRecentFileList(fileName); + updateRecentFile(); +} +void MainWindow::addRecentFileList(const QString &fileName) +{ int i=m_recentFiles.indexOf(fileName); if (i!=-1) m_recentFiles.removeAt(i); @@ -421,8 +428,11 @@ void MainWindow::addRecentFile(const QString &fileName) m_recentFiles.removeLast(); m_recentFiles.prepend(fileName); } +} +void MainWindow::updateRecentFile(void) +{ m_recentMenu->clear(); - i=0; + int i=0; foreach( QString str, m_recentFiles ) { m_recentMenu->addAction(str); diff --git a/addon/doxywizard/doxywizard.h b/addon/doxywizard/doxywizard.h index b84e2f8..49b7c02 100755 --- a/addon/doxywizard/doxywizard.h +++ b/addon/doxywizard/doxywizard.h @@ -58,6 +58,8 @@ class MainWindow : public QMainWindow MainWindow(); void saveConfig(const QString &fileName); void addRecentFile(const QString &fileName); + void addRecentFileList(const QString &fileName); + void updateRecentFile(void); void updateConfigFileName(const QString &fileName); void setWorkingDir(const QString &dirName); void updateLaunchButtonState(); |