kdecore: remove arguments Katie no longer supports

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-06-01 23:53:18 +03:00
parent c6a355ed34
commit b958f050d4
2 changed files with 4 additions and 58 deletions

View file

@ -275,15 +275,6 @@ KCmdLineArgsStatic::KCmdLineArgsStatic () {
qt_options.add("nograb", ki18n("tells Katie to never grab the mouse or the keyboard"));
qt_options.add("dograb", ki18n("running under a debugger can cause an implicit\n-nograb, use -dograb to override"));
qt_options.add("sync", ki18n("switches to synchronous mode for debugging"));
qt_options.add("fn");
qt_options.add("font <fontname>", ki18n("defines the application font"));
qt_options.add("bg");
qt_options.add("background <color>", ki18n("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)"));
qt_options.add("fg");
qt_options.add("foreground <color>", ki18n("sets the default foreground color"));
qt_options.add("btn");
qt_options.add("button <color>", ki18n("sets the default button color"));
qt_options.add("name <name>", ki18n("sets the application name"));
qt_options.add("title <title>", ki18n("sets the application title (caption)"));
#ifdef Q_WS_X11
qt_options.add("visual TrueColor", ki18n("forces the application to use a TrueColor visual on\nan 8-bit display"));

View file

@ -1,48 +1,3 @@
/*
testqtargs -- is there really a bug in KCmdLineArgs or am I on crack?
I used the following compile options:
g++ -g -Wall -o testqtargs testqtargs.cpp -I/usr/X11R6/include \
-I/opt/qt3/include -I/opt/kde3/include -L/usr/X11R6/lib -L/opt/qt3/lib \
-L/opt/kde3/lib -lqt -lkdecore
if invoked like this ./testqtargs --bg blue --caption something --hello hi
The program should list argv[] then produce output like this:
qt arg[0] = background
qt arg[1] = blue
arg bg = blue
arg caption = something
arg hello = hi
Instead for me it prints:
qt arg[0] = -background
qt arg[1] = blue
arg caption = something
arg hello = hi
See the extra dash in qt arg[0]? I believe that is the cause of the problem.
--bg is aliased to --background but If you try it with --background or
-background, you get the same thing.
in kdecore/kapplication.cpp, KCmdLineOption qt_options is defined and used
by the static method Kapplication::addCmdLineOptions to add the Qt options
but its' entries look like this:
{ "background <color>", I18N_NOOP("sets the default background color and an\n
application palette (light and dark shades are\ncalculated)."), 0},
it looks for "background" instead of "-background" so never find the arg.
Software: g++ 2.95, kdelibs from CVS Jan 28, Qt 3.01
OS: Debian GNU/Linux 3.0 (sid)
*/
#include <QtGui/QWidget>
#include <kapplication.h>
#include <kcmdlineargs.h>
@ -75,10 +30,10 @@ int main(int argc, char *argv[])
KCmdLineArgs *kdeargs = KCmdLineArgs::parsedArgs("kde");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
// An arg set by Qt
if(qtargs->isSet("background"))
// An arg set by Katie
if(qtargs->isSet("stylesheet"))
{
qDebug("arg bg = %s", qtargs->getOption("background").toLocal8Bit().data());
qDebug("arg stylesheet = %s", qtargs->getOption("stylesheet").toLocal8Bit().data());
}
// An arg set by KDE
if(kdeargs->isSet("caption"))