summaryrefslogtreecommitdiffstats
path: root/src/translators/tellicoimporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/translators/tellicoimporter.cpp')
-rw-r--r--src/translators/tellicoimporter.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/translators/tellicoimporter.cpp b/src/translators/tellicoimporter.cpp
index a8dfb62..d722c0c 100644
--- a/src/translators/tellicoimporter.cpp
+++ b/src/translators/tellicoimporter.cpp
@@ -39,11 +39,6 @@
using Tellico::Import::TellicoImporter;
-bool TellicoImporter::versionConversion(uint from, uint to) {
- // version 10 only added board games to version 9
- return from < to && (from != 9 || to != 10);
-}
-
TellicoImporter::TellicoImporter(const KURL& url_, bool loadAllImages_) : DataImporter(url_),
m_coll(0), m_loadAllImages(loadAllImages_), m_format(Unknown), m_modified(false),
m_cancelled(false), m_hasImages(false), m_buffer(0), m_zip(0), m_imgDir(0) {
@@ -157,7 +152,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) {
}
m_format = Error;
return;
- } else if(versionConversion(syntaxVersion, XML::syntaxVersion)) {
+ } else if(XML::versionConversion(syntaxVersion, XML::syntaxVersion)) {
// going form version 9 to 10, there's no conversion needed
TQString str = i18n("Tellico is converting the file to a more recent document format. "
"Information loss may occur if an older version of Tellico is used "
@@ -374,7 +369,7 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_)
Data::FieldPtr field;
if(type == Data::Field::Choice) {
- TQStringList allowed = TQStringList::split(TQString::fromLatin1(";"),
+ TQStringList allowed = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*;\\s*")),
elem_.attribute(TQString::fromLatin1("allowed")));
if(isI18n) {
for(TQStringList::Iterator it = allowed.begin(); it != allowed.end(); ++it) {
@@ -652,8 +647,9 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl
void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) {
TQString format = elem_.attribute(TQString::fromLatin1("format"));
const bool link = elem_.attribute(TQString::fromLatin1("link")) == Latin1Literal("true");
- TQString id = shareString(link ? elem_.attribute(TQString::fromLatin1("id"))
- : Data::Image::idClean(elem_.attribute(TQString::fromLatin1("id"))));
+ // idClean() already calls shareString()
+ TQString id = link ? shareString(elem_.attribute(TQString::fromLatin1("id")))
+ : Data::Image::idClean(elem_.attribute(TQString::fromLatin1("id")));
bool readInfo = true;
if(loadImage_) {