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:
parent
e63cc90102
commit
c7092239e5
1 changed files with 16 additions and 8 deletions
24
main.cpp
24
main.cpp
|
@ -474,16 +474,24 @@ 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" );
|
||||||
|
|
||||||
// HACK: append "--graphicssystem native" to argument list to force KWin to use this backend
|
int myargc = argc;
|
||||||
int myargc = argc + 2;
|
char **myargv = argv;
|
||||||
char **myargv = (char **)malloc( ( myargc + 1 ) * sizeof(char *) );
|
#if QT_VERSION >= 0x040a00
|
||||||
for ( int i = 0; i < argc; i++ )
|
# error Qt version larger than 4.9, please fix me
|
||||||
|
#endif
|
||||||
|
if (qVersion()[2] >= '5')
|
||||||
{
|
{
|
||||||
myargv[i] = argv[i];
|
// HACK: append "--graphicssystem native" to argument list to force KWin to use this backend
|
||||||
|
myargc = argc + 2;
|
||||||
|
myargv = (char **)malloc( ( myargc + 1 ) * sizeof(char *) );
|
||||||
|
for ( int i = 0; i < argc; i++ )
|
||||||
|
{
|
||||||
|
myargv[i] = argv[i];
|
||||||
|
}
|
||||||
|
myargv[ argc ] = "--graphicssystem";
|
||||||
|
myargv[ argc + 1 ] = "native";
|
||||||
|
myargv[ argc + 2 ] = 0;
|
||||||
}
|
}
|
||||||
myargv[ argc ] = "--graphicssystem";
|
|
||||||
myargv[ argc + 1 ] = "native";
|
|
||||||
myargv[ argc + 2 ] = 0;
|
|
||||||
|
|
||||||
KCmdLineArgs::init( myargc, myargv, &aboutData );
|
KCmdLineArgs::init( myargc, myargv, &aboutData );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue