Do not add arguments that Qt may not understand. I missed that we don't

actually require current qt-copy (which is more or less 4.5) in trunk.
Quick & dirty runtime Qt version detection copied from Thiago's code in
kcmdlineargs.cpp.

svn path=/trunk/KDE/kdebase/workspace/; revision=926646
This commit is contained in:
Andreas Hartmetz 2009-02-15 22:06:09 +00:00
parent e63cc90102
commit c7092239e5

View file

@ -474,9 +474,16 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
aboutData.addAuthor( ki18n( "Daniel M. Duley" ),KLocalizedString(), "mosfet@kde.org" ); aboutData.addAuthor( ki18n( "Daniel M. Duley" ),KLocalizedString(), "mosfet@kde.org" );
aboutData.addAuthor( ki18n( "Luboš Luňák" ), ki18n( "Maintainer" ), "l.lunak@kde.org" ); aboutData.addAuthor( ki18n( "Luboš Luňák" ), ki18n( "Maintainer" ), "l.lunak@kde.org" );
int myargc = argc;
char **myargv = argv;
#if QT_VERSION >= 0x040a00
# error Qt version larger than 4.9, please fix me
#endif
if (qVersion()[2] >= '5')
{
// HACK: append "--graphicssystem native" to argument list to force KWin to use this backend // HACK: append "--graphicssystem native" to argument list to force KWin to use this backend
int myargc = argc + 2; myargc = argc + 2;
char **myargv = (char **)malloc( ( myargc + 1 ) * sizeof(char *) ); myargv = (char **)malloc( ( myargc + 1 ) * sizeof(char *) );
for ( int i = 0; i < argc; i++ ) for ( int i = 0; i < argc; i++ )
{ {
myargv[i] = argv[i]; myargv[i] = argv[i];
@ -484,6 +491,7 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
myargv[ argc ] = "--graphicssystem"; myargv[ argc ] = "--graphicssystem";
myargv[ argc + 1 ] = "native"; myargv[ argc + 1 ] = "native";
myargv[ argc + 2 ] = 0; myargv[ argc + 2 ] = 0;
}
KCmdLineArgs::init( myargc, myargv, &aboutData ); KCmdLineArgs::init( myargc, myargv, &aboutData );