~ubuntu-branches/ubuntu/raring/kbibtex/raring

« back to all changes in this revision

Viewing changes to src/webquerypubmed.cpp

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2011-07-18 09:29:48 UTC
  • mfrom: (1.1.6) (2.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20110718092948-ksxjmg7kdfamolmg
Tags: 0.3-1
* First upstream release for KDE4 (Closes: #634255). A number of search
  engines are still missing, in comparison to the 0.2 series.
* Bumped Standards-Version to 3.9.2, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
*   Copyright (C) 2004-2009 by Thomas Fischer                             *
3
 
*   fischer@unix-ag.uni-kl.de                                             *
4
 
*                                                                         *
5
 
*   This program is free software; you can redistribute it and/or modify  *
6
 
*   it under the terms of the GNU General Public License as published by  *
7
 
*   the Free Software Foundation; either version 2 of the License, or     *
8
 
*   (at your option) any later version.                                   *
9
 
*                                                                         *
10
 
*   This program is distributed in the hope that it will be useful,       *
11
 
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 
*   GNU General Public License for more details.                          *
14
 
*                                                                         *
15
 
*   You should have received a copy of the GNU General Public License     *
16
 
*   along with this program; if not, write to the                         *
17
 
*   Free Software Foundation, Inc.,                                       *
18
 
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 
***************************************************************************/
20
 
#include <qwidget.h>
21
 
#include <qdom.h>
22
 
#include <qapplication.h>
23
 
#include <qstringlist.h>
24
 
#include <qbuffer.h>
25
 
#include <qcstring.h>
26
 
#include <qregexp.h>
27
 
#include <qspinbox.h>
28
 
 
29
 
#include <klineedit.h>
30
 
#include <kdialog.h>
31
 
#include <klocale.h>
32
 
#include <kurl.h>
33
 
#include <kmessagebox.h>
34
 
#include <kio/netaccess.h>
35
 
 
36
 
#include <entryfield.h>
37
 
#include <value.h>
38
 
#include <settings.h>
39
 
#include "webquerypubmed.h"
40
 
 
41
 
namespace KBibTeX
42
 
{
43
 
    WebQueryPubMedWidget::WebQueryPubMedWidget( QWidget *parent, const char *name )
44
 
            : WebQueryWidget( parent, name )
45
 
    {
46
 
        init();
47
 
 
48
 
        Settings *settings = Settings::self();
49
 
        QString value = settings->getWebQueryDefault( "PubMed" );
50
 
        value = value == QString::null ? "" : value;
51
 
        lineEditQuery->setText( value );
52
 
        slotTextChanged( value, true );
53
 
    }
54
 
 
55
 
    WebQueryPubMed::WebQueryPubMed( QWidget *parent ) : WebQuery( parent )
56
 
    {
57
 
        m_widget = new WebQueryPubMedWidget( parent );
58
 
    }
59
 
 
60
 
    WebQueryPubMed::~WebQueryPubMed()
61
 
    {
62
 
        delete m_widget;
63
 
    }
64
 
 
65
 
    QString WebQueryPubMed::title()
66
 
    {
67
 
        return i18n( "NCBI (PubMed)" );
68
 
    }
69
 
 
70
 
    QString WebQueryPubMed::disclaimer()
71
 
    {
72
 
        return i18n( "NCBI's Disclaimer and Copyright" );
73
 
    }
74
 
 
75
 
    QString WebQueryPubMed::disclaimerURL()
76
 
    {
77
 
        return "http://eutils.ncbi.nlm.nih.gov/About/disclaimer.html";
78
 
    }
79
 
 
80
 
    WebQueryWidget *WebQueryPubMed::widget()
81
 
    {
82
 
        return m_widget;
83
 
    }
84
 
 
85
 
    void WebQueryPubMed::query()
86
 
    {
87
 
        WebQuery::query();
88
 
        Settings *settings = Settings::self();
89
 
        settings->setWebQueryDefault( "PubMed", m_widget->lineEditQuery->text() );
90
 
 
91
 
        setNumStages( 2 );
92
 
        int numberOfResults = m_widget->spinBoxMaxHits->value();
93
 
 
94
 
        QString searchTerm =  m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" );
95
 
        if ( searchTerm.isEmpty() )
96
 
        {
97
 
            setEndSearch( WebQuery::statusInvalidQuery );
98
 
            return;
99
 
        }
100
 
 
101
 
        searchTerm = searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" );
102
 
        KURL url = KURL( QString( "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=%2&retmax=%1&tool=KBibTeX&email=kbibtex@unix-ag.uni-kl.de" ).arg( numberOfResults ).arg( searchTerm ) );
103
 
 
104
 
        QString data = downloadHTML( url );
105
 
        if ( data != QString::null && !m_aborted )
106
 
        {
107
 
            QBuffer buffer;
108
 
            buffer.open( IO_WriteOnly );
109
 
            QTextStream ts( &buffer );
110
 
            ts.setEncoding( QTextStream::UnicodeUTF8 );
111
 
            ts << data << endl;
112
 
            buffer.close();
113
 
 
114
 
            buffer.open( IO_ReadOnly );
115
 
            QValueList<int> intList;
116
 
            QXmlInputSource inputSource( &buffer );
117
 
            QXmlSimpleReader reader;
118
 
            WebQueryPubMedStructureParserQuery handler( &intList );
119
 
            reader.setContentHandler( &handler );
120
 
            reader.parse( &inputSource );
121
 
            buffer.close();
122
 
 
123
 
            QString ids;
124
 
            QValueList<int>::iterator it = intList.begin();
125
 
            if ( it != intList.end() )
126
 
            {
127
 
                ids.append( QString::number( *it ) );
128
 
                ++it;
129
 
                for ( ; it != intList.end(); ++it )
130
 
                {
131
 
                    ids.append( "," );
132
 
                    ids.append( QString::number( *it ) );
133
 
                }
134
 
            }
135
 
 
136
 
            url = KURL( QString( "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml&id=%1&tool=KBibTeX&email=kbibtex@unix-ag.uni-kl.de" ).arg( ids ) );
137
 
            data = downloadHTML( url );
138
 
            if ( data != QString::null && !m_aborted )
139
 
            {
140
 
                buffer.open( IO_WriteOnly );
141
 
                QTextStream ts( &buffer );
142
 
                ts.setEncoding( QTextStream::UnicodeUTF8 );
143
 
                ts << data << endl;
144
 
                buffer.close();
145
 
 
146
 
                buffer.open( IO_ReadOnly );
147
 
                QDomDocument doc( "efetch'ed" );
148
 
                doc.setContent( &buffer );
149
 
                QDomElement docElem = doc.documentElement();
150
 
                WebQueryPubMedResultParser resultParser;
151
 
                connect( &resultParser, SIGNAL( foundEntry( BibTeX::Entry*, bool ) ), this, SIGNAL( foundEntry( BibTeX::Entry*, bool ) ) );
152
 
                resultParser.parse( docElem );
153
 
                buffer.close();
154
 
                setEndSearch( WebQuery::statusSuccess );
155
 
            }
156
 
            else if ( !m_aborted )
157
 
            {
158
 
                QString message = KIO::NetAccess::lastErrorString();
159
 
                message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) );
160
 
                KMessageBox::error( m_parent, message );
161
 
                setEndSearch( WebQuery::statusError );
162
 
            }
163
 
            else
164
 
                setEndSearch( WebQuery::statusAborted );
165
 
        }
166
 
        else if ( !m_aborted )
167
 
        {
168
 
            QString message = KIO::NetAccess::lastErrorString();
169
 
            if ( message.isEmpty() )
170
 
                message.prepend( '\n' );
171
 
            message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) );
172
 
            KMessageBox::error( m_parent, message );
173
 
            setEndSearch( WebQuery::statusError );
174
 
        }
175
 
        else
176
 
            setEndSearch( WebQuery::statusAborted );
177
 
    }
178
 
 
179
 
    WebQueryPubMedStructureParserQuery::WebQueryPubMedStructureParserQuery( QValueList<int> *intList ) : QXmlDefaultHandler(), m_intList( intList )
180
 
    {
181
 
        m_intList->clear();
182
 
    }
183
 
 
184
 
    WebQueryPubMedStructureParserQuery::~WebQueryPubMedStructureParserQuery( )
185
 
    {
186
 
        // nothing
187
 
    }
188
 
 
189
 
    bool WebQueryPubMedStructureParserQuery::startElement( const QString & /*namespaceURI*/, const QString & /*localName*/, const QString & /*qName*/, const QXmlAttributes & /*atts*/ )
190
 
    {
191
 
        concatString = QString();
192
 
        return TRUE;
193
 
    }
194
 
 
195
 
    bool WebQueryPubMedStructureParserQuery::endElement( const QString & /*namespaceURI*/, const QString & /*localName*/, const QString & qName )
196
 
    {
197
 
        if ( qName == "Id" )
198
 
        {
199
 
            bool ok;
200
 
            int id = concatString.toInt( &ok );
201
 
            if ( ok && id > 0 && m_intList != NULL )
202
 
                m_intList->append( id );
203
 
        }
204
 
 
205
 
        return TRUE;
206
 
    }
207
 
 
208
 
    bool WebQueryPubMedStructureParserQuery::characters( const QString & ch )
209
 
    {
210
 
        concatString.append( ch );
211
 
        return TRUE;
212
 
    }
213
 
 
214
 
    WebQueryPubMedResultParser::WebQueryPubMedResultParser( ) : QObject()
215
 
    {
216
 
        // nothing
217
 
    }
218
 
 
219
 
    void WebQueryPubMedResultParser::parse( const QDomElement& rootElement )
220
 
    {
221
 
        if ( rootElement.tagName() == "PubmedArticleSet" )
222
 
            for ( QDomNode n = rootElement.firstChild(); !n.isNull(); n = n.nextSibling() )
223
 
            {
224
 
                QDomElement e = n.toElement();
225
 
                if ( !e.isNull() && e.tagName() == "PubmedArticle" )
226
 
                {
227
 
                    BibTeX::Entry * entry = new BibTeX::Entry( BibTeX::Entry::etMisc, "PubMed" );
228
 
                    parsePubmedArticle( e, entry );
229
 
                    emit foundEntry( entry, false );
230
 
                }
231
 
            }
232
 
    }
233
 
 
234
 
    WebQueryPubMedResultParser::~WebQueryPubMedResultParser()
235
 
    {
236
 
        // nothing
237
 
    }
238
 
 
239
 
    void WebQueryPubMedResultParser::parsePubmedArticle( const QDomElement& element, BibTeX::Entry *entry )
240
 
    {
241
 
        for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
242
 
        {
243
 
            QDomElement e = n.toElement();
244
 
            if ( !e.isNull() && e.tagName() == "MedlineCitation" )
245
 
                parseMedlineCitation( e, entry );
246
 
        }
247
 
    }
248
 
 
249
 
    void WebQueryPubMedResultParser::parseMedlineCitation( const QDomElement& element, BibTeX::Entry *entry )
250
 
    {
251
 
        for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
252
 
        {
253
 
            QDomElement e = n.toElement();
254
 
            if ( !e.isNull() )
255
 
            {
256
 
                if ( e.tagName() == "PMID" )
257
 
                {
258
 
                    entry->setId( QString( "PubMed_%1" ).arg( e.text() ) );
259
 
 
260
 
                    /** add url to pubmed website */
261
 
                    BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftURL );
262
 
                    if ( field == NULL )
263
 
                    {
264
 
                        field = new BibTeX::EntryField( BibTeX::EntryField::ftURL );
265
 
                        entry->addField( field );
266
 
                    }
267
 
                    field->setValue( new BibTeX::Value( QString( "http://www.ncbi.nlm.nih.gov/pubmed/" ).append( e.text() ) ) );
268
 
                }
269
 
                else if ( e.tagName() == "Article" )
270
 
                    parseArticle( e, entry );
271
 
                else if ( e.tagName() == "MedlineJournalInfo" )
272
 
                {
273
 
                    for ( QDomNode n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() )
274
 
                    {
275
 
                        QDomElement e2 = n2.toElement();
276
 
                        if ( e2.tagName() == "MedlineTA" )
277
 
                        {
278
 
                            BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftJournal );
279
 
                            if ( field == NULL )
280
 
                            {
281
 
                                field = new BibTeX::EntryField( BibTeX::EntryField::ftJournal );
282
 
                                entry->addField( field );
283
 
                            }
284
 
                            field->setValue( new BibTeX::Value( e2.text() ) );
285
 
                        }
286
 
                    }
287
 
                }
288
 
            }
289
 
        }
290
 
 
291
 
    }
292
 
 
293
 
    void WebQueryPubMedResultParser::parseArticle( const QDomElement& element, BibTeX::Entry *entry )
294
 
    {
295
 
        for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
296
 
        {
297
 
            QDomElement e = n.toElement();
298
 
 
299
 
            if ( e.tagName() == "Journal" )
300
 
            {
301
 
                parseJournal( e, entry );
302
 
                entry->setEntryType( BibTeX::Entry::etArticle );
303
 
            }
304
 
            else if ( e.tagName() == "ArticleTitle" )
305
 
            {
306
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftTitle );
307
 
                if ( field == NULL )
308
 
                {
309
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftTitle );
310
 
                    entry->addField( field );
311
 
                }
312
 
                field->setValue( new BibTeX::Value( e.text() ) );
313
 
            }
314
 
            else if ( e.tagName() == "Pagination" )
315
 
            {
316
 
                QDomElement medlinePgn = e.firstChild().toElement(); // may fail?
317
 
                if ( !medlinePgn.text().isEmpty() )
318
 
                {
319
 
                    BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftPages );
320
 
                    if ( field == NULL )
321
 
                    {
322
 
                        field = new BibTeX::EntryField( BibTeX::EntryField::ftPages );
323
 
                        entry->addField( field );
324
 
                    }
325
 
                    field->setValue( new BibTeX::Value( medlinePgn.text() ) );
326
 
                }
327
 
            }
328
 
            else if ( e.tagName() == "Abstract" )
329
 
            {
330
 
                QDomElement abstractText = e.firstChild().toElement();
331
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftAbstract );
332
 
                if ( field == NULL )
333
 
                {
334
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftAbstract );
335
 
                    entry->addField( field );
336
 
                }
337
 
                field->setValue( new BibTeX::Value( abstractText.text() ) );
338
 
            }
339
 
            else if ( e.tagName() == "Affiliation" )
340
 
            {
341
 
                BibTeX::EntryField * field = entry->getField( "affiliation" );
342
 
                if ( field == NULL )
343
 
                {
344
 
                    field = new BibTeX::EntryField( "affiliation" );
345
 
                    entry->addField( field );
346
 
                }
347
 
                field->setValue( new BibTeX::Value( e.text() ) );
348
 
            }
349
 
            else if ( e.tagName() == "AuthorList" )
350
 
                parseAuthorList( e, entry );
351
 
        }
352
 
    }
353
 
 
354
 
    void WebQueryPubMedResultParser::parseJournal( const QDomElement& element, BibTeX::Entry *entry )
355
 
    {
356
 
        for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
357
 
        {
358
 
            QDomElement e = n.toElement();
359
 
 
360
 
            if ( e.tagName() == "ISSN" )
361
 
            {
362
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftISSN );
363
 
                if ( field == NULL )
364
 
                {
365
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftISSN );
366
 
                    entry->addField( field );
367
 
                }
368
 
                field->setValue( new BibTeX::Value( e.text() ) );
369
 
            }
370
 
            else if ( e.tagName() == "JournalIssue" )
371
 
                parseJournalIssue( e, entry );
372
 
            else if ( e.tagName() == "Title" )
373
 
            {
374
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftJournal );
375
 
                if ( field == NULL )
376
 
                {
377
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftJournal );
378
 
                    entry->addField( field );
379
 
                }
380
 
                field->setValue( new BibTeX::Value( e.text() ) );
381
 
            }
382
 
        }
383
 
    }
384
 
 
385
 
    void WebQueryPubMedResultParser::parseJournalIssue( const QDomElement& element, BibTeX::Entry *entry )
386
 
    {
387
 
        for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
388
 
        {
389
 
            QDomElement e = n.toElement();
390
 
 
391
 
            if ( e.tagName() == "Volume" )
392
 
            {
393
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftVolume );
394
 
                if ( field == NULL )
395
 
                {
396
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftVolume );
397
 
                    entry->addField( field );
398
 
                }
399
 
                field->setValue( new BibTeX::Value( e.text() ) );
400
 
            }
401
 
            else if ( e.tagName() == "Issue" )
402
 
            {
403
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftNumber );
404
 
                if ( field == NULL )
405
 
                {
406
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftNumber );
407
 
                    entry->addField( field );
408
 
                }
409
 
                field->setValue( new BibTeX::Value( e.text() ) );
410
 
            }
411
 
            else if ( e.tagName() == "PubDate" )
412
 
                parsePubDate( e, entry );
413
 
        }
414
 
    }
415
 
 
416
 
    void WebQueryPubMedResultParser::parsePubDate( const QDomElement& element, BibTeX::Entry *entry )
417
 
    {
418
 
        for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
419
 
        {
420
 
            QDomElement e = n.toElement();
421
 
 
422
 
            if ( e.tagName() == "Year" )
423
 
            {
424
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftYear );
425
 
                if ( field == NULL )
426
 
                {
427
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftYear );
428
 
                    entry->addField( field );
429
 
                }
430
 
                field->setValue( new BibTeX::Value( e.text() ) );
431
 
            }
432
 
            else if ( e.tagName() == "Month" )
433
 
            {
434
 
                QString month = e.text().lower();
435
 
                BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftMonth );
436
 
                if ( field == NULL )
437
 
                {
438
 
                    field = new BibTeX::EntryField( BibTeX::EntryField::ftMonth );
439
 
                    entry->addField( field );
440
 
                }
441
 
                BibTeX::Value *value = new BibTeX::Value();
442
 
                value->items.append( new BibTeX::MacroKey( month ) );
443
 
                field->setValue( value );
444
 
            }
445
 
            else if ( e.tagName() == "MedlineDate" )
446
 
            {
447
 
                QStringList frags = QStringList::split( QRegExp( "\\s+" ), e.text() );
448
 
                for ( QStringList::Iterator it = frags.begin(); it != frags.end(); ++it )
449
 
                {
450
 
                    bool ok;
451
 
                    int num = ( *it ).toInt( &ok );
452
 
                    if ( ok && num > 1000 && num < 3000 )
453
 
                    {
454
 
                        BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftYear );
455
 
                        if ( field == NULL )
456
 
                        {
457
 
                            field = new BibTeX::EntryField( BibTeX::EntryField::ftYear );
458
 
                            entry->addField( field );
459
 
                        }
460
 
                        BibTeX::Value *value = new BibTeX::Value();
461
 
                        value->items.append( new BibTeX::MacroKey( QString::number( num ) ) );
462
 
                        field->setValue( value );
463
 
                    }
464
 
                    else if ( !ok && ( *it ).length() == 3 )
465
 
                    {
466
 
                        BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftMonth );
467
 
                        if ( field == NULL )
468
 
                        {
469
 
                            field = new BibTeX::EntryField( BibTeX::EntryField::ftMonth );
470
 
                            entry->addField( field );
471
 
                        }
472
 
                        BibTeX::Value *value = new BibTeX::Value();
473
 
                        value->items.append( new BibTeX::MacroKey(( *it ).lower() ) );
474
 
                        field->setValue( value );
475
 
                    }
476
 
                }
477
 
            }
478
 
        }
479
 
    }
480
 
 
481
 
    void WebQueryPubMedResultParser::parseAuthorList( const QDomElement& element, BibTeX::Entry *entry )
482
 
    {
483
 
        if ( element.attribute( "CompleteYN", "Y" ) == "Y" )
484
 
        {
485
 
            QStringList authorList;
486
 
            for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
487
 
            {
488
 
                QDomElement e = n.toElement();
489
 
                if ( e.tagName() == "Author" && e.attribute( "ValidYN", "Y" ) == "Y" )
490
 
                {
491
 
                    QString lastName = QString::null, firstName = QString::null;
492
 
                    for ( QDomNode n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() )
493
 
                    {
494
 
                        QDomElement e2 = n2.toElement();
495
 
                        if ( e2.tagName() == "LastName" )
496
 
                            lastName = e2.text();
497
 
                        else if ( e2.tagName() == "CollectiveName" )
498
 
                            lastName = e2.text();
499
 
                        else if ( e2.tagName() == "FirstName" || e2.tagName() == "ForeName" )
500
 
                            firstName = e2.text();
501
 
                    }
502
 
                    QString name = lastName;
503
 
                    if ( !firstName.isNull() && !firstName.isEmpty() )
504
 
                    {
505
 
                        if ( name.isNull() ) name = "UNSET";
506
 
                        name.prepend( "|" ).prepend( firstName );
507
 
                    }
508
 
                    if ( !name.isNull() )
509
 
                        authorList.append( name );
510
 
                }
511
 
            }
512
 
 
513
 
            BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftAuthor );
514
 
            if ( field == NULL )
515
 
            {
516
 
                field = new BibTeX::EntryField( BibTeX::EntryField::ftAuthor );
517
 
                entry->addField( field );
518
 
            }
519
 
            BibTeX::Value *value = new BibTeX::Value();
520
 
            Settings *settings = Settings::self();
521
 
            BibTeX::PersonContainer *personContainer = new BibTeX::PersonContainer( settings->editing_FirstNameFirst );
522
 
            value->items.append( personContainer );
523
 
            for ( QStringList::Iterator sli = authorList.begin(); sli != authorList.end(); ++sli )
524
 
            {
525
 
                QStringList nameParts = QStringList::split( '|', *sli );
526
 
                QString firstName = nameParts.count() > 1 ? nameParts[0] : "";
527
 
                QString lastName = nameParts[nameParts.count() - 1];
528
 
                personContainer->persons.append( new BibTeX::Person( firstName, lastName, settings->editing_FirstNameFirst ) );
529
 
            }
530
 
            field->setValue( value );
531
 
        }
532
 
    }
533
 
 
534
 
}
535