have to setkeydir before calling internfile when opening
This commit is contained in:
parent
7d30485f87
commit
e8bfa47271
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.49 2008-06-13 18:22:46 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.50 2008-09-16 10:13:48 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -850,16 +850,16 @@ void RclMain::startNativeViewer(Rcl::Doc doc)
|
|||||||
// configured command seems to be able to grok it or not.
|
// configured command seems to be able to grok it or not.
|
||||||
bool wantsipath = cmd.find("%i") != string::npos;
|
bool wantsipath = cmd.find("%i") != string::npos;
|
||||||
bool istempfile = false;
|
bool istempfile = false;
|
||||||
string fn, url;
|
string fn = urltolocalpath(doc.url);
|
||||||
|
string url;
|
||||||
|
rclconfig->setKeyDir(path_getfather(fn));
|
||||||
if (doc.ipath.empty() || wantsipath) {
|
if (doc.ipath.empty() || wantsipath) {
|
||||||
fn = urltolocalpath(doc.url);
|
|
||||||
url = url_encode(doc.url, 7);
|
url = url_encode(doc.url, 7);
|
||||||
} else {
|
} else {
|
||||||
// There is an ipath and the command does not know about
|
// There is an ipath and the command does not know about
|
||||||
// them. We need a temp file.
|
// them. We need a temp file.
|
||||||
TempFile temp;
|
TempFile temp;
|
||||||
if (!FileInterner::idocTempFile(temp, rclconfig,
|
if (!FileInterner::idocTempFile(temp, rclconfig, fn,
|
||||||
urltolocalpath(doc.url),
|
|
||||||
doc.ipath, doc.mimetype)) {
|
doc.ipath, doc.mimetype)) {
|
||||||
QMessageBox::warning(0, "Recoll",
|
QMessageBox::warning(0, "Recoll",
|
||||||
tr("Cannot extract document or create "
|
tr("Cannot extract document or create "
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user