From f0e2ddcdf09a0850b550a803574797706d546fdf Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 21 Oct 2014 22:57:05 +0200 Subject: [PATCH] Use constant c-style array instead of fancy Qt data structures --- src/libtomahawk/audio/AudioOutput.cpp | 41 +++++++++++---------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/src/libtomahawk/audio/AudioOutput.cpp b/src/libtomahawk/audio/AudioOutput.cpp index 9d93b4084..8d3d2df4d 100644 --- a/src/libtomahawk/audio/AudioOutput.cpp +++ b/src/libtomahawk/audio/AudioOutput.cpp @@ -72,33 +72,24 @@ AudioOutput::AudioOutput( QObject* parent ) qRegisterMetaType("AudioOutput::AudioState"); - QList args; - - args << "--ignore-config"; - args << "--extraintf=logger"; - if ( qApp->arguments().contains( "--verbose" ) ) { - args << "--verbose=3"; - } -/* - args << "--no-plugins-cache"; - args << "--no-media-library"; - args << "--no-osd"; - args << "--no-stats"; - args << "--no-video-title-show"; - args << "--no-snapshot-preview"; - args << "--services-discovery=''"; -*/ - args << "--no-video"; - args << "--no-xlib"; - - QVarLengthArray< const char * , 64 > vlcArgs( args.size() ); - for ( int i = 0 ; i < args.size() ; ++i ) { - vlcArgs[i] = args.at( i ).constData(); - tDebug() << args.at( i ); - } + const char* vlcArgs[] = { + "--ignore-config", + "--extraintf=logger", + qApp->arguments().contains( "--verbose" ) ? "--verbose=3" : "", + // "--no-plugins-cache", + // "--no-media-library", + // "--no-osd", + // "--no-stats", + // "--no-video-title-show", + // "--no-snapshot-preview", + // "--services-discovery=''", + "--no-video", + "--no-xlib" + }; // Create and initialize a libvlc instance (it should be done only once) - if ( !( vlcInstance = libvlc_new( vlcArgs.size(), vlcArgs.constData() ) ) ) { + vlcInstance = libvlc_new( sizeof(vlcArgs) / sizeof(*vlcArgs), vlcArgs ); + if ( !vlcInstance ) { tDebug() << "libVLC: could not initialize"; }