|
|
@ -29,7 +29,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
using namespace KexiDB;
|
|
|
|
using namespace KexiDB;
|
|
|
|
|
|
|
|
|
|
|
|
static KCmdLineOptions predefinedOptions[] =
|
|
|
|
static TDECmdLineOptions predefinedOptions[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{ "drv", 0, 0 },
|
|
|
|
{ "drv", 0, 0 },
|
|
|
|
{ "driver <name>", I18N_NOOP("Database driver name"), 0 },
|
|
|
|
{ "driver <name>", I18N_NOOP("Database driver name"), 0 },
|
|
|
@ -42,7 +42,7 @@ static KCmdLineOptions predefinedOptions[] =
|
|
|
|
{ "port <number>", I18N_NOOP("Server's port number"), 0 },
|
|
|
|
{ "port <number>", I18N_NOOP("Server's port number"), 0 },
|
|
|
|
{ "s", 0, 0 },
|
|
|
|
{ "s", 0, 0 },
|
|
|
|
{ "local-socket <filename>", I18N_NOOP("Server's local socket filename"), 0 },
|
|
|
|
{ "local-socket <filename>", I18N_NOOP("Server's local socket filename"), 0 },
|
|
|
|
KCmdLineLastOption
|
|
|
|
TDECmdLineLastOption
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------
|
|
|
|
//-----------------------------------------
|
|
|
@ -62,7 +62,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete instance;
|
|
|
|
delete instance;
|
|
|
|
|
|
|
|
|
|
|
|
for (KCmdLineOptions *optionsPtr = allOptions; optionsPtr->name; optionsPtr++) {
|
|
|
|
for (TDECmdLineOptions *optionsPtr = allOptions; optionsPtr->name; optionsPtr++) {
|
|
|
|
delete optionsPtr->name;
|
|
|
|
delete optionsPtr->name;
|
|
|
|
delete optionsPtr->description;
|
|
|
|
delete optionsPtr->description;
|
|
|
|
delete optionsPtr->def;
|
|
|
|
delete optionsPtr->def;
|
|
|
@ -71,7 +71,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KexiDB::DriverManager manager;
|
|
|
|
KexiDB::DriverManager manager;
|
|
|
|
KCmdLineOptions *allOptions;
|
|
|
|
TDECmdLineOptions *allOptions;
|
|
|
|
TDEInstance* instance;
|
|
|
|
TDEInstance* instance;
|
|
|
|
ConnectionData connData;
|
|
|
|
ConnectionData connData;
|
|
|
|
TQGuardedPtr<Connection> conn;
|
|
|
|
TQGuardedPtr<Connection> conn;
|
|
|
@ -80,7 +80,7 @@ public:
|
|
|
|
//-----------------------------------------
|
|
|
|
//-----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
SimpleCommandLineApp::SimpleCommandLineApp(
|
|
|
|
SimpleCommandLineApp::SimpleCommandLineApp(
|
|
|
|
int argc, char** argv, KCmdLineOptions *options,
|
|
|
|
int argc, char** argv, TDECmdLineOptions *options,
|
|
|
|
const char *programName, const char *version,
|
|
|
|
const char *programName, const char *version,
|
|
|
|
const char *shortDescription, int licenseType,
|
|
|
|
const char *shortDescription, int licenseType,
|
|
|
|
const char *copyrightStatement, const char *text,
|
|
|
|
const char *copyrightStatement, const char *text,
|
|
|
@ -96,18 +96,18 @@ SimpleCommandLineApp::SimpleCommandLineApp(
|
|
|
|
homePageAddress, bugsEmailAddress));
|
|
|
|
homePageAddress, bugsEmailAddress));
|
|
|
|
|
|
|
|
|
|
|
|
int predefinedOptionsCount = 0;
|
|
|
|
int predefinedOptionsCount = 0;
|
|
|
|
for (KCmdLineOptions *optionsPtr = predefinedOptions; optionsPtr->name; optionsPtr++, predefinedOptionsCount++)
|
|
|
|
for (TDECmdLineOptions *optionsPtr = predefinedOptions; optionsPtr->name; optionsPtr++, predefinedOptionsCount++)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
int userOptionsCount = 0;
|
|
|
|
int userOptionsCount = 0;
|
|
|
|
for (KCmdLineOptions *optionsPtr = options; optionsPtr->name; optionsPtr++, userOptionsCount++)
|
|
|
|
for (TDECmdLineOptions *optionsPtr = options; optionsPtr->name; optionsPtr++, userOptionsCount++)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
d->instance = new TDEInstance(appName);
|
|
|
|
d->instance = new TDEInstance(appName);
|
|
|
|
|
|
|
|
|
|
|
|
// join the predefined options and user options
|
|
|
|
// join the predefined options and user options
|
|
|
|
d->allOptions = new KCmdLineOptions[predefinedOptionsCount + userOptionsCount + 1];
|
|
|
|
d->allOptions = new TDECmdLineOptions[predefinedOptionsCount + userOptionsCount + 1];
|
|
|
|
KCmdLineOptions *allOptionsPtr = d->allOptions;
|
|
|
|
TDECmdLineOptions *allOptionsPtr = d->allOptions;
|
|
|
|
for (KCmdLineOptions *optionsPtr = predefinedOptions; optionsPtr->name; optionsPtr++, allOptionsPtr++) {
|
|
|
|
for (TDECmdLineOptions *optionsPtr = predefinedOptions; optionsPtr->name; optionsPtr++, allOptionsPtr++) {
|
|
|
|
allOptionsPtr->name = tqstrdup(optionsPtr->name);
|
|
|
|
allOptionsPtr->name = tqstrdup(optionsPtr->name);
|
|
|
|
allOptionsPtr->description = tqstrdup(optionsPtr->description);
|
|
|
|
allOptionsPtr->description = tqstrdup(optionsPtr->description);
|
|
|
|
if (optionsPtr == predefinedOptions) //first row == drv
|
|
|
|
if (optionsPtr == predefinedOptions) //first row == drv
|
|
|
@ -115,7 +115,7 @@ SimpleCommandLineApp::SimpleCommandLineApp(
|
|
|
|
else
|
|
|
|
else
|
|
|
|
allOptionsPtr->def = tqstrdup(optionsPtr->def);
|
|
|
|
allOptionsPtr->def = tqstrdup(optionsPtr->def);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (KCmdLineOptions *optionsPtr = options; optionsPtr->name; optionsPtr++, allOptionsPtr++) {
|
|
|
|
for (TDECmdLineOptions *optionsPtr = options; optionsPtr->name; optionsPtr++, allOptionsPtr++) {
|
|
|
|
allOptionsPtr->name = tqstrdup(optionsPtr->name);
|
|
|
|
allOptionsPtr->name = tqstrdup(optionsPtr->name);
|
|
|
|
allOptionsPtr->description = tqstrdup(optionsPtr->description);
|
|
|
|
allOptionsPtr->description = tqstrdup(optionsPtr->description);
|
|
|
|
allOptionsPtr->def = tqstrdup(optionsPtr->def);
|
|
|
|
allOptionsPtr->def = tqstrdup(optionsPtr->def);
|
|
|
|