summaryrefslogtreecommitdiffstats
path: root/kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp')
-rw-r--r--kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp b/kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp
index 52066acf..70a68570 100644
--- a/kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp
+++ b/kxsldbg/kxsldbgpart/libxsldbg/xsldbg.cpp
@@ -42,7 +42,7 @@
#include <libxml/xmlerror.h>
#include "xsldbgmsg.h"
-#include "xsldbgthread.h" /* for getThreadStatus */
+#include "xsldbgthread.h" /* for getThreadtqStatus */
#ifdef HAVE_READLINE
# include <readline/readline.h>
# ifdef HAVE_HISTORY
@@ -267,7 +267,7 @@ endTimer(const TQString& message)
#error "endTimer required stdarg functions"
#endif
/* Display the time taken to complete this task */
- xsldbgGenericErrorFunc(i18n("%1 took %2 ms to complete.\n").arg(message).arg(msec));
+ xsldbgGenericErrorFunc(i18n("%1 took %2 ms to complete.\n").tqarg(message).tqarg(msec));
}
#elif defined(HAVE_TIME_H)
@@ -295,7 +295,7 @@ endTimer(const TQString& message)
#error "endTimer required stdarg functions"
#endif
/* Display the time taken to complete this task */
- xsldbgGenericErrorFunc(i18n("%1 took %2 ms to complete.\n").arg(message).arg(msec));
+ xsldbgGenericErrorFunc(i18n("%1 took %2 ms to complete.\n").tqarg(message).tqarg(msec));
}
#else
@@ -317,7 +317,7 @@ endTimer(const TQString& message)
*/
#ifdef HAVE_STDARG_H
/* Display the time taken to complete this task */
- xsldbgGenericErrorFunc(i18n("%1 took %2 ms to complete.\n"),arg(message).arg(msec));
+ xsldbgGenericErrorFunc(i18n("%1 took %2 ms to complete.\n"),arg(message).tqarg(msec));
#else
/* We don't have gettimeofday, time or stdarg.h, what crazy world is
* this ?!
@@ -358,7 +358,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
xmlXIncludeProcess(doc);
if (optionsGetIntOption(OPTIONS_TIMING)) {
/* Display the time taken to do XInclude processing */
- endTimer(i18n("XInclude processing %1.").arg((const char*)optionsGetStringOption(OPTIONS_DATA_FILE_NAME)));
+ endTimer(i18n("XInclude processing %1.").tqarg((const char*)optionsGetStringOption(OPTIONS_DATA_FILE_NAME)));
}
}
#endif
@@ -380,7 +380,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
if (terminalIO != NULL)
res = xsltProfileStylesheet(cur, doc, params, terminalIO);
else if ((optionsGetStringOption(OPTIONS_OUTPUT_FILE_NAME) ==
- NULL) || (getThreadStatus() != XSLDBG_MSG_THREAD_RUN)
+ NULL) || (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN)
|| (filesTempFileName(1) == NULL))
res = xsltProfileStylesheet(cur, doc, params, stderr);
else {
@@ -396,7 +396,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
notifyXsldbgApp(XSLDBG_MSG_FILEOUT,
filesTempFileName(1));
} else {
- xsldbgGenericErrorFunc(i18n("Error: Unable to write temporary results to %1.\n").arg(filesTempFileName(1)));
+ xsldbgGenericErrorFunc(i18n("Error: Unable to write temporary results to %1.\n").tqarg(filesTempFileName(1)));
res = xsltProfileStylesheet(cur, doc, params, stderr);
}
}
@@ -429,7 +429,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
if (terminalIO != NULL)
xmlDebugDumpDocument(terminalIO, res);
else if ((optionsGetStringOption(OPTIONS_OUTPUT_FILE_NAME) ==
- NULL) || (getThreadStatus() != XSLDBG_MSG_THREAD_RUN)
+ NULL) || (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN)
|| (filesTempFileName(1) == NULL))
xmlDebugDumpDocument(stdout, res);
else {
@@ -443,7 +443,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
notifyXsldbgApp(XSLDBG_MSG_FILEOUT,
filesTempFileName(1));
} else {
- xsldbgGenericErrorFunc(i18n("Error: Unable to write temporary results to %1.\n").arg(filesTempFileName(1)));
+ xsldbgGenericErrorFunc(i18n("Error: Unable to write temporary results to %1.\n").tqarg(filesTempFileName(1)));
xmlDebugDumpDocument(stdout, res);
}
@@ -455,7 +455,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
if (cur->methodURI == NULL) {
if (optionsGetIntOption(OPTIONS_TIMING))
startTimer();
- if (xslDebugStatus != DEBUG_QUIT) {
+ if (xslDebugStatus != DEBUG_TQUIT) {
if (terminalIO != NULL)
bytesWritten = xsltSaveResultToFile(terminalIO, res, cur);
else if (optionsGetStringOption
@@ -490,7 +490,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
/* Indicate how long it took to save to file */
endTimer(i18n("Saving result"));
} else {
- xsldbgGenericErrorFunc(i18n("Warning: Unsupported, non-standard output method %1.\n").arg(xsldbgText(cur->method)));
+ xsldbgGenericErrorFunc(i18n("Warning: Unsupported, non-standard output method %1.\n").tqarg(xsldbgText(cur->method)));
}
}
}
@@ -513,7 +513,7 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur)
}
}
if ((xslDebugStatus != DEBUG_RUN_RESTART) && (bytesWritten == -1))
- xsldbgGenericErrorFunc(i18n("Error: Unable to save results of transformation to file %1.\n").arg(xsldbgText(optionsGetStringOption(OPTIONS_OUTPUT_FILE_NAME))));
+ xsldbgGenericErrorFunc(i18n("Error: Unable to save results of transformation to file %1.\n").tqarg(xsldbgText(optionsGetStringOption(OPTIONS_OUTPUT_FILE_NAME))));
}
int
@@ -532,7 +532,7 @@ xsldbgMain(int argc, char **argv)
xmlDocPtr doc;
KCmdLineArgs *args = 0;
- if (getThreadStatus() == XSLDBG_MSG_THREAD_NOTUSED)
+ if (getThreadtqStatus() == XSLDBG_MSG_THREAD_NOTUSED)
args = KCmdLineArgs::parsedArgs();
errorFile = stderr;
@@ -619,7 +619,7 @@ xsldbgMain(int argc, char **argv)
}
}
- if (getThreadStatus() != XSLDBG_MSG_THREAD_NOTUSED){
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_NOTUSED){
result = optionsSetIntOption(OPTIONS_SHELL, 1);
}
/* copy the volitile options over to xsldbg */
@@ -672,7 +672,7 @@ xsldbgMain(int argc, char **argv)
for ( it = xslParams.begin(); it != xslParams.end(); ++it){
param = (*it);
paramOK = true;
- separatorIdx = param.find(':');
+ separatorIdx = param.tqfind(':');
if (separatorIdx > 0){
paramName = param.left((uint)separatorIdx);
paramValue = param.mid((uint)separatorIdx + 1);
@@ -689,7 +689,7 @@ xsldbgMain(int argc, char **argv)
paramOK = false;
}
if (!paramOK)
- xsldbgGenericErrorFunc(i18n("Error: Argument \"%1\" to --param is not in the format <name>:<value>.\n").arg(param.data()));
+ xsldbgGenericErrorFunc(i18n("Error: Argument \"%1\" to --param is not in the format <name>:<value>.\n").tqarg(param.data()));
}
TQCString cdPath = args->getOption("cd");
@@ -719,7 +719,7 @@ xsldbgMain(int argc, char **argv)
debugGotControl(0);
- while (xslDebugStatus != DEBUG_QUIT) {
+ while (xslDebugStatus != DEBUG_TQUIT) {
xsldbgReachedFirstTemplate = false;
/* don't force xsldbg to show command prompt */
showPrompt = 0;
@@ -765,7 +765,7 @@ xsldbgMain(int argc, char **argv)
/*goto a xsldbg command prompt */
showPrompt = 1;
if (xslDebugStatus == DEBUG_NONE) {
- xslDebugStatus = DEBUG_QUIT; /* panic !! */
+ xslDebugStatus = DEBUG_TQUIT; /* panic !! */
result = 0;
}
}
@@ -776,21 +776,21 @@ xsldbgMain(int argc, char **argv)
doc = filesGetMainDoc();
if (doc == NULL) {
if (xslDebugStatus == DEBUG_NONE) {
- xslDebugStatus = DEBUG_QUIT; /* panic !! */
+ xslDebugStatus = DEBUG_TQUIT; /* panic !! */
result = 0;
} else {
/*goto a xsldbg command prompt */
showPrompt = 1;
}
} else {
- if (xslDebugStatus != DEBUG_QUIT) {
+ if (xslDebugStatus != DEBUG_TQUIT) {
xsltProcess(doc, cur);
result = 1;
}
}
if (optionsGetIntOption(OPTIONS_SHELL) && (showPrompt == 0)) {
- if ((xslDebugStatus != DEBUG_QUIT)
+ if ((xslDebugStatus != DEBUG_TQUIT)
&& !debugGotControl(-1)) {
xsldbgGenericErrorFunc(i18n("\nDebugger never received control.\n"));
/*goto a xsldbg command prompt */
@@ -831,12 +831,12 @@ xsldbgMain(int argc, char **argv)
}
} else {
/* request to execute stylesheet only so we're done */
- xslDebugStatus = DEBUG_QUIT;
+ xslDebugStatus = DEBUG_TQUIT;
}
} else {
/* Some sort of problem loading source file has occured. Quit? */
if (xslDebugStatus == DEBUG_NONE) {
- xslDebugStatus = DEBUG_QUIT; /* Panic!! */
+ xslDebugStatus = DEBUG_TQUIT; /* Panic!! */
result = 0;
} else {
/*goto a xsldbg command prompt */
@@ -872,7 +872,7 @@ xsldbgMain(int argc, char **argv)
}
xmlFreeDoc(tempDoc);
} else if (showPrompt && !optionsGetIntOption(OPTIONS_SHELL)) {
- xslDebugStatus = DEBUG_QUIT;
+ xslDebugStatus = DEBUG_TQUIT;
result = 0; /* panic */
}
@@ -911,13 +911,13 @@ xsldbgLoadStylesheet()
startTimer();
style = xmlParseFile((const char *) optionsGetStringOption(OPTIONS_SOURCE_FILE_NAME));
if (optionsGetIntOption(OPTIONS_TIMING))
- endTimer(i18n("Parsing stylesheet %1").arg((const char*)optionsGetStringOption(OPTIONS_SOURCE_FILE_NAME)));
+ endTimer(i18n("Parsing stylesheet %1").tqarg((const char*)optionsGetStringOption(OPTIONS_SOURCE_FILE_NAME)));
if (style == NULL) {
- xsldbgGenericErrorFunc(i18n("Error: Cannot parse file %1.\n").arg(xsldbgUrl(optionsGetStringOption(OPTIONS_SOURCE_FILE_NAME))));
+ xsldbgGenericErrorFunc(i18n("Error: Cannot parse file %1.\n").tqarg(xsldbgUrl(optionsGetStringOption(OPTIONS_SOURCE_FILE_NAME))));
cur = NULL;
if (!optionsGetIntOption(OPTIONS_SHELL)) {
xsldbgGenericErrorFunc(i18n("Fatal error: Aborting debugger due to an unrecoverable error.\n"));
- xslDebugStatus = DEBUG_QUIT;
+ xslDebugStatus = DEBUG_TQUIT;
} else {
xsltGenericError(xsltGenericErrorContext, "\n");
xslDebugStatus = DEBUG_STOP;
@@ -988,16 +988,16 @@ xsldbgLoadXmlData(void)
doc = xmlParseFile((char *) optionsGetStringOption(OPTIONS_DATA_FILE_NAME));
#endif
if (doc == NULL) {
- xsldbgGenericErrorFunc(i18n("Error: Unable to parse file %1.\n").arg(xsldbgUrl(optionsGetStringOption(OPTIONS_DATA_FILE_NAME))));
+ xsldbgGenericErrorFunc(i18n("Error: Unable to parse file %1.\n").tqarg(xsldbgUrl(optionsGetStringOption(OPTIONS_DATA_FILE_NAME))));
if (!optionsGetIntOption(OPTIONS_SHELL)) {
xsldbgGenericErrorFunc(i18n("Fatal error: Aborting debugger due to an unrecoverable error.\n"));
- xslDebugStatus = DEBUG_QUIT;
+ xslDebugStatus = DEBUG_TQUIT;
} else {
xsltGenericError(xsltGenericErrorContext, "\n");
xslDebugStatus = DEBUG_STOP;
}
} else if (optionsGetIntOption(OPTIONS_TIMING))
- endTimer(TQString("Parsing document %1").arg(xsldbgUrl(optionsGetStringOption(OPTIONS_DATA_FILE_NAME))).utf8().data());
+ endTimer(TQString("Parsing document %1").tqarg(xsldbgUrl(optionsGetStringOption(OPTIONS_DATA_FILE_NAME))).utf8().data());
return doc;
}
@@ -1032,12 +1032,12 @@ xsldbgLoadXmlTemporary(const xmlChar * path)
#endif
doc = xmlSAXParseFile(&mySAXhdlr, (char *) path, 0);
if (doc == NULL) {
- xsldbgGenericErrorFunc(i18n("Error: Unable to parse file %1.\n").arg(xsldbgUrl(path)));
+ xsldbgGenericErrorFunc(i18n("Error: Unable to parse file %1.\n").tqarg(xsldbgUrl(path)));
}
if (optionsGetIntOption(OPTIONS_TIMING)
- && (xslDebugStatus != DEBUG_QUIT)) {
- endTimer(TQString("Parsing document %1").arg(xsldbgUrl(path)));
+ && (xslDebugStatus != DEBUG_TQUIT)) {
+ endTimer(TQString("Parsing document %1").tqarg(xsldbgUrl(path)));
}
return doc;
}
@@ -1097,7 +1097,7 @@ handler_routine(DWORD dwCtrlType)
void xsldbgStructErrorHandler(void * userData, xmlErrorPtr error)
{
if (error && error->message && (error->level >= 0) && (error->level <= 4)){
- if (getThreadStatus() != XSLDBG_MSG_THREAD_RUN){
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN){
static const char *msgPrefix[4 + 1] = {"", "warning :", "error:", "fatal:"};
if (error->file)
xsltGenericError(xsltGenericErrorContext, "%s%s in file \"%s\" line %d", msgPrefix[error->level], error->message, error->file, error->line);
@@ -1240,7 +1240,7 @@ xsldbgInit()
xmlDefaultSAXHandlerInit();
xmlDefaultSAXHandler.cdataBlock = NULL;
- if (getThreadStatus() != XSLDBG_MSG_THREAD_NOTUSED) {
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_NOTUSED) {
initialized = 1;
return 1; /* this is all we need to do when running as a thread */
}
@@ -1310,7 +1310,7 @@ xsldbgGenericErrorFunc(void *ctx, const char *msg, ...)
Q_UNUSED(ctx);
va_start(args, msg);
- if (getThreadStatus() == XSLDBG_MSG_THREAD_RUN) {
+ if (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN) {
vsnprintf(msgBuffer, sizeof(msgBuffer), msg, args);
notifyTextXsldbgApp(XSLDBG_MSG_TEXTOUT, msgBuffer);