Switch to unified view

a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp
...
...
473
}
473
}
474
474
475
void RclMain::fileExit()
475
void RclMain::fileExit()
476
{
476
{
477
    LOGDEB(("RclMain: fileExit\n"));
477
    LOGDEB(("RclMain: fileExit\n"));
478
    m_tempfiles.clear();
479
    // Don't save geometry if we're currently fullscreened
478
    // Don't save geometry if we're currently fullscreened
480
    if (!isFullScreen()) {
479
    if (!isFullScreen()) {
481
        prefs.mainwidth = width();
480
        prefs.mainwidth = width();
482
        prefs.mainheight = height();
481
        prefs.mainheight = height();
483
    }
482
    }
...
...
994
    QFileDialog::getSaveFileName(this, //parent
993
    QFileDialog::getSaveFileName(this, //parent
995
                     tr("Save file"), 
994
                     tr("Save file"), 
996
                     QString::fromLocal8Bit(path_home().c_str())
995
                     QString::fromLocal8Bit(path_home().c_str())
997
        );
996
        );
998
    string tofile((const char *)s.toLocal8Bit());
997
    string tofile((const char *)s.toLocal8Bit());
999
    TempFile temp; // not used
998
    TempFile temp; // not used because tofile is set.
1000
    if (!FileInterner::idocToFile(temp, tofile, theconfig, doc)) {
999
    if (!FileInterner::idocToFile(temp, tofile, theconfig, doc)) {
1001
    QMessageBox::warning(0, "Recoll",
1000
    QMessageBox::warning(0, "Recoll",
1002
                 tr("Cannot extract document or create "
1001
                 tr("Cannot extract document or create "
1003
                "temporary file"));
1002
                "temporary file"));
1004
    return;
1003
    return;
...
...
1024
    if (ExecCmd::which(*bit, exefile, path)) 
1023
    if (ExecCmd::which(*bit, exefile, path)) 
1025
        return true;
1024
        return true;
1026
    }
1025
    }
1027
    exefile.clear();
1026
    exefile.clear();
1028
    return false;
1027
    return false;
1029
}
1030
1031
// Convert to file path if url is like file://
1032
static string fileurltolocalpath(string url)
1033
{
1034
    if (url.find("file://") == 0)
1035
        url = url.substr(7, string::npos);
1036
    else
1037
        return string();
1038
    string::size_type pos;
1039
    if ((pos = url.find_last_of("#")) != string::npos) {
1040
        url.erase(pos);
1041
    }
1042
    return url;
1043
}
1028
}
1044
1029
1045
void RclMain::startNativeViewer(Rcl::Doc doc)
1030
void RclMain::startNativeViewer(Rcl::Doc doc)
1046
{
1031
{
1047
    // Look for appropriate viewer
1032
    // Look for appropriate viewer
...
...
1149
                 tr("Cannot extract document or create "
1134
                 tr("Cannot extract document or create "
1150
                    "temporary file"));
1135
                    "temporary file"));
1151
        return;
1136
        return;
1152
    }
1137
    }
1153
    istempfile = true;
1138
    istempfile = true;
1154
  m_tempfiles.push_back(temp);
1139
  rememberTempFile(temp);
1155
    fn = temp->filename();
1140
    fn = temp->filename();
1156
    url = string("file://") + fn;
1141
    url = string("file://") + fn;
1157
    }
1142
    }
1158
1143
1159
    // If using an actual file, check that it exists, and if it is
1144
    // If using an actual file, check that it exists, and if it is
...
...
1174
                                     QString::fromLocal8Bit(fn.c_str()));
1159
                                     QString::fromLocal8Bit(fn.c_str()));
1175
                return;
1160
                return;
1176
            }
1161
            }
1177
        }
1162
        }
1178
        if (!temp.isNull()) {
1163
        if (!temp.isNull()) {
1179
            m_tempfiles.push_back(temp);
1164
      rememberTempFile(temp);
1180
            fn = temp->filename();
1165
            fn = temp->filename();
1181
            url = string("file://") + fn;
1166
            url = string("file://") + fn;
1182
        }
1167
        }
1183
    }
1168
    }
1184
1169