KDECore
kcmdlineargs.cpp
Go to the documentation of this file.
278 qt_options.add("session <sessionId>", ki18n("Restore the application for the given 'sessionId'"));
279 qt_options.add("cmap", ki18n("Causes the application to install a private color\nmap on an 8-bit display"));
280 qt_options.add("ncols <count>", ki18n("Limits the number of colors allocated in the color\ncube on an 8-bit display, if the application is\nusing the QApplication::ManyColor color\nspecification"));
282 qt_options.add("dograb", ki18n("running under a debugger can cause an implicit\n-nograb, use -dograb to override"));
287 qt_options.add("background <color>", ki18n("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)"));
296 qt_options.add("visual TrueColor", ki18n("forces the application to use a TrueColor visual on\nan 8-bit display"));
297 qt_options.add("inputstyle <inputstyle>", ki18n("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"));
305 qt_options.add("stylesheet <file.qss>", ki18n("applies the Qt stylesheet to the application widgets"));
306 qt_options.add("graphicssystem <system>", ki18n("use a different graphics system instead of the default one, options are raster and opengl (experimental)"));
307 qt_options.add("qmljsdebugger <port>", ki18n("QML JS debugger information. Application must be\nbuilt with -DQT_DECLARATIVE_DEBUG for the debugger to be\nenabled"));
317 kde_options.add("geometry <geometry>", ki18n("sets the client geometry of the main widget - see man X for the argument format (usually WidthxHeight+XPos+YPos)"));
319 kde_options.add("smkey <sessionKey>"); // this option is obsolete and exists only to allow smooth upgrades from sessions
338 KCmdLineArgsPrivate(const KCmdLineOptions &_options, const KLocalizedString &_name, const QByteArray &_id)
474 s->mCwd = QDir::currentPath().toLocal8Bit(); //currentPath() uses fromLocal8Bit internally apparently
824 KCmdLineArgs::usageError( i18nc("@info:shell %1 is cmdoption name","'%1' missing.", QString::fromLocal8Bit(opt_name)));
888 s->printQ(i18nc("@info:shell message on appcmd --version; do not translate 'Development Platform'"
915 s->printQ( i18nc("the 2nd argument is a list of name+address, one on each line","%1 was written by\n%2", QString(s->about->programName()) , authorlist ) );
924 if (s->about->bugAddress().isEmpty() || s->about->bugAddress() == QLatin1String("submit@bugs.kde.org") )
964 KCmdLineArgs::usageError(i18n("Unexpected argument '%1'.", KuitSemantics::escape(s->decodeInput(s->all_argv[i]))));
1139 s->printQ(i18n("Usage: %1 %2\n", QString::fromLocal8Bit(s->appName), KuitSemantics::escape(usage)));
1159 s->printQ(optionFormatString.arg(QString::fromLatin1("--help-all"),-25).arg(i18n("Show all options")));
1160 s->printQ(optionFormatString.arg(QString::fromLatin1("--author"),-25).arg(i18n("Show author information")));
1161 s->printQ(optionFormatString.arg(QString::fromLatin1("-v, --version"),-25).arg(i18n("Show version information")));
1162 s->printQ(optionFormatString.arg(QString::fromLatin1("--license"),-25).arg(i18n("Show license information")));
1606 tmpopt.add( "tempfile", ki18n("The files/URLs opened by the application will be deleted after use") );
QString i18n(const char *text)
Returns a localized version of a string.
Definition: klocalizedstring.h:630
static void addCmdLineOptions(const KCmdLineOptions &options, const KLocalizedString &name=KLocalizedString(), const QByteArray &id=QByteArray(), const QByteArray &afterId=QByteArray())
Add options to your application.
Definition: kcmdlineargs.cpp:503
static QStringList allArguments()
Returns the list of command-line arguments.
Definition: kcmdlineargs.cpp:1616
QString & append(QChar ch)
void clear()
QStringList getOptionList(const QByteArray &option) const
Read out all occurrences of a string option.
Definition: kcmdlineargs.cpp:1469
static int & qtArgc()
Returns the number of arguments returned by qtArgv()
Definition: kcmdlineargs.cpp:977
QString fromNativeSeparators(const QString &pathName)
KCmdLineOptions & add(const QByteArray &name, const KLocalizedString &description=KLocalizedString(), const QByteArray &defaultValue=QByteArray())
Add command line option, by providing its name, description, and possibly a default value...
Definition: kcmdlineargs.cpp:142
char at(int i) const
static const KAboutData * aboutData()
Returns the KAboutData for consumption by KComponentData.
Definition: kcmdlineargs.cpp:1060
static QString escape(const QString &text)
Convert &, ", ', <, > characters into XML entities &, <, >, ', ", respectively.
Definition: kuitsemantics.cpp:1633
KLocalizedString ki18n(const char *msg)
Creates localized string from a given message.
Definition: klocalizedstring.cpp:924
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
Access parsed arguments.
Definition: kcmdlineargs.cpp:611
#define K_GLOBAL_STATIC(TYPE, NAME)
This macro makes it easy to use non-POD types as global statics.
Definition: kglobal.h:221
int count() const
static QString cwd()
Get the CWD (Current Working Directory) associated with the current command line arguments.
Definition: kcmdlineargs.cpp:478
void chop(int n)
void cleanPath(const CleanPathOption &options=SimplifyDirSeparators)
Resolves "." and ".." components in path.
Definition: kurl.cpp:759
bool isEmpty() const
bool startsWith(const QByteArray &ba) const
iterator erase(iterator pos)
int length() const
QString currentPath()
static char ** qtArgv()
Returns command line options for consumption by Qt after parsing them in a way that is consistent wit...
Definition: kcmdlineargs.cpp:1011
#define KDE_VERSION_STRING
Version of KDE as string, at compile time.
Definition: kdeversion.h.cmake:47
QChar separator()
static void usageError(const QString &error)
Print an error to stderr and the usage help to stdout and exit.
Definition: kcmdlineargs.cpp:1080
QTextCodec * codecForLocale()
bool isSet(const QByteArray &option) const
Read out a boolean option or check for the presence of string option.
Definition: kcmdlineargs.cpp:1496
QString i18nc(const char *ctxt, const char *text)
Returns a localized version of a string and a context.
Definition: klocalizedstring.h:797
int count() const
Read the number of arguments that aren't options (but, for example, filenames).
Definition: kcmdlineargs.cpp:1546
KCmdLineArgs(const KCmdLineOptions &_options, const KLocalizedString &_name, const QByteArray &_id)
Constructor.
Definition: kcmdlineargs.cpp:1311
static void loadAppArgs(QDataStream &)
Load arguments from a stream.
Definition: kcmdlineargs.cpp:560
int indexOf(char ch, int from) const
const KSharedConfig::Ptr & config() const
Returns the general config object ("appnamerc").
Definition: kcomponentdata.cpp:201
QString fromLocal8Bit(const char *str, int size)
void append(const T &value)
QString fromUtf8(const char *str, int size)
Definition: ksycocafactory.h:28
bool isEmpty() const
Definition: kcmdlineargs.h:293
bool isEmpty() const
Definition: kcmdlineargs.h:290
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
typedef Iterator
static void usage(const QByteArray &id=QByteArray())
Print the usage help to stdout and exit.
Definition: kcmdlineargs.cpp:1095
T & first()
Definition: kaboutdata.h:33
Definition: kcmdlineargs.h:291
QByteArray mid(int pos, int len) const
bool atEnd() const
iterator end()
QByteArray toLocal8Bit() const
bool exists() const
char toLatin1() const
static void setCwd(const QByteArray &cwd)
Made public for apps that don't use KCmdLineArgs To be done before makeURL, to set the current workin...
Definition: kcmdlineargs.cpp:1329
QByteArray left(int len) const
bool isRelative() const
T takeFirst()
bool contains(char ch) const
static void init(int argc, char **argv, const QByteArray &appname, const QByteArray &catalog, const KLocalizedString &programName, const QByteArray &version, const KLocalizedString &description=KLocalizedString(), StdCmdLineArgs stdargs=StdCmdLineArgs(CmdLineArgQt|CmdLineArgKDE))
Initialize class.
Definition: kcmdlineargs.cpp:418
char * data()
QString fromLatin1(const char *str, int size)
QString getOption(const QByteArray &option) const
Read out a string option.
Definition: kcmdlineargs.cpp:1438
void prepend(const T &value)
static void addStdCmdLineOptions(StdCmdLineArgs stdargs=StdCmdLineArgs(CmdLineArgQt|CmdLineArgKDE))
add standard Qt/KDE command-line args
Definition: kcmdlineargs.cpp:492
iterator begin()
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
Class for producing and handling localized messages.
Definition: klocalizedstring.h:299
iterator begin()
bool endsWith(const QByteArray &ba) const
static void enable_i18n()
Enable i18n to be able to print a translated error message.
Definition: kcmdlineargs.cpp:1066
KCmdLineOptions & operator=(const KCmdLineOptions &options)
Assignment operator.
Definition: kcmdlineargs.cpp:134
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.