comparison base/RecentFiles.cpp @ 209:6576a208e8e7

* Add Open Location... * Add support for URLs in Recent Files * Do the right thing with the last location for file open dialogs when opening a URL (i.e. don't change it to the temporary file directory)
author Chris Cannam
date Wed, 10 Jan 2007 12:27:55 +0000
parents d5052b5fea9c
children 3b8008d09541
comparison
equal deleted inserted replaced
208:8a3d68910b37 209:6576a208e8e7
15 15
16 #include "RecentFiles.h" 16 #include "RecentFiles.h"
17 17
18 #include <QFileInfo> 18 #include <QFileInfo>
19 #include <QSettings> 19 #include <QSettings>
20 #include <QRegExp>
20 21
21 RecentFiles::RecentFiles(QString settingsGroup, size_t maxCount) : 22 RecentFiles::RecentFiles(QString settingsGroup, size_t maxCount) :
22 m_settingsGroup(settingsGroup), 23 m_settingsGroup(settingsGroup),
23 m_maxCount(maxCount) 24 m_maxCount(maxCount)
24 { 25 {
113 } 114 }
114 115
115 void 116 void
116 RecentFiles::addFile(QString name) 117 RecentFiles::addFile(QString name)
117 { 118 {
118 add(QFileInfo(name).absoluteFilePath()); 119 static QRegExp schemeRE("^[a-zA-Z]{2,5}://");
120 if (schemeRE.indexIn(name) == 0) {
121 add(name);
122 } else {
123 add(QFileInfo(name).absoluteFilePath());
124 }
119 } 125 }
120 126
121 127