From f07287c7714850e713d4aa5f42ca3000bb3d6edf Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 2 Sep 2014 11:21:11 +0200 Subject: [PATCH] Added support for profile command line option --- src/core/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index e3416cbd3..5cb923b55 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -95,7 +95,7 @@ int main( int argc, char * * argv ) bool core_only = false; bool fullscreen = true; bool exit_after_import = false; - QString file_to_load, file_to_save, file_to_import, render_out; + QString file_to_load, file_to_save, file_to_import, render_out, profilerOutputFile; for( int i = 1; i < argc; ++i ) { @@ -341,6 +341,11 @@ int main( int argc, char * * argv ) exit_after_import = true; } } + else if( argc > i && ( QString( argv[i] ) == "--profile" || QString( argv[i] ) == "-p" ) ) + { + profilerOutputFile = argv[i+1]; + ++i; + } else { if( argv[i][0] == '-' ) @@ -496,6 +501,11 @@ int main( int argc, char * * argv ) SLOT( updateConsoleProgress() ) ); t->start( 200 ); + if( profilerOutputFile.isEmpty() == false ) + { + engine::mixer()->profiler().setOutputFile( profilerOutputFile ); + } + // start now! r->startProcessing(); }