From 0c4f091e74a5c6d1e0b5f4cf47670bd1c3e1e3e6 Mon Sep 17 00:00:00 2001 From: Gökçen Eraslan Date: Tue, 12 Jan 2016 21:38:22 +0100 Subject: Port Quackle to Qt 5.5 --- quackleio/froggetopt.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'quackleio/froggetopt.cpp') diff --git a/quackleio/froggetopt.cpp b/quackleio/froggetopt.cpp index 68f20fe..24d9d2c 100644 --- a/quackleio/froggetopt.cpp +++ b/quackleio/froggetopt.cpp @@ -130,7 +130,7 @@ GetOpt::GetOpt() if ( !QCoreApplication::instance() ) qFatal( "GetOpt: requires a QApplication instance to be constructed first" ); - init( QCoreApplication::instance()->argc(), QCoreApplication::instance()->argv(), 1 ); + init( QCoreApplication::instance()->arguments(), 1 ); } /** @@ -141,7 +141,7 @@ GetOpt::GetOpt( int offset ) if ( !QCoreApplication::instance() ) qFatal( "GetOpt: requires a QApplication instance to be constructed first" ); - init( QCoreApplication::instance()->argc(), QCoreApplication::instance()->argv(), offset ); + init( QCoreApplication::instance()->arguments(), offset ); } /** @@ -178,6 +178,12 @@ GetOpt::GetOpt( int argc, char *argv[] ) init( 0, 0 ); } +void GetOpt::init( const QStringList &argv, int offset ) +{ + for ( int i = offset; i < argv.size(); ++i ) + args.append( argv[i] ); +} + /** \internal */ -- cgit v1.2.3