From: Flavio Date: Wed, 2 Feb 2011 14:47:48 +0000 (+0100) Subject: CLI support X-Git-Tag: 1.4~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0aaa359ebd775acb44be7a47e082c85e9c0b7d53;p=minitube CLI support --- diff --git a/src/MainWindow.h b/src/MainWindow.h index 5034df8..ec872e0 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -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(); diff --git a/src/main.cpp b/src/main.cpp index 6f0385f..e560d0f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ #include #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(); }