From 5287622cfa19b31a52e83d7f42a83f3971dd1b78 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 29 Mar 2008 15:39:19 +0000 Subject: [PATCH] Enabling should not be done here, and no longer needs to be. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24041 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiBibtex.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/frontends/qt4/GuiBibtex.cpp b/src/frontends/qt4/GuiBibtex.cpp index 9259d9958e..a49ca937e3 100644 --- a/src/frontends/qt4/GuiBibtex.cpp +++ b/src/frontends/qt4/GuiBibtex.cpp @@ -27,6 +27,8 @@ #include "frontends/alert.h" +#include "insets/InsetBibtex.h" + #include "support/debug.h" #include "support/ExceptionMessage.h" #include "support/FileFilterList.h" @@ -367,20 +369,14 @@ void GuiBibtex::applyView() dbs += ','; emb += ','; } - QString filename = databaseLW->item(i)->text(); - dbs += qstring_to_ucs4(filename); - try { - EmbeddedFile file(fromqstr(changeExtension(filename, "bib")), - buf.filePath()); - file.setEmbed(databaseLW->item(i)->checkState() == Qt::Checked); - // move file around if needed, an exception may be raised. - file.enable(buf.embedded(), &buf, true); - // if things are OK..., - if (file.embedded()) - emb += from_utf8(file.inzipName()); - } catch (ExceptionMessage const & message) { - Alert::error(message.title_, message.details_); - // failed to embed + QString item = databaseLW->item(i)->text(); + docstring bibfile = qstring_to_ucs4(item); + dbs += bibfile; + if (databaseLW->item(i)->checkState() == Qt::Checked) { + FileName bibfilepath = InsetBibtex::getBibTeXPath(bibfile, buf); + string inzipName = + EmbeddedFile::calcInzipName(bibfilepath.absFilename(), buf.filePath()); + emb += from_utf8(inzipName); } } -- 2.39.2