[EMAIL PROTECTED] wrote:
Author: bpeng
Date: Sat Mar 29 21:24:49 2008
New Revision: 24047

URL: http://www.lyx.org/trac/changeset/24047
Log:
Revert the addition of a static calcInzipName function, polish createBibFiles 
function

Modified: lyx-devel/trunk/src/frontends/qt4/GuiBibtex.cpp
URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/GuiBibtex.cpp?rev=24047
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiBibtex.cpp (original)
+++ lyx-devel/trunk/src/frontends/qt4/GuiBibtex.cpp Sat Mar 29 21:24:49 2008
@@ -372,12 +372,8 @@
                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);
-               }
+               if (databaseLW->item(i)->checkState() == Qt::Checked)
+                       emb += "embedded";
        }

Granted that this works, in the end, but you're subverting the meaning of the parameters here. You're supposed to pass LFUN_INSET_MODIFY a string that might appear in a .lyx file. That's what the interface expects. It seems like a very bad idea to pass otherwise meaningless strings---it needn't be "embedded" and might as well be "x". As a matter of solid programming principles, we should program to the interface. Someone might decide to add some error checking at some point, and then this would suddenly be wrong.

I strongly encourage you to revert this patch, except for the crucial bit about copying the file if the embedding status has changed, which is my bad.

Richard

Reply via email to