Rename KCmd to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 18896070bf
commit fb7e279ef2

@ -13,7 +13,7 @@ static const char *description =
static const char *version = "0.1"; static const char *version = "0.1";
static KCmdLineOptions options[] = static TDECmdLineOptions options[] =
{ {
// { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, // { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
{ 0, 0, 0 } { 0, 0, 0 }

@ -1815,7 +1815,7 @@ sub cplusplusToJava
return "double[]"; return "double[]";
} elsif ( kalyptusDataDict::ctypemap($cplusplusType) =~ /^\s*(unsigned )?short\s*\*/ ) { } elsif ( kalyptusDataDict::ctypemap($cplusplusType) =~ /^\s*(unsigned )?short\s*\*/ ) {
return "short[]"; return "short[]";
} elsif ( $cplusplusType =~ /KCmdLineOptions/ ) { } elsif ( $cplusplusType =~ /TDECmdLineOptions/ ) {
return "String[][]"; return "String[][]";
} elsif ( $cplusplusType =~ /char\s*\*\*/ || $cplusplusType =~ /TQStringList/|| $cplusplusType =~ /TQStrList/) { } elsif ( $cplusplusType =~ /char\s*\*\*/ || $cplusplusType =~ /TQStringList/|| $cplusplusType =~ /TQStrList/) {
return "String[]"; return "String[]";
@ -2066,8 +2066,8 @@ sub jniArgTocplusplus
} }
} }
} elsif ( $javaType =~ /String\[\]\[\]/ ) { } elsif ( $javaType =~ /String\[\]\[\]/ ) {
if ( $cplusplusType =~ /KCmdLineOptions/ ) { if ( $cplusplusType =~ /TDECmdLineOptions/ ) {
$jniArg = "(KCmdLineOptions*) KDESupport::toKCmdLineOptions(env, $argName)"; $jniArg = "(TDECmdLineOptions*) KDESupport::toTDECmdLineOptions(env, $argName)";
} }
} elsif ( $javaType =~ /String\[\]/ ) { } elsif ( $javaType =~ /String\[\]/ ) {
if ( $cplusplusType =~ /TQStringList/ ) { if ( $cplusplusType =~ /TQStringList/ ) {
@ -5466,8 +5466,8 @@ sub printJavadocComment($$$$)
$line =~ s/TQString::null/null/g; $line =~ s/TQString::null/null/g;
$line =~ s/(const )?QC?String(\s*&)?/String/g; $line =~ s/(const )?QC?String(\s*&)?/String/g;
$line =~ s/TQByteArray/byte[]/g; $line =~ s/TQByteArray/byte[]/g;
$line =~ s/(const )?KCmdLineOptions\s*(\w+)\[\]/String[][] $2/; $line =~ s/(const )?TDECmdLineOptions\s*(\w+)\[\]/String[][] $2/;
$line =~ s/KCmdLineLastOption//g; $line =~ s/TDECmdLineLastOption//g;
$line =~ s/virtual //g; $line =~ s/virtual //g;
$line =~ s/~\w+\(\)((\s*{\s*})|;)//g; $line =~ s/~\w+\(\)((\s*{\s*})|;)//g;
$line =~ s/0L/null/g; $line =~ s/0L/null/g;
@ -5572,7 +5572,7 @@ sub printJavadocComment($$$$)
$returntext =~ s/TQStringList/ArrayList/g; $returntext =~ s/TQStringList/ArrayList/g;
$returntext =~ s/([Aa]) ArrayList/$1n ArrayList/g; $returntext =~ s/([Aa]) ArrayList/$1n ArrayList/g;
$returntext =~ s/TQString/String/g; $returntext =~ s/TQString/String/g;
$returntext =~ s/KCmdLineOptions/String[][]/; $returntext =~ s/TDECmdLineOptions/String[][]/;
$returntext =~ s!\\note!<b>Note:<\b>!g; $returntext =~ s!\\note!<b>Note:<\b>!g;
$returntext =~ s!\\(code|verbatim)!<pre>!g; $returntext =~ s!\\(code|verbatim)!<pre>!g;
$returntext =~ s!\\(endcode|endverbatim)!</pre>!g; $returntext =~ s!\\(endcode|endverbatim)!</pre>!g;

@ -549,7 +549,7 @@ sub cplusplusToJava
return "double[]"; return "double[]";
} elsif ( kalyptusDataDict::ctypemap($cplusplusType) =~ /^\s*(unsigned )?short\s*\*/ ) { } elsif ( kalyptusDataDict::ctypemap($cplusplusType) =~ /^\s*(unsigned )?short\s*\*/ ) {
return "short[]"; return "short[]";
} elsif ( $cplusplusType =~ /KCmdLineOptions/ ) { } elsif ( $cplusplusType =~ /TDECmdLineOptions/ ) {
return "String[][]"; return "String[][]";
} elsif ( $cplusplusType =~ /char\s*\*\*/ || $cplusplusType =~ /TQStringList/|| $cplusplusType =~ /TQStrList/) { } elsif ( $cplusplusType =~ /char\s*\*\*/ || $cplusplusType =~ /TQStringList/|| $cplusplusType =~ /TQStrList/) {
return "String[]"; return "String[]";
@ -3305,8 +3305,8 @@ sub printJavadocComment($$$$)
$line =~ s/TQString::null/null/g; $line =~ s/TQString::null/null/g;
$line =~ s/(const )?QC?String(\s*&)?/String/g; $line =~ s/(const )?QC?String(\s*&)?/String/g;
$line =~ s/TQByteArray/byte[]/g; $line =~ s/TQByteArray/byte[]/g;
$line =~ s/(const )?KCmdLineOptions\s*(\w+)\[\]/String[][] $2/; $line =~ s/(const )?TDECmdLineOptions\s*(\w+)\[\]/String[][] $2/;
$line =~ s/KCmdLineLastOption//g; $line =~ s/TDECmdLineLastOption//g;
$line =~ s/virtual //g; $line =~ s/virtual //g;
$line =~ s/~\w+\(\)((\s*{\s*})|;)//g; $line =~ s/~\w+\(\)((\s*{\s*})|;)//g;
$line =~ s/0L/null/g; $line =~ s/0L/null/g;
@ -3411,7 +3411,7 @@ sub printJavadocComment($$$$)
$returntext =~ s/TQStringList/ArrayList/g; $returntext =~ s/TQStringList/ArrayList/g;
$returntext =~ s/([Aa]) ArrayList/$1n ArrayList/g; $returntext =~ s/([Aa]) ArrayList/$1n ArrayList/g;
$returntext =~ s/TQString/String/g; $returntext =~ s/TQString/String/g;
$returntext =~ s/KCmdLineOptions/String[][]/; $returntext =~ s/TDECmdLineOptions/String[][]/;
$returntext =~ s!\\note!<b>Note:<\b>!g; $returntext =~ s!\\note!<b>Note:<\b>!g;
$returntext =~ s!\\(code|verbatim)!<pre>!g; $returntext =~ s!\\(code|verbatim)!<pre>!g;
$returntext =~ s!\\(endcode|endverbatim)!</pre>!g; $returntext =~ s!\\(endcode|endverbatim)!</pre>!g;

@ -545,7 +545,7 @@ sub cplusplusToCSharp
return "out double"; return "out double";
} elsif ( kalyptusDataDict::ctypemap($cplusplusType) =~ /^\s*(unsigned )?short\s*\*/ ) { } elsif ( kalyptusDataDict::ctypemap($cplusplusType) =~ /^\s*(unsigned )?short\s*\*/ ) {
return "out short"; return "out short";
} elsif ( $cplusplusType =~ /KCmdLineOptions/ ) { } elsif ( $cplusplusType =~ /TDECmdLineOptions/ ) {
return "string[][]"; return "string[][]";
} elsif ( $cplusplusType =~ /char\s*\*\*/ || $cplusplusType =~ /TQStringList/|| $cplusplusType =~ /TQStrList/) { } elsif ( $cplusplusType =~ /char\s*\*\*/ || $cplusplusType =~ /TQStringList/|| $cplusplusType =~ /TQStrList/) {
return "string[]"; return "string[]";
@ -3498,8 +3498,8 @@ sub printCSharpdocComment($$$$)
$line =~ s/(const )?TQTime([^r])/DateTime$1/g; $line =~ s/(const )?TQTime([^r])/DateTime$1/g;
$line =~ s/TQString::null/null/g; $line =~ s/TQString::null/null/g;
$line =~ s/(const )?QC?String(\s*&)?/string/g; $line =~ s/(const )?QC?String(\s*&)?/string/g;
$line =~ s/(const )?KCmdLineOptions\s*(\w+)\[\]/string[][] $2/; $line =~ s/(const )?TDECmdLineOptions\s*(\w+)\[\]/string[][] $2/;
$line =~ s/KCmdLineLastOption//g; $line =~ s/TDECmdLineLastOption//g;
$line =~ s/virtual //g; $line =~ s/virtual //g;
$line =~ s/~\w+\(\)((\s*{\s*})|;)//g; $line =~ s/~\w+\(\)((\s*{\s*})|;)//g;
$line =~ s/0L/null/g; $line =~ s/0L/null/g;
@ -3601,7 +3601,7 @@ sub printCSharpdocComment($$$$)
$returntext =~ s/TQStringList/ArrayList/g; $returntext =~ s/TQStringList/ArrayList/g;
$returntext =~ s/([Aa]) ArrayList/$1n ArrayList/g; $returntext =~ s/([Aa]) ArrayList/$1n ArrayList/g;
$returntext =~ s/TQString/string/g; $returntext =~ s/TQString/string/g;
$returntext =~ s/KCmdLineOptions/string[][]/; $returntext =~ s/TDECmdLineOptions/string[][]/;
$returntext =~ s!\\note!<b>Note:<\b>!g; $returntext =~ s!\\note!<b>Note:<\b>!g;
$returntext =~ s!\\(code|verbatim)!<pre>!g; $returntext =~ s!\\(code|verbatim)!<pre>!g;
$returntext =~ s!\\(endcode|endverbatim)!</pre>!g; $returntext =~ s!\\(endcode|endverbatim)!</pre>!g;

@ -329,7 +329,7 @@ sub preParseClass
$className eq 'TQWidgetList' || $className eq 'TQWidgetList' ||
$className eq 'TQObjectList' || $className eq 'TQObjectList' ||
$className eq 'TQStrList' || $className eq 'TQStrList' ||
$className eq 'KCmdLineOptions' || $className eq 'TDECmdLineOptions' ||
# Those are template related # Those are template related
$className eq 'TQTSManip' || # cause compiler errors with several gcc versions $className eq 'TQTSManip' || # cause compiler errors with several gcc versions
$className eq 'TQGDict' || $className eq 'TQGDict' ||

@ -123,19 +123,19 @@ KDESupport::toKFileItemList(JNIEnv * env, jobjectArray itemList, KFileItemList *
return *kitemList; return *kitemList;
} }
KCmdLineOptions * TDECmdLineOptions *
KDESupport::toKCmdLineOptions(JNIEnv * env, jobjectArray optionsArray) KDESupport::toTDECmdLineOptions(JNIEnv * env, jobjectArray optionsArray)
{ {
jstring jstr; jstring jstr;
const char * str; const char * str;
int length; int length;
int index; int index;
jobjectArray optionEntry; jobjectArray optionEntry;
KCmdLineOptions * cmdLineOptions; TDECmdLineOptions * cmdLineOptions;
length = env->GetArrayLength(optionsArray); length = env->GetArrayLength(optionsArray);
// Allocate 'length + 1' entries, to include an all NULLs last entry // Allocate 'length + 1' entries, to include an all NULLs last entry
cmdLineOptions = (KCmdLineOptions *) calloc(length + 1, sizeof(struct KCmdLineOptions)); cmdLineOptions = (TDECmdLineOptions *) calloc(length + 1, sizeof(struct TDECmdLineOptions));
for (index = 0; index < length; index++) { for (index = 0; index < length; index++) {
optionEntry = (jobjectArray) env->GetObjectArrayElement(optionsArray, index); optionEntry = (jobjectArray) env->GetObjectArrayElement(optionsArray, index);

@ -50,8 +50,8 @@ public:
/** Convert from a Java ArrayList to a KFileItemList */ /** Convert from a Java ArrayList to a KFileItemList */
static KFileItemList * toKFileItemList(JNIEnv * env, jobjectArray itemList, KFileItemList ** kitemList); static KFileItemList * toKFileItemList(JNIEnv * env, jobjectArray itemList, KFileItemList ** kitemList);
/** Converts java options entries to the C++ KCmdLineOption equivalent */ /** Converts java options entries to the C++ TDECmdLineOption equivalent */
static KCmdLineOptions * toKCmdLineOptions(JNIEnv * env, jobjectArray optionsArray); static TDECmdLineOptions * toTDECmdLineOptions(JNIEnv * env, jobjectArray optionsArray);
/** Converts a java.io.ByteArrayOutputStream to a TQByteArray */ /** Converts a java.io.ByteArrayOutputStream to a TQByteArray */
static TQByteArray * toTQByteArrayFromStream(JNIEnv * env, TQByteArray * byteArray, jobject byteStream); static TQByteArray * toTQByteArrayFromStream(JNIEnv * env, TQByteArray * byteArray, jobject byteStream);

@ -13,14 +13,14 @@
class TDECmdLineArgsJBridge : public TDECmdLineArgs class TDECmdLineArgsJBridge : public TDECmdLineArgs
{ {
public: public:
TDECmdLineArgsJBridge(const KCmdLineOptions* arg1,const char* arg2,const char* arg3) : TDECmdLineArgs(arg1,arg2,arg3) {}; TDECmdLineArgsJBridge(const TDECmdLineOptions* arg1,const char* arg2,const char* arg3) : TDECmdLineArgs(arg1,arg2,arg3) {};
}; };
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_kde_koala_TDECmdLineArgs_addCmdLineOptions___3_3Ljava_lang_String_2(JNIEnv* env, jclass cls, jobjectArray options) Java_org_kde_koala_TDECmdLineArgs_addCmdLineOptions___3_3Ljava_lang_String_2(JNIEnv* env, jclass cls, jobjectArray options)
{ {
(void) cls; (void) cls;
TDECmdLineArgsJBridge::addCmdLineOptions((KCmdLineOptions*) KDESupport::toKCmdLineOptions(env, options)); TDECmdLineArgsJBridge::addCmdLineOptions((TDECmdLineOptions*) KDESupport::toTDECmdLineOptions(env, options));
return; return;
} }
@ -29,7 +29,7 @@ Java_org_kde_koala_TDECmdLineArgs_addCmdLineOptions___3_3Ljava_lang_String_2Ljav
{ {
(void) cls; (void) cls;
static TQCString* _qstring_name = 0; static TQCString* _qstring_name = 0;
TDECmdLineArgsJBridge::addCmdLineOptions((KCmdLineOptions*) KDESupport::toKCmdLineOptions(env, options), (const char*) QtSupport::toCharString(env, name, &_qstring_name)); TDECmdLineArgsJBridge::addCmdLineOptions((TDECmdLineOptions*) KDESupport::toTDECmdLineOptions(env, options), (const char*) QtSupport::toCharString(env, name, &_qstring_name));
return; return;
} }
@ -39,7 +39,7 @@ Java_org_kde_koala_TDECmdLineArgs_addCmdLineOptions___3_3Ljava_lang_String_2Ljav
(void) cls; (void) cls;
static TQCString* _qstring_name = 0; static TQCString* _qstring_name = 0;
static TQCString* _qstring_id = 0; static TQCString* _qstring_id = 0;
TDECmdLineArgsJBridge::addCmdLineOptions((KCmdLineOptions*) KDESupport::toKCmdLineOptions(env, options), (const char*) QtSupport::toCharString(env, name, &_qstring_name), (const char*) QtSupport::toCharString(env, id, &_qstring_id)); TDECmdLineArgsJBridge::addCmdLineOptions((TDECmdLineOptions*) KDESupport::toTDECmdLineOptions(env, options), (const char*) QtSupport::toCharString(env, name, &_qstring_name), (const char*) QtSupport::toCharString(env, id, &_qstring_id));
return; return;
} }
@ -50,7 +50,7 @@ Java_org_kde_koala_TDECmdLineArgs_addCmdLineOptions___3_3Ljava_lang_String_2Ljav
static TQCString* _qstring_name = 0; static TQCString* _qstring_name = 0;
static TQCString* _qstring_id = 0; static TQCString* _qstring_id = 0;
static TQCString* _qstring_afterId = 0; static TQCString* _qstring_afterId = 0;
TDECmdLineArgsJBridge::addCmdLineOptions((KCmdLineOptions*) KDESupport::toKCmdLineOptions(env, options), (const char*) QtSupport::toCharString(env, name, &_qstring_name), (const char*) QtSupport::toCharString(env, id, &_qstring_id), (const char*) QtSupport::toCharString(env, afterId, &_qstring_afterId)); TDECmdLineArgsJBridge::addCmdLineOptions((TDECmdLineOptions*) KDESupport::toTDECmdLineOptions(env, options), (const char*) QtSupport::toCharString(env, name, &_qstring_name), (const char*) QtSupport::toCharString(env, id, &_qstring_id), (const char*) QtSupport::toCharString(env, afterId, &_qstring_afterId));
return; return;
} }
@ -178,7 +178,7 @@ Java_org_kde_koala_TDECmdLineArgs_newTDECmdLineArgs(JNIEnv* env, jobject obj, jo
static TQCString* _qstring__name = 0; static TQCString* _qstring__name = 0;
static TQCString* _qstring__id = 0; static TQCString* _qstring__id = 0;
if (QtSupport::getQt(env, obj) == 0) { if (QtSupport::getQt(env, obj) == 0) {
QtSupport::setQt(env, obj, new TDECmdLineArgsJBridge((KCmdLineOptions*) KDESupport::toKCmdLineOptions(env, _options), (const char*) QtSupport::toCharString(env, _name, &_qstring__name), (const char*) QtSupport::toCharString(env, _id, &_qstring__id))); QtSupport::setQt(env, obj, new TDECmdLineArgsJBridge((TDECmdLineOptions*) KDESupport::toTDECmdLineOptions(env, _options), (const char*) QtSupport::toCharString(env, _name, &_qstring__name), (const char*) QtSupport::toCharString(env, _id, &_qstring__id)));
QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj)); QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
} }
return; return;

@ -186,7 +186,7 @@ public class TDECmdLineArgs implements QtSupport {
not specifically turned off in the command line. Equivalently, not specifically turned off in the command line. Equivalently,
it will be false if the option was specifically turned off in it will be false if the option was specifically turned off in
the command line, or if the option is turned off by default (in the command line, or if the option is turned off by default (in
the KCmdLineOptions list) and was not specifically turned on in the TDECmdLineOptions list) and was not specifically turned on in
the command line. the command line.
@short Read out a boolean option or check for the presence of string option. @short Read out a boolean option or check for the presence of string option.

@ -39,7 +39,7 @@
#include "jsconsolewidget.h" #include "jsconsolewidget.h"
#include "jssecuritypolicy.h" #include "jssecuritypolicy.h"
static KCmdLineOptions options[] = static TDECmdLineOptions options[] =
{ {
{ "c", 0, 0 }, { "c", 0, 0 },
{ "console", I18N_NOOP("Displays the KJSEmbed console"), 0 }, { "console", I18N_NOOP("Displays the KJSEmbed console"), 0 },

@ -187,7 +187,7 @@ void marshall_TQCStringList(Marshall *m) {
# define BREAKPOINT { fprintf(stderr, "hit ctrl-c\n"); int b = 0; while (b == 0) { ; } } # define BREAKPOINT { fprintf(stderr, "hit ctrl-c\n"); int b = 0; while (b == 0) { ; } }
#endif #endif
void marshall_KCmdLineOptions(Marshall *m) { void marshall_TDECmdLineOptions(Marshall *m) {
switch(m->action()) { switch(m->action()) {
case Marshall::FromVALUE: case Marshall::FromVALUE:
{ {
@ -201,8 +201,8 @@ void marshall_KCmdLineOptions(Marshall *m) {
} }
// Allocate 'length + 1' entries, to include an all NULLs last entry // Allocate 'length + 1' entries, to include an all NULLs last entry
KCmdLineOptions *cmdLineOptions = (KCmdLineOptions *) calloc( RARRAY_LEN(optionslist) + 1, TDECmdLineOptions *cmdLineOptions = (TDECmdLineOptions *) calloc( RARRAY_LEN(optionslist) + 1,
sizeof(struct KCmdLineOptions) ); sizeof(struct TDECmdLineOptions) );
VALUE options; VALUE options;
long i; long i;
@ -1388,7 +1388,7 @@ void marshall_TQMapTQCStringDCOPRef(Marshall *m) {
TypeHandler KDE_handlers[] = { TypeHandler KDE_handlers[] = {
{ "QCStringList", marshall_TQCStringList }, { "QCStringList", marshall_TQCStringList },
{ "KCmdLineOptions*", marshall_KCmdLineOptions }, { "TDECmdLineOptions*", marshall_TDECmdLineOptions },
{ "TDEActionPtrList", marshall_TDEActionList }, { "TDEActionPtrList", marshall_TDEActionList },
{ "TQPtrList<TDEAction>", marshall_TDEActionList }, { "TQPtrList<TDEAction>", marshall_TDEActionList },
{ "TQPtrList<TDEAction>&", marshall_TDEActionList }, { "TQPtrList<TDEAction>&", marshall_TDEActionList },

@ -39,13 +39,13 @@
#include <iostream> #include <iostream>
static const KCmdLineOptions options[] = static const TDECmdLineOptions options[] =
{ {
{ "d", 0, 0 }, { "d", 0, 0 },
{ "directory <dir>", I18N_NOOP("Directory to generate files in"), "." }, { "directory <dir>", I18N_NOOP("Directory to generate files in"), "." },
{ "+file.kcfg", I18N_NOOP("Input kcfg XML file"), 0 }, { "+file.kcfg", I18N_NOOP("Input kcfg XML file"), 0 },
{ "+file.kcfgc", I18N_NOOP("Code generation options file"), 0 }, { "+file.kcfgc", I18N_NOOP("Code generation options file"), 0 },
KCmdLineLastOption TDECmdLineLastOption
}; };

Loading…
Cancel
Save