Rename KCmdLineArgs to TDECmdLineArgs to avoid conflicts with KDE4

pull/16/head
Timothy Pearson 11 years ago
parent 6e8a7cc94c
commit 5bca2e3e42

@ -20,7 +20,7 @@ or <a href="http://doc.trolltech.com/porting.html">this page online</a>.<P>
<LI><A HREF="#general">Global changes</A></LI> <LI><A HREF="#general">Global changes</A></LI>
<LI><A HREF="#automoc">automoc/am_edit, Makefile.am tags</A></LI> <LI><A HREF="#automoc">automoc/am_edit, Makefile.am tags</A></LI>
<LI><A HREF="#KApplication">KApplication</A></LI> <LI><A HREF="#KApplication">KApplication</A></LI>
<LI><A HREF="#KCmdLineArgs">KCmdLineArgs</A></LI> <LI><A HREF="#TDECmdLineArgs">TDECmdLineArgs</A></LI>
<LI><A HREF="#KLocale">KLocale</A></LI> <LI><A HREF="#KLocale">KLocale</A></LI>
<LI><A HREF="#KGlobal">KGlobal: access to KDE global objects.</A></LI> <LI><A HREF="#KGlobal">KGlobal: access to KDE global objects.</A></LI>
<LI><A HREF="#KIconLoader">KIconLoader</A></LI> <LI><A HREF="#KIconLoader">KIconLoader</A></LI>
@ -148,14 +148,14 @@ or <a href="http://doc.trolltech.com/porting.html">this page online</a>.<P>
The KApplication constructor has changed. Command line arguments and The KApplication constructor has changed. Command line arguments and
program name should no longer be passed to KApplication but to program name should no longer be passed to KApplication but to
KCmdLineArgs. KCmdLineArgs performs command line parsing and a command TDECmdLineArgs. TDECmdLineArgs performs command line parsing and a command
line help. See below for more info.<P> line help. See below for more info.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4> <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KCmdLineArgs">KCmdLineArgs</A></H3> <H3><A NAME="TDECmdLineArgs">TDECmdLineArgs</A></H3>
KCmdLineArgs is a new class that handles command line parsing and TDECmdLineArgs is a new class that handles command line parsing and
command line help. It is now required that your application command line help. It is now required that your application
specifies at least:<P> specifies at least:<P>
<UL> <UL>
@ -165,13 +165,13 @@ or <a href="http://doc.trolltech.com/porting.html">this page online</a>.<P>
<LI>All command line options that it supports. <LI>All command line options that it supports.
</UL> </UL>
KCmdLineArgs itself will add the command line options supported by Qt TDECmdLineArgs itself will add the command line options supported by Qt
and KApplication.<P> and KApplication.<P>
You can also use the KAboutData class to specify name, description and You can also use the KAboutData class to specify name, description and
version.<P> version.<P>
In return for this information you can query KCmdLineArgs whether an In return for this information you can query TDECmdLineArgs whether an
certain option was specified on the command line and your application certain option was specified on the command line and your application
now automatically supports --help and --version. It aborts with a now automatically supports --help and --version. It aborts with a
useful error message when the command line contains a syntax error. useful error message when the command line contains a syntax error.

@ -57,11 +57,11 @@ int main(int argc, char **argv)
{ {
KAboutData aboutData("kconverttest", I18N_NOOP("KConvertTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, ""); KAboutData aboutData("kconverttest", I18N_NOOP("KConvertTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
KURL url; KURL url;

@ -22,15 +22,15 @@ int main(int argc, char **argv)
{ {
KAboutData aboutData( "kiotest", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, ""); KAboutData aboutData( "kiotest", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
QIOManager qiomanager; QIOManager qiomanager;
Dispatcher dispatcher(&qiomanager); Dispatcher dispatcher(&qiomanager);
KIOInputStream stream; KIOInputStream stream;
StdoutWriter writer; StdoutWriter writer;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if(args->count()) if(args->count())
{ {

@ -90,8 +90,8 @@ int main(int argc, char **argv)
{ {
KAboutData aboutData( "kiotestslow", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, ""); KAboutData aboutData( "kiotestslow", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
QIOManager qiomanager; QIOManager qiomanager;
Dispatcher dispatcher(&qiomanager); Dispatcher dispatcher(&qiomanager);
@ -102,7 +102,7 @@ int main(int argc, char **argv)
#endif #endif
KIOTestSlow writer; KIOTestSlow writer;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if(args->count()) if(args->count())
{ {

@ -53,7 +53,7 @@ int main(int argc, char **argv)
KAboutData::License_GPL, "(C) 2001, Nikolas Zimmermann"); KAboutData::License_GPL, "(C) 2001, Nikolas Zimmermann");
aboutdata.addAuthor("Nikolas Zimmermann", I18N_NOOP("Author"), "wildfox@kde.org"); aboutdata.addAuthor("Nikolas Zimmermann", I18N_NOOP("Author"), "wildfox@kde.org");
KCmdLineArgs::init(argc, argv, &aboutdata); TDECmdLineArgs::init(argc, argv, &aboutdata);
KUniqueApplication::addCmdLineOptions(); KUniqueApplication::addCmdLineOptions();
if(!KUniqueApplication::start()) if(!KUniqueApplication::start())

@ -113,7 +113,7 @@ KDE_EXPORT int kdemain(int argc, char **argv)
aboutdata.addAuthor("Stefan Westerfeld",I18N_NOOP("Sound support"),"stefan@space.twc.de"); aboutdata.addAuthor("Stefan Westerfeld",I18N_NOOP("Sound support"),"stefan@space.twc.de");
aboutdata.addAuthor("Charles Samuels",I18N_NOOP("Previous Maintainer"),"charles@kde.org"); aboutdata.addAuthor("Charles Samuels",I18N_NOOP("Previous Maintainer"),"charles@kde.org");
KCmdLineArgs::init( argc, argv, &aboutdata ); TDECmdLineArgs::init( argc, argv, &aboutdata );
KUniqueApplication::addCmdLineOptions(); KUniqueApplication::addCmdLineOptions();

@ -58,11 +58,11 @@ KAboutData aboutData("artsmessage", I18N_NOOP("artsmessage"), "0.1",
int main(int argc, char **argv) { int main(int argc, char **argv) {
aboutData.addAuthor("Jeff Tranter", 0, "tranter@kde.org"); aboutData.addAuthor("Jeff Tranter", 0, "tranter@kde.org");
KGlobal::locale()->setMainCatalogue("tdelibs"); KGlobal::locale()->setMainCatalogue("tdelibs");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
TQString msg; TQString msg;
// must be at least one argument // must be at least one argument

@ -53,7 +53,7 @@ int main(int argc, char** argv)
if ( argc < 2 ) { tqWarning("Usage: driver <appid>"); return 1; } if ( argc < 2 ) { tqWarning("Usage: driver <appid>"); return 1; }
const char* appname = strdup( argv[ 1 ] ); const char* appname = strdup( argv[ 1 ] );
argv[ 1 ] = 0; // sue me argv[ 1 ] = 0; // sue me
KCmdLineArgs::init( argc, argv, "TestAppDriver", "Tests the dcop familly of tools + libraries", "1.0" ); // FIXME TDECmdLineArgs::init( argc, argv, "TestAppDriver", "Tests the dcop familly of tools + libraries", "1.0" ); // FIXME
KApplication app; KApplication app;
app.dcopClient()->attach( ); app.dcopClient()->attach( );
app.dcopClient()->registerAs( "TestAppDriver" ); app.dcopClient()->registerAs( "TestAppDriver" );

@ -31,7 +31,7 @@ int main(int argc, char** argv)
batch(); batch();
return 0; return 0;
} }
KCmdLineArgs::init( argc, argv, "TestApp", "Tests the dcop familly of tools + libraries", "1.0" ); // FIXME TDECmdLineArgs::init( argc, argv, "TestApp", "Tests the dcop familly of tools + libraries", "1.0" ); // FIXME
KApplication app; KApplication app;
if(!app.dcopClient()->attach( )) if(!app.dcopClient()->attach( ))
return 1; return 1;

@ -34,7 +34,7 @@ Win::Win()
int main( int argc, char** argv ) int main( int argc, char** argv )
{ {
KAboutData* about = new KAboutData( "tetest", "TETest", "0.1" ); KAboutData* about = new KAboutData( "tetest", "TETest", "0.1" );
KCmdLineArgs::init( argc, argv, about ); TDECmdLineArgs::init( argc, argv, about );
KApplication a; KApplication a;
Win* win = new Win(); Win* win = new Win();
win->show(); win->show();

@ -435,12 +435,12 @@ int main( int argc, char **argv )
KAboutData aboutData( "kab2kabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); KAboutData aboutData( "kab2kabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" );
aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
bool override = false; bool override = false;

@ -18,7 +18,7 @@ using namespace KABC;
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("bigread","BigReadKabc","0.1"); KAboutData aboutData("bigread","BigReadKabc","0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KApplication app( false, false ); KApplication app( false, false );

@ -15,7 +15,7 @@ using namespace KABC;
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("bigwrite","BigWriteKabc","0.1"); KAboutData aboutData("bigwrite","BigWriteKabc","0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KApplication app( false, false ); KApplication app( false, false );

@ -38,7 +38,7 @@ int main(int argc,char **argv)
KAboutData aboutData("kabcargl","Fix broken pre3.0rc3 format","0.1"); KAboutData aboutData("kabcargl","Fix broken pre3.0rc3 format","0.1");
aboutData.addAuthor("Cornelius Schumacher", 0, "schumacher@kde.org"); aboutData.addAuthor("Cornelius Schumacher", 0, "schumacher@kde.org");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KApplication app; KApplication app;

@ -23,11 +23,11 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testaddressee","TestAddressee","0.1"); KAboutData aboutData("testaddressee","TestAddressee","0.1");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs();
kdDebug() << "Creating a" << endl; kdDebug() << "Creating a" << endl;
Addressee a; Addressee a;

@ -20,11 +20,11 @@ static const KCmdLineOptions options[] =
int main(int /*argc*/,char /* **argv*/) int main(int /*argc*/,char /* **argv*/)
{ {
/* KAboutData aboutData("testaddresseelist","TestAddresseeList","0.1"); /* KAboutData aboutData("testaddresseelist","TestAddresseeList","0.1");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); */ TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); */
kdDebug() << "Creating addressees" << endl; kdDebug() << "Creating addressees" << endl;
Addressee a, b, c, d, e, f; Addressee a, b, c, d, e, f;

@ -20,8 +20,8 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testaddressfmt","TestAddressFormat","0.1"); KAboutData aboutData("testaddressfmt","TestAddressFormat","0.1");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;

@ -12,7 +12,7 @@ int main( int argc,char **argv )
{ {
KAboutData aboutData( "testaddresslineedit", KAboutData aboutData( "testaddresslineedit",
I18N_NOOP( "Test Address LineEdit" ), "0.1" ); I18N_NOOP( "Test Address LineEdit" ), "0.1" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app; KApplication app;

@ -13,7 +13,7 @@ using namespace KABC;
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testdb","TestKabcDB","0.1"); KAboutData aboutData("testdb","TestKabcDB","0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
// KApplication app( false, false ); // KApplication app( false, false );
KApplication app; KApplication app;

@ -23,12 +23,12 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1"); KAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->isSet("list")) { if (args->isSet("list")) {
TQString name = args->getOption("list"); TQString name = args->getOption("list");

@ -21,7 +21,7 @@ using namespace KABC;
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1"); KAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KApplication app( false, false ); KApplication app( false, false );
AddressBook *ab = StdAddressBook::self(); AddressBook *ab = StdAddressBook::self();

@ -19,12 +19,12 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1"); KAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->isSet("multiple")) { if (args->isSet("multiple")) {
Addressee::List al = AddresseeDialog::getAddressees( 0 ); Addressee::List al = AddresseeDialog::getAddressees( 0 );
Addressee::List::ConstIterator it; Addressee::List::ConstIterator it;

@ -30,7 +30,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init(argc,argv,"testldapclient", 0, 0, 0, 0); TDECmdLineArgs::init(argc,argv,"testldapclient", 0, 0, 0, 0);
KApplication app; KApplication app;
TestLDAPClient test; TestLDAPClient test;

@ -166,14 +166,14 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testlock",I18N_NOOP("Test libkabc Lock"),"0.1"); KAboutData aboutData("testlock",I18N_NOOP("Test libkabc Lock"),"0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
TQString identifier; TQString identifier;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() == 1 ) { if ( args->count() == 1 ) {
identifier = args->arg( 0 ); identifier = args->arg( 0 );
} else if ( args->count() != 0 ) { } else if ( args->count() != 0 ) {

@ -9,7 +9,7 @@
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KApplication app; KApplication app;

@ -47,12 +47,12 @@ int main( int argc, char **argv )
KAboutData aboutData( "testread", "vCard test reader", "0.1" ); KAboutData aboutData( "testread", "vCard test reader", "0.1" );
aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app( false, false ); KApplication app( false, false );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() != 1 ) { if ( args->count() != 1 ) {
std::cerr << "Missing argument" << std::endl; std::cerr << "Missing argument" << std::endl;

@ -37,7 +37,7 @@ int main( int argc, char **argv )
{ {
KAboutData aboutData( "testwrite", "vCard test writer", "0.1" ); KAboutData aboutData( "testwrite", "vCard test writer", "0.1" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app( false, false ); KApplication app( false, false );

@ -410,11 +410,11 @@ int main(int argc, char *argv[])
// signal( SIGALRM, signal_handler ); // signal( SIGALRM, signal_handler );
KCmdLineArgs::init(argc, argv, "testregression", "TestRegression", TDECmdLineArgs::init(argc, argv, "testregression", "TestRegression",
"Regression tester for kate", "1.0"); "Regression tester for kate", "1.0");
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs( ); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs( );
TQCString baseDir = args->getOption("base"); TQCString baseDir = args->getOption("base");
TQCString baseDirConfigFile(::getenv("HOME") + TQCString(BASE_DIR_CONFIG)); TQCString baseDirConfigFile(::getenv("HOME") + TQCString(BASE_DIR_CONFIG));
@ -440,7 +440,7 @@ int main(int argc, char *argv[])
"\techo \"<root-path>\" > %s\n" "\techo \"<root-path>\" > %s\n"
"You may override the location by specifying the root explicitly on the\n" "You may override the location by specifying the root explicitly on the\n"
"command line with option -b\n" "command line with option -b\n"
"", KCmdLineArgs::appName(), "", TDECmdLineArgs::appName(),
(const char *)baseDirConfigFile, (const char *)baseDirConfigFile,
(const char *)baseDirConfigFile); (const char *)baseDirConfigFile);
::exit( 1 ); ::exit( 1 );

@ -213,11 +213,11 @@ extern "C" KDE_EXPORT int kdemain(int _argc, char *_argv[])
KGlobal::locale()->setMainCatalogue("kcmshell"); KGlobal::locale()->setMainCatalogue("kcmshell");
KCmdLineArgs::init(_argc, _argv, &aboutData); TDECmdLineArgs::init(_argc, _argv, &aboutData);
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KCMShell app; KCMShell app;
const KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); const TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
const TQCString lang = args->getOption("lang"); const TQCString lang = args->getOption("lang");
if( !lang.isNull() ) if( !lang.isNull() )

@ -116,7 +116,7 @@ KonfUpdate::KonfUpdate()
config = new KConfig("kconf_updaterc"); config = new KConfig("kconf_updaterc");
TQStringList updateFiles; TQStringList updateFiles;
KCmdLineArgs *args=KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args=TDECmdLineArgs::parsedArgs();
debug = args->isSet("debug"); debug = args->isSet("debug");
@ -139,7 +139,7 @@ KonfUpdate::KonfUpdate()
{ {
KURL url = args->url(i); KURL url = args->url(i);
if (!url.isLocalFile()) if (!url.isLocalFile())
KCmdLineArgs::usage(i18n("Only local files are supported.")); TDECmdLineArgs::usage(i18n("Only local files are supported."));
updateFiles.append(url.path()); updateFiles.append(url.path());
} }
} }
@ -948,8 +948,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
aboutData.addAuthor("Waldo Bastian", 0, "bastian@kde.org"); aboutData.addAuthor("Waldo Bastian", 0, "bastian@kde.org");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KInstance instance(&aboutData); KInstance instance(&aboutData);

@ -724,9 +724,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org"); d.addAuthor("David Faure", I18N_NOOP("Author"), "faure@kde.org");
d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org");
KCmdLineArgs::init(argc, argv, &d); TDECmdLineArgs::init(argc, argv, &d);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
bGlobalDatabase = args->isSet("global"); bGlobalDatabase = args->isSet("global");
bMenuTest = args->isSet("menutest"); bMenuTest = args->isSet("menutest");

@ -118,8 +118,8 @@ int main(int argc, char **argv)
KAboutData::License_GPL, "(c) 2003 Waldo Bastian"); KAboutData::License_GPL, "(c) 2003 Waldo Bastian");
d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org");
KCmdLineArgs::init(argc, argv, &d); TDECmdLineArgs::init(argc, argv, &d);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
// KApplication k(false, false); // KApplication k(false, false);
KApplication k(false); KApplication k(false);
@ -128,9 +128,9 @@ int main(int argc, char **argv)
// this program is in tdelibs so it uses tdelibs as catalog // this program is in tdelibs so it uses tdelibs as catalog
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->count() != 1) if (args->count() != 1)
KCmdLineArgs::usage(i18n("You must specify an application-id such as 'tde-konsole.desktop'")); TDECmdLineArgs::usage(i18n("You must specify an application-id such as 'tde-konsole.desktop'"));
utf8 = args->isSet("utf8"); utf8 = args->isSet("utf8");
@ -139,7 +139,7 @@ int main(int argc, char **argv)
bHighlight = args->isSet("highlight"); bHighlight = args->isSet("highlight");
if (!bPrintMenuId && !bPrintMenuName && !bHighlight) if (!bPrintMenuId && !bPrintMenuName && !bHighlight)
KCmdLineArgs::usage(i18n("You must specify at least one of --print-menu-id, --print-menu-name or --highlight")); TDECmdLineArgs::usage(i18n("You must specify at least one of --print-menu-id, --print-menu-name or --highlight"));
if (args->isSet("cache-update")) if (args->isSet("cache-update"))
{ {

@ -878,11 +878,11 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
KApplication::installSigpipeHandler(); KApplication::installSigpipeHandler();
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KUniqueApplication::addCmdLineOptions(); KUniqueApplication::addCmdLineOptions();
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
// this program is in tdelibs so it uses tdelibs as catalog // this program is in tdelibs so it uses tdelibs as catalog
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
@ -891,7 +891,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
putenv(strdup("SESSION_MANAGER=")); putenv(strdup("SESSION_MANAGER="));
// Parse command line before checking DCOP // Parse command line before checking DCOP
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
// Check DCOP communication. // Check DCOP communication.
{ {

@ -65,7 +65,7 @@ protected:
KHostName::KHostName() KHostName::KHostName()
{ {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->count() != 2) if (args->count() != 2)
args->usage(); args->usage();
oldName = args->arg(0); oldName = args->arg(0);
@ -371,8 +371,8 @@ int main(int argc, char **argv)
KAboutData::License_GPL, "(c) 2001 Waldo Bastian"); KAboutData::License_GPL, "(c) 2001 Waldo Bastian");
d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org"); d.addAuthor("Waldo Bastian", I18N_NOOP("Author"), "bastian@kde.org");
KCmdLineArgs::init(argc, argv, &d); TDECmdLineArgs::init(argc, argv, &d);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KInstance k(&d); KInstance k(&d);

@ -128,9 +128,9 @@ int main( int argc, char **argv ) {
KAboutData about( "makekdewidgets", I18N_NOOP( "makekdewidgets" ), version, description, KAboutData::License_GPL, "(C) 2004-2005 ian reinhart geiser", 0, 0, "geiseri@kde.org" ); KAboutData about( "makekdewidgets", I18N_NOOP( "makekdewidgets" ), version, description, KAboutData::License_GPL, "(C) 2004-2005 ian reinhart geiser", 0, 0, "geiseri@kde.org" );
about.addAuthor( "ian reinhart geiser", 0, "geiseri@kde.org" ); about.addAuthor( "ian reinhart geiser", 0, "geiseri@kde.org" );
KCmdLineArgs::init( argc, argv, &about ); TDECmdLineArgs::init( argc, argv, &about );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() < 1 ) { if ( args->count() < 1 ) {
args->usage(); args->usage();
return ( 1 ); return ( 1 );

@ -95,15 +95,15 @@ int main(int argc, char **argv) {
"$Revision$", "$Revision$",
I18N_NOOP("TDE Translator for XML")); I18N_NOOP("TDE Translator for XML"));
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KLocale::setMainCatalogue("kio_help"); KLocale::setMainCatalogue("kio_help");
KInstance ins("meinproc"); KInstance ins("meinproc");
KGlobal::locale(); KGlobal::locale();
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() != 1 ) { if ( args->count() != 1 ) {
args->usage(); args->usage();
return ( 1 ); return ( 1 );

@ -17,9 +17,9 @@ static KCmdLineOptions options[] =
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
KCmdLineArgs::init( argc, argv, "testKJASSever", "testKJASServer", "test program", "0.0" ); TDECmdLineArgs::init( argc, argv, "testKJASSever", "testKJASServer", "test program", "0.0" );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;

@ -449,16 +449,16 @@ int main(int argc, char *argv[])
// workaround various Qt crashes by always enforcing a TrueColor visual // workaround various Qt crashes by always enforcing a TrueColor visual
TQApplication::setColorSpec( TQApplication::ManyColor ); TQApplication::setColorSpec( TQApplication::ManyColor );
KCmdLineArgs::init(argc, argv, "testregression", "TestRegression", TDECmdLineArgs::init(argc, argv, "testregression", "TestRegression",
"Regression tester for khtml", "1.0"); "Regression tester for khtml", "1.0");
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs( ); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs( );
TQCString baseDir = args->getOption("base"); TQCString baseDir = args->getOption("base");
if ( args->count() < 1 && baseDir.isEmpty() ) { if ( args->count() < 1 && baseDir.isEmpty() ) {
KCmdLineArgs::usage(); TDECmdLineArgs::usage();
::exit( 1 ); ::exit( 1 );
} }

@ -37,14 +37,14 @@ static KCmdLineOptions options[] = { { "+file", "url to open", 0 } , KCmdLineLas
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KCmdLineArgs::init(argc, argv, "testkhtml", "Testkhtml", TDECmdLineArgs::init(argc, argv, "testkhtml", "Testkhtml",
"a basic web browser using the KHTML library", "1.0"); "a basic web browser using the KHTML library", "1.0");
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication a; KApplication a;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs( ); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs( );
if ( args->count() == 0 ) { if ( args->count() == 0 ) {
KCmdLineArgs::usage(); TDECmdLineArgs::usage();
::exit( 1 ); ::exit( 1 );
} }

@ -62,11 +62,11 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
TQCString cname = KApplication::launcher(); TQCString cname = KApplication::launcher();
char *name = cname.data(); char *name = cname.data();
KCmdLineArgs::init(argc, argv, name, "KLauncher", "A service launcher.", TDECmdLineArgs::init(argc, argv, name, "KLauncher", "A service launcher.",
"v1.0"); "v1.0");
KLauncher::addCmdLineOptions(); KLauncher::addCmdLineOptions();
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
// WABA: Make sure not to enable session management. // WABA: Make sure not to enable session management.
putenv(strdup("SESSION_MANAGER=")); putenv(strdup("SESSION_MANAGER="));
@ -74,7 +74,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
// Allow the locale to initialize properly // Allow the locale to initialize properly
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
int maxTry = 3; int maxTry = 3;
while(true) while(true)

@ -2322,7 +2322,7 @@ KURL KFileDialog::getStartURL( const TQString& startDir,
} }
else else
{ {
ret = KCmdLineArgs::makeURL( TQFile::encodeName(startDir) ); ret = TDECmdLineArgs::makeURL( TQFile::encodeName(startDir) );
// If we won't be able to list it (e.g. http), then use default // If we won't be able to list it (e.g. http), then use default
if ( !KProtocolInfo::supportsListing( ret ) ) if ( !KProtocolInfo::supportsListing( ret ) )
useDefaultStartDir = true; useDefaultStartDir = true;

@ -68,9 +68,9 @@ KIOExec::KIOExec()
jobList = new TQPtrList<KIO::Job>; jobList = new TQPtrList<KIO::Job>;
jobList->setAutoDelete( false ); // jobs autodelete themselves jobList->setAutoDelete( false ); // jobs autodelete themselves
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->count() < 1) if (args->count() < 1)
KCmdLineArgs::usage(i18n("'command' expected.\n")); TDECmdLineArgs::usage(i18n("'command' expected.\n"));
tempfiles = args->isSet("tempfiles"); tempfiles = args->isSet("tempfiles");
if ( args->isSet( "suggestedfilename" ) ) if ( args->isSet( "suggestedfilename" ) )
@ -280,8 +280,8 @@ int main( int argc, char **argv )
aboutData.addAuthor("Waldo Bastian",0, "bastian@kde.org"); aboutData.addAuthor("Waldo Bastian",0, "bastian@kde.org");
aboutData.addAuthor("Oswald Buddenhagen",0, "ossi@kde.org"); aboutData.addAuthor("Oswald Buddenhagen",0, "ossi@kde.org");
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;

@ -280,7 +280,7 @@ static void printSupportedMimeTypes()
} }
// caller needs to delete the returned list! // caller needs to delete the returned list!
static KFileItemList * fileItemList( const KCmdLineArgs *args ) static KFileItemList * fileItemList( const TDECmdLineArgs *args )
{ {
KFileItemList * items = new KFileItemList(); KFileItemList * items = new KFileItemList();
items->setAutoDelete( true ); items->setAutoDelete( true );
@ -291,14 +291,14 @@ static KFileItemList * fileItemList( const KCmdLineArgs *args )
return items; return items;
} }
static void showPropertiesDialog( const KCmdLineArgs *args ) static void showPropertiesDialog( const TDECmdLineArgs *args )
{ {
KFileItemList *items = fileItemList( args ); KFileItemList *items = fileItemList( args );
new KPropertiesDialog( *items, 0L, "props dialog", true ); new KPropertiesDialog( *items, 0L, "props dialog", true );
delete items; delete items;
} }
static void printMimeTypes( const KCmdLineArgs *args ) static void printMimeTypes( const TDECmdLineArgs *args )
{ {
for ( int i = 0; i < args->count(); i++ ) for ( int i = 0; i < args->count(); i++ )
{ {
@ -318,7 +318,7 @@ static void printList( const TQStringList& list )
} }
static void processMetaDataOptions( const TQPtrList<FileProps> propList, static void processMetaDataOptions( const TQPtrList<FileProps> propList,
KCmdLineArgs *args ) TDECmdLineArgs *args )
{ {
// kfile --mimetype --supportedMimetypes --listsupported --listavailable --listpreferred --listwritable --getValue "key" --setValue "key=value" --allValues --preferredValues --dialog --quiet file [file...] // kfile --mimetype --supportedMimetypes --listsupported --listavailable --listpreferred --listwritable --getValue "key" --setValue "key=value" --allValues --preferredValues --dialog --quiet file [file...]
// "key" may be a list of keys, separated by commas // "key" may be a list of keys, separated by commas
@ -416,11 +416,11 @@ int main( int argc, char **argv )
about.addAuthor( "Carsten Pfeiffer", 0, "pfeiffer@kde.org", about.addAuthor( "Carsten Pfeiffer", 0, "pfeiffer@kde.org",
"http://devel-home.kde.org/~pfeiffer/" ); "http://devel-home.kde.org/~pfeiffer/" );
KCmdLineArgs::init( argc, argv, &about ); TDECmdLineArgs::init( argc, argv, &about );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
bool useGUI = args->isSet( "dialog" ); bool useGUI = args->isSet( "dialog" );
KApplication app( useGUI, useGUI ); KApplication app( useGUI, useGUI );
@ -435,7 +435,7 @@ int main( int argc, char **argv )
int files = args->count(); int files = args->count();
if ( files == 0 ) if ( files == 0 )
KCmdLineArgs::usage( i18n("No files specified") ); // exit()s TDECmdLineArgs::usage( i18n("No files specified") ); // exit()s
if ( args->isSet( "dialog" ) ) if ( args->isSet( "dialog" ) )
{ {

@ -29,12 +29,12 @@ static const KCmdLineOptions options[] =
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs::init( argc, argv, "kmailservice", I18N_NOOP("KMailService"), I18N_NOOP("Mail service"), "unknown" ); TDECmdLineArgs::init( argc, argv, "kmailservice", I18N_NOOP("KMailService"), I18N_NOOP("Mail service"), "unknown" );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication a( false, false ); KApplication a( false, false );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() != 1 ) if ( args->count() != 1 )
return 1; return 1;

@ -64,9 +64,9 @@ int main(int argc, char **argv) {
KAboutData::License_GPL, "(c) 2000 Stephan Kulow"); KAboutData::License_GPL, "(c) 2000 Stephan Kulow");
d.addAuthor("Stephan Kulow", I18N_NOOP("Author"), "coolo@kde.org"); d.addAuthor("Stephan Kulow", I18N_NOOP("Author"), "coolo@kde.org");
KCmdLineArgs::init(argc, argv, &d); TDECmdLineArgs::init(argc, argv, &d);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
KApplication a(false, false); KApplication a(false, false);

@ -38,13 +38,13 @@ static const KCmdLineOptions options[] =
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs::init(argc, argv, "ktelnetservice", I18N_NOOP("telnet service"), TDECmdLineArgs::init(argc, argv, "ktelnetservice", I18N_NOOP("telnet service"),
I18N_NOOP("telnet protocol handler"), "unknown"); I18N_NOOP("telnet protocol handler"), "unknown");
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->count() != 1) if (args->count() != 1)
return 1; return 1;

@ -1387,8 +1387,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
aboutdata.addAuthor("David Faure",I18N_NOOP("Developer"),"faure@kde.org"); aboutdata.addAuthor("David Faure",I18N_NOOP("Developer"),"faure@kde.org");
aboutdata.addAuthor("Matej Koss",I18N_NOOP("Developer"),"koss@miesto.sk"); aboutdata.addAuthor("Matej Koss",I18N_NOOP("Developer"),"koss@miesto.sk");
KCmdLineArgs::init( argc, argv, &aboutdata ); TDECmdLineArgs::init( argc, argv, &aboutdata );
// KCmdLineArgs::addCmdLineOptions( options ); // TDECmdLineArgs::addCmdLineOptions( options );
KUniqueApplication::addCmdLineOptions(); KUniqueApplication::addCmdLineOptions();
if (!KUniqueApplication::start()) if (!KUniqueApplication::start())

@ -65,7 +65,7 @@ static bool check(const TQString& txt, TQString a, TQString b)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init(argc,argv,"jobtest", 0, 0, 0, 0); TDECmdLineArgs::init(argc,argv,"jobtest", 0, 0, 0, 0);
KApplication app; KApplication app;
JobTest test; JobTest test;

@ -68,7 +68,7 @@ static bool check(const TQString& txt, T a, T b)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init(argc,argv,"kacltest", 0, 0, 0, 0); TDECmdLineArgs::init(argc,argv,"kacltest", 0, 0, 0, 0);
KApplication app; KApplication app;
KACLTest test; KACLTest test;

@ -25,13 +25,13 @@ static const KCmdLineOptions options[] =
int main (int argc, char **argv) int main (int argc, char **argv)
{ {
KCmdLineArgs::init(argc, argv, "KDirWatchTest", TDECmdLineArgs::init(argc, argv, "KDirWatchTest",
"Test for KDirWatch", "1.0"); "Test for KDirWatch", "1.0");
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication::addCmdLineOptions(); KApplication::addCmdLineOptions();
KApplication a; KApplication a;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
myTest testObject; myTest testObject;

@ -44,9 +44,9 @@ int main(int argc, char **argv)
KCmdLineLastOption KCmdLineLastOption
}; };
KCmdLineArgs::init( argc, argv, "kionetrctest", description, version ); TDECmdLineArgs::init( argc, argv, "kionetrctest", description, version );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
int count = args->count(); int count = args->count();
KApplication app; KApplication app;

@ -9,7 +9,7 @@
int main ( int argc, char** argv ) int main ( int argc, char** argv )
{ {
KAboutData aboutData("kiopassdlgtest", "KIO Password Dialog Test", "1.0"); KAboutData aboutData("kiopassdlgtest", "KIO Password Dialog Test", "1.0");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KApplication app; KApplication app;
TQString usr, pass, comment, label; TQString usr, pass, comment, label;

@ -494,11 +494,11 @@ static KCmdLineOptions options[] =
}; };
int main(int argc, char **argv) { int main(int argc, char **argv) {
KCmdLineArgs::init( argc, argv, "kioslavetest", description, version ); TDECmdLineArgs::init( argc, argv, "kioslavetest", description, version );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
TQString src = args->getOption("src"); TQString src = args->getOption("src");
TQString dest = args->getOption("dest"); TQString dest = args->getOption("dest");
@ -529,7 +529,7 @@ int main(int argc, char **argv) {
op = KioslaveTest::Shred; op = KioslaveTest::Shred;
} else if ( tmps == "mkdir") { } else if ( tmps == "mkdir") {
op = KioslaveTest::Mkdir; op = KioslaveTest::Mkdir;
} else KCmdLineArgs::usage("unknown operation"); } else TDECmdLineArgs::usage("unknown operation");
tmps = args->getOption("progress"); tmps = args->getOption("progress");
if ( tmps == "none") { if ( tmps == "none") {
@ -538,7 +538,7 @@ int main(int argc, char **argv) {
pr = KioslaveTest::ProgressDefault; pr = KioslaveTest::ProgressDefault;
} else if ( tmps == "status") { } else if ( tmps == "status") {
pr = KioslaveTest::ProgressStatus; pr = KioslaveTest::ProgressStatus;
} else KCmdLineArgs::usage("unknown progress mode"); } else TDECmdLineArgs::usage("unknown progress mode");
args->clear(); // Free up memory args->clear(); // Free up memory

@ -31,13 +31,13 @@ static KCmdLineOptions options[] =
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KCmdLineArgs::init( argc, argv, "kmimefromext", "A mimetype testing tool, gives the mimetype for a given filename", "0.0" ); TDECmdLineArgs::init( argc, argv, "kmimefromext", "A mimetype testing tool, gives the mimetype for a given filename", "0.0" );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
TQString fileName = args->arg( 0 ); TQString fileName = args->arg( 0 );
// The "true" here means only the filename will be looked at. // The "true" here means only the filename will be looked at.

@ -14,14 +14,14 @@ static KCmdLineOptions options[] =
int main ( int argc, char** argv ) int main ( int argc, char** argv )
{ {
KAboutData aboutData("kpropertiesdialogtest", "KIO Properties Dialog Test", "1.0"); KAboutData aboutData("kpropertiesdialogtest", "KIO Properties Dialog Test", "1.0");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() < 1 ) if ( args->count() < 1 )
KCmdLineArgs::usage(); TDECmdLineArgs::usage();
KURL u = args->url( 0 ); KURL u = args->url( 0 );
// This is the test for the KPropertiesDialog constructor that is now // This is the test for the KPropertiesDialog constructor that is now

@ -29,7 +29,7 @@ int main(int argc, char **argv) {
KAboutData aboutData("kprotocolinfotest", "KProtocolinfo Test", KAboutData aboutData("kprotocolinfotest", "KProtocolinfo Test",
"1.0"); "1.0");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KApplication app; KApplication app;
KURL url; KURL url;

@ -33,16 +33,16 @@ static KCmdLineOptions options[] =
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KCmdLineArgs::init( argc, argv, "ktradertest", "KTradertest", "A KTrader testing tool", "0.0" ); TDECmdLineArgs::init( argc, argv, "ktradertest", "KTradertest", "A KTrader testing tool", "0.0" );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app( false, false ); // no GUI KApplication app( false, false ); // no GUI
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() < 1 ) if ( args->count() < 1 )
KCmdLineArgs::usage(); TDECmdLineArgs::usage();
TQString query = TQString::fromLocal8Bit( args->arg( 0 ) ); TQString query = TQString::fromLocal8Bit( args->arg( 0 ) );

@ -159,14 +159,14 @@ int main(int argc, char **argv)
setenv( "TDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup setenv( "TDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup
KAboutData aboutData(appName, programName, version, description); KAboutData aboutData(appName, programName, version, description);
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
app.disableAutoDcopRegistration(); app.disableAutoDcopRegistration();
// Allow testing of the search engine using both delimiters... // Allow testing of the search engine using both delimiters...
char delimiter = KCmdLineArgs::parsedArgs()->isSet("s") ? ' ' : ':'; char delimiter = TDECmdLineArgs::parsedArgs()->isSet("s") ? ' ' : ':';
// Many tests check the "default search engine" feature. // Many tests check the "default search engine" feature.
// There is no default search engine by default (since it was annoying when making typos), // There is no default search engine by default (since it was annoying when making typos),

@ -165,7 +165,7 @@ void KURLCompletionTest::testLocalURL()
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init(argc,argv,"kurlcompletiontest", 0, 0, 0, 0); TDECmdLineArgs::init(argc,argv,"kurlcompletiontest", 0, 0, 0, 0);
KApplication app; KApplication app;
{ {

@ -181,17 +181,17 @@ void removeGroup(KFileMetaInfo& info, TQString group)
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
// Initialize command line args // Initialize command line args
KCmdLineArgs::init(argc, argv, "kfilemetatest", "testing kfilmetainfo", "X"); TDECmdLineArgs::init(argc, argv, "kfilemetatest", "testing kfilmetainfo", "X");
// Tell which options are supported // Tell which options are supported
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
// Add options from other components // Add options from other components
KApplication::addCmdLineOptions(); KApplication::addCmdLineOptions();
KApplication app; KApplication app;
KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs();
TQCString ov; TQCString ov;
ov = args->getOption("mimetypeinfo"); ov = args->getOption("mimetypeinfo");

@ -65,13 +65,13 @@ static KCmdLineOptions options[] =
int main(int argc, char **argv) { int main(int argc, char **argv) {
KCmdLineArgs::init( argc, argv, "speedapp", "A KIO::listRecursive testing tool", "0.0" ); TDECmdLineArgs::init( argc, argv, "speedapp", "A KIO::listRecursive testing tool", "0.0" );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
KURL url; KURL url;
if ( args->count() == 1 ) if ( args->count() == 1 )

@ -190,13 +190,13 @@ void scanDirectory(FileInfoList &fileEntries, const TQString &name, const TQStri
extern "C" KDE_EXPORT int kdemain(int argc, char **argv) extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs::init( argc, argv, appName, TDECmdLineArgs::init( argc, argv, appName,
I18N_NOOP("TDE HTTP cache maintenance tool"), I18N_NOOP("TDE HTTP cache maintenance tool"),
description, version, true); description, version, true);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
bool deleteAll = args->isSet("clear-all"); bool deleteAll = args->isSet("clear-all");

@ -43,16 +43,16 @@ static const KCmdLineOptions options[] =
extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs::init(argc, argv, "kcookiejar", I18N_NOOP("HTTP cookie daemon"), TDECmdLineArgs::init(argc, argv, "kcookiejar", I18N_NOOP("HTTP cookie daemon"),
description, version); description, version);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KInstance a("kcookiejar"); KInstance a("kcookiejar");
kapp->dcopClient()->attach(); kapp->dcopClient()->attach();
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
TQCString replyType; TQCString replyType;
TQByteArray replyData; TQByteArray replyData;
if (args->isSet("remove-all")) if (args->isSet("remove-all"))

@ -250,15 +250,15 @@ int main(int argc, char *argv[])
nextYear = new TQCString(TQString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::currentDate().year()+1).utf8()); nextYear = new TQCString(TQString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::currentDate().year()+1).utf8());
KAboutData about("kcookietest", "kcookietest", "1.0", description, KAboutData::License_GPL, "(C) 2004 Waldo Bastian"); KAboutData about("kcookietest", "kcookietest", "1.0", description, KAboutData::License_GPL, "(C) 2004 Waldo Bastian");
KCmdLineArgs::init( argc, argv, &about); TDECmdLineArgs::init( argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KInstance a("kcookietest"); KInstance a("kcookietest");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->count() != 1) if (args->count() != 1)
KCmdLineArgs::usage(); TDECmdLineArgs::usage();
jar = new KCookieJar; jar = new KCookieJar;

@ -79,7 +79,7 @@ void GhnsWidget::downloadWallpapers()
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("ghns","Get Hot New Stuff","0.1"); KAboutData aboutData("ghns","Get Hot New Stuff","0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KApplication app; KApplication app;

@ -36,11 +36,11 @@ static const KCmdLineOptions op[] =
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
KAboutData about("khotnewstuff", "KHotNewStuff", "0.2"); KAboutData about("khotnewstuff", "KHotNewStuff", "0.2");
KCmdLineArgs *args; TDECmdLineArgs *args;
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions(op); TDECmdLineArgs::addCmdLineOptions(op);
args = KCmdLineArgs::parsedArgs(); args = TDECmdLineArgs::parsedArgs();
KApplication i; KApplication i;

@ -108,7 +108,7 @@ void MyWidget::upload()
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KAboutData aboutData("knewstufftest","KNewStuff Test","0.1"); KAboutData aboutData("knewstufftest","KNewStuff Test","0.1");
KCmdLineArgs::init(argc,argv,&aboutData); TDECmdLineArgs::init(argc,argv,&aboutData);
KApplication app; KApplication app;

@ -101,10 +101,10 @@ static const char description[] = "This is a test shell for the kghostview part.
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KCmdLineArgs::init(argc, argv, "ghostviewtest", description, version); TDECmdLineArgs::init(argc, argv, "ghostviewtest", description, version);
KCmdLineArgs::addCmdLineOptions( options ); // Add my own options. TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options.
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
Shell *shell = new Shell; Shell *shell = new Shell;
if ( args->count() == 1 ) if ( args->count() == 1 )
{ {

@ -30,7 +30,7 @@ class TestSubResource : public TestResource
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KAboutData aboutData( "testresources", "Kresource Test", "0" ); KAboutData aboutData( "testresources", "Kresource Test", "0" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app; KApplication app;

@ -37,7 +37,7 @@ static const char ver[] = "0.9.1";
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
KCmdLineArgs::init(argc, argv, "kinstalltheme", I18N_NOOP("KInstalltheme"), desc, ver); TDECmdLineArgs::init(argc, argv, "kinstalltheme", I18N_NOOP("KInstalltheme"), desc, ver);
KApplication qapp(false, false); //We don't allow styles.. Kind of ironic, isn't it? KApplication qapp(false, false); //We don't allow styles.. Kind of ironic, isn't it?
KGlobal::dirs()->addResourceType("themercs", KGlobal::dirs()->kde_default("data")+TQString("kstyle/themes")); KGlobal::dirs()->addResourceType("themercs", KGlobal::dirs()->kde_default("data")+TQString("kstyle/themes"));

@ -54,9 +54,9 @@ int main( int argc, char **argv )
KAboutData::License_BSD, "(C) 2005 Jeroen Wijnhout", 0, 0, KAboutData::License_BSD, "(C) 2005 Jeroen Wijnhout", 0, 0,
"Jeroen.Wijnhout@kdemail.net"); "Jeroen.Wijnhout@kdemail.net");
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
KUnitTest::Runner::loadModules(args->getOption("folder"), args->getOption("query")); KUnitTest::Runner::loadModules(args->getOption("folder"), args->getOption("query"));
KUnitTest::Runner::setDebugCapturingEnabled(args->isSet("enable-dbgcap")); KUnitTest::Runner::setDebugCapturingEnabled(args->isSet("enable-dbgcap"));

@ -150,8 +150,8 @@ SampleTest - 1 test passed, 1 test failed
* KAboutData about("SampleTests", I18N_NOOP("SampleTests"), version, description, * KAboutData about("SampleTests", I18N_NOOP("SampleTests"), version, description,
* KAboutData::License_BSD, "(C) 2005 You!", 0, 0, "mail@provider"); * KAboutData::License_BSD, "(C) 2005 You!", 0, 0, "mail@provider");
* *
* KCmdLineArgs::init(argc, argv, &about); * TDECmdLineArgs::init(argc, argv, &about);
* KCmdLineArgs::addCmdLineOptions( options ); * TDECmdLineArgs::addCmdLineOptions( options );
* KApplication app; * KApplication app;
* *
* KUnitTest::RunnerGUI runner(0); * KUnitTest::RunnerGUI runner(0);

@ -123,7 +123,7 @@ void KFindTest::slotHighlight(int id, int index, int matchedLength)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
KCmdLineArgs::init(argc, argv, "kfindtest", "KFindTest", 0, 0, false); TDECmdLineArgs::init(argc, argv, "kfindtest", "KFindTest", 0, 0, false);
KApplication app; KApplication app;
TQString text = "This file is part of the KDE project.\n" TQString text = "This file is part of the KDE project.\n"

@ -252,7 +252,7 @@ static void testReplacementHistory()
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KCmdLineArgs::init(argc, argv, "kreplacetest", 0, 0); TDECmdLineArgs::init(argc, argv, "kreplacetest", 0, 0);
KApplication app; KApplication app;
testReplacementHistory(); // #130831 testReplacementHistory(); // #130831

@ -44,7 +44,7 @@ void WalletReceiver::walletOpened( bool got )
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
KAboutData aboutData( "kwalletasync", "kwalletasync", "version" ); KAboutData aboutData( "kwalletasync", "kwalletasync", "version" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app( "kwalletasync" ); KApplication app( "kwalletasync" );
// register with DCOP // register with DCOP

@ -66,7 +66,7 @@ void WalletReceiver::walletOpened( bool got )
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
KAboutData aboutData( "kwalletboth", "kwalletboth", "version" ); KAboutData aboutData( "kwalletboth", "kwalletboth", "version" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app( "kwalletboth" ); KApplication app( "kwalletboth" );
// register with DCOP // register with DCOP

@ -24,7 +24,7 @@ void openWallet()
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
KAboutData aboutData( "kwalletsync", "kwalletsync", "version" ); KAboutData aboutData( "kwalletsync", "kwalletsync", "version" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app( "kwalletsync" ); KApplication app( "kwalletsync" );
// register with DCOP // register with DCOP

@ -94,9 +94,9 @@ typedef WId Window;
KDE_EXPORT int main(int argc, char *argv[]) KDE_EXPORT int main(int argc, char *argv[])
{ {
KLocale::setMainCatalogue("libkscreensaver"); KLocale::setMainCatalogue("libkscreensaver");
KCmdLineArgs::init(argc, argv, kss_applicationName, kss_description, kss_version); TDECmdLineArgs::init(argc, argv, kss_applicationName, kss_description, kss_version);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
@ -108,7 +108,7 @@ KDE_EXPORT int main(int argc, char *argv[])
Window saveWin = 0; Window saveWin = 0;
KScreenSaver *target; KScreenSaver *target;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->isSet("setup")) if (args->isSet("setup"))
{ {

@ -48,7 +48,7 @@ class KAboutDataPrivate;
* about.addAuthor("Joe Developer", I18N_NOOP("developer"), "joe@host.com", 0); * about.addAuthor("Joe Developer", I18N_NOOP("developer"), "joe@host.com", 0);
* about.addCredit("Joe User", I18N_NOOP("A lot of bug reports"), * about.addCredit("Joe User", I18N_NOOP("A lot of bug reports"),
* "joe.user@host.org", 0); * "joe.user@host.org", 0);
* KCmdLineArgs::init(argc, argv, &about); * TDECmdLineArgs::init(argc, argv, &about);
* \endcode * \endcode
*/ */
class TDECORE_EXPORT KAboutPerson class TDECORE_EXPORT KAboutPerson
@ -173,7 +173,7 @@ private:
* *
* Currently, the values set here are shown by the "About" box * Currently, the values set here are shown by the "About" box
* (see KAboutDialog), used by the bug report dialog (see KBugReport), * (see KAboutDialog), used by the bug report dialog (see KBugReport),
* and by the help shown on command line (see KCmdLineArgs). * and by the help shown on command line (see TDECmdLineArgs).
* *
* @short Holds information needed by the "About" box and other * @short Holds information needed by the "About" box and other
* classes. * classes.

@ -640,16 +640,16 @@ KApplication::KApplication( int& argc, char** argv, const TQCString& rAppName,
setName(rAppName); setName(rAppName);
installSigpipeHandler(); installSigpipeHandler();
KCmdLineArgs::initIgnore(argc, argv, rAppName.data()); TDECmdLineArgs::initIgnore(argc, argv, rAppName.data());
parseCommandLine( ); parseCommandLine( );
init(GUIenabled); init(GUIenabled);
d->m_KAppDCOPInterface = new KAppDCOPInterface(this); d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
} }
KApplication::KApplication( bool allowStyles, bool GUIenabled ) : KApplication::KApplication( bool allowStyles, bool GUIenabled ) :
// TQApplication( *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), TRUE ), // Qt4 requires that there always be a GUI // TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), TRUE ), // Qt4 requires that there always be a GUI
TQApplication( *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps
KInstance( KCmdLineArgs::about), KInstance( TDECmdLineArgs::about),
#ifdef Q_WS_X11 #ifdef Q_WS_X11
display(0L), display(0L),
argb_visual(false), argb_visual(false),
@ -672,9 +672,9 @@ KApplication::KApplication( bool allowStyles, bool GUIenabled ) :
#ifdef Q_WS_X11 #ifdef Q_WS_X11
KApplication::KApplication( Display *dpy, bool allowStyles ) : KApplication::KApplication( Display *dpy, bool allowStyles ) :
TQApplication( dpy, *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ), getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ),
KInstance( KCmdLineArgs::about), display(0L), d (new KApplicationPrivate) KInstance( TDECmdLineArgs::about), display(0L), d (new KApplicationPrivate)
{ {
aIconPixmap.pm.icon = 0L; aIconPixmap.pm.icon = 0L;
aIconPixmap.pm.miniIcon = 0L; aIconPixmap.pm.miniIcon = 0L;
@ -688,9 +688,9 @@ KApplication::KApplication( Display *dpy, bool allowStyles ) :
} }
KApplication::KApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles ) : KApplication::KApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles ) :
TQApplication( dpy, *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ), disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ),
KInstance( KCmdLineArgs::about), display(0L), d (new KApplicationPrivate) KInstance( TDECmdLineArgs::about), display(0L), d (new KApplicationPrivate)
{ {
aIconPixmap.pm.icon = 0L; aIconPixmap.pm.icon = 0L;
aIconPixmap.pm.miniIcon = 0L; aIconPixmap.pm.miniIcon = 0L;
@ -706,9 +706,9 @@ KApplication::KApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual,
KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap,
bool allowStyles ) : bool allowStyles ) :
TQApplication( dpy, *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ),
KInstance( KCmdLineArgs::about), display(0L), d (new KApplicationPrivate) KInstance( TDECmdLineArgs::about), display(0L), d (new KApplicationPrivate)
{ {
if ((visual) && (colormap)) if ((visual) && (colormap))
getX11RGBAInformation(dpy); getX11RGBAInformation(dpy);
@ -725,7 +725,7 @@ KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap
KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap,
bool allowStyles, KInstance * _instance ) : bool allowStyles, KInstance * _instance ) :
TQApplication( dpy, *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ),
KInstance( _instance ), display(0L), d (new KApplicationPrivate) KInstance( _instance ), display(0L), d (new KApplicationPrivate)
{ {
@ -744,7 +744,7 @@ KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap
#endif #endif
KApplication::KApplication( bool allowStyles, bool GUIenabled, KInstance* _instance ) : KApplication::KApplication( bool allowStyles, bool GUIenabled, KInstance* _instance ) :
TQApplication( *KCmdLineArgs::tqt_argc(), *KCmdLineArgs::tqt_argv(), TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
GUIenabled ), GUIenabled ),
KInstance( _instance ), KInstance( _instance ),
#ifdef Q_WS_X11 #ifdef Q_WS_X11
@ -786,7 +786,7 @@ KApplication::KApplication(Display *display, int& argc, char** argv, const TQCSt
setName(rAppName); setName(rAppName);
installSigpipeHandler(); installSigpipeHandler();
KCmdLineArgs::initIgnore(argc, argv, rAppName.data()); TDECmdLineArgs::initIgnore(argc, argv, rAppName.data());
parseCommandLine( ); parseCommandLine( );
init(GUIenabled); init(GUIenabled);
d->m_KAppDCOPInterface = new KAppDCOPInterface(this); d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
@ -977,7 +977,7 @@ void KApplication::init(bool GUIenabled)
#ifdef Q_WS_MACX #ifdef Q_WS_MACX
if (GUIenabled) { if (GUIenabled) {
TQPixmap pixmap = KGlobal::iconLoader()->loadIcon( KCmdLineArgs::appName(), TQPixmap pixmap = KGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(),
KIcon::NoGroup, KIcon::SizeLarge, KIcon::DefaultState, 0L, false ); KIcon::NoGroup, KIcon::SizeLarge, KIcon::DefaultState, 0L, false );
if (!pixmap.isNull()) { if (!pixmap.isNull()) {
TQImage i = pixmap.convertToImage().convertDepth(32).smoothScale(40, 40); TQImage i = pixmap.convertToImage().convertDepth(32).smoothScale(40, 40);
@ -1063,7 +1063,7 @@ DCOPClient *KApplication::dcopClient()
return s_DCOPClient; return s_DCOPClient;
s_DCOPClient = new DCOPClient(); s_DCOPClient = new DCOPClient();
KCmdLineArgs *args = KCmdLineArgs::parsedArgs("tde"); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tde");
if (args && args->isSet("dcopserver")) if (args && args->isSet("dcopserver"))
{ {
s_DCOPClient->setServerAddress( args->getOption("dcopserver")); s_DCOPClient->setServerAddress( args->getOption("dcopserver"));
@ -1562,13 +1562,13 @@ static const KCmdLineOptions kde_options[] =
void void
KApplication::addCmdLineOptions() KApplication::addCmdLineOptions()
{ {
KCmdLineArgs::addCmdLineOptions(qt_options, "Qt", "qt"); TDECmdLineArgs::addCmdLineOptions(qt_options, "Qt", "qt");
KCmdLineArgs::addCmdLineOptions(kde_options, "TDE", "tde"); TDECmdLineArgs::addCmdLineOptions(kde_options, "TDE", "tde");
} }
void KApplication::parseCommandLine( ) void KApplication::parseCommandLine( )
{ {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs("tde"); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tde");
if ( !args ) return; if ( !args ) return;
@ -1823,7 +1823,7 @@ bool KApplication::detectCompositionManagerAvailable(bool force_available, bool
} }
else { else {
// See if compositing has been enabled // See if compositing has been enabled
KCmdLineArgs *qtargs = KCmdLineArgs::parsedArgs("qt"); TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt");
char *displayname = 0; char *displayname = 0;
if ( qtargs->isSet("display")) if ( qtargs->isSet("display"))
displayname = qtargs->getOption( "display" ).data(); displayname = qtargs->getOption( "display" ).data();
@ -1896,7 +1896,7 @@ bool KApplication::detectCompositionManagerAvailable(bool force_available, bool
} }
Display* KApplication::openX11RGBADisplay() { Display* KApplication::openX11RGBADisplay() {
KCmdLineArgs *qtargs = KCmdLineArgs::parsedArgs("qt"); TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt");
char *display = 0; char *display = 0;
if ( qtargs->isSet("display")) if ( qtargs->isSet("display"))
display = qtargs->getOption( "display" ).data(); display = qtargs->getOption( "display" ).data();

@ -111,7 +111,7 @@ public:
/** /**
* This constructor takes aboutData and command line * This constructor takes aboutData and command line
* arguments from KCmdLineArgs. * arguments from TDECmdLineArgs.
* *
* If ARGB (transparent) widgets are to be used in your application, * If ARGB (transparent) widgets are to be used in your application,
* please use * please use
@ -234,7 +234,7 @@ public:
#endif #endif
/** /**
* @deprecated do not use it at all, it will make your application crash, use KCmdLineArgs * @deprecated do not use it at all, it will make your application crash, use TDECmdLineArgs
* *
* Constructor. Parses command-line arguments. * Constructor. Parses command-line arguments.
* *
@ -256,12 +256,12 @@ public:
* no styles either. * no styles either.
*/ */
// REMOVE FOR KDE 4.0 - using it only gives crashing applications because // REMOVE FOR KDE 4.0 - using it only gives crashing applications because
// KCmdLineArgs::init isn't called // TDECmdLineArgs::init isn't called
KApplication(int& argc, char** argv, KApplication(int& argc, char** argv,
const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true) KDE_DEPRECATED; const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true) KDE_DEPRECATED;
/** /**
* Add Qt and KDE command line options to KCmdLineArgs. * Add Qt and KDE command line options to TDECmdLineArgs.
*/ */
static void addCmdLineOptions(); static void addCmdLineOptions();
@ -1315,7 +1315,7 @@ private:
void init( bool GUIenabled ); void init( bool GUIenabled );
void parseCommandLine( ); // Handle KDE arguments (Using KCmdLineArgs) void parseCommandLine( ); // Handle KDE arguments (Using TDECmdLineArgs)
void read_app_startup_id(); void read_app_startup_id();

@ -54,7 +54,7 @@
#endif #endif
template class TQAsciiDict<TQCString>; template class TQAsciiDict<TQCString>;
template class TQPtrList<KCmdLineArgs>; template class TQPtrList<TDECmdLineArgs>;
class KCmdLineParsedOptions : public TQAsciiDict<TQCString> class KCmdLineParsedOptions : public TQAsciiDict<TQCString>
{ {
@ -104,27 +104,27 @@ public:
}; };
class KCmdLineArgsList: public TQPtrList<KCmdLineArgs> class TDECmdLineArgsList: public TQPtrList<TDECmdLineArgs>
{ {
public: public:
KCmdLineArgsList() { } TDECmdLineArgsList() { }
}; };
KCmdLineArgsList *KCmdLineArgs::argsList = 0; TDECmdLineArgsList *TDECmdLineArgs::argsList = 0;
int KCmdLineArgs::argc = 0; int TDECmdLineArgs::argc = 0;
char **KCmdLineArgs::argv = 0; char **TDECmdLineArgs::argv = 0;
char *KCmdLineArgs::mCwd = 0; char *TDECmdLineArgs::mCwd = 0;
static KStaticDeleter <char> mCwdd; static KStaticDeleter <char> mCwdd;
const KAboutData *KCmdLineArgs::about = 0; const KAboutData *TDECmdLineArgs::about = 0;
bool KCmdLineArgs::parsed = false; bool TDECmdLineArgs::parsed = false;
bool KCmdLineArgs::ignoreUnknown = false; bool TDECmdLineArgs::ignoreUnknown = false;
// //
// Static functions // Static functions
// //
void void
KCmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* programName, TDECmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* programName,
const char *_description, const char *_version, bool noKApp) const char *_description, const char *_version, bool noKApp)
{ {
init(_argc, _argv, init(_argc, _argv,
@ -133,7 +133,7 @@ KCmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* pr
} }
void void
KCmdLineArgs::init(int _argc, char **_argv, const char *_appname, TDECmdLineArgs::init(int _argc, char **_argv, const char *_appname,
const char *_description, const char *_version, bool noKApp) const char *_description, const char *_version, bool noKApp)
{ {
init(_argc, _argv, init(_argc, _argv,
@ -142,7 +142,7 @@ KCmdLineArgs::init(int _argc, char **_argv, const char *_appname,
} }
void void
KCmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname ) TDECmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname )
{ {
init(_argc, _argv, init(_argc, _argv,
new KAboutData(_appname, _appname, "unknown", "TDE Application", false)); new KAboutData(_appname, _appname, "unknown", "TDE Application", false));
@ -150,7 +150,7 @@ KCmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname )
} }
void void
KCmdLineArgs::init(const KAboutData* ab) TDECmdLineArgs::init(const KAboutData* ab)
{ {
char **_argv = (char **) malloc(sizeof(char *)); char **_argv = (char **) malloc(sizeof(char *));
_argv[0] = (char *) ab->appName(); _argv[0] = (char *) ab->appName();
@ -159,14 +159,14 @@ KCmdLineArgs::init(const KAboutData* ab)
void void
KCmdLineArgs::init(int _argc, char **_argv, const KAboutData *_about, bool noKApp) TDECmdLineArgs::init(int _argc, char **_argv, const KAboutData *_about, bool noKApp)
{ {
argc = _argc; argc = _argc;
argv = _argv; argv = _argv;
if (!argv) if (!argv)
{ {
fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n"); fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n");
fprintf(stderr, "Passing null-pointer to 'argv' is not allowed.\n\n"); fprintf(stderr, "Passing null-pointer to 'argv' is not allowed.\n\n");
assert( 0 ); assert( 0 );
@ -191,30 +191,30 @@ KCmdLineArgs::init(int _argc, char **_argv, const KAboutData *_about, bool noKAp
KApplication::addCmdLineOptions(); KApplication::addCmdLineOptions();
} }
TQString KCmdLineArgs::cwd() TQString TDECmdLineArgs::cwd()
{ {
return TQFile::decodeName(TQCString(mCwd)); return TQFile::decodeName(TQCString(mCwd));
} }
const char * KCmdLineArgs::appName() const char * TDECmdLineArgs::appName()
{ {
if (!argc) return 0; if (!argc) return 0;
return argv[0]; return argv[0];
} }
void void
KCmdLineArgs::addCmdLineOptions( const KCmdLineOptions *options, const char *name, TDECmdLineArgs::addCmdLineOptions( const KCmdLineOptions *options, const char *name,
const char *id, const char *afterId) const char *id, const char *afterId)
{ {
if (!argsList) if (!argsList)
argsList = new KCmdLineArgsList(); argsList = new TDECmdLineArgsList();
int pos = argsList->count(); int pos = argsList->count();
if (pos && id && argsList->last() && !argsList->last()->name) if (pos && id && argsList->last() && !argsList->last()->name)
pos--; pos--;
KCmdLineArgs *args; TDECmdLineArgs *args;
int i = 0; int i = 0;
for(args = argsList->first(); args; args = argsList->next(), i++) for(args = argsList->first(); args; args = argsList->next(), i++)
{ {
@ -230,12 +230,12 @@ KCmdLineArgs::addCmdLineOptions( const KCmdLineOptions *options, const char *nam
assert( parsed == false ); // You must add _ALL_ cmd line options assert( parsed == false ); // You must add _ALL_ cmd line options
// before accessing the arguments! // before accessing the arguments!
args = new KCmdLineArgs(options, name, id); args = new TDECmdLineArgs(options, name, id);
argsList->insert(pos, args); argsList->insert(pos, args);
} }
void void
KCmdLineArgs::saveAppArgs( TQDataStream &ds) TDECmdLineArgs::saveAppArgs( TQDataStream &ds)
{ {
if (!parsed) if (!parsed)
parseAllArgs(); parseAllArgs();
@ -252,7 +252,7 @@ KCmdLineArgs::saveAppArgs( TQDataStream &ds)
if (!count) return; if (!count) return;
KCmdLineArgs *args; TDECmdLineArgs *args;
for(args = argsList->first(); args; args = argsList->next()) for(args = argsList->first(); args; args = argsList->next())
{ {
ds << TQCString(args->id); ds << TQCString(args->id);
@ -261,7 +261,7 @@ KCmdLineArgs::saveAppArgs( TQDataStream &ds)
} }
void void
KCmdLineArgs::loadAppArgs( TQDataStream &ds) TDECmdLineArgs::loadAppArgs( TQDataStream &ds)
{ {
parsed = true; // don't reparse argc/argv! parsed = true; // don't reparse argc/argv!
@ -269,7 +269,7 @@ KCmdLineArgs::loadAppArgs( TQDataStream &ds)
removeArgs("qt"); removeArgs("qt");
removeArgs("tde"); removeArgs("tde");
KCmdLineArgs *args; TDECmdLineArgs *args;
if ( argsList ) { if ( argsList ) {
for(args = argsList->first(); args; args = argsList->next()) for(args = argsList->first(); args; args = argsList->next())
{ {
@ -307,9 +307,9 @@ KCmdLineArgs::loadAppArgs( TQDataStream &ds)
parsed = true; parsed = true;
} }
KCmdLineArgs *KCmdLineArgs::parsedArgs(const char *id) TDECmdLineArgs *TDECmdLineArgs::parsedArgs(const char *id)
{ {
KCmdLineArgs *args = argsList ? argsList->first() : 0; TDECmdLineArgs *args = argsList ? argsList->first() : 0;
while(args) while(args)
{ {
if ((id && ::qstrcmp(args->id, id) == 0) || (!id && !args->id)) if ((id && ::qstrcmp(args->id, id) == 0) || (!id && !args->id))
@ -324,9 +324,9 @@ KCmdLineArgs *KCmdLineArgs::parsedArgs(const char *id)
return args; return args;
} }
void KCmdLineArgs::removeArgs(const char *id) void TDECmdLineArgs::removeArgs(const char *id)
{ {
KCmdLineArgs *args = argsList ? argsList->first() : 0; TDECmdLineArgs *args = argsList ? argsList->first() : 0;
while(args) while(args)
{ {
if (args->id && id && ::qstrcmp(args->id, id) == 0) if (args->id && id && ::qstrcmp(args->id, id) == 0)
@ -426,9 +426,9 @@ findOption(const KCmdLineOptions *options, TQCString &opt,
void void
KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled, bool &moreOptions) TDECmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled, bool &moreOptions)
{ {
KCmdLineArgs *args = argsList->first(); TDECmdLineArgs *args = argsList->first();
const char *opt_name; const char *opt_name;
const char *def; const char *def;
TQCString argument; TQCString argument;
@ -534,19 +534,19 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
} }
void void
KCmdLineArgs::printQ(const TQString &msg) TDECmdLineArgs::printQ(const TQString &msg)
{ {
TQCString localMsg = msg.local8Bit(); TQCString localMsg = msg.local8Bit();
fprintf(stdout, "%s", localMsg.data()); fprintf(stdout, "%s", localMsg.data());
} }
void void
KCmdLineArgs::parseAllArgs() TDECmdLineArgs::parseAllArgs()
{ {
bool allowArgs = false; bool allowArgs = false;
bool inOptions = true; bool inOptions = true;
bool everythingAfterArgIsArgs = false; bool everythingAfterArgIsArgs = false;
KCmdLineArgs *appOptions = argsList->last(); TDECmdLineArgs *appOptions = argsList->last();
if (!appOptions->id) if (!appOptions->id)
{ {
const KCmdLineOptions *option = appOptions->options; const KCmdLineOptions *option = appOptions->options;
@ -676,7 +676,7 @@ KCmdLineArgs::parseAllArgs()
* Return argc * Return argc
*/ */
int * int *
KCmdLineArgs::tqt_argc() TDECmdLineArgs::tqt_argc()
{ {
if (!argsList) if (!argsList)
KApplication::addCmdLineOptions(); // Lazy bastards! KApplication::addCmdLineOptions(); // Lazy bastards!
@ -685,12 +685,12 @@ KCmdLineArgs::tqt_argc()
if( tqt_argc != -1 ) if( tqt_argc != -1 )
return &tqt_argc; return &tqt_argc;
KCmdLineArgs *args = parsedArgs("qt"); TDECmdLineArgs *args = parsedArgs("qt");
assert(args); // No qt options have been added! assert(args); // No qt options have been added!
if (!argv) if (!argv)
{ {
fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n"); fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n");
fprintf(stderr, "Application has not called KCmdLineArgs::init(...).\n\n"); fprintf(stderr, "Application has not called TDECmdLineArgs::init(...).\n\n");
assert( 0 ); assert( 0 );
exit(255); exit(255);
@ -707,7 +707,7 @@ KCmdLineArgs::tqt_argc()
* Return argv * Return argv
*/ */
char *** char ***
KCmdLineArgs::tqt_argv() TDECmdLineArgs::tqt_argv()
{ {
if (!argsList) if (!argsList)
KApplication::addCmdLineOptions(); // Lazy bastards! KApplication::addCmdLineOptions(); // Lazy bastards!
@ -716,12 +716,12 @@ KCmdLineArgs::tqt_argv()
if( tqt_argv != NULL ) if( tqt_argv != NULL )
return &tqt_argv; return &tqt_argv;
KCmdLineArgs *args = parsedArgs("qt"); TDECmdLineArgs *args = parsedArgs("qt");
assert(args); // No qt options have been added! assert(args); // No qt options have been added!
if (!argv) if (!argv)
{ {
fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n"); fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n");
fprintf(stderr, "Application has not called KCmdLineArgs::init(...).\n\n"); fprintf(stderr, "Application has not called TDECmdLineArgs::init(...).\n\n");
assert( 0 ); assert( 0 );
exit(255); exit(255);
@ -740,7 +740,7 @@ KCmdLineArgs::tqt_argv()
} }
void void
KCmdLineArgs::enable_i18n() TDECmdLineArgs::enable_i18n()
{ {
// called twice or too late // called twice or too late
if (KGlobal::_locale) if (KGlobal::_locale)
@ -754,7 +754,7 @@ KCmdLineArgs::enable_i18n()
} }
void void
KCmdLineArgs::usage(const TQString &error) TDECmdLineArgs::usage(const TQString &error)
{ {
assert(KGlobal::_locale); assert(KGlobal::_locale);
TQCString localError = error.local8Bit(); TQCString localError = error.local8Bit();
@ -769,7 +769,7 @@ KCmdLineArgs::usage(const TQString &error)
} }
void void
KCmdLineArgs::usage(const char *id) TDECmdLineArgs::usage(const char *id)
{ {
enable_i18n(); enable_i18n();
assert(argsList != 0); // It's an error to call usage(...) without assert(argsList != 0); // It's an error to call usage(...) without
@ -781,7 +781,7 @@ KCmdLineArgs::usage(const char *id)
TQString tmp; TQString tmp;
TQString usage; TQString usage;
KCmdLineArgs *args = argsList->last(); TDECmdLineArgs *args = argsList->last();
if (!(args->id) && (args->options) && if (!(args->id) && (args->options) &&
(args->options->name) && (args->options->name[0] != '+')) (args->options->name) && (args->options->name[0] != '+'))
@ -798,7 +798,7 @@ KCmdLineArgs::usage(const char *id)
args = argsList->prev(); args = argsList->prev();
} }
KCmdLineArgs *appOptions = argsList->last(); TDECmdLineArgs *appOptions = argsList->last();
if (!appOptions->id) if (!appOptions->id)
{ {
const KCmdLineOptions *option = appOptions->options; const KCmdLineOptions *option = appOptions->options;
@ -986,7 +986,7 @@ KCmdLineArgs::usage(const char *id)
* *
* The given arguments are assumed to be constants. * The given arguments are assumed to be constants.
*/ */
KCmdLineArgs::KCmdLineArgs( const KCmdLineOptions *_options, TDECmdLineArgs::TDECmdLineArgs( const KCmdLineOptions *_options,
const char *_name, const char *_id) const char *_name, const char *_id)
: options(_options), name(_name), id(_id) : options(_options), name(_name), id(_id)
{ {
@ -998,7 +998,7 @@ KCmdLineArgs::KCmdLineArgs( const KCmdLineOptions *_options,
/** /**
* Destructor. * Destructor.
*/ */
KCmdLineArgs::~KCmdLineArgs() TDECmdLineArgs::~TDECmdLineArgs()
{ {
delete parsedOptionList; delete parsedOptionList;
delete parsedArgList; delete parsedArgList;
@ -1007,7 +1007,7 @@ KCmdLineArgs::~KCmdLineArgs()
} }
void void
KCmdLineArgs::clear() TDECmdLineArgs::clear()
{ {
delete parsedArgList; delete parsedArgList;
parsedArgList = 0; parsedArgList = 0;
@ -1016,7 +1016,7 @@ KCmdLineArgs::clear()
} }
void void
KCmdLineArgs::reset() TDECmdLineArgs::reset()
{ {
if ( argsList ) { if ( argsList ) {
argsList->setAutoDelete( true ); argsList->setAutoDelete( true );
@ -1028,7 +1028,7 @@ KCmdLineArgs::reset()
} }
void void
KCmdLineArgs::save( TQDataStream &ds) const TDECmdLineArgs::save( TQDataStream &ds) const
{ {
uint count = 0; uint count = 0;
if (parsedOptionList) if (parsedOptionList)
@ -1043,7 +1043,7 @@ KCmdLineArgs::save( TQDataStream &ds) const
} }
void void
KCmdLineArgs::load( TQDataStream &ds) TDECmdLineArgs::load( TQDataStream &ds)
{ {
if (!parsedOptionList) parsedOptionList = new KCmdLineParsedOptions; if (!parsedOptionList) parsedOptionList = new KCmdLineParsedOptions;
if (!parsedArgList) parsedArgList = new KCmdLineParsedArgs; if (!parsedArgList) parsedArgList = new KCmdLineParsedArgs;
@ -1064,7 +1064,7 @@ KCmdLineArgs::load( TQDataStream &ds)
} }
void void
KCmdLineArgs::setOption(const TQCString &opt, bool enabled) TDECmdLineArgs::setOption(const TQCString &opt, bool enabled)
{ {
if (isQt) if (isQt)
{ {
@ -1087,7 +1087,7 @@ KCmdLineArgs::setOption(const TQCString &opt, bool enabled)
} }
void void
KCmdLineArgs::setOption(const TQCString &opt, const char *value) TDECmdLineArgs::setOption(const TQCString &opt, const char *value)
{ {
if (isQt) if (isQt)
{ {
@ -1114,7 +1114,7 @@ KCmdLineArgs::setOption(const TQCString &opt, const char *value)
} }
TQCString TQCString
KCmdLineArgs::getOption(const char *_opt) const TDECmdLineArgs::getOption(const char *_opt) const
{ {
TQCString *value = 0; TQCString *value = 0;
if (parsedOptionList) if (parsedOptionList)
@ -1134,7 +1134,7 @@ KCmdLineArgs::getOption(const char *_opt) const
if (result != 3) if (result != 3)
{ {
fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n"); fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n");
fprintf(stderr, "Application requests for getOption(\"%s\") but the \"%s\" option\n", fprintf(stderr, "Application requests for getOption(\"%s\") but the \"%s\" option\n",
_opt, _opt); _opt, _opt);
fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n"); fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n");
@ -1146,7 +1146,7 @@ KCmdLineArgs::getOption(const char *_opt) const
} }
QCStringList QCStringList
KCmdLineArgs::getOptionList(const char *_opt) const TDECmdLineArgs::getOptionList(const char *_opt) const
{ {
QCStringList result; QCStringList result;
if (!parsedOptionList) if (!parsedOptionList)
@ -1176,7 +1176,7 @@ KCmdLineArgs::getOptionList(const char *_opt) const
} }
bool bool
KCmdLineArgs::isSet(const char *_opt) const TDECmdLineArgs::isSet(const char *_opt) const
{ {
// Look up the default. // Look up the default.
const char *opt_name; const char *opt_name;
@ -1187,7 +1187,7 @@ KCmdLineArgs::isSet(const char *_opt) const
if (result == 0) if (result == 0)
{ {
fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n"); fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n");
fprintf(stderr, "Application requests for isSet(\"%s\") but the \"%s\" option\n", fprintf(stderr, "Application requests for isSet(\"%s\") but the \"%s\" option\n",
_opt, _opt); _opt, _opt);
fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n"); fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n");
@ -1219,7 +1219,7 @@ KCmdLineArgs::isSet(const char *_opt) const
} }
int int
KCmdLineArgs::count() const TDECmdLineArgs::count() const
{ {
if (!parsedArgList) if (!parsedArgList)
return 0; return 0;
@ -1227,11 +1227,11 @@ KCmdLineArgs::count() const
} }
const char * const char *
KCmdLineArgs::arg(int n) const TDECmdLineArgs::arg(int n) const
{ {
if (!parsedArgList || (n >= (int) parsedArgList->count())) if (!parsedArgList || (n >= (int) parsedArgList->count()))
{ {
fprintf(stderr, "\n\nFAILURE (KCmdLineArgs): Argument out of bounds\n"); fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs): Argument out of bounds\n");
fprintf(stderr, "Application requests for arg(%d) without checking count() first.\n", fprintf(stderr, "Application requests for arg(%d) without checking count() first.\n",
n); n);
@ -1243,12 +1243,12 @@ KCmdLineArgs::arg(int n) const
} }
KURL KURL
KCmdLineArgs::url(int n) const TDECmdLineArgs::url(int n) const
{ {
return makeURL( arg(n) ); return makeURL( arg(n) );
} }
KURL KCmdLineArgs::makeURL(const char *_urlArg) KURL TDECmdLineArgs::makeURL(const char *_urlArg)
{ {
const TQString urlArg = TQFile::decodeName(_urlArg); const TQString urlArg = TQFile::decodeName(_urlArg);
TQFileInfo fileInfo(urlArg); TQFileInfo fileInfo(urlArg);
@ -1269,7 +1269,7 @@ KURL KCmdLineArgs::makeURL(const char *_urlArg)
} }
void void
KCmdLineArgs::addArgument(const char *argument) TDECmdLineArgs::addArgument(const char *argument)
{ {
if (!parsedArgList) if (!parsedArgList)
parsedArgList = new KCmdLineParsedArgs; parsedArgList = new KCmdLineParsedArgs;
@ -1284,14 +1284,14 @@ static const KCmdLineOptions kde_tempfile_option[] =
}; };
void void
KCmdLineArgs::addTempFileOption() TDECmdLineArgs::addTempFileOption()
{ {
KCmdLineArgs::addCmdLineOptions( kde_tempfile_option, "TDE-tempfile", "tde-tempfile" ); TDECmdLineArgs::addCmdLineOptions( kde_tempfile_option, "TDE-tempfile", "tde-tempfile" );
} }
bool KCmdLineArgs::isTempFileSet() bool TDECmdLineArgs::isTempFileSet()
{ {
KCmdLineArgs* args = KCmdLineArgs::parsedArgs( "tde-tempfile" ); TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs( "tde-tempfile" );
if ( args ) if ( args )
return args->isSet( "tempfile" ); return args->isSet( "tempfile" );
return false; return false;

@ -31,11 +31,11 @@ typedef TQValueList<TQCString> QCStringList;
/** /**
* @short Structure that holds command line options. * @short Structure that holds command line options.
* *
* This class is intended to be used with the KCmdLineArgs class, which * This class is intended to be used with the TDECmdLineArgs class, which
* provides convenient and powerful command line argument parsing and * provides convenient and powerful command line argument parsing and
* handling functionality. * handling functionality.
* *
* @see KCmdLineArgs for additional usage information * @see TDECmdLineArgs for additional usage information
*/ */
struct TDECORE_EXPORT KCmdLineOptions struct TDECORE_EXPORT KCmdLineOptions
{ {
@ -49,7 +49,7 @@ struct TDECORE_EXPORT KCmdLineOptions
* <i>myapp --nofoo</i> is called: * <i>myapp --nofoo</i> is called:
* *
* \code * \code
* KCmdLineArgs::parsedArgs()->isSet("foo"); // false * TDECmdLineArgs::parsedArgs()->isSet("foo"); // false
* \endcode * \endcode
*/ */
const char *name; const char *name;
@ -67,34 +67,34 @@ struct TDECORE_EXPORT KCmdLineOptions
#define KCmdLineLastOption { 0, 0, 0 } #define KCmdLineLastOption { 0, 0, 0 }
class KCmdLineArgsList; class TDECmdLineArgsList;
class KApplication; class KApplication;
class KUniqueApplication; class KUniqueApplication;
class KCmdLineParsedOptions; class KCmdLineParsedOptions;
class KCmdLineParsedArgs; class KCmdLineParsedArgs;
class KAboutData; class KAboutData;
class KCmdLineArgsPrivate; class TDECmdLineArgsPrivate;
/** /**
* @short A class for command-line argument handling. * @short A class for command-line argument handling.
* *
* KCmdLineArgs provides simple access to the command-line arguments * TDECmdLineArgs provides simple access to the command-line arguments
* for an application. It takes into account Qt-specific options, * for an application. It takes into account Qt-specific options,
* KDE-specific options and application specific options. * KDE-specific options and application specific options.
* *
* This class is used in %main() via the static method * This class is used in %main() via the static method
* init(). * init().
* *
* A typical %KDE application using %KCmdLineArgs should look like this: * A typical %KDE application using %TDECmdLineArgs should look like this:
* *
* \code * \code
* int main(int argc, char *argv[]) * int main(int argc, char *argv[])
* { * {
* // Initialize command line args * // Initialize command line args
* KCmdLineArgs::init(argc, argv, appName, programName, description, version); * TDECmdLineArgs::init(argc, argv, appName, programName, description, version);
* *
* // Tell which options are supported * // Tell which options are supported
* KCmdLineArgs::addCmdLineOptions( options ); * TDECmdLineArgs::addCmdLineOptions( options );
* *
* // Add options from other components * // Add options from other components
* KUniqueApplication::addCmdLineOptions(); * KUniqueApplication::addCmdLineOptions();
@ -111,7 +111,7 @@ class KCmdLineArgsPrivate;
* // necessary. * // necessary.
* // A KUniqueApplication might want to handle it in newInstance(). * // A KUniqueApplication might want to handle it in newInstance().
* *
* KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
* *
* // A binary option (on / off) * // A binary option (on / off)
* if (args->isSet("some-option")) * if (args->isSet("some-option"))
@ -165,7 +165,7 @@ class KCmdLineArgsPrivate;
* \endcode * \endcode
* *
* The I18N_NOOP macro is used to indicate that these strings should be * The I18N_NOOP macro is used to indicate that these strings should be
* marked for translation. The actual translation is done by KCmdLineArgs. * marked for translation. The actual translation is done by TDECmdLineArgs.
* You can't use i18n() here because we are setting up a static data * You can't use i18n() here because we are setting up a static data
* structure and can't do translations at compile time. * structure and can't do translations at compile time.
* *
@ -219,11 +219,11 @@ class KCmdLineArgsPrivate;
* @author Waldo Bastian * @author Waldo Bastian
* @version 0.0.4 * @version 0.0.4
*/ */
class TDECORE_EXPORT KCmdLineArgs class TDECORE_EXPORT TDECmdLineArgs
{ {
friend class KApplication; friend class KApplication;
friend class KUniqueApplication; friend class KUniqueApplication;
friend class TQPtrList<KCmdLineArgs>; friend class TQPtrList<TDECmdLineArgs>;
public: public:
// Static functions: // Static functions:
@ -321,8 +321,8 @@ public:
* true. If required, you must check yourself the number of arguments * true. If required, you must check yourself the number of arguments
* specified by the user: * specified by the user:
* \code * \code
* KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
* if (args->count() == 0) KCmdLineArgs::usage(i18n("No file specified!")); * if (args->count() == 0) TDECmdLineArgs::usage(i18n("No file specified!"));
* \endcode * \endcode
* *
* In BNF: * In BNF:
@ -367,7 +367,7 @@ public:
* *
* @param id The name of the options you are interested in, can be 0. * @param id The name of the options you are interested in, can be 0.
*/ */
static KCmdLineArgs *parsedArgs(const char *id=0); static TDECmdLineArgs *parsedArgs(const char *id=0);
/** /**
* Get the CWD (Current Working Directory) associated with the * Get the CWD (Current Working Directory) associated with the
@ -501,14 +501,14 @@ public:
/** /**
* Used by url(). * Used by url().
* Made public for apps that don't use KCmdLineArgs * Made public for apps that don't use TDECmdLineArgs
* @param urlArg the argument * @param urlArg the argument
* @return the url. * @return the url.
*/ */
static KURL makeURL( const char * urlArg ); static KURL makeURL( const char * urlArg );
/** /**
* Made public for apps that don't use KCmdLineArgs * Made public for apps that don't use TDECmdLineArgs
* To be done before makeURL, to set the current working * To be done before makeURL, to set the current working
* directory in case makeURL needs it. * directory in case makeURL needs it.
* @param cwd the new working directory * @param cwd the new working directory
@ -553,7 +553,7 @@ protected:
* @internal * @internal
* Constructor. * Constructor.
*/ */
KCmdLineArgs( const KCmdLineOptions *_options, const char *_name, TDECmdLineArgs( const KCmdLineOptions *_options, const char *_name,
const char *_id); const char *_id);
/** /**
@ -563,7 +563,7 @@ protected:
* *
* Destructor. * Destructor.
*/ */
~KCmdLineArgs(); ~TDECmdLineArgs();
private: private:
/** /**
@ -659,7 +659,7 @@ private:
* @param appname The untranslated name of your application. This should * @param appname The untranslated name of your application. This should
* match with @p argv[0]. * match with @p argv[0].
* *
* This function makes KCmdLineArgs ignore all unknown options as well as * This function makes TDECmdLineArgs ignore all unknown options as well as
* all arguments. * all arguments.
*/ */
static void initIgnore(int _argc, char **_argv, const char *_appname); static void initIgnore(int _argc, char **_argv, const char *_appname);
@ -673,7 +673,7 @@ private:
KCmdLineParsedArgs *parsedArgList; KCmdLineParsedArgs *parsedArgList;
bool isQt; bool isQt;
static KCmdLineArgsList *argsList; // All options. static TDECmdLineArgsList *argsList; // All options.
static const KAboutData *about; static const KAboutData *about;
static int argc; // The original argc static int argc; // The original argc
@ -683,7 +683,7 @@ private:
static char *mCwd; // Current working directory. Important for KUnqiueApp! static char *mCwd; // Current working directory. Important for KUnqiueApp!
static bool parseArgs; static bool parseArgs;
KCmdLineArgsPrivate *d; TDECmdLineArgsPrivate *d;
}; };
#endif #endif

@ -41,7 +41,7 @@ int main( int argc, char **argv )
KAboutData aboutData( "example", I18N_NOOP("autoconfig example"), "0.1" ); KAboutData aboutData( "example", I18N_NOOP("autoconfig example"), "0.1" );
aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app; KApplication app;

@ -35,7 +35,7 @@ int main( int argc, char **argv )
KAboutData aboutData( "example", I18N_NOOP("cfgc example"), "0.1" ); KAboutData aboutData( "example", I18N_NOOP("cfgc example"), "0.1" );
aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KApplication app; KApplication app;

@ -962,12 +962,12 @@ int main( int argc, char **argv )
aboutData.addCredit( "Duncan Mac-Vicar P.", "dpointer support", aboutData.addCredit( "Duncan Mac-Vicar P.", "dpointer support",
"duncan@kde.org", "http://www.mac-vicar.com/~duncan" ); "duncan@kde.org", "http://www.mac-vicar.com/~duncan" );
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KInstance app( &aboutData ); KInstance app( &aboutData );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if ( args->count() < 2 ) { if ( args->count() < 2 ) {
kdError() << "Too few arguments." << endl; kdError() << "Too few arguments." << endl;

@ -46,8 +46,8 @@ int main(int argc, char **argv)
KAboutData about("kdetcompmgr", I18N_NOOP("kdetcompmgr"), version, description, KAboutData about("kdetcompmgr", I18N_NOOP("kdetcompmgr"), version, description,
KAboutData::License_GPL, "(C) 2011 Timothy Pearson", 0, 0, "kb9vqf@pearsoncomputing.net"); KAboutData::License_GPL, "(C) 2011 Timothy Pearson", 0, 0, "kb9vqf@pearsoncomputing.net");
about.addAuthor( "Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net" ); about.addAuthor( "Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net" );
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;

@ -60,7 +60,7 @@ class TDECORE_EXPORT KInstance
* You have to destroy both, since the instance doesn't own the about data. * You have to destroy both, since the instance doesn't own the about data.
* Don't build a KAboutData on the stack in this case ! * Don't build a KAboutData on the stack in this case !
* Building a KAboutData on the stack is only ok for usage with * Building a KAboutData on the stack is only ok for usage with
* KCmdLineArgs and KApplication (not destroyed until the app exits). * TDECmdLineArgs and KApplication (not destroyed until the app exits).
* @param aboutData data about this instance (see KAboutData) * @param aboutData data about this instance (see KAboutData)
*/ */
KInstance( const KAboutData * aboutData ); KInstance( const KAboutData * aboutData );

@ -125,7 +125,7 @@ static KLockFile::LockResult lockFile(const TQString &lockFile, KDE_struct_stat
hostname[0] = 0; hostname[0] = 0;
gethostname(hostname, 255); gethostname(hostname, 255);
hostname[255] = 0; hostname[255] = 0;
TQCString instanceName = KCmdLineArgs::appName(); TQCString instanceName = TDECmdLineArgs::appName();
(*(uniqueFile.textStream())) << TQString::number(getpid()) << endl (*(uniqueFile.textStream())) << TQString::number(getpid()) << endl
<< instanceName << endl << instanceName << endl

@ -86,7 +86,7 @@ public:
void void
KUniqueApplication::addCmdLineOptions() KUniqueApplication::addCmdLineOptions()
{ {
KCmdLineArgs::addCmdLineOptions(kunique_options, 0, "kuniqueapp", "tde" ); TDECmdLineArgs::addCmdLineOptions(kunique_options, 0, "kuniqueapp", "tde" );
} }
bool bool
@ -99,12 +99,12 @@ KUniqueApplication::start()
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
s_nofork = true; s_nofork = true;
#else #else
KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kuniqueapp"); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("kuniqueapp");
s_nofork = !args->isSet("fork"); s_nofork = !args->isSet("fork");
delete args; delete args;
#endif #endif
TQCString appName = KCmdLineArgs::about->appName(); TQCString appName = TDECmdLineArgs::about->appName();
if (s_nofork) if (s_nofork)
{ {
@ -285,14 +285,14 @@ KUniqueApplication::start()
TQByteArray data, reply; TQByteArray data, reply;
TQDataStream ds(data, IO_WriteOnly); TQDataStream ds(data, IO_WriteOnly);
KCmdLineArgs::saveAppArgs(ds); TDECmdLineArgs::saveAppArgs(ds);
ds << new_asn_id; ds << new_asn_id;
dc->setPriorityCall(true); dc->setPriorityCall(true);
TQCString replyType; TQCString replyType;
if (!dc->call(appName, KCmdLineArgs::about->appName(), "newInstance()", data, replyType, reply)) if (!dc->call(appName, TDECmdLineArgs::about->appName(), "newInstance()", data, replyType, reply))
{ {
kdError() << "Communication problem with " << KCmdLineArgs::about->appName() << ", it probably crashed." << endl; kdError() << "Communication problem with " << TDECmdLineArgs::about->appName() << ", it probably crashed." << endl;
delete dc; // Clean up DCOP commmunication delete dc; // Clean up DCOP commmunication
::exit(255); ::exit(255);
} }
@ -316,7 +316,7 @@ KUniqueApplication::start()
KUniqueApplication::KUniqueApplication(bool allowStyles, bool GUIenabled, bool configUnique) KUniqueApplication::KUniqueApplication(bool allowStyles, bool GUIenabled, bool configUnique)
: KApplication( allowStyles, GUIenabled, initHack( configUnique )), : KApplication( allowStyles, GUIenabled, initHack( configUnique )),
DCOPObject(KCmdLineArgs::about->appName()) DCOPObject(TDECmdLineArgs::about->appName())
{ {
d = new KUniqueApplicationPrivate; d = new KUniqueApplicationPrivate;
d->processingRequest = false; d->processingRequest = false;
@ -332,7 +332,7 @@ KUniqueApplication::KUniqueApplication(bool allowStyles, bool GUIenabled, bool c
KUniqueApplication::KUniqueApplication(Display *display, Qt::HANDLE visual, KUniqueApplication::KUniqueApplication(Display *display, Qt::HANDLE visual,
Qt::HANDLE colormap, bool allowStyles, bool configUnique) Qt::HANDLE colormap, bool allowStyles, bool configUnique)
: KApplication( display, visual, colormap, allowStyles, initHack( configUnique )), : KApplication( display, visual, colormap, allowStyles, initHack( configUnique )),
DCOPObject(KCmdLineArgs::about->appName()) DCOPObject(TDECmdLineArgs::about->appName())
{ {
d = new KUniqueApplicationPrivate; d = new KUniqueApplicationPrivate;
d->processingRequest = false; d->processingRequest = false;
@ -353,7 +353,7 @@ KUniqueApplication::~KUniqueApplication()
// this gets called before even entering TQApplication::TQApplication() // this gets called before even entering TQApplication::TQApplication()
KInstance* KUniqueApplication::initHack( bool configUnique ) KInstance* KUniqueApplication::initHack( bool configUnique )
{ {
KInstance* inst = new KInstance( KCmdLineArgs::about ); KInstance* inst = new KInstance( TDECmdLineArgs::about );
if (configUnique) if (configUnique)
{ {
KConfigGroupSaver saver( inst->config(), "KDE" ); KConfigGroupSaver saver( inst->config(), "KDE" );
@ -433,7 +433,7 @@ KUniqueApplication::processDelayed()
if (request->fun == "newInstance()") { if (request->fun == "newInstance()") {
dcopClient()->setPriorityCall(false); dcopClient()->setPriorityCall(false);
TQDataStream ds(request->data, IO_ReadOnly); TQDataStream ds(request->data, IO_ReadOnly);
KCmdLineArgs::loadAppArgs(ds); TDECmdLineArgs::loadAppArgs(ds);
if( !ds.atEnd()) // backwards compatibility if( !ds.atEnd()) // backwards compatibility
{ {
TQCString asn_id; TQCString asn_id;

@ -39,7 +39,7 @@ class KUniqueApplicationPrivate;
* see kapplication.h * see kapplication.h
* *
* If your application is used to open files, it should also support the --tempfile * If your application is used to open files, it should also support the --tempfile
* option (see KCmdLineArgs::addTempFileOption()), to delete tempfiles after use. * option (see TDECmdLineArgs::addTempFileOption()), to delete tempfiles after use.
* Add X-TDE-HasTempFileOption=true to the .desktop file to indicate this. * Add X-TDE-HasTempFileOption=true to the .desktop file to indicate this.
* *
* @see KApplication DCOPObject * @see KApplication DCOPObject
@ -50,7 +50,7 @@ class TDECORE_EXPORT KUniqueApplication : public KApplication, public DCOPObject
Q_OBJECT Q_OBJECT
public: public:
/** /**
* Constructor. Takes command line arguments from KCmdLineArgs * Constructor. Takes command line arguments from TDECmdLineArgs
* *
* @param allowStyles Set to false to disable the loading on plugin based * @param allowStyles Set to false to disable the loading on plugin based
* styles. This is only useful to applications that do not display a GUI * styles. This is only useful to applications that do not display a GUI
@ -70,7 +70,7 @@ public:
#ifdef Q_WS_X11 #ifdef Q_WS_X11
/** /**
* Constructor. Takes command line arguments from KCmdLineArgs * Constructor. Takes command line arguments from TDECmdLineArgs
* *
* @param display Will be passed to Qt as the X display. The display * @param display Will be passed to Qt as the X display. The display
* must be valid and already opened. * must be valid and already opened.
@ -114,8 +114,8 @@ public:
* \code * \code
* int main(int argc, char **argv) { * int main(int argc, char **argv) {
* KAboutData about("myappname", "myAppName", .....); * KAboutData about("myappname", "myAppName", .....);
* KCmdLineArgs::init(argc, argv, &about); * TDECmdLineArgs::init(argc, argv, &about);
* KCmdLineArgs::addCmdLineOptions( myCmdOptions ); * TDECmdLineArgs::addCmdLineOptions( myCmdOptions );
* KUniqueApplication::addCmdLineOptions(); * KUniqueApplication::addCmdLineOptions();
* *
* if (!KUniqueApplication::start()) { * if (!KUniqueApplication::start()) {
@ -162,7 +162,7 @@ public:
* application asking for a new window to be created, possibly with * application asking for a new window to be created, possibly with
* some data already loaded based on the arguments received. * some data already loaded based on the arguments received.
* *
* Command line arguments have been passed to KCmdLineArgs before this * Command line arguments have been passed to TDECmdLineArgs before this
* function is called and can be checked in the usual way. * function is called and can be checked in the usual way.
* *
* The default implementation ensures the mainwindow of the already * The default implementation ensures the mainwindow of the already

@ -115,9 +115,9 @@ int main(int argc, char **argv)
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KAboutData about("tde-config", "tde-config", "1.0", description, KAboutData::License_GPL, "(C) 2000 Stephan Kulow"); KAboutData about("tde-config", "tde-config", "1.0", description, KAboutData::License_GPL, "(C) 2000 Stephan Kulow");
KCmdLineArgs::init( argc, argv, &about); TDECmdLineArgs::init( argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options ); // Add my own options. TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options.
KInstance a("tde-config"); KInstance a("tde-config");
a.setConfigReadOnly(TRUE); a.setConfigReadOnly(TRUE);
@ -125,7 +125,7 @@ int main(int argc, char **argv)
(void)KGlobal::config(); (void)KGlobal::config();
// Get application specific arguments // Get application specific arguments
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
_expandvars = args->isSet("expandvars"); _expandvars = args->isSet("expandvars");

@ -115,9 +115,9 @@ int main(int argc, char **argv)
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KAboutData about("tde-config", "tde-config", "1.0", description, KAboutData::License_GPL, "(C) 2000 Stephan Kulow"); KAboutData about("tde-config", "tde-config", "1.0", description, KAboutData::License_GPL, "(C) 2000 Stephan Kulow");
KCmdLineArgs::init( argc, argv, &about); TDECmdLineArgs::init( argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options ); // Add my own options. TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options.
KInstance a("tde-config"); KInstance a("tde-config");
a.setConfigReadOnly(TRUE); a.setConfigReadOnly(TRUE);
@ -125,7 +125,7 @@ int main(int argc, char **argv)
(void)KGlobal::config(); (void)KGlobal::config();
// Get application specific arguments // Get application specific arguments
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
_expandvars = args->isSet("expandvars"); _expandvars = args->isSet("expandvars");

@ -29,7 +29,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
KAboutData about("kapptest", "kapptest", "version"); KAboutData about("kapptest", "kapptest", "version");
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KApplication a; KApplication a;

@ -39,10 +39,10 @@ int main(int argc, char **argv) {
aboutData.addAuthor("Carlos Moro",0, "cfmoro@correo.uniovi.es"); aboutData.addAuthor("Carlos Moro",0, "cfmoro@correo.uniovi.es");
KCmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
KApplication app(false, false); KApplication app(false, false);

@ -25,16 +25,16 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
KLocale::setMainCatalogue("tdelibs"); KLocale::setMainCatalogue("tdelibs");
KCmdLineArgs::init( argc, argv, "testapp", description, version); TDECmdLineArgs::init( argc, argv, "testapp", description, version);
KCmdLineArgs::addCmdLineOptions( options ); // Add my own options. TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options.
// MyWidget::addCmdLineOptions(); // MyWidget::addCmdLineOptions();
KApplication k( false, false /*true, true*/ ); KApplication k( false, false /*true, true*/ );
// Get application specific arguments // Get application specific arguments
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
// Check if an option is set // Check if an option is set
if (args->isSet("test")) if (args->isSet("test"))
{ {
@ -79,7 +79,7 @@ main(int argc, char *argv[])
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
KCmdLineArgs::init( argc, argv, "testapp", description, version); TDECmdLineArgs::init( argc, argv, "testapp", description, version);
KApplication k( true, true ); KApplication k( true, true );

@ -54,7 +54,7 @@ void testkasciistricmp()
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init( argc, argv, "kglobaltest", 0, 0, 0, 0 ); TDECmdLineArgs::init( argc, argv, "kglobaltest", 0, 0, 0, 0 );
KApplication app( false, false ); KApplication app( false, false );
testkasciistricmp(); testkasciistricmp();

@ -51,7 +51,7 @@ protected:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KCmdLineArgs::init(argc, argv, ":", "", "", ""); TDECmdLineArgs::init(argc, argv, ":", "", "", "");
KApplication app(false,false); KApplication app(false,false);
TQString s, s2; TQString s, s2;

@ -334,9 +334,9 @@ int main (int argc, char *argv[])
KCmdLineLastOption KCmdLineLastOption
}; };
KCmdLineArgs::init( argc, argv, "kmdcodectest", description, version ); TDECmdLineArgs::init( argc, argv, "kmdcodectest", description, version );
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
int count = args->count(); int count = args->count();
KApplication app; KApplication app;

@ -411,7 +411,7 @@ int TestApp::newInstance(TQValueList<TQCString> /*params*/)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
KAboutData about("socktest2", "SockTest", "1.0"); KAboutData about("socktest2", "SockTest", "1.0");
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KUniqueApplication::addCmdLineOptions(); KUniqueApplication::addCmdLineOptions();
/* TestApp a; /* TestApp a;

@ -58,7 +58,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
KAboutData about("socktest", "SockTest", "version"); KAboutData about("socktest", "SockTest", "version");
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KApplication::addCmdLineOptions(); KApplication::addCmdLineOptions();
KApplication app; KApplication app;

@ -44,7 +44,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
KAboutData about("kuniqueapptest", "kuniqueapptest", "version"); KAboutData about("kuniqueapptest", "kuniqueapptest", "version");
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KUniqueApplication::addCmdLineOptions(); KUniqueApplication::addCmdLineOptions();
if (!TestApp::start()) if (!TestApp::start())

@ -82,7 +82,7 @@ void testAdjustPath()
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init( argc, argv, "kurltest", 0, 0, 0, 0 ); TDECmdLineArgs::init( argc, argv, "kurltest", 0, 0, 0, 0 );
KApplication app( false, false ); KApplication app( false, false );
KURL::List lst; KURL::List lst;

@ -28,7 +28,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
KAboutData about("kapptest", "kapptest", "version"); KAboutData about("kapptest", "kapptest", "version");
KCmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::init(argc, argv, &about);
KApplication a; KApplication a;

@ -1,5 +1,5 @@
/* /*
testqtargs -- is there really a bug in KCmdLineArgs or am I on crack? testqtargs -- is there really a bug in TDECmdLineArgs or am I on crack?
I used the following compile options: I used the following compile options:
@ -64,10 +64,10 @@ int main(int argc, char *argv[])
"1.0", I18N_NOOP("testqtargs"), KAboutData::License_GPL, "1.0", I18N_NOOP("testqtargs"), KAboutData::License_GPL,
"", "", "", ""); "", "", "", "");
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *qtargs = KCmdLineArgs::parsedArgs("qt"); TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt");
for (int i = 0; i < qtargs->count(); i++) for (int i = 0; i < qtargs->count(); i++)
{ {
tqDebug("qt arg[%d] = %s", i, qtargs->arg(i)); tqDebug("qt arg[%d] = %s", i, qtargs->arg(i));
@ -75,8 +75,8 @@ int main(int argc, char *argv[])
KApplication app; KApplication app;
KCmdLineArgs *kdeargs = KCmdLineArgs::parsedArgs("tde"); TDECmdLineArgs *kdeargs = TDECmdLineArgs::parsedArgs("tde");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
// An arg set by Qt // An arg set by Qt
if(qtargs->isSet("background")) if(qtargs->isSet("background"))

@ -538,7 +538,7 @@ int main_console(int argc, char **argv)
printf("Searching for standard icon for name %s in the following directories:\n\r", argv[PARAM_ICON_NAME]); printf("Searching for standard icon for name %s in the following directories:\n\r", argv[PARAM_ICON_NAME]);
KApplication::disableAutoDcopRegistration(); KApplication::disableAutoDcopRegistration();
KAboutData aboutd("tdelfeditor", "tdelfeditor", "0.0.1"); KAboutData aboutd("tdelfeditor", "tdelfeditor", "0.0.1");
KCmdLineArgs::init(&aboutd); TDECmdLineArgs::init(&aboutd);
KApplication app(false, false); KApplication app(false, false);
TQStringList rds = KGlobal::dirs()->resourceDirs("icon"); TQStringList rds = KGlobal::dirs()->resourceDirs("icon");

@ -32,12 +32,12 @@ static KCmdLineOptions options[] =
extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
{ {
KCmdLineArgs::init(argc,argv,"cupsdconf", TDECmdLineArgs::init(argc,argv,"cupsdconf",
I18N_NOOP("A CUPS configuration tool"), I18N_NOOP("A CUPS configuration tool"),
I18N_NOOP("A CUPS configuration tool"),"0.0.1"); I18N_NOOP("A CUPS configuration tool"),"0.0.1");
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
KURL configfile; KURL configfile;
if (args->count() > 0) if (args->count() > 0)

@ -14,15 +14,15 @@ static KCmdLineOptions options[] =
extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
{ {
KCmdLineArgs::init(argc, argv, "kaddprinterwizard", TDECmdLineArgs::init(argc, argv, "kaddprinterwizard",
I18N_NOOP("Start the add printer wizard"), I18N_NOOP("Start the add printer wizard"),
"0.1"); "0.1");
KCmdLineArgs::addCmdLineOptions(options); TDECmdLineArgs::addCmdLineOptions(options);
KGlobal::locale()->setMainCatalogue("tdelibs"); KGlobal::locale()->setMainCatalogue("tdelibs");
KApplication app; KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
bool doConfig = args->isSet("tdeconfig"); bool doConfig = args->isSet("tdeconfig");
bool doSrvConfig = args->isSet("serverconfig"); bool doSrvConfig = args->isSet("serverconfig");

@ -35,7 +35,7 @@ class KBugReportPrivate;
* (program name, version, bug-report address, etc.) * (program name, version, bug-report address, etc.)
* comes from the KAboutData class. * comes from the KAboutData class.
* Make sure you create an instance of KAboutData and pass it * Make sure you create an instance of KAboutData and pass it
* to KCmdLineArgs. * to TDECmdLineArgs.
* *
* @author David Faure <faure@kde.org> * @author David Faure <faure@kde.org>
*/ */

@ -185,7 +185,7 @@ void KDETrayProxy::withdrawWindow( Window w )
#include <kcmdlineargs.h> #include <kcmdlineargs.h>
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
{ {
KCmdLineArgs::init( argc, argv, "a", "b", "c", "d" ); TDECmdLineArgs::init( argc, argv, "a", "b", "c", "d" );
KApplication app( false ); // no styles KApplication app( false ); // no styles
app.disableSessionManagement(); app.disableSessionManagement();
KDETrayProxy proxy; KDETrayProxy proxy;

@ -119,7 +119,7 @@ void KLineEditTest::slotHide()
int main ( int argc, char **argv) int main ( int argc, char **argv)
{ {
KAboutData aboutData( "klineedittest", "klineedittest", "1.0" ); KAboutData aboutData( "klineedittest", "klineedittest", "1.0" );
KCmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::init(argc, argv, &aboutData);
KApplication::addCmdLineOptions(); KApplication::addCmdLineOptions();
KApplication a; KApplication a;

@ -13,11 +13,11 @@ static const KCmdLineOptions options[] =
int main(int argc, char**argv) int main(int argc, char**argv)
{ {
KCmdLineArgs::init(argc, argv, "test", "test" ,"test" ,"1.0"); TDECmdLineArgs::init(argc, argv, "test", "test" ,"test" ,"1.0");
KCmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions( options );
KApplication app("test"); KApplication app("test");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
if (args->count()!=1) if (args->count()!=1)
{ {
std::cout << "Usage: kpixmapregionselectordialogtest <imageFile>" << std::endl; std::cout << "Usage: kpixmapregionselectordialogtest <imageFile>" << std::endl;

@ -354,7 +354,7 @@ void Test::toggleLabels(bool state)
int main(int argc, char** argv ) int main(int argc, char** argv )
{ {
KCmdLineArgs::init(argc, argv, "ktabwidgettest", "ktabwidget test app", "1.0"); TDECmdLineArgs::init(argc, argv, "ktabwidgettest", "ktabwidget test app", "1.0");
KApplication app(argc, argv); KApplication app(argc, argv);
Test *t = new Test(); Test *t = new Test();

@ -502,7 +502,7 @@ void testWindow::slotMakeItem3Current()
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
int i; int i;
KCmdLineArgs::init(argc, argv, "KWindowTest", "description", "version"); TDECmdLineArgs::init(argc, argv, "KWindowTest", "description", "version");
KApplication *myApp = new KApplication(); KApplication *myApp = new KApplication();
testWindow *test = new testWindow; testWindow *test = new testWindow;

Loading…
Cancel
Save