summaryrefslogtreecommitdiffstats
path: root/kvoctrain/kvoctrain/spotlight2kvtml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kvoctrain/kvoctrain/spotlight2kvtml.cpp')
-rw-r--r--kvoctrain/kvoctrain/spotlight2kvtml.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/kvoctrain/kvoctrain/spotlight2kvtml.cpp b/kvoctrain/kvoctrain/spotlight2kvtml.cpp
index c6f9c565..62533df7 100644
--- a/kvoctrain/kvoctrain/spotlight2kvtml.cpp
+++ b/kvoctrain/kvoctrain/spotlight2kvtml.cpp
@@ -36,7 +36,7 @@ using namespace std;
#include <kapplication.h>
#define KVD_VERS_PREFIX " v" //#include "kvoctraindoc.h"
-#define QM_VERB "v" //#include "QueryManager.h"
+#define TQM_VERB "v" //#include "QueryManager.h"
#include "kvoctraincore.h"
@@ -92,11 +92,11 @@ void readToMem (TQTextStream &is, TQString month, TQString year)
spotty spot;
bool first_line = true;
- while (!is.eof() && is.device()->status() == IO_Ok) {
+ while (!is.eof() && is.tqdevice()->status() == IO_Ok) {
line = is.readLine();
int pos;
- while ((pos = line.find(" ")) >= 0)
+ while ((pos = line.tqfind(" ")) >= 0)
line.remove (pos, 1);
bool head_line = (!line.stripWhiteSpace().isEmpty() && line == line.upper() );
@@ -107,32 +107,32 @@ void readToMem (TQTextStream &is, TQString month, TQString year)
}
first_line = false;
- if ( line.find ("see p.") >= 0
- || line.find ("see pp.") >= 0
- || line.find ("see also p") >= 0) {
+ if ( line.tqfind ("see p.") >= 0
+ || line.tqfind ("see pp.") >= 0
+ || line.tqfind ("see also p") >= 0) {
line = "";
}
int c = 0x92;
- while ((pos = line.find (c)) >= 0)
+ while ((pos = line.tqfind (c)) >= 0)
line[pos] = '\'';
c = 0x94;
- while ((pos = line.find (c)) >= 0)
+ while ((pos = line.tqfind (c)) >= 0)
line[pos] = ' ';
pos = 0;
- while ((pos = line.find ('&', pos)) >= 0) {
+ while ((pos = line.tqfind ('&', pos)) >= 0) {
line.insert (pos+1, "amp;");
pos += 5; // skip &amp;
}
- while ((pos = line.find ('<')) >= 0) {
+ while ((pos = line.tqfind ('<')) >= 0) {
line.remove(pos, 1);
line.insert (pos, "&lt;");
}
- while ((pos = line.find ('>')) >= 0) {
+ while ((pos = line.tqfind ('>')) >= 0) {
line.remove(pos, 1);
line.insert (pos, "&gt;");
}
@@ -144,9 +144,9 @@ void readToMem (TQTextStream &is, TQString month, TQString year)
lesson_str = line + ", "+month+" "+year;
}
else {
- pos = line.find ('\t');
+ pos = line.tqfind ('\t');
if (pos < 0)
- pos = line.find ('|');
+ pos = line.tqfind ('|');
if (pos >= 0) {
if (lesson_pending) {
lesson_pending = false;
@@ -159,54 +159,54 @@ void readToMem (TQTextStream &is, TQString month, TQString year)
spot.de_rem = "";
if (line.left (3) == "to ") {
- spot.type = QM_VERB;
+ spot.type = TQM_VERB;
line.remove (0, 3);
pos -= 3;
}
spot.en = line.mid(0, pos);
spot.de = line.mid(pos+1, line.length()-pos-1);
- if ((pos = spot.en.find(" UK") ) >= 0) {
+ if ((pos = spot.en.tqfind(" UK") ) >= 0) {
spot.en_rem+= i18n("UK ").local8Bit();
spot.en.remove (pos, 3);
}
- if ((pos = spot.en.find("(UK)") ) >= 0) {
+ if ((pos = spot.en.tqfind("(UK)") ) >= 0) {
spot.en_rem+= i18n("UK ").local8Bit();
spot.en.remove (pos, 4);
}
- if ((pos = spot.en.find(" N. Am.") ) >= 0) {
+ if ((pos = spot.en.tqfind(" N. Am.") ) >= 0) {
spot.en_rem+= i18n("N. Am. ").local8Bit();
spot.en.remove (pos, 7);
}
- if ((pos = spot.en.find("(N. Am.)") ) >= 0) {
+ if ((pos = spot.en.tqfind("(N. Am.)") ) >= 0) {
spot.en_rem+= i18n("N. Am. ").local8Bit();
spot.en.remove (pos, 8);
}
- if ((pos = spot.en.find(" US") ) >= 0) {
+ if ((pos = spot.en.tqfind(" US") ) >= 0) {
spot.en_rem+= i18n("US ").local8Bit();
spot.en.remove (pos, 3);
}
- if ((pos = spot.en.find("(US)") ) >= 0) {
+ if ((pos = spot.en.tqfind("(US)") ) >= 0) {
spot.en_rem+= i18n("US ").local8Bit();
spot.en.remove (pos, 4);
}
- if ((pos = spot.en.find("ifml.") ) >= 0) {
+ if ((pos = spot.en.tqfind("ifml.") ) >= 0) {
spot.en_rem+= i18n("ifml. ").local8Bit();
spot.en.remove (pos, 5);
}
- if ((pos = spot.en.find("(ifml.)") ) >= 0) {
+ if ((pos = spot.en.tqfind("(ifml.)") ) >= 0) {
spot.en_rem+= i18n("ifml. ").local8Bit();
spot.en.remove (pos, 7);
}
- if ((pos = spot.en.find("vulg.") ) >= 0) {
+ if ((pos = spot.en.tqfind("vulg.") ) >= 0) {
spot.en_rem+= i18n("vulg. ").local8Bit();
spot.en.remove (pos, 5);
}
- if ((pos = spot.en.find("(vulg.)") ) >= 0) {
+ if ((pos = spot.en.tqfind("(vulg.)") ) >= 0) {
spot.en_rem+= i18n("vulg. ").local8Bit();
spot.en.remove (pos, 7);
}
@@ -289,7 +289,7 @@ void writeToKvtml(TQTextStream &os, TQString month, TQString year)
writeSpotty (os, spottys[0], true);
int l = 1;
- while (os.device()->status() == IO_Ok && l < (int) spottys.size() ) {
+ while (os.tqdevice()->status() == IO_Ok && l < (int) spottys.size() ) {
writeSpotty (os, spottys[l], false);
l++;
}
@@ -304,14 +304,14 @@ int main(int argc, char **argv)
KApplication app(argc,argv, "kvoctrain");
if (argc != 4) {
- cerr << i18n("usage: spotlight2kvtml spotfile month year\n\n").local8Bit();
+ cerr << i18n("usage: spotlight2kvtml spotfile month year\n\n").local8Bit().data();
exit (1);
}
TQString spot (argv[1]);
TQString kvtml;
- int dot = spot.findRev('.');
+ int dot = spot.tqfindRev('.');
if (dot < 0) {
kvtml = spot + "." KVTML_EXT;
}
@@ -327,8 +327,8 @@ int main(int argc, char **argv)
readToMem (is, argv[2], argv[3]);
fs.close();
- if (is.device()->status() != IO_Ok ) {
- cerr << i18n("Could not read ").local8Bit() << spot.local8Bit() << endl;
+ if (is.tqdevice()->status() != IO_Ok ) {
+ cerr << i18n("Could not read ").local8Bit().data() << spot.local8Bit().data() << endl;
exit (1);
}
@@ -338,8 +338,8 @@ int main(int argc, char **argv)
writeToKvtml(os, argv[2], argv[3]);
fk.close();
- if (os.device()->status() != IO_Ok ) {
- cerr << i18n("Could not write ").local8Bit() << kvtml.local8Bit() << endl;
+ if (os.tqdevice()->status() != IO_Ok ) {
+ cerr << i18n("Could not write ").local8Bit().data() << kvtml.local8Bit().data() << endl;
exit (1);
}