mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
add descriptions to RideFile types
...and use these to get rid of the explicit list of ride file type descriptions in the import wizard.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Sean C. Rhea (srhea@srhea.net)
|
||||
* 2009 Justin F. Knotzke (jknotzke@shampoo.ca)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
@@ -162,11 +163,13 @@ RideFileFactory &RideFileFactory::instance()
|
||||
return *instance_;
|
||||
}
|
||||
|
||||
int RideFileFactory::registerReader(const QString &suffix,
|
||||
int RideFileFactory::registerReader(const QString &suffix,
|
||||
const QString &description,
|
||||
RideFileReader *reader)
|
||||
{
|
||||
assert(!readFuncs_.contains(suffix));
|
||||
readFuncs_.insert(suffix, reader);
|
||||
descriptions_.insert(suffix, description);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -175,6 +178,14 @@ QStringList RideFileFactory::suffixes() const
|
||||
return readFuncs_.keys();
|
||||
}
|
||||
|
||||
QRegExp
|
||||
RideFileFactory::rideFileRegExp() const
|
||||
{
|
||||
QStringList suffixList = RideFileFactory::instance().suffixes();
|
||||
QString s("^(\\d\\d\\d\\d)_(\\d\\d)_(\\d\\d)_(\\d\\d)_(\\d\\d)_(\\d\\d)\\.(%1)$");
|
||||
return QRegExp(s.arg(suffixList.join("|")));
|
||||
}
|
||||
|
||||
RideFile *RideFileFactory::openRideFile(QFile &file,
|
||||
QStringList &errors) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user