Switch to unified view

a/src/qtgui/advsearch_w.cpp b/src/qtgui/advsearch_w.cpp
...
...
382
        QString qcat = yesFiltypsLB->item(i)->text();
382
        QString qcat = yesFiltypsLB->item(i)->text();
383
        map<QString,QString>::const_iterator qit;
383
        map<QString,QString>::const_iterator qit;
384
        string cat;
384
        string cat;
385
        if ((qit = cat_rtranslations.find(qcat)) != 
385
        if ((qit = cat_rtranslations.find(qcat)) != 
386
            cat_rtranslations.end()) {
386
            cat_rtranslations.end()) {
387
          cat = (const char *)qit->second.toUtf8();
387
          cat = qs2utf8s(qit->second);
388
        } else {
388
        } else {
389
          cat = (const char *)qcat.toUtf8();
389
          cat = qs2utf8s(qcat);
390
        }
390
        }
391
        vector<string> types;
391
        vector<string> types;
392
        theconfig->getMimeCatTypes(cat, types);
392
        theconfig->getMimeCatTypes(cat, types);
393
        for (vector<string>::const_iterator it = types.begin();
393
        for (vector<string>::const_iterator it = types.begin();
394
             it != types.end(); it++) {
394
             it != types.end(); it++) {
395
            sdata->addFiletype(*it);
395
            sdata->addFiletype(*it);
396
        }
396
        }
397
        } else {
397
        } else {
398
      sdata->addFiletype((const char *)
398
      sdata->addFiletype(qs2utf8s(yesFiltypsLB->item(i)->text()));
399
                 yesFiltypsLB->item(i)->text().toUtf8());
400
        }
399
        }
401
    }
400
    }
402
    }
401
    }
403
402
404
    if (filterDatesCB->isChecked()) {
403
    if (filterDatesCB->isChecked()) {
...
...
420
    sdata->setMaxSize(size);
419
    sdata->setMaxSize(size);
421
    }
420
    }
422
421
423
    if (!subtreeCMB->currentText().isEmpty()) {
422
    if (!subtreeCMB->currentText().isEmpty()) {
424
    QString current = subtreeCMB->currentText();
423
    QString current = subtreeCMB->currentText();
425
  sdata->addDirSpec((const char*)subtreeCMB->currentText().toUtf8(),
424
  sdata->addClause(new Rcl::SearchDataClausePath(
425
               (const char*)current.toLocal8Bit(),
426
              direxclCB->isChecked());
426
                 direxclCB->isChecked()));
427
    // Keep history clean and sorted. Maybe there would be a
427
    // Keep history clean and sorted. Maybe there would be a
428
    // simpler way to do this
428
    // simpler way to do this
429
    list<QString> entries;
429
    list<QString> entries;
430
    for (int i = 0; i < subtreeCMB->count(); i++) {
430
    for (int i = 0; i < subtreeCMB->count(); i++) {
431
        entries.push_back(subtreeCMB->itemText(i));
431
        entries.push_back(subtreeCMB->itemText(i));
...
...
461
461
462
    while (sdata->m_query.size() > m_clauseWins.size()) {
462
    while (sdata->m_query.size() > m_clauseWins.size()) {
463
    addClause();
463
    addClause();
464
    }
464
    }
465
465
466
    subtreeCMB->setEditText("");
467
    direxclCB->setChecked(0);
468
466
    for (unsigned int i = 0; i < sdata->m_query.size(); i++) {
469
    for (unsigned int i = 0; i < sdata->m_query.size(); i++) {
467
    // Set fields from clause
470
    // Set fields from clause
468
    if (sdata->m_query[i]->getTp() == SCLT_SUB) {
471
    if (sdata->m_query[i]->getTp() == SCLT_SUB) {
469
        LOGERR(("AdvSearch::fromSearch: SUB clause found !\n"));
472
        LOGERR(("AdvSearch::fromSearch: SUB clause found !\n"));
473
      continue;
474
  }
475
  if (sdata->m_query[i]->getTp() == SCLT_PATH) {
476
      SearchDataClausePath *cs = 
477
      dynamic_cast<SearchDataClausePath*>(sdata->m_query[i]);
478
      // We can only use one such clause. There should be only one too 
479
      // if this is sfrom aved search data.
480
      QString qdir = QString::fromLocal8Bit(cs->gettext().c_str());
481
      subtreeCMB->setEditText(qdir);
482
      direxclCB->setChecked(cs->getexclude());
470
        continue;
483
        continue;
471
    }
484
    }
472
    SearchDataClauseSimple *cs = 
485
    SearchDataClauseSimple *cs = 
473
        dynamic_cast<SearchDataClauseSimple*>(sdata->m_query[i]);
486
        dynamic_cast<SearchDataClauseSimple*>(sdata->m_query[i]);
474
    m_clauseWins[i]->setFromClause(cs);
487
    m_clauseWins[i]->setFromClause(cs);
...
...
529
    } else {
542
    } else {
530
    filterSizesCB->setChecked(0);
543
    filterSizesCB->setChecked(0);
531
    minSizeLE->setText("");
544
    minSizeLE->setText("");
532
    maxSizeLE->setText("");
545
    maxSizeLE->setText("");
533
    }
546
    }
534
    
535
    if (!sdata->m_dirspecs.empty()) {
536
  // Can only use one entry
537
  QString qdir = QString::fromLocal8Bit(sdata->m_dirspecs[0].dir.c_str());
538
  subtreeCMB->setEditText(qdir);
539
  direxclCB->setChecked(sdata->m_dirspecs[0].exclude);
540
    } else {
541
  subtreeCMB->setEditText("");
542
  direxclCB->setChecked(0);
543
    }
544
}
547
}
545
548
546
void AdvSearch::slotHistoryNext()
549
void AdvSearch::slotHistoryNext()
547
{
550
{
548
    if (g_advshistory == 0)
551
    if (g_advshistory == 0)