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
This commit is contained in:
Richard Heck 2008-03-29 15:39:19 +00:00
parent c811c3a2ad
commit 5287622cfa

View File

@ -27,6 +27,8 @@
#include "frontends/alert.h" #include "frontends/alert.h"
#include "insets/InsetBibtex.h"
#include "support/debug.h" #include "support/debug.h"
#include "support/ExceptionMessage.h" #include "support/ExceptionMessage.h"
#include "support/FileFilterList.h" #include "support/FileFilterList.h"
@ -367,20 +369,14 @@ void GuiBibtex::applyView()
dbs += ','; dbs += ',';
emb += ','; emb += ',';
} }
QString filename = databaseLW->item(i)->text(); QString item = databaseLW->item(i)->text();
dbs += qstring_to_ucs4(filename); docstring bibfile = qstring_to_ucs4(item);
try { dbs += bibfile;
EmbeddedFile file(fromqstr(changeExtension(filename, "bib")), if (databaseLW->item(i)->checkState() == Qt::Checked) {
buf.filePath()); FileName bibfilepath = InsetBibtex::getBibTeXPath(bibfile, buf);
file.setEmbed(databaseLW->item(i)->checkState() == Qt::Checked); string inzipName =
// move file around if needed, an exception may be raised. EmbeddedFile::calcInzipName(bibfilepath.absFilename(), buf.filePath());
file.enable(buf.embedded(), &buf, true); emb += from_utf8(inzipName);
// 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
} }
} }