Switch to unified view

a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp
...
...
609
    TempDir tmpdir;
609
    TempDir tmpdir;
610
    int loglevel;
610
    int loglevel;
611
 public: 
611
 public: 
612
    string missing;
612
    string missing;
613
    TempFile imgtmp;
613
    TempFile imgtmp;
614
    string tdirreason;
614
615
615
    LoadThread(int *stp, Rcl::Doc& odoc, const Rcl::Doc& idc) 
616
    LoadThread(int *stp, Rcl::Doc& odoc, const Rcl::Doc& idc) 
616
    : statusp(stp), out(odoc), idoc(idc)
617
    : statusp(stp), out(odoc), idoc(idc)
617
    {
618
    {
618
        loglevel = DebugLog::getdbl()->getlevel();
619
        loglevel = DebugLog::getdbl()->getlevel();
619
    }
620
    }
620
    ~LoadThread() {
621
    ~LoadThread() {
621
    }
622
    }
622
    virtual void run() {
623
    virtual void run() {
623
    DebugLog::getdbl()->setloglevel(loglevel);
624
    DebugLog::getdbl()->setloglevel(loglevel);
624
  string reason;
625
    if (!tmpdir.ok()) {
625
    if (!tmpdir.ok()) {
626
      QMessageBox::critical(0, "Recoll",
626
      tdirreason = tmpdir.getreason();
627
                Preview::tr("Cannot create temporary directory"));
628
        LOGERR(("Preview: %s\n", tmpdir.getreason().c_str()));
627
        LOGERR(("Preview: %s\n", tdirreason.c_str()));
629
        *statusp = -1;
628
        *statusp = -1;
630
        return;
629
        return;
631
    }
630
    }
632
631
633
    FileInterner interner(idoc, theconfig, tmpdir, 
632
    FileInterner interner(idoc, theconfig, tmpdir, 
...
...
751
750
752
    if (CancelCheck::instance().cancelState())
751
    if (CancelCheck::instance().cancelState())
753
    return false;
752
    return false;
754
    if (status != 0) {
753
    if (status != 0) {
755
        QString explain;
754
        QString explain;
755
  if (!lthr.tdirreason.empty()) {
756
            explain = tr("Cannot create temporary directory: ") +
757
                QString::fromLocal8Bit(lthr.tdirreason.c_str());
758
      QMessageBox::critical(0, "Recoll", explain);
756
        if (!lthr.missing.empty()) {
759
  } else if (!lthr.missing.empty()) {
757
            explain = QString::fromAscii("<br>") +
760
            explain = QString::fromAscii("<br>") +
758
                tr("Missing helper program: ") +
761
                tr("Missing helper program: ") +
759
                QString::fromLocal8Bit(lthr.missing.c_str());
762
                QString::fromLocal8Bit(lthr.missing.c_str());
760
        }
761
        QMessageBox::warning(0, "Recoll",
763
      QMessageBox::warning(0, "Recoll",
762
                             tr("Can't turn doc into internal "
764
               tr("Can't turn doc into internal "
763
                                "representation for ") +
765
                  "representation for ") +
764
                             fdoc.mimetype.c_str() + explain);
766
               fdoc.mimetype.c_str() + explain);
767
        } else {
768
      QMessageBox::warning(0, "Recoll", 
769
                tr("Error while loading file"));
770
  }
771
765
    return false;
772
    return false;
766
    }
773
    }
767
    // Reset config just in case.
774
    // Reset config just in case.
768
    theconfig->setKeyDir("");
775
    theconfig->setKeyDir("");
769
776