diff base/RecentFiles.cpp @ 277:3b8008d09541

* Add a colour database, and Add New Colour function to the colour combo in property box. The colour property is only correctly handled in the waveform layer so far. * Add en_GB translation, to translate those annoying Color texts in the Qt colour picker dialog.
author Chris Cannam
date Wed, 11 Jul 2007 17:21:37 +0000
parents 6576a208e8e7
children 6a94bb528e9d
line wrap: on
line diff
--- a/base/RecentFiles.cpp	Thu Jul 05 11:07:01 2007 +0000
+++ b/base/RecentFiles.cpp	Wed Jul 11 17:21:37 2007 +0000
@@ -15,6 +15,8 @@
 
 #include "RecentFiles.h"
 
+#include "Preferences.h"
+
 #include <QFileInfo>
 #include <QSettings>
 #include <QRegExp>
@@ -117,10 +119,19 @@
 RecentFiles::addFile(QString name)
 {
     static QRegExp schemeRE("^[a-zA-Z]{2,5}://");
+    static QRegExp tempRE("[\\/][Tt]e?mp[\\/]");
     if (schemeRE.indexIn(name) == 0) {
         add(name);
     } else {
-        add(QFileInfo(name).absoluteFilePath());
+        QString absPath = QFileInfo(name).absoluteFilePath();
+        if (tempRE.indexIn(absPath) != -1) {
+            Preferences *prefs = Preferences::getInstance();
+            if (prefs && !prefs->getOmitTempsFromRecentFiles()) {
+                add(absPath);
+            }
+        } else {
+            add(absPath);
+        }
     }
 }