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
12
main.cpp
12
main.cpp
|
@ -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( "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
|
||||
int myargc = argc + 2;
|
||||
char **myargv = (char **)malloc( ( myargc + 1 ) * sizeof(char *) );
|
||||
myargc = argc + 2;
|
||||
myargv = (char **)malloc( ( myargc + 1 ) * sizeof(char *) );
|
||||
for ( int i = 0; i < argc; i++ )
|
||||
{
|
||||
myargv[i] = argv[i];
|
||||
|
@ -484,6 +491,7 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
|
|||
myargv[ argc ] = "--graphicssystem";
|
||||
myargv[ argc + 1 ] = "native";
|
||||
myargv[ argc + 2 ] = 0;
|
||||
}
|
||||
|
||||
KCmdLineArgs::init( myargc, myargv, &aboutData );
|
||||
|
||||
|
|
Loading…
Reference in a new issue