Logo Search packages:      
Sourcecode: kbib version File versions  Download package

BibEntry * KBibEditEntryDlg::getBibEntry ( void   ) 

No descriptions

Definition at line 746 of file kbibeditentrydlg.cpp.

References BibEntry::clearExtraField(), GUI::FieldWidget::fieldName(), GUI::FieldWidget::getMacro(), GUI::FieldWidget::getText(), BibEntry::setField(), BibEntry::setKey(), and BibEntry::setStringMacroIndicator().

Referenced by slotCreateKey(), and slotEntryTypeChange().

{
      QString qst;
      qst = keyField->text();
      qst = qst.stripWhiteSpace();

      m_entry->setKey ( qst );

      GUI::FieldWidget *field = rqFields.first();

      QString lst;

      while ( field!=0 )
      {
            qst = field->getText();
            qst = qst.stripWhiteSpace();
            lst = field->fieldName();
            m_entry->setField ( lst.lower(), qst );
            m_entry->setStringMacroIndicator ( ( lst.lower() ), field->getMacro() );
            field = rqFields.next();

      }

      field = optFields.first();

      while ( field!=0 )
      {
            qst = field->getText();
            qst = qst.stripWhiteSpace();
            lst = field->fieldName();
            m_entry->setField ( lst.lower(), qst );
            m_entry->setStringMacroIndicator ( ( lst.lower() ), field->getMacro() );
            field = optFields.next();


      }

      QListViewItem *it =extraFieldView->firstChild();
      m_entry->clearExtraField();
      for ( int i = 0 ; i < extraFieldView->childCount(); i++ )
      {

            lst = it->text ( 1 );
            qst = it->text ( 2 );
            qst = qst.stripWhiteSpace();

            m_entry->setField ( lst, qst );
            QCheckListItem *itm = dynamic_cast<QCheckListItem*> ( it );
            m_entry->setStringMacroIndicator ( const_cast<char*> ( ( lst.lower() ).ascii() ), itm->isOn() );
            it = it->nextSibling();

      }

      /*
          if ( (BibEntryDefTable::self()->getBibEntryDef(m_entry->getEntryType()) )->getFieldIdx(QString::fromLatin1("abstract") ) >= 0)
              m_entry->setField(QString::fromLatin1("abstract"), abstractEdit->text() );

            if ( (BibEntryDefTable::self()->getBibEntryDef(m_entry->getEntryType()) )->getFieldIdx(QString::fromLatin1("comment") ) >= 0)
              m_entry->setField(QString::fromLatin1("comment"), noteEdit->text() );
      */
      if ( abstractEdit->isShown() )
            m_entry->setField ( QString::fromLatin1 ( "abstract" ), abstractEdit->text() );
      if ( noteEdit->isShown() )
            m_entry->setField ( QString::fromLatin1 ( "comment" ), noteEdit->text() );
      return m_entry;

}


Generated by  Doxygen 1.6.0   Back to index