summaryrefslogtreecommitdiffstats
path: root/kgeography/src/mapparser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
commita374efce3a207b39514be3c52264091400ce297e (patch)
tree77bdf654b55826d4f59b53a5621310206bcaead1 /kgeography/src/mapparser.cpp
parentf81a494f3957d5cf38c787973415597941934727 (diff)
downloadtdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz
tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kgeography/src/mapparser.cpp')
-rw-r--r--kgeography/src/mapparser.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/kgeography/src/mapparser.cpp b/kgeography/src/mapparser.cpp
index 8a4cf200..bf04f0dc 100644
--- a/kgeography/src/mapparser.cpp
+++ b/kgeography/src/mapparser.cpp
@@ -25,19 +25,19 @@ bool mapReader::parseMap(const TQString &path)
TQString aux;
p_map = new KGmap();
p_map -> setFile(path);
- aux = path.left(path.findRev('/') + 1); // aux = path but without the file name
+ aux = path.left(path.tqfindRev('/') + 1); // aux = path but without the file name
mapParser handler(p_map, aux);
TQFile xmlFile(path);
if (xmlFile.exists())
{
- TQXmlInputSource source(&xmlFile);
+ TQXmlInputSource source(TQT_TQIODEVICE(&xmlFile));
setContentHandler(&handler);
if (parse(source)) return true;
p_error = handler.errorString();
}
else
{
- p_error = i18n("%1 does not exist.").arg(path);
+ p_error = i18n("%1 does not exist.").tqarg(path);
}
return false;
}
@@ -74,19 +74,19 @@ bool mapParser::startElement(const TQString&, const TQString &name, const TQStri
if (prev.isEmpty())
{
b = name == "map";
- if (!b) p_error = i18n("The map description file should begin with the %1 tag").arg("map");
+ if (!b) p_error = i18n("The map description file should begin with the %1 tag").tqarg("map");
}
else if (prev == "map")
{
if (name != "mapFile" && name != "name" && name != "division")
{
b = false;
- p_error = i18n("%1 is not a valid tag inside tag %2. Valid tags are %3, %4 and %5").arg(name).arg(prev).arg("mapFile").arg("name").arg("division");
+ p_error = i18n("%1 is not a valid tag inside tag %2. Valid tags are %3, %4 and %5").tqarg(name).tqarg(prev).tqarg("mapFile").tqarg("name").tqarg("division");
}
else if ((name == "mapFile" && p_mapFileSet) || (name == "name" && p_mapNameSet))
{
b = false;
- p_error = i18n("%1 tag has already been set").arg(name);
+ p_error = i18n("%1 tag has already been set").tqarg(name);
}
p_colorSet = false;
if (name == "division")
@@ -102,21 +102,21 @@ bool mapParser::startElement(const TQString&, const TQString &name, const TQStri
prev == "ignore")
{
b = false;
- p_error = i18n("There can not be a tag inside %1 tag").arg(prev);
+ p_error = i18n("There can not be a tag inside %1 tag").tqarg(prev);
}
else if (prev == "division")
{
if (name != "color" && name != "name" && name != "ignore" && name != "flag" && name != "capital")
{
b = false;
- p_error = i18n("%1 is not a valid tag inside tag %2. Valid tags are %3, %4, %5, %6 and %7").arg(name).arg(prev).arg("color").arg("name").arg("ignore").arg("capital").arg("flag");
+ p_error = i18n("%1 is not a valid tag inside tag %2. Valid tags are %3, %4, %5, %6 and %7").tqarg(name).tqarg(prev).tqarg("color").tqarg("name").tqarg("ignore").tqarg("capital").tqarg("flag");
}
else if ((name == "name" && p_divisionNameSet) || (name == "color" && p_colorSet) ||
(name == "ignore" && p_divisionIgnoreSet) || (name == "flag" && p_flagFileSet) ||
(name == "capital" && p_capitalSet))
{
b = false;
- p_error = i18n("%1 tag has already been set").arg(name);
+ p_error = i18n("%1 tag has already been set").tqarg(name);
}
p_red = -1;
p_green = -1;
@@ -146,7 +146,7 @@ bool mapParser::endElement(const TQString &, const TQString &, const TQString &)
{
b = p_map -> setMapFile(p_path + p_contents);
p_mapFileSet = true;
- if (!b) p_error = i18n("File %1 does not exist").arg(p_path + p_contents);
+ if (!b) p_error = i18n("File %1 does not exist").tqarg(p_path + p_contents);
}
else if (aux == "division")
{
@@ -154,9 +154,9 @@ bool mapParser::endElement(const TQString &, const TQString &, const TQString &)
b = p_divisionNameSet;
if (!b) p_error = i18n("There is a division without name");
b = b && p_map -> addDivision(p_division);
- if (!b) p_error = i18n("There is already either a division called %1 or a division with the same colors as %2").arg(p_division -> getName()).arg(p_division -> getName());
+ if (!b) p_error = i18n("There is already either a division called %1 or a division with the same colors as %2").tqarg(p_division -> getName()).tqarg(p_division -> getName());
b = b && (p_capitalSet || !p_division -> canAsk(false));
- if (!b) p_error = i18n("Division %1 has no capital").arg(p_division -> getName());
+ if (!b) p_error = i18n("Division %1 has no capital").tqarg(p_division -> getName());
}
else if (p_previousTags == ":map:division:name")
{
@@ -173,17 +173,17 @@ bool mapParser::endElement(const TQString &, const TQString &, const TQString &)
if (p_red == -1)
{
b = false;
- p_error = i18n("Tag %1 has not the %2 tag.").arg("<color>").arg("<red>");
+ p_error = i18n("Tag %1 has not the %2 tag.").tqarg("<color>").tqarg("<red>");
}
else if (p_green == -1)
{
b = false;
- p_error = i18n("Tag %1 has not the %2 tag.").arg("<color>").arg("<green>");
+ p_error = i18n("Tag %1 has not the %2 tag.").tqarg("<color>").tqarg("<green>");
}
else if (p_blue == -1)
{
b = false;
- p_error = i18n("Tag %1 has not the %2 tag.").arg("<color>").arg("<blue>");
+ p_error = i18n("Tag %1 has not the %2 tag.").tqarg("<color>").tqarg("<blue>");
}
else p_colorSet = true;
}
@@ -217,21 +217,21 @@ bool mapParser::endElement(const TQString &, const TQString &, const TQString &)
else
{
b = false;
- p_error = i18n("Invalid value in tag %1").arg("<ignore>");
+ p_error = i18n("Invalid value in tag %1").tqarg("<ignore>");
}
}
else if (aux == "flag")
{
b = p_division -> setFlagFile(p_path + "flags/" + p_contents);
p_flagFileSet = true;
- if (!b) p_error = i18n("Could not find flag file %1").arg(p_path + "flags/" + p_contents);
+ if (!b) p_error = i18n("Could not find flag file %1").tqarg(p_path + "flags/" + p_contents);
}
else if (aux == "map")
{
}
else b = false;
removeLastTag();
- p_contents = TQString::null;
+ p_contents = TQString();
return b;
}
@@ -258,7 +258,7 @@ bool mapParser::endDocument()
}
else if (!p_mapNameSet) aux = "name";
else if (!p_mapFileSet) aux = "mapFile";
- p_error = i18n("Tag %1 is missing.").arg(aux);
+ p_error = i18n("Tag %1 is missing.").tqarg(aux);
return false;
}
@@ -270,10 +270,10 @@ TQString mapParser::errorString()
TQString mapParser::getPreviousTag() const
{
- return p_previousTags.right(p_previousTags.length() - p_previousTags.findRev(':') - 1);
+ return p_previousTags.right(p_previousTags.length() - p_previousTags.tqfindRev(':') - 1);
}
void mapParser::removeLastTag()
{
- p_previousTags = p_previousTags.left(p_previousTags.findRev(':'));
+ p_previousTags = p_previousTags.left(p_previousTags.tqfindRev(':'));
}