diff options
Diffstat (limited to 'src/mergeelements.cpp')
-rw-r--r-- | src/mergeelements.cpp | 196 |
1 files changed, 98 insertions, 98 deletions
diff --git a/src/mergeelements.cpp b/src/mergeelements.cpp index 9ad05d7..3bb1083 100644 --- a/src/mergeelements.cpp +++ b/src/mergeelements.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include <cmath> -#include <qlayout.h> -#include <qlabel.h> -#include <qprogressbar.h> -#include <qtimer.h> +#include <ntqlayout.h> +#include <ntqlabel.h> +#include <ntqprogressbar.h> +#include <ntqtimer.h> #include <klocale.h> #include <kpushbutton.h> @@ -45,8 +45,8 @@ namespace KBibTeX { - MergeElementsCliqueItem::MergeElementsCliqueItem( BibTeX::Entry* _entry, BibTeX::Macro* _macro, BibTeX::Preamble* _preamble, QListView *parent ) - : QCheckListItem( parent, _entry == NULL ?( _macro == NULL ? _preamble->value()->text() : _macro->key() ) : _entry->id(), QCheckListItem::CheckBox ), entry( _entry ), macro( _macro ), preamble( _preamble ) + MergeElementsCliqueItem::MergeElementsCliqueItem( BibTeX::Entry* _entry, BibTeX::Macro* _macro, BibTeX::Preamble* _preamble, TQListView *parent ) + : TQCheckListItem( parent, _entry == NULL ?( _macro == NULL ? _preamble->value()->text() : _macro->key() ) : _entry->id(), TQCheckListItem::CheckBox ), entry( _entry ), macro( _macro ), preamble( _preamble ) { // nothing } @@ -56,71 +56,71 @@ namespace KBibTeX emit stateChanged( this ); }; - MergeEntriesAlternativesController::MergeEntriesAlternativesController( const QString &label, QListView *parent ) - : QCheckListItem( parent, label, QCheckListItem::RadioButtonController ), fieldType( BibTeX::EntryField::ftUnknown ), fieldName( label ) + MergeEntriesAlternativesController::MergeEntriesAlternativesController( const TQString &label, TQListView *parent ) + : TQCheckListItem( parent, label, TQCheckListItem::RadioButtonController ), fieldType( BibTeX::EntryField::ftUnknown ), fieldName( label ) { // nothing } - MergeEntriesAlternativesController::MergeEntriesAlternativesController( BibTeX::EntryField::FieldType _fieldType, QListView *parent ) - : QCheckListItem( parent, BibTeX::EntryField::fieldTypeToString( _fieldType ), QCheckListItem::RadioButtonController ), fieldType( _fieldType ), fieldName( BibTeX::EntryField::fieldTypeToString( _fieldType ) ) + MergeEntriesAlternativesController::MergeEntriesAlternativesController( BibTeX::EntryField::FieldType _fieldType, TQListView *parent ) + : TQCheckListItem( parent, BibTeX::EntryField::fieldTypeToString( _fieldType ), TQCheckListItem::RadioButtonController ), fieldType( _fieldType ), fieldName( BibTeX::EntryField::fieldTypeToString( _fieldType ) ) { // nothing } - MergeMacrosAlternativesController::MergeMacrosAlternativesController( bool isKey, QListView *parent ) - : QCheckListItem( parent, isKey ? i18n( "Key" ) : i18n( "Value" ), QCheckListItem::RadioButtonController ) + MergeMacrosAlternativesController::MergeMacrosAlternativesController( bool isKey, TQListView *parent ) + : TQCheckListItem( parent, isKey ? i18n( "Key" ) : i18n( "Value" ), TQCheckListItem::RadioButtonController ) { // nothing } MergeEntriesAlternativesItem::MergeEntriesAlternativesItem( BibTeX::EntryField *_field, MergeEntriesAlternativesController *parent ) - : QCheckListItem( parent, _field->value()->text(), QCheckListItem::RadioButton ), field( _field ) + : TQCheckListItem( parent, _field->value()->text(), TQCheckListItem::RadioButton ), field( _field ) { // nothing } MergeMacrosAlternativesItem::MergeMacrosAlternativesItem( BibTeX::Value *_value, MergeMacrosAlternativesController *parent ) - : QCheckListItem( parent, _value->text(), QCheckListItem::RadioButton ), value( _value ) + : TQCheckListItem( parent, _value->text(), TQCheckListItem::RadioButton ), value( _value ) { // nothing } - MergeElementsAlternativesId::MergeElementsAlternativesId( const QString & _id, MergeEntriesAlternativesController *parent ) : QCheckListItem( parent, _id, QCheckListItem::RadioButton ), id( _id ) + MergeElementsAlternativesId::MergeElementsAlternativesId( const TQString & _id, MergeEntriesAlternativesController *parent ) : TQCheckListItem( parent, _id, TQCheckListItem::RadioButton ), id( _id ) { // nothing } - MergeMacroAlternativesKey::MergeMacroAlternativesKey( const QString & _key, MergeMacrosAlternativesController *parent ) : QCheckListItem( parent, _key, QCheckListItem::RadioButton ), key( _key ) + MergeMacroAlternativesKey::MergeMacroAlternativesKey( const TQString & _key, MergeMacrosAlternativesController *parent ) : TQCheckListItem( parent, _key, TQCheckListItem::RadioButton ), key( _key ) { // nothing } - MergeEntriesAlternativesEntryType::MergeEntriesAlternativesEntryType( const QString & _typeString, MergeEntriesAlternativesController *parent ) - : QCheckListItem( parent, _typeString, QCheckListItem::RadioButton ), typeString( _typeString ), type( BibTeX::Entry::entryTypeFromString( _typeString ) ) + MergeEntriesAlternativesEntryType::MergeEntriesAlternativesEntryType( const TQString & _typeString, MergeEntriesAlternativesController *parent ) + : TQCheckListItem( parent, _typeString, TQCheckListItem::RadioButton ), typeString( _typeString ), type( BibTeX::Entry::entryTypeFromString( _typeString ) ) { // nothing } MergeEntriesAlternativesEntryType::MergeEntriesAlternativesEntryType( BibTeX::Entry::EntryType _type, MergeEntriesAlternativesController *parent ) - : QCheckListItem( parent, BibTeX::Entry::entryTypeToString( _type ), QCheckListItem::RadioButton ), typeString( BibTeX::Entry::entryTypeToString( _type ) ), type( _type ) + : TQCheckListItem( parent, BibTeX::Entry::entryTypeToString( _type ), TQCheckListItem::RadioButton ), typeString( BibTeX::Entry::entryTypeToString( _type ) ), type( _type ) { // nothing } - MergePreambleAlternativesController::MergePreambleAlternativesController( QListView *parent ) - : QCheckListItem( parent, i18n( "Preamble text" ), QCheckListItem::RadioButtonController ) + MergePreambleAlternativesController::MergePreambleAlternativesController( TQListView *parent ) + : TQCheckListItem( parent, i18n( "Preamble text" ), TQCheckListItem::RadioButtonController ) { // nothing } - MergePreambleAlternatives::MergePreambleAlternatives( const QString &_text, MergePreambleAlternativesController *parent ) - :QCheckListItem( parent, _text, QCheckListItem::RadioButton ), text( _text ) + MergePreambleAlternatives::MergePreambleAlternatives( const TQString &_text, MergePreambleAlternativesController *parent ) + :TQCheckListItem( parent, _text, TQCheckListItem::RadioButton ), text( _text ) { // nothing } - MergeElements::MergeElements( QWidget *parent ) + MergeElements::MergeElements( TQWidget *parent ) : KDialogBase( parent, "MergeElements", true, "undefined", Ok | Cancel | User1 | User2, User1, true, KGuiItem( i18n( "Next" ), "next" ), KGuiItem( i18n( "Previous" ), "previous" ) ), m_currentCliqueIndex( 0 ) { setupGUI(); @@ -135,13 +135,13 @@ namespace KBibTeX void MergeElements::setupGUI() { - QWidget *vboxContainer = new QWidget( this ); + TQWidget *vboxContainer = new TQWidget( this ); setMainWidget( vboxContainer ); - QBoxLayout *vboxLayout = new QVBoxLayout( vboxContainer, 0, KDialog::spacingHint() ); - vboxLayout->setResizeMode( QLayout::Minimum ); + TQBoxLayout *vboxLayout = new TQVBoxLayout( vboxContainer, 0, KDialog::spacingHint() ); + vboxLayout->setResizeMode( TQLayout::Minimum ); - QLabel *label = new QLabel( i18n( "Select elements to merge. At least two elements must be checked to perform a merge operation. Checked entries will be replaced by the merged element, unchecked elements will be kept." ), vboxContainer ); - label->setAlignment( Qt::WordBreak ); + TQLabel *label = new TQLabel( i18n( "Select elements to merge. At least two elements must be checked to perform a merge operation. Checked entries will be replaced by the merged element, unchecked elements will be kept." ), vboxContainer ); + label->setAlignment( TQt::WordBreak ); vboxLayout->addWidget( label ); m_listViewClique = new KListView( vboxContainer ); m_listViewClique->addColumn( i18n( "Entry/Macro Id" ) ); @@ -151,13 +151,13 @@ namespace KBibTeX vboxLayout->setStretchFactor( m_listViewClique, 1 ); label->setBuddy( m_listViewClique ); - m_progressBar = new QProgressBar( vboxContainer ); + m_progressBar = new TQProgressBar( vboxContainer ); vboxLayout->addWidget( m_progressBar ); vboxLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "Choose from this list which alternatives you want to keep in the merged element." ), vboxContainer ); - label->setAlignment( Qt::WordBreak ); + label = new TQLabel( i18n( "Choose from this list which alternatives you want to keep in the merged element." ), vboxContainer ); + label->setAlignment( TQt::WordBreak ); vboxLayout->addWidget( label ); m_listViewAlternatives = new KListView( vboxContainer ); m_listViewAlternatives->addColumn( i18n( "Field/Key" ) ); @@ -167,7 +167,7 @@ namespace KBibTeX vboxLayout->setStretchFactor( m_listViewAlternatives, 3 ); label->setBuddy( m_listViewAlternatives ); - connect( m_listViewClique, SIGNAL( doubleClicked( QListViewItem * ) ), this, SLOT( slotPreviewElement( QListViewItem * ) ) ); + connect( m_listViewClique, SIGNAL( doubleClicked( TQListViewItem * ) ), this, SLOT( slotPreviewElement( TQListViewItem * ) ) ); connect( this, SIGNAL( user1Clicked() ), this, SLOT( slotNextClique() ) ); connect( this, SIGNAL( user2Clicked() ), this, SLOT( slotPreviousClique() ) ); connect( this, SIGNAL( okClicked() ), this, SLOT( saveCurrentMergeSet() ) ); @@ -226,13 +226,13 @@ namespace KBibTeX m_mergeSetList[m_currentCliqueIndex]->fields.clear(); } m_mergeSetList[m_currentCliqueIndex]->type = BibTeX::Entry::etUnknown; - m_mergeSetList[m_currentCliqueIndex]->typeString = QString::null; - m_mergeSetList[m_currentCliqueIndex]->id = QString::null; - m_mergeSetList[m_currentCliqueIndex]->macroKey = QString::null; + m_mergeSetList[m_currentCliqueIndex]->typeString = TQString::null; + m_mergeSetList[m_currentCliqueIndex]->id = TQString::null; + m_mergeSetList[m_currentCliqueIndex]->macroKey = TQString::null; m_mergeSetList[m_currentCliqueIndex]->macroValue = NULL; - m_mergeSetList[m_currentCliqueIndex]->preambleText=QString::null; + m_mergeSetList[m_currentCliqueIndex]->preambleText=TQString::null; - for ( QListViewItemIterator it( m_listViewClique, QListViewItemIterator::Checked ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewClique, TQListViewItemIterator::Checked ); it.current(); ++it ) { MergeElementsCliqueItem *eci = dynamic_cast<MergeElementsCliqueItem*>( *it ); BibTeX::Entry *entry = eci->entry; @@ -246,7 +246,7 @@ namespace KBibTeX m_mergeSetList[m_currentCliqueIndex]->preambles.append( preamble ); } - for ( QListViewItemIterator it( m_listViewAlternatives, QListViewItemIterator::Checked ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewAlternatives, TQListViewItemIterator::Checked ); it.current(); ++it ) { MergeEntriesAlternativesItem *item = dynamic_cast<MergeEntriesAlternativesItem*>( *it ); if ( item != NULL ) @@ -298,14 +298,14 @@ namespace KBibTeX return; } - for ( QListViewItemIterator it( m_listViewClique ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewClique ); it.current(); ++it ) { MergeElementsCliqueItem *item = dynamic_cast<MergeElementsCliqueItem*>( *it ); BibTeX::Entry *entry = item->entry; BibTeX::Macro *macro = item->macro; BibTeX::Preamble *preamble = item->preamble; if ( entry != NULL ) - for ( QValueList<BibTeX::Entry*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->entries.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->entries.end(); ++it2 ) + for ( TQValueList<BibTeX::Entry*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->entries.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->entries.end(); ++it2 ) { if ( entry->id() == ( *it2 )->id() ) { @@ -315,7 +315,7 @@ namespace KBibTeX } else if ( macro != NULL ) { - for ( QValueList<BibTeX::Macro*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->macros.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->macros.end(); ++it2 ) + for ( TQValueList<BibTeX::Macro*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->macros.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->macros.end(); ++it2 ) if ( macro->key() == ( *it2 )->key() ) { item->setOn( true ); @@ -323,7 +323,7 @@ namespace KBibTeX } } else if ( preamble!=NULL ) - for ( QValueList<BibTeX::Preamble*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->preambles.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->preambles.end(); ++it2 ) + for ( TQValueList<BibTeX::Preamble*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->preambles.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->preambles.end(); ++it2 ) if ( preamble->value()->text() == ( *it2 )->value()->text() ) { item->setOn( true ); @@ -333,12 +333,12 @@ namespace KBibTeX slotRefreshAlternatives(); - for ( QListViewItemIterator it( m_listViewAlternatives ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewAlternatives ); it.current(); ++it ) { MergeEntriesAlternativesItem *item = dynamic_cast<MergeEntriesAlternativesItem*>( *it ); if ( item != NULL ) { - for ( QValueList<BibTeX::EntryField*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->fields.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->fields.end(); ++it2 ) + for ( TQValueList<BibTeX::EntryField*>::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->fields.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->fields.end(); ++it2 ) if ( item->field->fieldTypeName().lower() == ( *it2 )->fieldTypeName().lower() && item->field->value()->text() == ( *it2 )->value()->text() ) { item->setOn( true ); @@ -386,7 +386,7 @@ namespace KBibTeX mpa->setOn( true ); } else - qDebug( "Item is of unknown type" ); + tqDebug( "Item is of unknown type" ); } } } @@ -404,12 +404,12 @@ namespace KBibTeX if ( !m_mergeSetList[i]->entries.isEmpty() ) { - QString id = m_mergeSetList[i]->id == QString::null ? ( *m_mergeSetList[i]->entries.begin() )->id() : m_mergeSetList[i]->id; + TQString id = m_mergeSetList[i]->id == TQString::null ? ( *m_mergeSetList[i]->entries.begin() )->id() : m_mergeSetList[i]->id; BibTeX::Entry *newEntry = NULL; if ( m_mergeSetList[i]->type == BibTeX::Entry::etUnknown ) { - if ( m_mergeSetList[i]->typeString == QString::null ) + if ( m_mergeSetList[i]->typeString == TQString::null ) { BibTeX::Entry *firstEntry = *m_mergeSetList[i]->entries.begin(); if ( firstEntry->entryType() == BibTeX::Entry::etUnknown ) @@ -423,19 +423,19 @@ namespace KBibTeX else newEntry = new BibTeX::Entry( m_mergeSetList[i]->type, id ); - for ( QValueList<BibTeX::EntryField*>::Iterator it = m_mergeSetList[i]->fields.begin(); it != m_mergeSetList[i]->fields.end(); ++it ) + for ( TQValueList<BibTeX::EntryField*>::Iterator it = m_mergeSetList[i]->fields.begin(); it != m_mergeSetList[i]->fields.end(); ++it ) { newEntry->addField( new BibTeX::EntryField( *it ) ); } - for ( QValueList<BibTeX::Entry*>::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) - for ( QValueList<BibTeX::EntryField*>::ConstIterator fIt = ( *it )->begin(); fIt != ( *it )->end(); ++fIt ) + for ( TQValueList<BibTeX::Entry*>::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) + for ( TQValueList<BibTeX::EntryField*>::ConstIterator fIt = ( *it )->begin(); fIt != ( *it )->end(); ++fIt ) if ( newEntry->getField(( *fIt )->fieldTypeName() ) == NULL ) { newEntry->addField( new BibTeX::EntryField( *fIt ) ); } - for ( QValueList<BibTeX::Entry*>::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) + for ( TQValueList<BibTeX::Entry*>::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) { BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( bibTeXFile->containsKey(( *it )->id() ) ); if ( entry != NULL ) @@ -454,7 +454,7 @@ namespace KBibTeX BibTeX::Macro *newMacro = new BibTeX::Macro( m_mergeSetList[i]->macroKey ); newMacro->setValue( m_mergeSetList[i]->macroValue ); - for ( QValueList<BibTeX::Macro*>::Iterator it = m_mergeSetList[i]->macros.begin(); it != m_mergeSetList[i]->macros.end(); ++it ) + for ( TQValueList<BibTeX::Macro*>::Iterator it = m_mergeSetList[i]->macros.begin(); it != m_mergeSetList[i]->macros.end(); ++it ) { bibTeXFile->deleteElement( *it ); if ( otherBibTeXFile != NULL ) @@ -467,7 +467,7 @@ namespace KBibTeX { BibTeX::Preamble *newPreamble = new BibTeX::Preamble( m_mergeSetList[i]->preambleText ); - for ( QValueList<BibTeX::Preamble*>::Iterator it = m_mergeSetList[i]->preambles.begin(); it != m_mergeSetList[i]->preambles.end(); ++it ) + for ( TQValueList<BibTeX::Preamble*>::Iterator it = m_mergeSetList[i]->preambles.begin(); it != m_mergeSetList[i]->preambles.end(); ++it ) { bibTeXFile->deleteElement( *it ); if ( otherBibTeXFile != NULL ) @@ -484,23 +484,23 @@ namespace KBibTeX setCaption( i18n( "Find Duplicates" ) ); Settings * settings = Settings::self( NULL ); int sensitivity = ( int )( FindDuplicates::maxDistance / exp( log( 10 ) * settings->editing_findDuplicatesSensitivity / 10.0 ) ); - qDebug( "sensitivity= %i / %i", sensitivity, FindDuplicates::maxDistance ); + tqDebug( "sensitivity= %i / %i", sensitivity, FindDuplicates::maxDistance ); FindDuplicates findDuplicates( m_duplicateCliqueList, sensitivity, bibTeXFile, parentWidget( true ) ); if ( m_duplicateCliqueList.isEmpty() ) { KMessageBox::information( parentWidget( true ), i18n( "No duplicates found." ), i18n( "Find Duplicates" ) ); - return QDialog::Rejected; + return TQDialog::Rejected; } m_mergeSetList = new MergeSet*[m_duplicateCliqueList.size()]; memset( m_mergeSetList, 0, sizeof( MergeSet* )*m_duplicateCliqueList.size() ); - qDebug( "%i cliques", m_duplicateCliqueList.size() ); + tqDebug( "%i cliques", m_duplicateCliqueList.size() ); setClique( 0 ); int result = exec(); - if ( result == QDialog::Accepted ) + if ( result == TQDialog::Accepted ) applyMergeSet( bibTeXFile ); delete[] m_mergeSetList; @@ -510,24 +510,24 @@ namespace KBibTeX void MergeElements::slotRefreshAlternatives() { - QMap<BibTeX::EntryField::FieldType, MergeEntriesAlternativesController*> mapFieldToController; - QMap<BibTeX::EntryField::FieldType, First> firstEntryData; + TQMap<BibTeX::EntryField::FieldType, MergeEntriesAlternativesController*> mapFieldToController; + TQMap<BibTeX::EntryField::FieldType, First> firstEntryData; bool first = true; MergePreambleAlternativesController* preambleController = NULL; MergeMacrosAlternativesController* macroKeyController = NULL; MergeMacrosAlternativesController* macroValueController = NULL; MergeEntriesAlternativesController *idController = NULL; MergeEntriesAlternativesController *typeController = NULL; - QString firstId = QString::null; - QString firstMacroKey = QString::null; + TQString firstId = TQString::null; + TQString firstMacroKey = TQString::null; BibTeX::Value *firstMacroValue = NULL; - QString firstPreambleText = QString::null; + TQString firstPreambleText = TQString::null; BibTeX::Entry::EntryType firstType = BibTeX::Entry::etUnknown; - QString firstTypeString = QString::null; + TQString firstTypeString = TQString::null; m_listViewAlternatives->clear(); - for ( QListViewItemIterator it( m_listViewClique, QListViewItemIterator::Checked ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewClique, TQListViewItemIterator::Checked ); it.current(); ++it ) { MergeElementsCliqueItem *meci = dynamic_cast<MergeElementsCliqueItem*>( *it ); BibTeX::Entry *entry = NULL; @@ -563,9 +563,9 @@ namespace KBibTeX } else { - QString thisText = entry->id(); + TQString thisText = entry->id(); bool isNew = true; - for ( QListViewItem *cur = idController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) + for ( TQListViewItem *cur = idController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) { MergeElementsAlternativesId *meai = dynamic_cast<MergeElementsAlternativesId*>( cur ); isNew = meai->id != thisText; @@ -590,10 +590,10 @@ namespace KBibTeX } else { - QString typeString = entry->entryTypeString(); + TQString typeString = entry->entryTypeString(); BibTeX::Entry::EntryType type = entry->entryType(); bool isNew = true; - for ( QListViewItem *cur = typeController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) + for ( TQListViewItem *cur = typeController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) { MergeEntriesAlternativesEntryType *meat = dynamic_cast<MergeEntriesAlternativesEntryType*>( cur ); isNew = type == BibTeX::Entry::etUnknown && meat->typeString != typeString || meat->type != type; @@ -611,9 +611,9 @@ namespace KBibTeX if ( mapFieldToController.contains(( *efi )->fieldType() ) ) { MergeEntriesAlternativesController *controller = mapFieldToController[( *efi )->fieldType()]; - QString thisText = ( *efi )->value()->text(); + TQString thisText = ( *efi )->value()->text(); bool isNew = true; - for ( QListViewItem *cur = controller->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) + for ( TQListViewItem *cur = controller->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) { MergeEntriesAlternativesItem *meai = dynamic_cast<MergeEntriesAlternativesItem*>( cur ); isNew = meai->field->value()->text() != thisText; @@ -623,8 +623,8 @@ namespace KBibTeX } else if ( firstEntryData.contains(( *efi )->fieldType() ) ) { - QString firstText = firstEntryData[( *efi )->fieldType()].field->value()->text(); - QString thisText = ( *efi )->value()->text(); + TQString firstText = firstEntryData[( *efi )->fieldType()].field->value()->text(); + TQString thisText = ( *efi )->value()->text(); if ( firstText != thisText ) { MergeEntriesAlternativesController *controller = new MergeEntriesAlternativesController(( *efi )->fieldType(), m_listViewAlternatives ); @@ -666,9 +666,9 @@ namespace KBibTeX } else { - QString thisText = macro->key(); + TQString thisText = macro->key(); bool isNew = true; - for ( QListViewItem *cur = macroKeyController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) + for ( TQListViewItem *cur = macroKeyController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) { MergeMacroAlternativesKey *mak = dynamic_cast<MergeMacroAlternativesKey*>( cur ); isNew = mak->key != thisText; @@ -691,9 +691,9 @@ namespace KBibTeX } else { - QString macroString = macro->value()->text(); + TQString macroString = macro->value()->text(); bool isNew = true; - for ( QListViewItem *cur = macroValueController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) + for ( TQListViewItem *cur = macroValueController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) { MergeMacrosAlternativesItem *mai = dynamic_cast<MergeMacrosAlternativesItem*>( cur ); isNew = macroString != mai->value->text(); @@ -721,9 +721,9 @@ namespace KBibTeX } else { - QString thisText = preamble->value()->text(); + TQString thisText = preamble->value()->text(); bool isNew = true; - for ( QListViewItem *cur = preambleController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) + for ( TQListViewItem *cur = preambleController->firstChild(); isNew && cur != NULL; cur = cur->nextSibling() ) { MergePreambleAlternatives *mpa = dynamic_cast<MergePreambleAlternatives*>( cur ); isNew = mpa->text != thisText; @@ -757,7 +757,7 @@ namespace KBibTeX enableButton( User2, false ); } - void MergeElements::slotPreviewElement( QListViewItem *item ) + void MergeElements::slotPreviewElement( TQListViewItem *item ) { MergeElementsCliqueItem *meci = dynamic_cast<MergeElementsCliqueItem*>( item ); if ( meci != NULL && meci->entry != NULL ) @@ -771,8 +771,8 @@ namespace KBibTeX /* This function was taken form KMainWindow of KDE 3.5 and modified to fit KBibTeX */ void MergeElements::saveWindowSize( KConfig *config ) const { - int scnum = QApplication::desktop()->screenNumber( parentWidget() ); - QRect desk = QApplication::desktop()->screenGeometry( scnum ); + int scnum = TQApplication::desktop()->screenNumber( parentWidget() ); + TQRect desk = TQApplication::desktop()->screenGeometry( scnum ); int w, h; #if defined Q_WS_X11 // save maximalization as desktop size + 1 in that direction @@ -787,10 +787,10 @@ namespace KBibTeX } //TODO: add "Maximized" property instead "+1" hack #endif - QRect size( desk.width(), w, desk.height(), h ); + TQRect size( desk.width(), w, desk.height(), h ); bool defaultSize = false;//( size == d->defaultWindowSize ); - QString widthString = QString::fromLatin1( "Width %1" ).arg( desk.width() ); - QString heightString = QString::fromLatin1( "Height %1" ).arg( desk.height() ); + TQString widthString = TQString::fromLatin1( "Width %1" ).arg( desk.width() ); + TQString heightString = TQString::fromLatin1( "Height %1" ).arg( desk.height() ); if ( !config->hasDefault( widthString ) && defaultSize ) config->revertToDefault( widthString ); else @@ -802,15 +802,15 @@ namespace KBibTeX config->writeEntry( heightString, h ); } - void MergeElements::showEvent( QShowEvent * ) + void MergeElements::showEvent( TQShowEvent * ) { - qDebug( "showEvent" ); - QTimer::singleShot( 10, this, SLOT( slotRestore() ) ); + tqDebug( "showEvent" ); + TQTimer::singleShot( 10, this, SLOT( slotRestore() ) ); } void MergeElements::slotRestore() { - qDebug( "slotRestore" ); + tqDebug( "slotRestore" ); KConfig * config = kapp->config(); config->setGroup( "MergeElements" ); restoreWindowSize( config ); @@ -820,20 +820,20 @@ namespace KBibTeX void MergeElements::restoreWindowSize( KConfig *config ) { // restore the size - int scnum = QApplication::desktop()->screenNumber( parentWidget() ); - QRect desk = QApplication::desktop()->screenGeometry( scnum ); - QSize size( config->readNumEntry( QString::fromLatin1( "Width %1" ).arg( desk.width() ), 0 ), - config->readNumEntry( QString::fromLatin1( "Height %1" ).arg( desk.height() ), 0 ) ); + int scnum = TQApplication::desktop()->screenNumber( parentWidget() ); + TQRect desk = TQApplication::desktop()->screenGeometry( scnum ); + TQSize size( config->readNumEntry( TQString::fromLatin1( "Width %1" ).arg( desk.width() ), 0 ), + config->readNumEntry( TQString::fromLatin1( "Height %1" ).arg( desk.height() ), 0 ) ); if ( size.isEmpty() ) { // try the KDE 2.0 way - size = QSize( config->readNumEntry( QString::fromLatin1( "Width" ), 0 ), - config->readNumEntry( QString::fromLatin1( "Height" ), 0 ) ); + size = TQSize( config->readNumEntry( TQString::fromLatin1( "Width" ), 0 ), + config->readNumEntry( TQString::fromLatin1( "Height" ), 0 ) ); if ( !size.isEmpty() ) { // make sure the other resolutions don't get old settings - config->writeEntry( QString::fromLatin1( "Width" ), 0 ); - config->writeEntry( QString::fromLatin1( "Height" ), 0 ); + config->writeEntry( TQString::fromLatin1( "Width" ), 0 ); + config->writeEntry( TQString::fromLatin1( "Height" ), 0 ); } } if ( !size.isEmpty() ) @@ -849,7 +849,7 @@ namespace KBibTeX resize( size.width(), height() ); else resize( size ); - // QWidget::showMaximized() is both insufficient and broken + // TQWidget::showMaximized() is both insufficient and broken KWin::setState( winId(), state ); #else if ( size.width() > desk.width() || size.height() > desk.height() ) |