updates to recent files menu

Tue, 06 Aug 2013 16:23:16 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 06 Aug 2013 16:23:16 +0300
changeset 438
2f9eade6eb6f
parent 437
51313dba897d
child 439
c3421d3f01a2

updates to recent files menu

src/gui.cpp file | annotate | diff | comparison | revisions
--- a/src/gui.cpp	Tue Aug 06 13:52:32 2013 +0300
+++ b/src/gui.cpp	Tue Aug 06 16:23:16 2013 +0300
@@ -147,13 +147,17 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 void ForgeWindow::updateRecentFilesMenu() {
+	QStringList files = io_recentfiles.value.split ("@", QString::SkipEmptyParts);
+	QStringListIterator it (files);
+	
 	// First, clear any items in the recent files menu
 	for (QAction* recent : m_recentFiles)
 		delete recent;
 	m_recentFiles.clear();
 	
-	List<str> files = container_cast<QStringList, List<str>> (io_recentfiles.value.split ("@"));
-	for (str file : c_rev<str> (files)) {
+	it.toBack();
+	while (it.hasPrevious()) {
+		str file = it.previous();
 		QAction* recent = new QAction (getIcon ("open-recent"), file, this);
 		
 		connect (recent, SIGNAL (triggered()), this, SLOT (slot_recentFile()));

mercurial