[vlmc-devel] commit: guimain.cpp: Search for project token and then only load project file. (Rohit Yadav )

git at videolan.org git at videolan.org
Mon Oct 4 16:16:54 CEST 2010


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Mon Oct  4 20:02:10 2010 +0530| [7631314602714a760af5fdf1349a39c84ae687c5] | committer: Rohit Yadav 

guimain.cpp: Search for project token and then only load project file.
This matches the docs provided in man page for VLMC.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=7631314602714a760af5fdf1349a39c84ae687c5
---

 src/Main/guimain.cpp |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/Main/guimain.cpp b/src/Main/guimain.cpp
index 9459110..bba9aaf 100644
--- a/src/Main/guimain.cpp
+++ b/src/Main/guimain.cpp
@@ -115,8 +115,19 @@ VLMCmain( int argc, char **argv )
     d.exec();
 #endif
     MainWindow w;
-    if ( argc > 1 )
-        GUIProjectManager::getInstance()->loadProject( argv[argc - 1] );
+
+    /* Check for project file */
+    for ( int i = 1; i < argc; i++ )
+    {
+        QString arg = argv[i];
+
+        if ( argc > ( i + 1 ) && ( arg == "--project" || arg == "-p" ) )
+        {
+            GUIProjectManager::getInstance()->loadProject( argv[i+1] );
+            break;
+        }
+    }
+
     w.show();
     return app.exec();
 }



More information about the Vlmc-devel mailing list