comparison 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
comparison
equal deleted inserted replaced
276:657825878970 277:3b8008d09541
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #include "RecentFiles.h" 16 #include "RecentFiles.h"
17
18 #include "Preferences.h"
17 19
18 #include <QFileInfo> 20 #include <QFileInfo>
19 #include <QSettings> 21 #include <QSettings>
20 #include <QRegExp> 22 #include <QRegExp>
21 23
115 117
116 void 118 void
117 RecentFiles::addFile(QString name) 119 RecentFiles::addFile(QString name)
118 { 120 {
119 static QRegExp schemeRE("^[a-zA-Z]{2,5}://"); 121 static QRegExp schemeRE("^[a-zA-Z]{2,5}://");
122 static QRegExp tempRE("[\\/][Tt]e?mp[\\/]");
120 if (schemeRE.indexIn(name) == 0) { 123 if (schemeRE.indexIn(name) == 0) {
121 add(name); 124 add(name);
122 } else { 125 } else {
123 add(QFileInfo(name).absoluteFilePath()); 126 QString absPath = QFileInfo(name).absoluteFilePath();
127 if (tempRE.indexIn(absPath) != -1) {
128 Preferences *prefs = Preferences::getInstance();
129 if (prefs && !prefs->getOmitTempsFromRecentFiles()) {
130 add(absPath);
131 }
132 } else {
133 add(absPath);
134 }
124 } 135 }
125 } 136 }
126 137
127 138