本文整理汇总了C++中KCmdLineArgs::makeURL方法的典型用法代码示例。如果您正苦于以下问题:C++ KCmdLineArgs::makeURL方法的具体用法?C++ KCmdLineArgs::makeURL怎么用?C++ KCmdLineArgs::makeURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KCmdLineArgs
的用法示例。
在下文中一共展示了KCmdLineArgs::makeURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]) {
KAboutData aboutData( "rkward", I18N_NOOP ("RKWard"), version, description, KAboutData::License_GPL, "(c) 2002, 2004, 2005, 2006", 0, "http://rkward.sf.net", "[email protected]");
aboutData.addAuthor ("Thomas Friedrichsmeier", I18N_NOOP ("Project leader / main developer"), 0);
aboutData.addAuthor ("Pierre Ecochard", I18N_NOOP ("C++ coder since 0.2.9"), 0);
aboutData.addCredit ("Contributors in alphabetical order", 0, 0);
aboutData.addCredit ("Philippe Grosjean", I18N_NOOP ("Several helpful comments and discussions"), 0);
aboutData.addCredit ("Adrien d'Hardemare", I18N_NOOP ("Plugins and patches"), 0);
aboutData.addCredit ("Yves Jacolin", I18N_NOOP ("New website"), 0);
aboutData.addCredit ("Prasenjit Kapat", I18N_NOOP ("Several plugins"), 0);
aboutData.addCredit ("Marco Martin", I18N_NOOP ("A cool icon"), 0);
aboutData.addCredit ("Daniele Medri", I18N_NOOP ("RKWard logo, many suggestions, help on wording"), 0);
aboutData.addCredit ("Stefan Roediger", I18N_NOOP ("Many plugins, suggestions, marketing, translations"), 0);
aboutData.addCredit ("David Sibai", I18N_NOOP ("Several valuable comments, hints and patches"), 0);
aboutData.addCredit ("Ilias Soumpasis", I18N_NOOP ("Translation, Suggestions, plugins"), 0);
aboutData.addCredit ("Ralf Tautenhahn", I18N_NOOP ("Many comments, useful suggestions, and bug reports"), 0);
aboutData.addCredit ("Roland Vollgraf", I18N_NOOP ("Some patches"), 0);
aboutData.addCredit (I18N_NOOP ("Many more people on [email protected]"), I18N_NOOP ("Sorry, if we forgot to list you. Please contact us to get added"), 0);
// before initializing the commandline args, remove the ".bin" from "rkward.bin".
// This is so it prints "Usage rkward..." instead of "Usage rkward.bin...", etc.
// it seems safest to keep a copy, since the shell still owns argv[0]
char *argv_zero_copy = argv[0];
argv[0] = qstrdup (QString (argv_zero_copy).remove (".bin").local8Bit ());
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
RKWardApplication app;
if (app.isRestored ()) {
RESTORE(RKWardMainWindow); // well, whatever this is supposed to do -> TODO
} else {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
RK_Debug_Level = 5 - QString (args->getOption ("debug-level")).toInt ();
RK_Debug_Flags = QString (args->getOption ("debug-flags")).toInt (0, 2);
qDebug ("Debug-flags as decimal: %d", RK_Debug_Flags);
KURL *open_url = 0;
if (args->count ()) {
open_url = new KURL (args->makeURL (args->arg (0)));
}
args->clear();
new RKWardMainWindow(open_url);
}
// do it!
int status = app.exec ();
// restore old argv[0] so the shell is happy
argv[0] = argv_zero_copy;
return status;
}