Skip to content

Commit

Permalink
Merge pull request #462 from albert-github/feature/bug_764359
Browse files Browse the repository at this point in the history
 Bug 764359 - Recent File list allows only 2 entries
  • Loading branch information
Dimitri van Heesch committed Apr 2, 2016
2 parents 9e0cd53 + 0f53af1 commit 3731948
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions addon/doxywizard/doxywizard.cpp
Expand Up @@ -368,14 +368,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();

}

Expand All @@ -401,6 +403,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);
Expand All @@ -415,8 +422,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);
Expand Down
2 changes: 2 additions & 0 deletions addon/doxywizard/doxywizard.h
Expand Up @@ -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();
Expand Down

0 comments on commit 3731948

Please sign in to comment.