~ubuntu-branches/ubuntu/precise/kbibtex/precise

« back to all changes in this revision

Viewing changes to src/documentlistview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Patrick Davies
  • Date: 2007-10-28 10:06:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071028100645-jw9oadntiao5oszf
Tags: 0.2-0ubuntu1
* New upstream release.
* Bumped up compat and debhelper versions to 5.
* Added Original-Maintainer as per Ubuntu spec.
* Moved Homepage as per Debian spec.
* Removed from patches:
  - 10-invalid_pure_specifier.dpatch - applied upstream.
  - 11-accented_characters.dpatch - applied upstream.
  - 12-empty_pubmed_search.dpatch - applied upstream.
  - 13-store_search_urls.dpatch - applied upstream.
* Updated 14-xslt_export and use simple-patchsys instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
*   Copyright (C) 2004-2006 by Thomas Fischer                             *
 
2
*   Copyright (C) 2004-2007 by Thomas Fischer                             *
3
3
*   fischer@unix-ag.uni-kl.de                                             *
4
4
*                                                                         *
5
5
*   This program is free software; you can redistribute it and/or modify  *
40
40
#include <kpopupmenu.h>
41
41
#include <kmessagebox.h>
42
42
#include <kdebug.h>
 
43
#include <kprogress.h>
43
44
#include <kiconloader.h>
 
45
#include <krun.h>
44
46
 
45
47
#include <kbibtex_part.h>
46
48
#include <documentlistviewitem.h>
51
53
#include <entry.h>
52
54
#include <macro.h>
53
55
#include <comment.h>
 
56
#include <preamblewidget.h>
 
57
#include <preamble.h>
54
58
#include <entrywidget.h>
55
59
#include <commentwidget.h>
56
60
#include <macrowidget.h>
62
66
namespace KBibTeX
63
67
{
64
68
    DocumentListView::DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent, const char *name )
65
 
            : KListView( parent, name ), m_docWidget( docWidget ), m_contextMenu( NULL ), m_headerMenu( NULL ), m_isReadOnly( isReadOnly ), m_newElementCounter( 1 )
 
69
            : KListView( parent, name ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_contextMenu( NULL ), m_headerMenu( NULL ), m_isReadOnly( isReadOnly ), m_newElementCounter( 1 )
66
70
    {
67
71
        setAllColumnsShowFocus( true );
68
72
        setShowSortIndicator( true );
69
73
        setSelectionMode( QListView::Extended );
70
 
        header() ->setClickEnabled ( TRUE );
 
74
        header() ->setClickEnabled( TRUE );
71
75
        header() ->setMovingEnabled( TRUE );
72
76
        buildColumns();
73
77
 
74
78
        //         setDragEnabled ( true );
75
79
        //         setDragAutoScroll( true );
76
80
        setAcceptDrops( TRUE );
77
 
        setDropVisualizer ( TRUE );
 
81
        setDropVisualizer( TRUE );
78
82
 
79
83
        connect( header(), SIGNAL( clicked( int ) ), this, SLOT( setSortingColumn( int ) ) );
80
84
        connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), this, SLOT( showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint & ) ) );
108
112
    void DocumentListView::setItems()
109
113
    {
110
114
        QApplication::setOverrideCursor( Qt::waitCursor );
111
 
        setUpdatesEnabled( FALSE );
 
115
 
 
116
        KProgressDialog *prgDlg = new KProgressDialog( this, "prgDlg", i18n( "Updating" ), i18n( "Updating main view" ), TRUE );
 
117
        prgDlg->show();
 
118
        KProgress *progress = prgDlg->progressBar();
 
119
        progress->setTotalSteps( m_bibtexFile->count() );
 
120
 
 
121
        bool update = viewport()->isUpdatesEnabled();
 
122
        viewport()->setUpdatesEnabled( FALSE );
112
123
 
113
124
        clear();
114
125
        for ( unsigned int i = 0; i < m_bibtexFile->count(); i++ )
115
126
        {
116
127
            BibTeX::Element *element = m_bibtexFile->at( i );
117
 
            QListViewItem *item = new DocumentListViewItem( element, this );
 
128
            QListViewItem *item = new DocumentListViewItem( m_bibtexFile, element, this );
118
129
            item->setVisible( m_filter.isEmpty() || element->containsPattern( m_filter, m_filterFieldType ) );
 
130
            progress->setProgress( i );
 
131
 
 
132
            if ( i % 43 == 23 )
 
133
                kapp->processEvents();
119
134
        }
120
 
        //     sort();
121
135
 
122
 
        setUpdatesEnabled( TRUE );
 
136
        //setUpdatesEnabled( TRUE );
 
137
        viewport()->setUpdatesEnabled( update );
123
138
        triggerUpdate();
 
139
        delete prgDlg;
 
140
 
124
141
        QApplication::restoreOverrideCursor();
125
 
        //     triggerUpdate();
126
142
    }
127
143
 
128
144
    bool DocumentListView::insertItems( BibTeX::File *items, KBibTeX::DocumentListViewItem *after )
129
145
    {
 
146
        if ( m_bibtexFile == NULL )
 
147
            m_bibtexFile = new BibTeX::File();
 
148
 
130
149
        for ( BibTeX::File::ElementList::iterator it = items->begin(); it != items->end(); it++ )
131
150
        {
132
151
            BibTeX::Element *element = BibTeX::File::cloneElement( *it );
133
152
 
134
153
            m_bibtexFile->appendElement( element, after == NULL ? NULL : after->element() );
135
 
            after = new DocumentListViewItem( element, this, after );
 
154
            after = new DocumentListViewItem( m_bibtexFile, element, this, after );
136
155
            after->setUnreadStatus( TRUE );
137
156
            m_unreadItems.append( after );
138
157
        }
144
163
 
145
164
    void DocumentListView::updateVisiblity()
146
165
    {
147
 
        Settings * settings = Settings::self();
 
166
        Settings * settings = Settings::self( m_bibtexFile );
148
167
 
149
168
        QListViewItemIterator it( this );
150
169
        while ( it.current() )
177
196
 
178
197
    void DocumentListView::restoreState()
179
198
    {
180
 
        Settings * settings = Settings::self();
 
199
        Settings * settings = Settings::self( m_bibtexFile );
181
200
        if ( settings->editing_UseSpecialFont )
182
201
            setFont( settings->editing_SpecialFont );
183
202
        else
198
217
            m_headerMenu->setCheckable( TRUE );
199
218
            connect( m_headerMenu, SIGNAL( activated( int ) ), this, SLOT( activateShowColumnMenu( int ) ) );
200
219
 
201
 
            Settings * settings = Settings::self();
 
220
            Settings * settings = Settings::self( m_bibtexFile );
202
221
 
203
222
            int item = m_headerMenu->insertItem( i18n( "Element Type" ), 0 );
204
223
            m_headerMenu->setItemChecked( item, settings->editing_MainListColumnsWidth[ 0 ] > 0 );
206
225
 
207
226
            for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ )
208
227
            {
209
 
                BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType ) ( i + ( int ) BibTeX::EntryField::ftAbstract );
 
228
                BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract );
210
229
                QString label = Settings::fieldTypeToI18NString( fieldType );
211
230
                item = m_headerMenu->insertItem( label, ( int ) fieldType + 2 );
212
231
                m_headerMenu->setItemChecked( item, settings->editing_MainListColumnsWidth[ i + 2 ] > 0 );
221
240
        while ( it.current() )
222
241
        {
223
242
            DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
224
 
            m_bibtexFile->deleteElement( kblvi->element() );
225
 
            it++;
226
 
            takeItem( kblvi );
227
 
            delete ( kblvi );
 
243
            if ( kblvi->isVisible() )
 
244
            {
 
245
                m_bibtexFile->deleteElement( kblvi->element() );
 
246
                it++;
 
247
                takeItem( kblvi );
 
248
                delete( kblvi );
 
249
            }
228
250
        }
229
251
 
230
252
        if ( above )
246
268
        {
247
269
            DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
248
270
            BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( kblvi->element() );
249
 
            if ( entry != NULL )
 
271
            if ( entry != NULL && kblvi->isVisible() )
250
272
            {
251
273
                if ( !refs.isEmpty() )
252
274
                    refs.append( "," );
269
291
        QListViewItem * lvi = selectedItem();
270
292
        if ( lvi == NULL )
271
293
            lvi = currentItem();
272
 
 
273
294
        DocumentListViewItem * dlvi = NULL;
274
295
        if ( lvi != NULL )
275
296
            dlvi = dynamic_cast<KBibTeX::DocumentListViewItem *>( lvi );
276
297
 
277
 
        BibTeX::FileImporter *importer = NULL;
278
 
        if ( BibTeX::FileImporterBibTeX::guessCanDecode( kapp->clipboard() ->text() ) )
279
 
            importer = new BibTeX::FileImporterBibTeX();
280
 
 
281
 
        if ( ! importer )
282
 
        {
283
 
            // Decoding the paste text as bibtex failed. Maybe the user wants to paste the text as
284
 
            // link address, abstract, etc...
285
 
            if ( ! dlvi )
286
 
                return FALSE;
 
298
        QString clipboardText = kapp->clipboard() ->text();
 
299
        /** check if clipboard contains BibTeX content */
 
300
        if ( BibTeX::FileImporterBibTeX::guessCanDecode( clipboardText ) )
 
301
        {
 
302
            Settings * settings = Settings::self( m_bibtexFile );
 
303
            BibTeX::FileImporter *importer = new BibTeX::FileImporterBibTeX( settings->editing_FirstNameFirst );
 
304
            BibTeX::File *clipboardData = importer->load( clipboardText );
 
305
            delete importer;
 
306
 
 
307
            if ( clipboardData != NULL && clipboardData->count() > 0 )
 
308
            {
 
309
                bool result = insertItems( clipboardData, dlvi );
 
310
                delete clipboardData;
 
311
                return result;
 
312
            }
 
313
            else
 
314
                return FALSE;
 
315
        }
 
316
        else
 
317
        {
 
318
            /** Decoding the paste text as bibtex failed. Maybe the user wants
 
319
                to paste the text as link address, abstract, etc... */
 
320
            if ( !dlvi ) // no list view item selected to add data to
 
321
                return FALSE;
 
322
 
 
323
            // fetch BibTeX element from current list view item
287
324
            BibTeX::Entry * element = dynamic_cast<BibTeX::Entry*>( dlvi->element() );
288
325
            if ( ! element )
289
326
                return FALSE;
 
327
 
 
328
            // build popup menu
290
329
            KPopupMenu * popup = new KPopupMenu( this, "pastePopup" );
291
330
            popup->insertTitle( i18n( "Paste text as..." ) );
292
 
            for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear; i++ )
 
331
            for ( int i = ( int ) BibTeX::EntryField::ftAuthor; i <= ( int ) BibTeX::EntryField::ftYear; i++ )
293
332
            {
294
 
                BibTeX::EntryField::FieldType ft;
295
 
                ft = ( BibTeX::EntryField::FieldType ) i;
 
333
                BibTeX::EntryField::FieldType ft = ( BibTeX::EntryField::FieldType ) i;
296
334
                popup->insertItem( Settings::fieldTypeToI18NString( ft ), i );
297
335
            }
298
336
            popup->insertSeparator();
299
337
            QIconSet cancelPixmap = KGlobal::iconLoader() ->loadIconSet( "cancel", KIcon::Small );
300
338
            int cancelId = popup->insertItem( cancelPixmap, i18n( "Cancel" ) );
 
339
 
 
340
            // show popup menu
301
341
            int selectedId = popup->exec( QCursor::pos() );
302
342
            if ( selectedId == cancelId || selectedId == -1 )
303
 
                return FALSE;
 
343
                return FALSE; // cancel menu
 
344
 
 
345
            // determine field to add clipboard value to
304
346
            BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType ) selectedId;
305
347
            BibTeX::EntryField * field = element->getField( fieldType );
306
 
            if ( ! field )
 
348
            if ( field == NULL )
307
349
            {
308
350
                field = new BibTeX::EntryField( fieldType );
309
351
                element->addField( field );
311
353
            else if ( field->value() != NULL )
312
354
                delete field->value();
313
355
 
314
 
            BibTeX::Value * value = NULL;
 
356
            clipboardText = BibTeX::EncoderLaTeX::currentEncoderLaTeX() ->encode( clipboardText );
 
357
 
 
358
            // create new value from clipboard's content
 
359
            BibTeX::Value * value = new BibTeX::Value();
315
360
            if ( fieldType == BibTeX::EntryField::ftAuthor || fieldType == BibTeX::EntryField::ftEditor )
316
 
                value = new BibTeX::ValuePersons();
 
361
            {
 
362
                Settings * settings = Settings::self( m_bibtexFile );
 
363
                value->items.append( new BibTeX::PersonContainer( clipboardText, settings->editing_FirstNameFirst ) );
 
364
            }
 
365
            else if ( fieldType == BibTeX::EntryField::ftKeywords )
 
366
                value->items.append( new BibTeX::KeywordContainer( clipboardText ) );
317
367
            else
318
 
                value = new BibTeX::Value();
319
 
            QString stringValue = kapp->clipboard() ->text();
320
 
            // FIXME: I assume that the encoding is correct here; i am not sure if
321
 
            // this is ok; maybe I need a construct like in
322
 
            // BibTeXFileImporterBibTeX::load() here;
323
 
            // maybe Thomas Fischer knows if this needs fixing...
324
 
            // TF: I assume that all clipboard content is UTF-8 ...
325
 
            stringValue = BibTeX::EncoderLaTeX::currentEncoderLaTeX() ->encode( stringValue );
 
368
                value->items.append( new BibTeX::PlainText( clipboardText ) );
326
369
 
327
 
            value->add( new BibTeX::ValueItem( stringValue, FALSE ) );
328
370
            field->setValue( value );
 
371
 
329
372
            return TRUE;
330
373
        }
331
 
 
332
 
        BibTeX::File *clipboardData = importer->load( kapp->clipboard() ->text() );
333
 
        delete importer;
334
 
 
335
 
        if ( clipboardData != NULL )
336
 
            return insertItems( clipboardData, dlvi );
 
374
    }
 
375
 
 
376
    void DocumentListView::sendSelectedToLyx()
 
377
    {
 
378
        QStringList refsToSend;
 
379
        QListViewItemIterator it( this, QListViewItemIterator::Selected );
 
380
        while ( it.current() )
 
381
        {
 
382
            DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
 
383
            BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( kblvi->element() );
 
384
            if ( entry != NULL && kblvi->isVisible() )
 
385
                refsToSend.append( entry->id() );
 
386
            it++;
 
387
        }
 
388
 
 
389
        Settings * settings = Settings::self( m_bibtexFile );
 
390
        QString lyxPipeFilename = settings->detectLyXInPipe();
 
391
        kdDebug() << "sendSelectedToLyx: lyxPipeFilename= " << lyxPipeFilename << endl;
 
392
        QFile pipe( lyxPipeFilename );
 
393
        if ( pipe.exists() && pipe.open( IO_WriteOnly ) )
 
394
        {
 
395
            QTextStream * writer = new QTextStream( &pipe );
 
396
            QString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," );
 
397
            *writer << msg << endl;
 
398
            delete writer;
 
399
            pipe.close();
 
400
        }
337
401
        else
338
 
            return FALSE;
 
402
            KMessageBox::error( this, ( lyxPipeFilename.isEmpty() ? i18n( "Cannot establish a link to LyX" ) : QString( i18n( "Cannot establish a link to LyX using the pipe \"%1\"" ) ).arg( lyxPipeFilename ) ) + i18n( "\nMaybe LyX is not running?" ), i18n( "Error communicating with LyX" ) );
339
403
    }
340
404
 
341
405
    void DocumentListView::slotDoubleClick( QListViewItem *item )
342
406
    {
343
 
        Settings * settings = Settings::self();
 
407
        Settings * settings = Settings::self( m_bibtexFile );
344
408
        bool openingDocumentOK = FALSE;
345
409
 
346
410
        if ( settings->editing_MainListDoubleClickAction == 1 )
363
427
                        KURL url = KURL( *it );
364
428
                        if ( url.isValid() && ( !url.isLocalFile() || QFile::exists( url.path() ) ) )
365
429
                        {
366
 
                            kapp->invokeBrowser( url.prettyURL() );
 
430
                            new KRun( url, this );
367
431
                            openingDocumentOK = TRUE;
368
432
                            break;
369
433
                        }
373
437
        }
374
438
 
375
439
        if ( !openingDocumentOK )
376
 
            editElement( item );
 
440
            m_docWidget->editElement( );
377
441
    }
378
442
 
379
443
 
412
476
                    {
413
477
                        BibTeX::Macro* macro = dynamic_cast<BibTeX::Macro*>( lvi->element() );
414
478
                        if ( macro )
 
479
                        {
415
480
                            dialogResult = KBibTeX::MacroWidget::execute( macro, m_isReadOnly );
416
 
                        if ( dialogResult == QDialog::Accepted )
417
 
                            result = macro;
 
481
                            if ( dialogResult == QDialog::Accepted )
 
482
                                result = macro;
 
483
                        }
 
484
                        else
 
485
                        {
 
486
                            BibTeX::Preamble* preamble = dynamic_cast<BibTeX::Preamble*>( lvi->element() );
 
487
                            if ( preamble )
 
488
                            {
 
489
                                dialogResult = KBibTeX::PreambleWidget::execute( preamble, m_isReadOnly );
 
490
                                if ( dialogResult == QDialog::Accepted )
 
491
                                    result = preamble;
 
492
                            }
 
493
                        }
418
494
                    }
419
495
                }
420
496
 
467
543
 
468
544
    void DocumentListView::setSortingColumn( int column )
469
545
    {
470
 
        Settings * settings = Settings::self();
 
546
        Settings * settings = Settings::self( m_bibtexFile );
471
547
        settings->editing_MainListSortingColumn = column;
472
548
        settings->editing_MainListSortingOrder = ( sortOrder() == Qt::Ascending ) ? 1 : -1;
473
549
    }
474
550
 
475
551
    bool DocumentListView::acceptDrag( QDropEvent * event ) const
476
552
    {
477
 
        return QTextDrag::canDecode( event ) || QUriDrag::canDecode( event );;
 
553
        return QTextDrag::canDecode( event ) || QUriDrag::canDecode( event );
478
554
    }
479
555
 
480
 
    void DocumentListView::saveColumnIndex( int col )
 
556
    void DocumentListView::saveColumnIndex()
481
557
    {
482
 
        Settings * settings = Settings::self();
 
558
        Settings * settings = Settings::self( m_bibtexFile );
483
559
        QHeader *hdr = header();
484
560
 
485
 
        int from = col == -1 ? 0 : col, to = col == -1 ? columns() : ( col + 1 );
486
 
 
487
 
        for ( int i = from; i < to; i++ )
488
 
        {
 
561
        for ( int i = 0; i < columns(); i++ )
489
562
            settings->editing_MainListColumnsIndex[ i ] = hdr->mapToIndex( i );
490
 
        }
491
563
    }
492
564
 
493
565
    void DocumentListView::restoreColumnIndex()
494
566
    {
495
 
        Settings * settings = Settings::self();
 
567
        Settings * settings = Settings::self( m_bibtexFile );
496
568
        QHeader *hdr = header();
497
569
 
498
570
        for ( int i = 0; i < columns(); i++ )
501
573
 
502
574
    void DocumentListView::saveColumnWidths( int col )
503
575
    {
504
 
        Settings * settings = Settings::self();
 
576
        Settings * settings = Settings::self( m_bibtexFile );
505
577
 
506
578
        int from = col == -1 ? 0 : col, to = col == -1 ? columns() : ( col + 1 );
507
579
 
516
588
 
517
589
    void DocumentListView::restoreColumnWidths()
518
590
    {
519
 
        Settings * settings = Settings::self();
 
591
        Settings * settings = Settings::self( m_bibtexFile );
520
592
 
521
593
        for ( int col = 0; col < columns(); col++ )
522
594
        {
527
599
 
528
600
    void DocumentListView::restoreSortingColumn()
529
601
    {
530
 
        Settings * settings = Settings::self();
 
602
        Settings * settings = Settings::self( m_bibtexFile );
531
603
        setSortColumn( settings->editing_MainListSortingColumn );
532
604
        setSortOrder( settings->editing_MainListSortingOrder > 0 ? Qt::Ascending : Qt::Descending );
533
605
    }
548
620
        QString text;
549
621
        QStrList urlList;
550
622
 
551
 
        if ( QUriDrag::decode( event, urlList ) )
 
623
        if ( QTextDrag::decode( event, text ) && KURL( text ).isValid() )
 
624
            urlList.append( text );
 
625
 
 
626
        if ( !urlList.isEmpty() || QUriDrag::decode( event, urlList ) )
552
627
        {
553
 
            QString url = urlList.at ( 0 );
 
628
            QString url = urlList.at( 0 );
554
629
            QString tmpFile;
555
630
            if ( ! KIO::NetAccess::download( url, tmpFile, 0 ) )
556
631
            {
568
643
            text = QString( ba );
569
644
            f.close();
570
645
            KIO::NetAccess::removeTempFile( tmpFile );
571
 
 
572
646
        }
573
 
        else if ( ! QTextDrag::decode( event, text ) )
574
 
            return ;
 
647
        else if ( !QTextDrag::decode( event, text ) )
 
648
            return;
575
649
 
576
650
        event->accept( TRUE );
577
651
        DocumentListViewItem * dlvi = dynamic_cast<KBibTeX::DocumentListViewItem *>( item );
578
652
        BibTeX::FileImporter *importer = NULL;
579
653
        if ( BibTeX::FileImporterBibTeX::guessCanDecode( text ) )
580
 
            importer = new BibTeX::FileImporterBibTeX();
 
654
        {
 
655
            Settings * settings = Settings::self( m_bibtexFile );
 
656
            importer = new BibTeX::FileImporterBibTeX( settings->editing_FirstNameFirst );
 
657
        }
581
658
        //        else if (BibTeX::FileImporterExternal::guessCanDecode( text ))
582
659
        //            importer = new BibTeX::FileImporterExternal();
583
660
        else
621
698
        while ( it.current() )
622
699
        {
623
700
            DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
624
 
            exporter->save( &buffer, kblvi->element() );
 
701
            if ( kblvi->isVisible() )
 
702
                exporter->save( &buffer, kblvi->element() );
625
703
            it++;
626
704
        }
627
705
        delete exporter;
650
728
                    break;
651
729
                }
652
730
 
653
 
            default: break;
 
731
            default:
 
732
                break;
654
733
            }
655
734
        }
656
735
 
657
736
        return KListView::eventFilter( watched, e );
658
737
    }
659
738
 
660
 
    void DocumentListView::keyPressEvent ( QKeyEvent *e )
 
739
    void DocumentListView::keyPressEvent( QKeyEvent *e )
661
740
    {
662
741
        if ( e->key() == QKeyEvent::Key_Enter || e->key() == QKeyEvent::Key_Return )
663
 
        {
664
742
            slotDoubleClick();
665
 
        }
666
743
        else
667
744
            KListView::keyPressEvent( e );
668
745
    }
698
775
 
699
776
        for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ )
700
777
        {
701
 
            BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType ) ( i + ( int ) BibTeX::EntryField::ftAbstract );
 
778
            BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract );
702
779
            QString label = Settings::fieldTypeToI18NString( fieldType );
703
780
            addColumn( label );
704
781
        }