summaryrefslogtreecommitdiffstats
path: root/src/entry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/entry.cpp')
-rw-r--r--src/entry.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/entry.cpp b/src/entry.cpp
index fcd81fd..00be859 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -17,9 +17,9 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qregexp.h>
+#include <ntqstring.h>
+#include <ntqstringlist.h>
+#include <ntqregexp.h>
#include <entry.h>
#include <file.h>
@@ -32,18 +32,18 @@ namespace BibTeX
{
Entry::Entry( )
- : Element(), m_entryType( etUnknown ), m_entryTypeString( QString::null ), m_id( QString::null )
+ : Element(), m_entryType( etUnknown ), m_entryTypeString( TQString::null ), m_id( TQString::null )
{
// nothing
}
- Entry::Entry( const EntryType entryType, const QString &id )
+ Entry::Entry( const EntryType entryType, const TQString &id )
: Element( ), m_entryType( entryType ), m_id( id )
{
m_entryTypeString = entryTypeToString( entryType );
}
- Entry::Entry( const QString& entryTypeString, const QString& id ) : Element( ), m_entryTypeString( entryTypeString ), m_id( id )
+ Entry::Entry( const TQString& entryTypeString, const TQString& id ) : Element( ), m_entryTypeString( entryTypeString ), m_id( id )
{
m_entryType = entryTypeFromString( entryTypeString );
if ( m_entryType != etUnknown )
@@ -85,9 +85,9 @@ namespace BibTeX
return true;
}
- QString Entry::text() const
+ TQString Entry::text() const
{
- QString result = "Id: ";
+ TQString result = "Id: ";
result.append( m_id ).append( " (" ).append( entryTypeString() ).append( ")\n" );
for ( EntryFields::ConstIterator it = m_fields.begin(); it != m_fields.end(); it++ )
@@ -105,7 +105,7 @@ namespace BibTeX
m_entryTypeString = entryTypeToString( entryType );
}
- void Entry::setEntryTypeString( const QString& entryTypeString )
+ void Entry::setEntryTypeString( const TQString& entryTypeString )
{
m_entryTypeString = entryTypeString;
m_entryType = entryTypeFromString( entryTypeString );
@@ -116,22 +116,22 @@ namespace BibTeX
return m_entryType;
}
- QString Entry::entryTypeString() const
+ TQString Entry::entryTypeString() const
{
return m_entryTypeString;
}
- void Entry::setId( const QString& id )
+ void Entry::setId( const TQString& id )
{
m_id = id;
}
- QString Entry::id() const
+ TQString Entry::id() const
{
return m_id;
}
- bool Entry::containsPattern( const QString & pattern, EntryField::FieldType fieldType, BibTeX::Element::FilterType filterType, bool caseSensitive ) const
+ bool Entry::containsPattern( const TQString & pattern, EntryField::FieldType fieldType, BibTeX::Element::FilterType filterType, bool caseSensitive ) const
{
if ( filterType == ftExact )
{
@@ -147,10 +147,10 @@ namespace BibTeX
else
{
/** for each word in the search pattern ... */
- QStringList words = QStringList::split( QRegExp( "\\s+" ), pattern );
+ TQStringList words = TQStringList::split( TQRegExp( "\\s+" ), pattern );
bool *hits = new bool[words.count()];
int i = 0;
- for ( QStringList::Iterator wit = words.begin(); wit != words.end(); ++wit, ++i )
+ for ( TQStringList::Iterator wit = words.begin(); wit != words.end(); ++wit, ++i )
{
hits[i] = fieldType == EntryField::ftUnknown && m_id.contains( *wit, caseSensitive );
@@ -170,18 +170,18 @@ namespace BibTeX
}
}
- QStringList Entry::urls() const
+ TQStringList Entry::urls() const
{
- QStringList result;
- const QString fieldNames[] = {"localfile", "pdf", "ps", "postscript", "doi", "url", "howpublished", "ee", "biburl", "note"};
+ TQStringList result;
+ const TQString fieldNames[] = {"localfile", "pdf", "ps", "postscript", "doi", "url", "howpublished", "ee", "biburl", "note"};
const int fieldNamesCount = sizeof( fieldNames ) / sizeof( fieldNames[0] );
for ( int j = 1; j < 5 ; ++j ) /** there may be variants such as url3 or doi2 */
for ( int i = 0; i < fieldNamesCount; i++ )
{
- QString fieldName = fieldNames[i];
+ TQString fieldName = fieldNames[i];
/** field names should be like url, url2, url3, ... */
- if ( j > 1 ) fieldName.append( QString::number( j ) );
+ if ( j > 1 ) fieldName.append( TQString::number( j ) );
EntryField * field = getField( fieldName );
if (( field && !field->value()->items.isEmpty() ) )
@@ -189,7 +189,7 @@ namespace BibTeX
PlainText *plainText = dynamic_cast<PlainText*>( field->value()->items.first() );
if ( plainText != NULL )
{
- QString plain = plainText->text();
+ TQString plain = plainText->text();
int urlPos = plain.find( "\\url{", 0, FALSE );
if ( urlPos > -1 )
{
@@ -226,7 +226,7 @@ namespace BibTeX
return result;
}
- EntryField* Entry::getField( const QString & fieldName ) const
+ EntryField* Entry::getField( const TQString & fieldName ) const
{
EntryField * result = NULL;
@@ -237,7 +237,7 @@ namespace BibTeX
return result;
}
- bool Entry::deleteField( const QString & fieldName )
+ bool Entry::deleteField( const TQString & fieldName )
{
for ( EntryFields::ConstIterator it = m_fields.begin(); it != m_fields.end(); it++ )
if (( *it ) ->fieldTypeName().lower() == fieldName.lower() )
@@ -303,7 +303,7 @@ namespace BibTeX
{
EntryField *otherField = new EntryField( *it );
EntryField::FieldType otherFieldType = otherField->fieldType();
- QString otherFieldTypeName = otherField->fieldTypeName();
+ TQString otherFieldTypeName = otherField->fieldTypeName();
EntryField *thisField = otherFieldType != EntryField::ftUnknown ? getField( otherFieldType ) : getField( otherFieldTypeName );
if ( thisField == NULL )
@@ -319,48 +319,48 @@ namespace BibTeX
}
}
- QString Entry::entryTypeToString( const EntryType entryType )
+ TQString Entry::entryTypeToString( const EntryType entryType )
{
switch ( entryType )
{
case etArticle:
- return QString( "Article" );
+ return TQString( "Article" );
case etBook:
- return QString( "Book" );
+ return TQString( "Book" );
case etBooklet:
- return QString( "Booklet" );
+ return TQString( "Booklet" );
case etCollection:
- return QString( "Collection" );
+ return TQString( "Collection" );
case etElectronic:
- return QString( "Electronic" );
+ return TQString( "Electronic" );
case etInBook:
- return QString( "InBook" );
+ return TQString( "InBook" );
case etInCollection:
- return QString( "InCollection" );
+ return TQString( "InCollection" );
case etInProceedings:
- return QString( "InProceedings" );
+ return TQString( "InProceedings" );
case etManual:
- return QString( "Manual" );
+ return TQString( "Manual" );
case etMastersThesis:
- return QString( "MastersThesis" );
+ return TQString( "MastersThesis" );
case etMisc:
- return QString( "Misc" );
+ return TQString( "Misc" );
case etPhDThesis:
- return QString( "PhDThesis" );
+ return TQString( "PhDThesis" );
case etProceedings:
- return QString( "Proceedings" );
+ return TQString( "Proceedings" );
case etTechReport:
- return QString( "TechReport" );
+ return TQString( "TechReport" );
case etUnpublished:
- return QString( "Unpublished" );
+ return TQString( "Unpublished" );
default:
- return QString( "Unknown" );
+ return TQString( "Unknown" );
}
}
- Entry::EntryType Entry::entryTypeFromString( const QString & entryTypeString )
+ Entry::EntryType Entry::entryTypeFromString( const TQString & entryTypeString )
{
- QString entryTypeStringLower = entryTypeString.lower();
+ TQString entryTypeStringLower = entryTypeString.lower();
if ( entryTypeStringLower == "article" )
return etArticle;
else if ( entryTypeStringLower == "book" )