void startSearch()
{
    char input[130];
    int i, c, adv;
    char tst[512];
    
    while((c = getchar()) != EOF) {
        printf("SEARCH\n");
        input[0] = c;
        adv = FALSE;
        printf("Search: ");
        fgets(tst, sizeof(tst), stdin);
        for (i=1; i < strlen(tst); i++) {
            input[i] = tst[i-1];
        }
        input[i] = '\0';
        if(input[strlen(input) - 1] == '\n')
            input[strlen(input) - 1] = '\0';
        for (i=0; i < strlen(input); i++) {
            if (input[i] == ' ') {
                adv = TRUE;
                break;
            }
        }
        if (adv){
            advSearch(input);
        }else{
            basicSearch(input);
        }
    }
    quit_search = TRUE;
}
Example #2
0
    void MainWindow::connectAllActions()
    {
        QObject::connect( m_iconOnlyAction, SIGNAL(triggered()),
                          this, SLOT( iconOnly()) );
        QObject::connect( m_textOnlyAction, SIGNAL(triggered()),
                          this, SLOT( textOnly()) );
        QObject::connect( m_textBelowAction, SIGNAL(triggered()),
                          this, SLOT( textBelowIcon()) );
        QObject::connect( m_textBesideAction, SIGNAL(triggered()),
                          this, SLOT( textBesideIcon()) );
        QObject::connect( m_hideToolbarAction, SIGNAL(triggered()),
                          this, SLOT( hideToolbar() ) );
        QObject::connect( m_directDownloadAction, SIGNAL(triggered()),
                          this, SLOT(directDownload()));
        QObject::connect( m_downloadAction, SIGNAL(triggered()),
                          this, SLOT(findDownloadLink()));
        QObject::connect( m_basicSearchAction, SIGNAL(triggered()),
                          this, SLOT( basicSearch()) );
        QObject::connect( m_advancedSearchAction, SIGNAL(triggered()),
                          this, SLOT(advancedSearch()) );
        QObject::connect( m_exitAction, SIGNAL(triggered()),
                          this, SLOT( close()) );
        QObject::connect( m_aboutQt, SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) );
        QObject::connect( m_aboutHend, SIGNAL(triggered()),this, SLOT( aboutHend() ) );

        QObject::connect( m_videoDisplayTable, SIGNAL(activated(QModelIndex)),
                          this, SLOT(viewDetails(QModelIndex)) );
        QObject::connect( m_filterByUploadDateButton, SIGNAL(clicked()),
                          this, SLOT(filterUploadHandler()) );
        QObject::connect( m_filterByTypeButton, SIGNAL(clicked()),
                          this, SLOT( filterTypeHandler() ) );
        QObject::connect( m_filterByDurationButton, SIGNAL(clicked()),
                          this, SLOT(filterDurationHandler()));
        QObject::connect( m_filterByFeaturesButton, SIGNAL(clicked()),
                          this, SLOT( filterFeaturesHandler()));
        QObject::connect( m_filterBySortButton, SIGNAL(clicked()),
                          this, SLOT( filterSortHandler()) );
        QObject::connect( m_filterList, SIGNAL(currentTextChanged(QString)),
                          this, SLOT(filterController(QString)) );
    }