]> git.sur5r.net Git - minitube/commitdiff
CLI support
authorFlavio <flavio@odisseo.local>
Wed, 2 Feb 2011 14:47:48 +0000 (15:47 +0100)
committerFlavio <flavio@odisseo.local>
Wed, 2 Feb 2011 14:47:48 +0000 (15:47 +0100)
src/MainWindow.h
src/main.cpp

index 5034df8afb8dc1c18e249ddece89e6b26f054ccd..ec872e0d9633b683277e799939f517029626080a 100644 (file)
@@ -23,6 +23,9 @@ public:
     ~MainWindow();
     Phonon::SeekSlider* getSeekSlider() { return seekSlider; }
 
+public slots:
+    void showMedia(SearchParams *params);
+
 protected:
     void closeEvent(QCloseEvent *);
     bool eventFilter(QObject *obj, QEvent *event);
@@ -31,7 +34,6 @@ private slots:
     void fadeInWidget(QWidget *oldWidget, QWidget *newWidget);
     void goBack();
     void showSearch();
-    void showMedia(SearchParams *params);
     void visitSite();
     void donate();
     void about();
index 6f0385fd91031d10ce64552776b250fbcee3afa3..e560d0f2b9bf3b38bd0d3d336ad6202beb7e5f57 100644 (file)
@@ -2,6 +2,7 @@
 #include <qtsingleapplication.h>
 #include "constants.h"
 #include "MainWindow.h"
+#include "searchparams.h"
 #ifdef APP_MAC
 // #include "local/mac/mac_startup.h"
 #endif
@@ -84,5 +85,12 @@ int main(int argc, char **argv) {
     // all string literals are UTF-8
     QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 
+    if (app.arguments().size() > 1) {
+        QString query = app.arguments().at(1);
+        SearchParams *searchParams = new SearchParams();
+        searchParams->setKeywords(query);
+        mainWin.showMedia(searchParams);
+    }
+
     return app.exec();
 }