Switch to unified view

a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp
...
...
761
class LoadThread : public QThread {
761
class LoadThread : public QThread {
762
    int *statusp;
762
    int *statusp;
763
    Rcl::Doc& out;
763
    Rcl::Doc& out;
764
    const Rcl::Doc& idoc;
764
    const Rcl::Doc& idoc;
765
    string filename;
765
    string filename;
766
    string tmpdir;
766
    TempDir tmpdir;
767
    int loglevel;
767
    int loglevel;
768
 public: 
768
 public: 
769
    string missing;
769
    string missing;
770
    LoadThread(int *stp, Rcl::Doc& odoc, const Rcl::Doc& idc) 
770
    LoadThread(int *stp, Rcl::Doc& odoc, const Rcl::Doc& idc) 
771
    : statusp(stp), out(odoc), idoc(idc)
771
    : statusp(stp), out(odoc), idoc(idc)
772
    {
772
    {
773
        loglevel = DebugLog::getdbl()->getlevel();
773
        loglevel = DebugLog::getdbl()->getlevel();
774
    }
774
    }
775
    ~LoadThread() {
775
    ~LoadThread() {
776
  if (tmpdir.length()) {
777
      wipedir(tmpdir);
778
      rmdir(tmpdir.c_str());
779
  }
780
    }
776
    }
781
    virtual void run() {
777
    virtual void run() {
782
    DebugLog::getdbl()->setloglevel(loglevel);
778
    DebugLog::getdbl()->setloglevel(loglevel);
783
    string reason;
779
    string reason;
784
  if (!maketmpdir(tmpdir, reason)) {
780
  if (!tmpdir.ok()) {
785
        QMessageBox::critical(0, "Recoll",
781
        QMessageBox::critical(0, "Recoll",
786
                  Preview::tr("Cannot create temporary directory"));
782
                  Preview::tr("Cannot create temporary directory"));
787
        LOGERR(("Preview: %s\n", reason.c_str()));
783
        LOGERR(("Preview: %s\n", tmpdir.getreason().c_str()));
788
        *statusp = -1;
784
        *statusp = -1;
789
        return;
785
        return;
790
    }
786
    }
791
787
792
      // QMessageBox::critical(0, "Recoll", Preview::tr("File does not exist"));
788
      // QMessageBox::critical(0, "Recoll", Preview::tr("File does not exist"));