From 5f5e7c5455d52826b0bd50f64fcffb7695ce970d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 29 Jun 2013 12:56:53 +0200 Subject: Initial TQt conversion --- src/comment.cpp | 16 +- src/comment.h | 10 +- src/commentwidget.cpp | 26 +-- src/commentwidget.h | 18 +- src/documentlistview.cpp | 172 +++++++++---------- src/documentlistview.h | 30 ++-- src/documentlistviewitem.cpp | 14 +- src/documentlistviewitem.h | 4 +- src/documentsourceview.cpp | 38 ++--- src/documentsourceview.h | 14 +- src/documentwidget.cpp | 354 +++++++++++++++++++-------------------- src/documentwidget.h | 58 +++---- src/element.cpp | 6 +- src/element.h | 8 +- src/encoder.h | 14 +- src/encoderlatex.cpp | 140 ++++++++-------- src/encoderlatex.h | 30 ++-- src/encoderxml.cpp | 26 +-- src/encoderxml.h | 22 +-- src/entry.cpp | 86 +++++----- src/entry.h | 40 ++--- src/entryfield.cpp | 78 ++++----- src/entryfield.h | 14 +- src/entrywidget.cpp | 170 +++++++++---------- src/entrywidget.h | 78 ++++----- src/entrywidgetauthor.cpp | 14 +- src/entrywidgetauthor.h | 8 +- src/entrywidgetexternal.cpp | 82 ++++----- src/entrywidgetexternal.h | 8 +- src/entrywidgetkeyword.cpp | 72 ++++---- src/entrywidgetkeyword.h | 30 ++-- src/entrywidgetmisc.cpp | 20 +-- src/entrywidgetmisc.h | 4 +- src/entrywidgetother.cpp | 84 +++++----- src/entrywidgetother.h | 30 ++-- src/entrywidgetpublication.cpp | 86 +++++----- src/entrywidgetpublication.h | 12 +- src/entrywidgetsource.cpp | 34 ++-- src/entrywidgetsource.h | 12 +- src/entrywidgettab.cpp | 20 +-- src/entrywidgettab.h | 16 +- src/entrywidgettitle.cpp | 16 +- src/entrywidgettitle.h | 4 +- src/entrywidgetuserdefined.cpp | 24 +-- src/entrywidgetuserdefined.h | 6 +- src/entrywidgetwarningsitem.cpp | 6 +- src/entrywidgetwarningsitem.h | 12 +- src/fieldlineedit.cpp | 70 ++++---- src/fieldlineedit.h | 20 +-- src/fieldlistview.cpp | 120 ++++++------- src/fieldlistview.h | 40 ++--- src/file.cpp | 66 ++++---- src/file.h | 46 ++--- src/fileexporter.cpp | 2 +- src/fileexporter.h | 14 +- src/fileexporterbibtex.cpp | 108 ++++++------ src/fileexporterbibtex.h | 36 ++-- src/fileexporterbibutils.cpp | 76 ++++----- src/fileexporterbibutils.h | 20 +-- src/fileexporterdocbook5.cpp | 22 +-- src/fileexporterdocbook5.h | 18 +- src/fileexporterexternal.cpp | 54 +++--- src/fileexporterexternal.h | 18 +- src/fileexporterpdf.cpp | 66 ++++---- src/fileexporterpdf.h | 28 ++-- src/fileexporterps.cpp | 34 ++-- src/fileexporterps.h | 26 +-- src/fileexporterris.cpp | 36 ++-- src/fileexporterris.h | 8 +- src/fileexporterrtf.cpp | 34 ++-- src/fileexporterrtf.h | 24 +-- src/fileexportertoolchain.cpp | 90 +++++----- src/fileexportertoolchain.h | 28 ++-- src/fileexporterxml.cpp | 46 ++--- src/fileexporterxml.h | 14 +- src/fileexporterxslt.cpp | 34 ++-- src/fileexporterxslt.h | 4 +- src/fileimporter.cpp | 12 +- src/fileimporter.h | 16 +- src/fileimporterbibtex.cpp | 170 +++++++++---------- src/fileimporterbibtex.h | 34 ++-- src/fileimporterbibutils.cpp | 104 ++++++------ src/fileimporterbibutils.h | 20 +-- src/fileimporterexternal.cpp | 44 ++--- src/fileimporterexternal.h | 16 +- src/fileimporterris.cpp | 64 +++---- src/fileimporterris.h | 16 +- src/findduplicates.cpp | 62 +++---- src/findduplicates.h | 30 ++-- src/idsuggestions.cpp | 110 ++++++------ src/idsuggestions.h | 38 ++--- src/idsuggestionswidget.cpp | 192 ++++++++++----------- src/idsuggestionswidget.h | 72 ++++---- src/iso5426converter.cpp | 14 +- src/iso5426converter.h | 14 +- src/iso6937converter.cpp | 14 +- src/iso6937converter.h | 12 +- src/kbibtex_part.cpp | 106 ++++++------ src/kbibtex_part.h | 36 ++-- src/kbibtexshell.cpp | 22 +-- src/kbibtexshell.h | 14 +- src/latin1literal.h | 16 +- src/macro.cpp | 20 +-- src/macro.h | 14 +- src/macrowidget.cpp | 18 +- src/macrowidget.h | 8 +- src/main.cpp | 4 +- src/mergeelements.cpp | 196 +++++++++++----------- src/mergeelements.h | 72 ++++---- src/messagehandler.cpp | 4 +- src/messagehandler.h | 12 +- src/preamble.cpp | 16 +- src/preamble.h | 6 +- src/preamblewidget.cpp | 14 +- src/preamblewidget.h | 10 +- src/searchbar.cpp | 56 +++---- src/searchbar.h | 14 +- src/settings.cpp | 344 ++++++++++++++++++------------------- src/settings.h | 98 +++++------ src/settingsdlg.cpp | 22 +-- src/settingsdlg.h | 2 +- src/settingsediting.cpp | 142 ++++++++-------- src/settingsediting.h | 52 +++--- src/settingsfileio.cpp | 130 +++++++------- src/settingsfileio.h | 34 ++-- src/settingsidsuggestions.cpp | 102 +++++------ src/settingsidsuggestions.h | 34 ++-- src/settingskeyword.cpp | 54 +++--- src/settingskeyword.h | 24 +-- src/settingssearchurl.cpp | 64 +++---- src/settingssearchurl.h | 12 +- src/settingsuserdefinedinput.cpp | 66 ++++---- src/settingsuserdefinedinput.h | 8 +- src/settingsz3950.cpp | 90 +++++----- src/settingsz3950.h | 24 +-- src/sidebar.cpp | 74 ++++---- src/sidebar.h | 36 ++-- src/value.cpp | 140 ++++++++-------- src/value.h | 88 +++++----- src/valuewidget.cpp | 100 +++++------ src/valuewidget.h | 30 ++-- src/webquery.cpp | 186 ++++++++++---------- src/webquery.h | 64 +++---- src/webqueryamatex.cpp | 34 ++-- src/webqueryamatex.h | 10 +- src/webqueryarxiv.cpp | 106 ++++++------ src/webqueryarxiv.h | 28 ++-- src/webquerybibsonomy.cpp | 32 ++-- src/webquerybibsonomy.h | 10 +- src/webquerycitebase.cpp | 30 ++-- src/webquerycitebase.h | 10 +- src/webqueryciteseerx.cpp | 58 +++---- src/webqueryciteseerx.h | 26 +-- src/webquerycsb.cpp | 118 ++++++------- src/webquerycsb.h | 20 +-- src/webquerydblp.cpp | 64 +++---- src/webquerydblp.h | 14 +- src/webquerygooglescholar.cpp | 118 ++++++------- src/webquerygooglescholar.h | 32 ++-- src/webqueryieeexplore.cpp | 54 +++--- src/webqueryieeexplore.h | 26 +-- src/webquerymathscinet.cpp | 66 ++++---- src/webquerymathscinet.h | 10 +- src/webquerypubmed.cpp | 176 +++++++++---------- src/webquerypubmed.h | 54 +++--- src/webquerysciencedirect.cpp | 126 +++++++------- src/webquerysciencedirect.h | 18 +- src/webqueryspireshep.cpp | 76 ++++----- src/webqueryspireshep.h | 16 +- src/webqueryz3950.cpp | 98 +++++------ src/webqueryz3950.h | 28 ++-- src/webqueryzmath.cpp | 28 ++-- src/webqueryzmath.h | 10 +- src/xsltransform.cpp | 24 +-- src/xsltransform.h | 6 +- src/z3950connection.cpp | 146 ++++++++-------- src/z3950connection.h | 78 ++++----- 177 files changed, 4375 insertions(+), 4375 deletions(-) (limited to 'src') diff --git a/src/comment.cpp b/src/comment.cpp index dcf0a58..3d2e5c1 100644 --- a/src/comment.cpp +++ b/src/comment.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -26,7 +26,7 @@ namespace BibTeX { - Comment::Comment( const QString& text, bool useCommand ) : Element(), m_text( text ), m_useCommand( useCommand ) + Comment::Comment( const TQString& text, bool useCommand ) : Element(), m_text( text ), m_useCommand( useCommand ) { // nothing } @@ -42,12 +42,12 @@ namespace BibTeX // nothing } - QString Comment::text() const + TQString Comment::text() const { return m_text; } - void Comment::setText( const QString &text ) + void Comment::setText( const TQString &text ) { m_text = text; } @@ -62,7 +62,7 @@ namespace BibTeX m_useCommand = useCommand; } - bool Comment::containsPattern( const QString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const + bool Comment::containsPattern( const TQString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const { if ( filterType == ftExact ) { @@ -72,9 +72,9 @@ namespace BibTeX else { /** for each word in the search pattern ... */ - QStringList words = QStringList::split( QRegExp( "\\s+" ), pattern ); + TQStringList words = TQStringList::split( TQRegExp( "\\s+" ), pattern ); unsigned int hits = 0; - for ( QStringList::Iterator it = words.begin(); it != words.end(); ++it ) + for ( TQStringList::Iterator it = words.begin(); it != words.end(); ++it ) { /** check if word is contained in text */ if ( fieldType == EntryField::ftUnknown && m_text.contains( *it, caseSensitive ) ) diff --git a/src/comment.h b/src/comment.h index f259daf..10927e8 100644 --- a/src/comment.h +++ b/src/comment.h @@ -28,20 +28,20 @@ namespace BibTeX class Comment : public Element { public: - Comment( const QString &text, bool useCommand = false ); + Comment( const TQString &text, bool useCommand = false ); Comment( Comment *other ); virtual ~Comment(); - QString text() const; - void setText( const QString &text ); + TQString text() const; + void setText( const TQString &text ); bool useCommand() const; void setUseCommand( bool useCommand ); - bool containsPattern( const QString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; + bool containsPattern( const TQString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; Element* clone(); private: - QString m_text; + TQString m_text; bool m_useCommand; }; diff --git a/src/commentwidget.cpp b/src/commentwidget.cpp index 09d371f..56a6854 100644 --- a/src/commentwidget.cpp +++ b/src/commentwidget.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -33,8 +33,8 @@ namespace KBibTeX { - CommentWidget::CommentWidget( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_comment( comment ), m_isReadOnly( isReadOnly ) + CommentWidget::CommentWidget( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_comment( comment ), m_isReadOnly( isReadOnly ) { setupGUI(); getCommentData(); @@ -50,18 +50,18 @@ namespace KBibTeX void CommentWidget::setupGUI() { setMinimumWidth( 384 ); - QVBoxLayout * layout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout * layout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QLabel *label = new QLabel( i18n( "Co&mment:" ), this ); + TQLabel *label = new TQLabel( i18n( "Co&mment:" ), this ); layout->addWidget( label ); - m_multiLineEdit = new QMultiLineEdit( this ); + m_multiLineEdit = new TQMultiLineEdit( this ); m_multiLineEdit->setFont( KGlobalSettings::fixedFont() ); layout->addWidget( m_multiLineEdit ); label->setBuddy( m_multiLineEdit ); m_multiLineEdit->setReadOnly( m_isReadOnly ); - m_checkboxUseCommand = new QCheckBox( i18n( "&Use @Comment for comment instead of plain text" ), this ); + m_checkboxUseCommand = new TQCheckBox( i18n( "&Use @Comment for comment instead of plain text" ), this ); layout->addWidget( m_checkboxUseCommand ); } @@ -77,14 +77,14 @@ namespace KBibTeX m_comment->setUseCommand( m_checkboxUseCommand->isChecked() ); } - QDialog::DialogCode CommentWidget::execute( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent, const char *name ) + TQDialog::DialogCode CommentWidget::execute( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent, const char *name ) { KDialogBase * dlg = new KDialogBase( parent, name, true, i18n( "Edit BibTeX Comment" ), KDialogBase::Ok | KDialogBase::Cancel ); CommentWidget* ui = new CommentWidget( comment, isReadOnly, dlg, "kbibtex::commentwidget" ); dlg->setMainWidget( ui ); - QDialog::DialogCode result = ( QDialog::DialogCode ) dlg->exec(); - if ( !isReadOnly && result == QDialog::Accepted ) + TQDialog::DialogCode result = ( TQDialog::DialogCode ) dlg->exec(); + if ( !isReadOnly && result == TQDialog::Accepted ) ui->setCommentData(); delete( ui ); diff --git a/src/commentwidget.h b/src/commentwidget.h index 16ac051..8b9c0b9 100644 --- a/src/commentwidget.h +++ b/src/commentwidget.h @@ -20,29 +20,29 @@ #ifndef COMMENTWIDGET_H #define COMMENTWIDGET_H -#include -#include +#include +#include #include -class QMultiLineEdit; -class QCheckBox; +class TQMultiLineEdit; +class TQCheckBox; namespace KBibTeX { - class CommentWidget : public QWidget + class CommentWidget : public TQWidget { Q_OBJECT public: - CommentWidget( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + CommentWidget( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~CommentWidget(); - static QDialog::DialogCode execute( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + static TQDialog::DialogCode execute( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); private: BibTeX::Comment* m_comment; - QCheckBox *m_checkboxUseCommand; - QMultiLineEdit *m_multiLineEdit; + TQCheckBox *m_checkboxUseCommand; + TQMultiLineEdit *m_multiLineEdit; bool m_isReadOnly; void setupGUI(); diff --git a/src/documentlistview.cpp b/src/documentlistview.cpp index 61ff980..7478252 100644 --- a/src/documentlistview.cpp +++ b/src/documentlistview.cpp @@ -21,17 +21,17 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -69,12 +69,12 @@ namespace KBibTeX { - DocumentListView::DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent, const char *name ) + DocumentListView::DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent, const char *name ) : KListView( parent, name ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_contextMenu( NULL ), m_headerMenu( NULL ), m_isReadOnly( isReadOnly ), m_newElementCounter( 1 ) { setAllColumnsShowFocus( true ); setShowSortIndicator( true ); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); header() ->setClickEnabled( TRUE ); header() ->setMovingEnabled( TRUE ); buildColumns(); @@ -85,9 +85,9 @@ namespace KBibTeX setDropVisualizer( TRUE ); connect( header(), SIGNAL( clicked( int ) ), this, SLOT( setSortingColumn( int ) ) ); - connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), this, SLOT( showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint & ) ) ); - connect( this, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ), this, SLOT( slotDoubleClick( QListViewItem* ) ) ); - connect( this, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), this, SLOT( slotDropped( QDropEvent*, QListViewItem* ) ) ); + connect( this, SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ), this, SLOT( showBibtexListContextMenu( KListView *, TQListViewItem *, const TQPoint & ) ) ); + connect( this, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ), this, SLOT( slotDoubleClick( TQListViewItem* ) ) ); + connect( this, SIGNAL( dropped( TQDropEvent*, TQListViewItem* ) ), this, SLOT( slotDropped( TQDropEvent*, TQListViewItem* ) ) ); } DocumentListView::~DocumentListView() @@ -115,7 +115,7 @@ namespace KBibTeX void DocumentListView::setItems() { - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); KProgressDialog *prgDlg = new KProgressDialog( this, "prgDlg", i18n( "List View" ), i18n( "Updating main view ..." ), TRUE ); prgDlg->show(); @@ -145,7 +145,7 @@ namespace KBibTeX updateVisiblity(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void DocumentListView::insertItems( BibTeX::File *items, KBibTeX::DocumentListViewItem *after ) @@ -167,9 +167,9 @@ namespace KBibTeX if ( m_bibtexFile->containsKey( newEntry->id() ) ) { int counter = 0; - QString newId = QString( newEntry->id() ).append( '_' ).append( QString::number( ++counter ) ); + TQString newId = TQString( newEntry->id() ).append( '_' ).append( TQString::number( ++counter ) ); while ( m_bibtexFile->containsKey( newId ) ) - newId = QString( newEntry->id() ).append( '_' ).append( QString::number( ++counter ) ); + newId = TQString( newEntry->id() ).append( '_' ).append( TQString::number( ++counter ) ); newEntry->setId( newId ); } element = newEntry; @@ -185,7 +185,7 @@ namespace KBibTeX m_unreadItems.append( after ); emit modified(); - QTimer::singleShot( 3500, this, SLOT( makeNewItemsUnread() ) ); + TQTimer::singleShot( 3500, this, SLOT( makeNewItemsUnread() ) ); return after; } @@ -197,7 +197,7 @@ namespace KBibTeX void DocumentListView::updateVisiblity() { - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { DocumentListViewItem * kblvi = dynamic_cast( it.current() ); @@ -263,7 +263,7 @@ namespace KBibTeX for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ ) { BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract ); - QString label = Settings::fieldTypeToI18NString( fieldType ); + TQString label = Settings::fieldTypeToI18NString( fieldType ); item = m_headerMenu->insertItem( label, ( int ) fieldType + 2 ); m_headerMenu->setItemChecked( item, settings->editing_MainListColumnsWidth[ i + 2 ] > 0 ); } @@ -272,11 +272,11 @@ namespace KBibTeX void DocumentListView::deleteSelected() { - QListViewItemIterator it( this, QListViewItemIterator::Selected | QListViewItemIterator::Visible ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected | TQListViewItemIterator::Visible ); if ( it.current() == NULL ) return; - QListViewItem *above = it.current() ->itemAbove(); - QValueList toBeDeleted; + TQListViewItem *above = it.current() ->itemAbove(); + TQValueList toBeDeleted; while ( it.current() ) { DocumentListViewItem * kblvi = dynamic_cast( it.current() ); @@ -284,7 +284,7 @@ namespace KBibTeX it++; } - for ( QValueList::Iterator it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) + for ( TQValueList::Iterator it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) { m_bibtexFile->deleteElement(( *it )->element() ); takeItem( *it ); @@ -297,11 +297,11 @@ namespace KBibTeX emit modified(); } - const QValueList DocumentListView::selectedItems() + const TQValueList DocumentListView::selectedItems() { - QValueList result; + TQValueList result; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); while ( it.current() ) { DocumentListViewItem * kblvi = dynamic_cast( it.current() ); @@ -313,33 +313,33 @@ namespace KBibTeX return result; } - QString DocumentListView::selectedToBibTeXText() + TQString DocumentListView::selectedToBibTeXText() { BibTeX::FileExporterBibTeX *exporter = new BibTeX::FileExporterBibTeX(); exporter->setEncoding( "latex" ); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QValueList selectedElements = selectedItems(); - for ( QValueList::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it ) + TQValueList selectedElements = selectedItems(); + for ( TQValueList::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it ) exporter->save( &buffer, *it ); buffer.close(); delete exporter; buffer.open( IO_ReadOnly ); - QTextStream in( &buffer ); - in.setEncoding( QTextStream::UnicodeUTF8 ); - QString result = in.read(); + TQTextStream in( &buffer ); + in.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString result = in.read(); buffer.close(); return result; } - QString DocumentListView::selectedToBibTeXRefs() + TQString DocumentListView::selectedToBibTeXRefs() { - QString refs; - QValueList selectedElements = selectedItems(); - for ( QValueList::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it ) + TQString refs; + TQValueList selectedElements = selectedItems(); + for ( TQValueList::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it ) { BibTeX::Entry *entry = dynamic_cast( *it ); if ( entry == NULL ) continue; @@ -348,7 +348,7 @@ namespace KBibTeX refs.append( "," ); refs.append( entry->id() ); } - return QString( "\\cite{%1}" ).arg( refs ); + return TQString( "\\cite{%1}" ).arg( refs ); } void DocumentListView::copy() @@ -373,11 +373,11 @@ namespace KBibTeX if ( dlvi == NULL ) dlvi = dynamic_cast( currentItem() ); - QString clipboardText = kapp->clipboard() ->text(); + TQString clipboardText = kapp->clipboard() ->text(); return paste( clipboardText, dlvi ); } - bool DocumentListView::paste( const QString& text, DocumentListViewItem *at ) + bool DocumentListView::paste( const TQString& text, DocumentListViewItem *at ) { Settings * settings = Settings::self( m_bibtexFile ); @@ -454,11 +454,11 @@ namespace KBibTeX popup->insertItem( Settings::fieldTypeToI18NString( ft ), i ); } popup->insertSeparator(); - QIconSet cancelPixmap = KGlobal::iconLoader() ->loadIconSet( "cancel", KIcon::Small ); + TQIconSet cancelPixmap = KGlobal::iconLoader() ->loadIconSet( "cancel", KIcon::Small ); int cancelId = popup->insertItem( cancelPixmap, i18n( "Cancel" ) ); // show popup menu - int selectedId = popup->exec( QCursor::pos() ); + int selectedId = popup->exec( TQCursor::pos() ); if ( selectedId == cancelId || selectedId == -1 ) return FALSE; // cancel menu @@ -473,7 +473,7 @@ namespace KBibTeX else if ( field->value() != NULL ) delete field->value(); - QString encodedText = BibTeX::EncoderLaTeX::currentEncoderLaTeX() ->encode( text ); + TQString encodedText = BibTeX::EncoderLaTeX::currentEncoderLaTeX() ->encode( text ); // create new value from clipboard's content BibTeX::Value * value = new BibTeX::Value(); @@ -495,13 +495,13 @@ namespace KBibTeX void DocumentListView::selectAll() { - QListView::selectAll( true ); + TQListView::selectAll( true ); } /* void DocumentListView::sendSelectedToLyx() { - QStringList refsToSend; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQStringList refsToSend; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); while ( it.current() ) { DocumentListViewItem * kblvi = dynamic_cast( it.current() ); @@ -512,28 +512,28 @@ namespace KBibTeX } Settings * settings = Settings::self( m_bibtexFile ); - QString lyxPipeFilename = settings->detectLyXInPipe(); + TQString lyxPipeFilename = settings->detectLyXInPipe(); kdDebug() << "sendSelectedToLyx: lyxPipeFilename= " << lyxPipeFilename << endl; - QFile pipe( lyxPipeFilename ); + TQFile pipe( lyxPipeFilename ); if ( pipe.exists() && pipe.open( IO_WriteOnly ) ) { - QTextStream * writer = new QTextStream( &pipe ); - QString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," ); + TQTextStream * writer = new TQTextStream( &pipe ); + TQString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," ); *writer << msg << endl; delete writer; pipe.close(); } else - 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" ) ); + KMessageBox::error( this, ( lyxPipeFilename.isEmpty() ? i18n( "Cannot establish a link to LyX" ) : TQString( i18n( "Cannot establish a link to LyX using the pipe \"%1\"" ) ).arg( lyxPipeFilename ) ) + i18n( "\nMaybe LyX is not running?" ), i18n( "Error communicating with LyX" ) ); }*/ - void DocumentListView::slotDoubleClick( QListViewItem *item ) + void DocumentListView::slotDoubleClick( TQListViewItem *item ) { DocumentListViewItem *dlvi = dynamic_cast( item ); if ( dlvi != NULL ) emit executed( dlvi ); } - void DocumentListView::filter( const QString & text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType ) + void DocumentListView::filter( const TQString & text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType ) { m_filter = text; m_filterType = filterType; @@ -563,7 +563,7 @@ namespace KBibTeX } } - void DocumentListView::showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint & p ) + void DocumentListView::showBibtexListContextMenu( KListView *, TQListViewItem *, const TQPoint & p ) { if ( m_contextMenu != NULL ) { @@ -576,25 +576,25 @@ namespace KBibTeX { Settings * settings = Settings::self( m_bibtexFile ); settings->editing_MainListSortingColumn = column; - settings->editing_MainListSortingOrder = ( sortOrder() == Qt::Ascending ) ? 1 : -1; + settings->editing_MainListSortingOrder = ( sortOrder() == TQt::Ascending ) ? 1 : -1; } - bool DocumentListView::acceptDrag( QDropEvent * event ) const + bool DocumentListView::acceptDrag( TQDropEvent * event ) const { if ( event->source() == this ) return false; - return QTextDrag::canDecode( event ) || QUriDrag::canDecode( event ); + return TQTextDrag::canDecode( event ) || TQUriDrag::canDecode( event ); } void DocumentListView::startDrag() { Settings * settings = Settings::self( m_bibtexFile ); - QDragObject *d = new QTextDrag( settings->editing_DragAction == Settings::COPYREFERENCE ? selectedToBibTeXRefs() : selectedToBibTeXText(), this ); + TQDragObject *d = new TQTextDrag( settings->editing_DragAction == Settings::COPYREFERENCE ? selectedToBibTeXRefs() : selectedToBibTeXText(), this ); d->dragCopy(); } void DocumentListView::saveColumnIndex() { Settings * settings = Settings::self( m_bibtexFile ); - QHeader *hdr = header(); + TQHeader *hdr = header(); for ( int i = 0; i < columns(); i++ ) settings->editing_MainListColumnsIndex[ i ] = hdr->mapToIndex( i ); @@ -603,7 +603,7 @@ namespace KBibTeX void DocumentListView::restoreColumnIndex() { Settings * settings = Settings::self( m_bibtexFile ); - QHeader *hdr = header(); + TQHeader *hdr = header(); for ( int i = 0; i < columns(); i++ ) hdr->moveSection( i, settings->editing_MainListColumnsIndex[ i ] ); @@ -617,7 +617,7 @@ namespace KBibTeX for ( int i = from; i < to; i++ ) { - if ( columnWidthMode( i ) == QListView::Manual ) + if ( columnWidthMode( i ) == TQListView::Manual ) settings->editing_MainListColumnsWidth[ i ] = columnWidth( i ); else settings->editing_MainListColumnsWidth[ i ] = 0xffff; @@ -639,12 +639,12 @@ namespace KBibTeX { Settings * settings = Settings::self( m_bibtexFile ); setSortColumn( settings->editing_MainListSortingColumn ); - setSortOrder( settings->editing_MainListSortingOrder > 0 ? Qt::Ascending : Qt::Descending ); + setSortOrder( settings->editing_MainListSortingOrder > 0 ? TQt::Ascending : TQt::Descending ); } void DocumentListView::makeNewItemsUnread() { - for ( QValueList::ConstIterator it = m_unreadItems.begin() ; it != m_unreadItems.end(); ++it ) + for ( TQValueList::ConstIterator it = m_unreadItems.begin() ; it != m_unreadItems.end(); ++it ) { ( *it ) ->setUnreadStatus( FALSE ); ( *it ) ->repaint(); @@ -653,36 +653,36 @@ namespace KBibTeX m_unreadItems.clear(); } - void DocumentListView::slotDropped( QDropEvent * event, QListViewItem * item ) + void DocumentListView::slotDropped( TQDropEvent * event, TQListViewItem * item ) { - QString text; - QStrList urlList; + TQString text; + TQStrList urlList; - if ( QTextDrag::decode( event, text ) && KURL( text ).isValid() ) + if ( TQTextDrag::decode( event, text ) && KURL( text ).isValid() ) urlList.append( text ); - if ( !urlList.isEmpty() || QUriDrag::decode( event, urlList ) ) + if ( !urlList.isEmpty() || TQUriDrag::decode( event, urlList ) ) { - QString url = urlList.at( 0 ); - QString tmpFile; + TQString url = urlList.at( 0 ); + TQString tmpFile; if ( ! KIO::NetAccess::download( url, tmpFile, 0 ) ) { KMessageBox::error( this, KIO::NetAccess::lastErrorString() ); return ; } - QFile f( tmpFile ); + TQFile f( tmpFile ); if ( ! f.open( IO_ReadOnly ) ) { KMessageBox::error( this, f.errorString() ); KIO::NetAccess::removeTempFile( tmpFile ); return ; } - QByteArray ba = f.readAll(); - text = QString( ba ); + TQByteArray ba = f.readAll(); + text = TQString( ba ); f.close(); KIO::NetAccess::removeTempFile( tmpFile ); } - else if ( !QTextDrag::decode( event, text ) ) + else if ( !TQTextDrag::decode( event, text ) ) return; event->accept( TRUE ); @@ -691,16 +691,16 @@ namespace KBibTeX paste( text, dlvi ); } - bool DocumentListView::eventFilter( QObject * watched, QEvent * e ) + bool DocumentListView::eventFilter( TQObject * watched, TQEvent * e ) { if ( watched == header() ) { switch ( e->type() ) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - if ( static_cast( e ) ->button() == RightButton && m_headerMenu != NULL ) - m_headerMenu->popup( QCursor::pos() ); + if ( static_cast( e ) ->button() == RightButton && m_headerMenu != NULL ) + m_headerMenu->popup( TQCursor::pos() ); break; } @@ -713,9 +713,9 @@ namespace KBibTeX return KListView::eventFilter( watched, e ); } - void DocumentListView::keyPressEvent( QKeyEvent *e ) + void DocumentListView::keyPressEvent( TQKeyEvent *e ) { - if ( e->key() == QKeyEvent::Key_Enter || e->key() == QKeyEvent::Key_Return ) + if ( e->key() == TQKeyEvent::Key_Enter || e->key() == TQKeyEvent::Key_Return ) { DocumentListViewItem *item = dynamic_cast( selectedItem() ); if ( item == NULL ) @@ -742,7 +742,7 @@ namespace KBibTeX setColumnWidth( col, colWidth ); header() ->setResizeEnabled( colWidth > 0, col ); - setColumnWidthMode( col, colWidth < 0xffff ? QListView::Manual : QListView::Maximum ); + setColumnWidthMode( col, colWidth < 0xffff ? TQListView::Manual : TQListView::Maximum ); saveColumnWidths( col ); } @@ -759,7 +759,7 @@ namespace KBibTeX for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ ) { BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract ); - QString label = Settings::fieldTypeToI18NString( fieldType ); + TQString label = Settings::fieldTypeToI18NString( fieldType ); addColumn( label ); } } diff --git a/src/documentlistview.h b/src/documentlistview.h index da2c6c5..aedb0b2 100644 --- a/src/documentlistview.h +++ b/src/documentlistview.h @@ -27,7 +27,7 @@ #include #include -class QString; +class TQString; class KURL; class KActionMenu; class KPopupMenu; @@ -41,7 +41,7 @@ namespace KBibTeX { Q_OBJECT public: - DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~DocumentListView(); void setFactory( KXMLGUIFactory *factory, KXMLGUIClient *client ); @@ -52,7 +52,7 @@ namespace KBibTeX KBibTeX::DocumentListViewItem *insertItem( BibTeX::Element *item, KBibTeX::DocumentListViewItem *after ); void deleteSelected(); - const QValueList selectedItems(); + const TQValueList selectedItems(); // void sendSelectedToLyx(); void updateVisiblity(); @@ -70,9 +70,9 @@ namespace KBibTeX void copyReferences(); void cut(); bool paste(); - bool paste( const QString& text, DocumentListViewItem *at ); + bool paste( const TQString& text, DocumentListViewItem *at ); void selectAll(); - void filter( const QString& text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType ); + void filter( const TQString& text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType ); void setReadOnly( bool isReadOnly ); void activateShowColumnMenu( int id ); @@ -80,10 +80,10 @@ namespace KBibTeX void insertItem( BibTeX::Element *item ); private slots: - void slotDoubleClick( QListViewItem * item = NULL ); + void slotDoubleClick( TQListViewItem * item = NULL ); void setSortingColumn( int column ); - void showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint &p ); - void slotDropped( QDropEvent* event, QListViewItem* item ); + void showBibtexListContextMenu( KListView *, TQListViewItem *, const TQPoint &p ); + void slotDropped( TQDropEvent* event, TQListViewItem* item ); void saveColumnIndex(); void restoreColumnIndex(); void saveColumnWidths( int col = -1 ); @@ -92,12 +92,12 @@ namespace KBibTeX void makeNewItemsUnread(); protected: - bool acceptDrag( QDropEvent* e ) const; + bool acceptDrag( TQDropEvent* e ) const; void startDrag(); - virtual bool eventFilter( QObject *watched, QEvent *e ); + virtual bool eventFilter( TQObject *watched, TQEvent *e ); - virtual void keyPressEvent( QKeyEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); private: static const int maxColumns = 256; @@ -107,16 +107,16 @@ namespace KBibTeX KPopupMenu *m_headerMenu; KActionMenu *m_columnVisibleAction; bool m_isReadOnly; - QValueList m_unreadItems; + TQValueList m_unreadItems; - QString m_filter; + TQString m_filter; BibTeX::Element::FilterType m_filterType; BibTeX::EntryField::FieldType m_filterFieldType; int m_newElementCounter; void setItems(); - QString selectedToBibTeXText(); - QString selectedToBibTeXRefs(); + TQString selectedToBibTeXText(); + TQString selectedToBibTeXRefs(); void showColumn( int col, int colWidth = 0xffff ); void hideColumn( int col ); diff --git a/src/documentlistviewitem.cpp b/src/documentlistviewitem.cpp index 7a71873..ce4db30 100644 --- a/src/documentlistviewitem.cpp +++ b/src/documentlistviewitem.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include @@ -36,7 +36,7 @@ namespace KBibTeX setTexts(); } - DocumentListViewItem::DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, QListViewItem *after ) : KListViewItem( parent, after ), m_element( element ), m_bibtexFile( file ), m_parent( parent ) + DocumentListViewItem::DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, TQListViewItem *after ) : KListViewItem( parent, after ), m_element( element ), m_bibtexFile( file ), m_parent( parent ) { setTexts(); } @@ -61,7 +61,7 @@ namespace KBibTeX m_unreadStatus = unread; } - void DocumentListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) + void DocumentListViewItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { if ( !p ) return ; @@ -69,7 +69,7 @@ namespace KBibTeX // make unread items bold if ( m_unreadStatus ) { - QFont f = p->font(); + TQFont f = p->font(); f.setBold( TRUE ); p->setFont( f ); } @@ -112,7 +112,7 @@ namespace KBibTeX if ( comment ) { setText( 0, i18n( "Comment" ) ); - QString text = comment->text(); + TQString text = comment->text(); text.replace( '\n', ' ' ); setText(( int ) BibTeX::EntryField::ftTitle - ( int ) BibTeX::EntryField::ftAbstract + 2, text ); } diff --git a/src/documentlistviewitem.h b/src/documentlistviewitem.h index 3462fd6..5debafa 100644 --- a/src/documentlistviewitem.h +++ b/src/documentlistviewitem.h @@ -31,7 +31,7 @@ namespace KBibTeX { public: DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent ); - DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, QListViewItem *after ); + DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, TQListViewItem *after ); ~DocumentListViewItem(); @@ -40,7 +40,7 @@ namespace KBibTeX void setUnreadStatus( bool unread ); protected: - void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); + void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ); private: BibTeX::Element *m_element; diff --git a/src/documentsourceview.cpp b/src/documentsourceview.cpp index 0edce91..86d2322 100644 --- a/src/documentsourceview.cpp +++ b/src/documentsourceview.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -46,8 +46,8 @@ namespace KBibTeX { - DocumentSourceView::DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_isReadOnly( isReadOnly ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_document( NULL ), m_view( NULL ), m_progDlg( NULL ) + DocumentSourceView::DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_isReadOnly( isReadOnly ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_document( NULL ), m_view( NULL ), m_progDlg( NULL ) { setupGUI(); @@ -97,7 +97,7 @@ namespace KBibTeX /** * Paste a line of text into the document at the designated position */ - void DocumentSourceView::insertLines( const QString& text, int line ) + void DocumentSourceView::insertLines( const TQString& text, int line ) { m_editInterface->insertLine( line < 0 ? m_editInterface->numLines() : ( uint ) line, text ); @@ -122,7 +122,7 @@ namespace KBibTeX void DocumentSourceView::setFactory( KXMLGUIFactory *factory, KXMLGUIClient * client ) { KTextEditor::PopupMenuInterface * popupInterface = dynamic_cast( m_view ); - popupInterface->installPopup(( QPopupMenu* )( factory ->container( "ktexteditor_popup", client ) ) ); + popupInterface->installPopup(( TQPopupMenu* )( factory ->container( "ktexteditor_popup", client ) ) ); } void DocumentSourceView::configureEditor() @@ -159,7 +159,7 @@ namespace KBibTeX dlg.setSupportsCaseSensitiveFind( FALSE ); dlg.setSupportsRegularExpressionFind( FALSE ); #endif - if ( dlg.exec() == QDialog::Accepted ) + if ( dlg.exec() == TQDialog::Accepted ) { m_lastSearchTerm = dlg.pattern(); m_findHistory = dlg.findHistory(); @@ -215,7 +215,7 @@ namespace KBibTeX m_progDlg->setAllowCancel( false ); kapp->processEvents(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); BibTeX::FileExporterBibTeX * exporter = new BibTeX::FileExporterBibTeX(); connect( exporter, SIGNAL( progress( int, int ) ), this, SLOT( updateProgress( int, int ) ) ); @@ -231,9 +231,9 @@ namespace KBibTeX { kapp->processEvents(); buffer.open( IO_ReadOnly ); - QTextStream in( &buffer ); - in.setEncoding( QTextStream::UnicodeUTF8 ); - QString text = in.read(); + TQTextStream in( &buffer ); + in.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString text = in.read(); buffer.close(); if ( m_editInterface ) @@ -259,11 +259,11 @@ namespace KBibTeX { if ( m_editInterface ) { - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream stream( &buffer ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &buffer ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << m_editInterface->text(); buffer.close(); @@ -281,7 +281,7 @@ namespace KBibTeX return NULL; } - void DocumentSourceView::focusInEvent( QFocusEvent* /*event*/ ) + void DocumentSourceView::focusInEvent( TQFocusEvent* /*event*/ ) { if ( m_view != NULL ) m_view->setFocus(); @@ -297,8 +297,8 @@ namespace KBibTeX m_document->setReadWrite( !m_isReadOnly ); if ( !m_isReadOnly ) connect( m_document, SIGNAL( textChanged() ), this, SIGNAL( modified() ) ); - QBoxLayout * layout = new QVBoxLayout( this ); - layout->addWidget( static_cast( m_view ) ); + TQBoxLayout * layout = new TQVBoxLayout( this ); + layout->addWidget( static_cast( m_view ) ); int c = m_document->hlModeCount() ; int hlIdx = -1; @@ -366,7 +366,7 @@ namespace KBibTeX fromLine = 0; fromCol = 0; } - while ( KMessageBox::questionYesNo( this, QString( i18n( "Could not find text '%1' in the document.\nStart from the beginning?" ) ).arg( m_lastSearchTerm ), i18n( "Find text in source view" ), KGuiItem( i18n( "Restart search" ) ) ) == KMessageBox::Yes ); + while ( KMessageBox::questionYesNo( this, TQString( i18n( "Could not find text '%1' in the document.\nStart from the beginning?" ) ).arg( m_lastSearchTerm ), i18n( "Find text in source view" ), KGuiItem( i18n( "Restart search" ) ) ) == KMessageBox::Yes ); } void DocumentSourceView::updateProgress( int current, int total ) diff --git a/src/documentsourceview.h b/src/documentsourceview.h index 8edb23a..1ea0519 100644 --- a/src/documentsourceview.h +++ b/src/documentsourceview.h @@ -20,7 +20,7 @@ #ifndef KBIBTEXDOCUMENTSOURCEVIEW_H #define KBIBTEXDOCUMENTSOURCEVIEW_H -#include +#include #include @@ -37,11 +37,11 @@ namespace KBibTeX /** * @author Thomas Fischer */ - class DocumentSourceView : public QWidget + class DocumentSourceView : public TQWidget { Q_OBJECT public: - DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~DocumentSourceView(); bool setBibTeXFile( BibTeX::File *bibtexFile ); @@ -50,7 +50,7 @@ namespace KBibTeX void copy(); void cut(); bool paste(); - void insertLines( const QString& text, int line = -1 ); + void insertLines( const TQString& text, int line = -1 ); void selectAll(); void setReadOnly( bool isReadOnly ); @@ -66,7 +66,7 @@ namespace KBibTeX void modified(); protected: - virtual void focusInEvent( QFocusEvent* event ); + virtual void focusInEvent( TQFocusEvent* event ); private: bool m_isReadOnly; @@ -75,8 +75,8 @@ namespace KBibTeX Kate::Document* m_document; Kate::View* m_view; KTextEditor::EditInterface* m_editInterface; - QString m_lastSearchTerm; - QStringList m_findHistory; + TQString m_lastSearchTerm; + TQStringList m_findHistory; KProgressDialog *m_progDlg; void setupGUI(); diff --git a/src/documentwidget.cpp b/src/documentwidget.cpp index 1a59434..1353dee 100644 --- a/src/documentwidget.cpp +++ b/src/documentwidget.cpp @@ -19,19 +19,19 @@ ***************************************************************************/ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -92,8 +92,8 @@ namespace KBibTeX { - DocumentWidget::DocumentWidget( bool isReadOnly, QWidget *parent, const char *name ) - : QTabWidget( parent, name ), m_lineEditNewKeyword( NULL ), m_isReadOnly( isReadOnly ), m_filename( QString::null ), m_progressDialog( NULL ), m_newElementCounter( 1 ), m_editMode( emList ), m_viewDocumentActionMenu( NULL ), m_assignKeywordsActionMenu( NULL ), m_searchWebsitesActionMenu( NULL ), m_actionEditCut( NULL ), m_actionEditCopy( NULL ), m_actionEditCopyRef( NULL ), m_actionEditPaste( NULL ), m_actionEditSelectAll( NULL ), m_actionEditFind( NULL ), m_actionEditFindNext( NULL ), m_dirWatch( this ) + DocumentWidget::DocumentWidget( bool isReadOnly, TQWidget *parent, const char *name ) + : TQTabWidget( parent, name ), m_lineEditNewKeyword( NULL ), m_isReadOnly( isReadOnly ), m_filename( TQString::null ), m_progressDialog( NULL ), m_newElementCounter( 1 ), m_editMode( emList ), m_viewDocumentActionMenu( NULL ), m_assignKeywordsActionMenu( NULL ), m_searchWebsitesActionMenu( NULL ), m_actionEditCut( NULL ), m_actionEditCopy( NULL ), m_actionEditCopyRef( NULL ), m_actionEditPaste( NULL ), m_actionEditSelectAll( NULL ), m_actionEditFind( NULL ), m_actionEditFindNext( NULL ), m_dirWatch( this ) { m_bibtexfile = new BibTeX::File(); @@ -111,30 +111,30 @@ namespace KBibTeX void DocumentWidget::setupGUI() { setAcceptDrops( TRUE ); - setFocusPolicy( QWidget::ClickFocus ); + setFocusPolicy( TQWidget::ClickFocus ); // List view tab widget =============================== - m_container = new QWidget( this ); - QVBoxLayout *layout = new QVBoxLayout( m_container, 0, 0 ); + m_container = new TQWidget( this ); + TQVBoxLayout *layout = new TQVBoxLayout( m_container, 0, 0 ); addTab( m_container, i18n( "L&ist view" ) ); m_searchBar = new SearchBar( m_container ); layout->addWidget( m_searchBar ); - m_horSplitter = new QSplitter( Qt::Horizontal, m_container ); + m_horSplitter = new TQSplitter( TQt::Horizontal, m_container ); layout->addWidget( m_horSplitter ); - m_horSplitter->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); + m_horSplitter->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding ); m_sideBar = new SideBar( m_isReadOnly, m_horSplitter ); - m_vertSplitter = new QSplitter( Qt::Vertical, m_horSplitter ); - m_vertSplitter->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); + m_vertSplitter = new TQSplitter( TQt::Vertical, m_horSplitter ); + m_vertSplitter->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding ); m_listViewElements = new DocumentListView( this, m_isReadOnly, m_vertSplitter ); m_preview = new KTextEdit( m_vertSplitter ); m_preview->setReadOnly( TRUE ); - m_preview->setAlignment( Qt::AlignTop && Qt::AlignLeft ); + m_preview->setAlignment( TQt::AlignTop && TQt::AlignLeft ); // Source view tab widget ============================= @@ -144,22 +144,22 @@ namespace KBibTeX // Setup actions connect( m_searchBar, SIGNAL( onlineSearch() ), this, SLOT( onlineSearch() ) ); - connect( m_searchBar, SIGNAL( doSearch( const QString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ), m_listViewElements, SLOT( filter( const QString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ) ); + connect( m_searchBar, SIGNAL( doSearch( const TQString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ), m_listViewElements, SLOT( filter( const TQString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ) ); connect( m_listViewElements, SIGNAL( executed( DocumentListViewItem* ) ), this, SLOT( executeElement( DocumentListViewItem* ) ) ); connect( m_listViewElements, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) ); - connect( m_listViewElements, SIGNAL( currentChanged( QListViewItem* ) ), this, SLOT( slotPreviewElement( QListViewItem* ) ) ); - connect( m_listViewElements, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( slotPreviewElement( QListViewItem* ) ) ); - connect( this, SIGNAL( currentChanged( QWidget * ) ), this, SLOT( slotTabChanged( QWidget* ) ) ); + connect( m_listViewElements, SIGNAL( currentChanged( TQListViewItem* ) ), this, SLOT( slotPreviewElement( TQListViewItem* ) ) ); + connect( m_listViewElements, SIGNAL( clicked( TQListViewItem* ) ), this, SLOT( slotPreviewElement( TQListViewItem* ) ) ); + connect( this, SIGNAL( currentChanged( TQWidget * ) ), this, SLOT( slotTabChanged( TQWidget* ) ) ); connect( m_sourceView, SIGNAL( modified() ), this, SLOT( slotModified() ) ); connect( m_listViewElements, SIGNAL( modified() ), this, SLOT( slotModified() ) ); connect( m_sideBar, SIGNAL( valueRenamed() ), this, SLOT( slotModified() ) ); connect( m_sideBar, SIGNAL( valueRenamed() ), this, SLOT( refreshBibTeXFile() ) ); - connect( m_sideBar, SIGNAL( selected( const QString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ), m_searchBar, SLOT( setSearch( const QString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ) ); - connect( &m_dirWatch, SIGNAL( dirty( const QString& ) ), this, SLOT( slotFileGotDirty( const QString & ) ) ); + connect( m_sideBar, SIGNAL( selected( const TQString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ), m_searchBar, SLOT( setSearch( const TQString&, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType ) ) ); + connect( &m_dirWatch, SIGNAL( dirty( const TQString& ) ), this, SLOT( slotFileGotDirty( const TQString & ) ) ); } - bool DocumentWidget::open( const QString &fileName, bool mergeOnly ) + bool DocumentWidget::open( const TQString &fileName, bool mergeOnly ) { bool result = FALSE; if ( !mergeOnly ) @@ -168,10 +168,10 @@ namespace KBibTeX BibTeX::FileImporter *importer = fileImporterFactory( fileName ); if ( importer != NULL ) { - QFile file( fileName ); + TQFile file( fileName ); if ( file.open( IO_ReadOnly ) ) { - result = open( &file, mergeOnly, QString( i18n( "Loading file %1" ) ).arg( fileName ), importer ); + result = open( &file, mergeOnly, TQString( i18n( "Loading file %1" ) ).arg( fileName ), importer ); if ( result ) { m_bibtexfile->fileName = fileName; @@ -192,7 +192,7 @@ namespace KBibTeX return result; } - bool DocumentWidget::open( QIODevice *iodevice, bool mergeOnly, const QString &label, BibTeX::FileImporter *importer ) + bool DocumentWidget::open( TQIODevice *iodevice, bool mergeOnly, const TQString &label, BibTeX::FileImporter *importer ) { bool result = FALSE; setEnabled( FALSE ); @@ -215,7 +215,7 @@ namespace KBibTeX { if ( mergeOnly ) { - for ( QValueList::ConstIterator eit = newFile->constBegin(); eit != newFile->constEnd(); ++eit ) + for ( TQValueList::ConstIterator eit = newFile->constBegin(); eit != newFile->constEnd(); ++eit ) m_bibtexfile->appendElement(( *eit )->clone() ); if ( KMessageBox::questionYesNo( this, i18n( "Do you want to search for duplicates in the merged document?" ), i18n( "Find duplicates?" ), KGuiItem( i18n( "Find Duplicates" ) ) ) == KMessageBox::Yes ) @@ -253,7 +253,7 @@ namespace KBibTeX return result; } - bool DocumentWidget::save( const QString &fileName, QStringList *errorLog ) + bool DocumentWidget::save( const TQString &fileName, TQStringList *errorLog ) { bool result = FALSE; m_dirWatch.removeFile( m_filename ); @@ -276,9 +276,9 @@ namespace KBibTeX format = BibTeX::File::formatPS; else if ( fileName.endsWith( ".xml", FALSE ) ) { - QStringList options = QStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "DocBook5|MODS|internal XML" : "DocBook5|internal XML" ) ); + TQStringList options = TQStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "DocBook5|MODS|internal XML" : "DocBook5|internal XML" ) ); bool ok = false; - QString answer = KInputDialog::getItem( i18n( "Choose file format" ), QString( i18n( "Choose file format of file '%1':" ) ).arg( fileName ), options, 0, false, &ok, this ); + TQString answer = KInputDialog::getItem( i18n( "Choose file format" ), TQString( i18n( "Choose file format of file '%1':" ) ).arg( fileName ), options, 0, false, &ok, this ); if ( ok && !answer.isNull() && answer == "DocBook5" ) format = BibTeX::File::formatDocBook5; else if ( ok && !answer.isNull() && answer == "MODS" ) @@ -291,14 +291,14 @@ namespace KBibTeX if ( format != BibTeX::File::formatUndefined ) { - QString usedFileName = fileName; - QFileInfo fi( fileName ); - if ( !fi.readLink().isNull() && KMessageBox::questionYesNo( this, QString( i18n( "The selected filename \"%1\" is a symbolic link pointing to \"%2\".\nReplace the link with a new file or overwrite the existing file the link points to?" ) ).arg( usedFileName ).arg( Settings::resolveLink( fileName, fi.readLink() ) ), i18n( "Symbolic Link" ), KGuiItem( i18n( "Replace link" ) ), KGuiItem( i18n( "Overwrite file the link points to" ) ) ) == KMessageBox::No ) + TQString usedFileName = fileName; + TQFileInfo fi( fileName ); + if ( !fi.readLink().isNull() && KMessageBox::questionYesNo( this, TQString( i18n( "The selected filename \"%1\" is a symbolic link pointing to \"%2\".\nReplace the link with a new file or overwrite the existing file the link points to?" ) ).arg( usedFileName ).arg( Settings::resolveLink( fileName, fi.readLink() ) ), i18n( "Symbolic Link" ), KGuiItem( i18n( "Replace link" ) ), KGuiItem( i18n( "Overwrite file the link points to" ) ) ) == KMessageBox::No ) usedFileName = Settings::resolveLink( fileName, fi.readLink() ); - QFile file( usedFileName ); + TQFile file( usedFileName ); if ( file.open( IO_WriteOnly ) ) { - result = save( &file, format, QString( i18n( "Writing file %1" ) ).arg( fileName ), errorLog ); + result = save( &file, format, TQString( i18n( "Writing file %1" ) ).arg( fileName ), errorLog ); if ( result ) { m_bibtexfile->fileName = fileName; @@ -316,7 +316,7 @@ namespace KBibTeX return result; } - bool DocumentWidget::save( QIODevice *iodevice, BibTeX::File::FileFormat format, const QString &label, QStringList *errorLog ) + bool DocumentWidget::save( TQIODevice *iodevice, BibTeX::File::FileFormat format, const TQString &label, TQStringList *errorLog ) { Settings * settings = Settings::self( m_bibtexfile ); @@ -363,7 +363,7 @@ namespace KBibTeX case BibTeX::FileExporterExternal::exporterXSLT: { KStandardDirs * kstd = KGlobal::dirs(); - QString resPath = kstd->findResource( "data", "kbibtexpart/xslt/html.xsl" ); + TQString resPath = kstd->findResource( "data", "kbibtexpart/xslt/html.xsl" ); if ( resPath != NULL ) transform = new BibTeX::XSLTransform( resPath ); @@ -385,7 +385,7 @@ namespace KBibTeX { if ( !settings->external_latex2rtfAvailable ) { - QString msg = i18n( "To export a BibTeX document to the Rich Text Format (RTF) KBibTeX requires the program 'latex2rtf'." ) ; + TQString msg = i18n( "To export a BibTeX document to the Rich Text Format (RTF) KBibTeX requires the program 'latex2rtf'." ) ; KMessageBox::information( this, msg ); errorLog->append( msg ); } @@ -400,9 +400,9 @@ namespace KBibTeX break; case BibTeX::File::formatDocBook5: { - if ( settings->fileIO_bib2db5ClassPath == QString::null ) + if ( settings->fileIO_bib2db5ClassPath == TQString::null ) { - QString msg = i18n( "To export a BibTeX document to the DocBook5 format KBibTeX requires the program 'bib2db5'." ) ; + TQString msg = i18n( "To export a BibTeX document to the DocBook5 format KBibTeX requires the program 'bib2db5'." ) ; KMessageBox::information( this, msg ); errorLog->append( msg ); } @@ -424,10 +424,10 @@ namespace KBibTeX BibTeX::FileExporterPDF *pdfExporter = new BibTeX::FileExporterPDF( settings->fileIO_EmbedFiles ); pdfExporter->setLaTeXLanguage( settings->fileIO_ExportLanguage ); pdfExporter->setLaTeXBibliographyStyle( settings->fileIO_ExportBibliographyStyle ); - QStringList searchPaths; - for ( QStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it ) + TQStringList searchPaths; + for ( TQStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it ) searchPaths.append( *it ); - if ( m_bibtexfile->fileName != QString::null ) + if ( m_bibtexfile->fileName != TQString::null ) searchPaths.append( KURL( m_bibtexfile->fileName ).directory( FALSE, FALSE ) ); pdfExporter->setDocumentSearchPaths( searchPaths ); exporter = pdfExporter; @@ -460,7 +460,7 @@ namespace KBibTeX return result; } - bool DocumentWidget::newElement( const QString& elementType ) + bool DocumentWidget::newElement( const TQString& elementType ) { Settings * settings = Settings::self( m_bibtexfile ); @@ -468,9 +468,9 @@ namespace KBibTeX { if ( elementType.lower() == "macro" ) { - QString name = QString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewMacro%1" ) ).arg( m_newElementCounter++ ); + TQString name = TQString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewMacro%1" ) ).arg( m_newElementCounter++ ); BibTeX::Macro *macro = new BibTeX::Macro( name ); - if ( MacroWidget::execute( macro, m_isReadOnly ) == QDialog::Accepted ) + if ( MacroWidget::execute( macro, m_isReadOnly ) == TQDialog::Accepted ) { new DocumentListViewItem( m_bibtexfile, macro, m_listViewElements ); m_bibtexfile->appendElement( macro ); @@ -487,7 +487,7 @@ namespace KBibTeX else if ( elementType.lower() == "comment" ) { BibTeX::Comment * comment = new BibTeX::Comment( i18n( "Put your comment here..." ) ); - if ( CommentWidget::execute( comment, m_isReadOnly ) == QDialog::Accepted ) + if ( CommentWidget::execute( comment, m_isReadOnly ) == TQDialog::Accepted ) { new DocumentListViewItem( m_bibtexfile, comment, m_listViewElements ); m_bibtexfile->appendElement( comment ); @@ -502,7 +502,7 @@ namespace KBibTeX else if ( elementType.lower() == "preamble" ) { BibTeX::Preamble * preamble = new BibTeX::Preamble( ); - if ( PreambleWidget::execute( preamble, m_isReadOnly ) == QDialog::Accepted ) + if ( PreambleWidget::execute( preamble, m_isReadOnly ) == TQDialog::Accepted ) { new DocumentListViewItem( m_bibtexfile, preamble, m_listViewElements ); m_bibtexfile->appendElement( preamble ); @@ -516,10 +516,10 @@ namespace KBibTeX } else { - QString name = nextNewEntry(); + TQString name = nextNewEntry(); BibTeX::Entry *entry = new BibTeX::Entry( elementType, name ); m_dirWatch.stopScan(); - if ( EntryWidget::execute( entry, m_bibtexfile, m_isReadOnly, TRUE ) == QDialog::Accepted ) + if ( EntryWidget::execute( entry, m_bibtexfile, m_isReadOnly, TRUE ) == TQDialog::Accepted ) { new DocumentListViewItem( m_bibtexfile, entry, m_listViewElements ); m_bibtexfile->appendElement( entry ); @@ -540,8 +540,8 @@ namespace KBibTeX { if ( elementType.lower() == "macro" ) { - QString name = QString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewString%1" ) ).arg( m_newElementCounter++ ); - m_sourceView->insertLines( QString( "@string{ %1 = \"%2\" }" ).arg( name ).arg( i18n( "No text yet" ) ) ); + TQString name = TQString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewString%1" ) ).arg( m_newElementCounter++ ); + m_sourceView->insertLines( TQString( "@string{ %1 = \"%2\" }" ).arg( name ).arg( i18n( "No text yet" ) ) ); } else if ( elementType.lower() == "comment" ) { @@ -553,7 +553,7 @@ namespace KBibTeX } else { - QString name = nextNewEntry(); + TQString name = nextNewEntry(); BibTeX::Entry *entry = new BibTeX::Entry( elementType, name ); for ( int t = 0; t < 2; t++ ) @@ -573,7 +573,7 @@ namespace KBibTeX } BibTeX::FileExporter * exporter = new BibTeX::FileExporterBibTeX( ); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); bool result = exporter->save( &buffer, entry ); buffer.close(); @@ -581,12 +581,12 @@ namespace KBibTeX if ( result ) { buffer.open( IO_ReadOnly ); - QTextStream textStream( &buffer ); - textStream.setEncoding( QTextStream::UnicodeUTF8 ); - QString text = textStream.read(); + TQTextStream textStream( &buffer ); + textStream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString text = textStream.read(); buffer.close(); - QStringList lines = QStringList::split( '\n', text ); - for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) + TQStringList lines = TQStringList::split( '\n', text ); + for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) m_sourceView->insertLines( *it ); } @@ -656,7 +656,7 @@ namespace KBibTeX BibTeX::Element * currentElement = NULL; - QListViewItem * item = m_listViewElements->selectedItem(); + TQListViewItem * item = m_listViewElements->selectedItem(); if ( item == NULL ) item = m_listViewElements->currentItem(); DocumentListViewItem * dlvi = dynamic_cast( item ); @@ -675,7 +675,7 @@ namespace KBibTeX { for ( KURL::List::Iterator i = documentURLs.begin(); i != documentURLs.end(); ++i ) { - QString prettyURL = ( *i ).prettyURL(); + TQString prettyURL = ( *i ).prettyURL(); if ( prettyURL.endsWith( ".pdf", FALSE ) || prettyURL.find( "/pdf/" ) > 0 ) popup->insertItem( SmallIcon( "pdf" ), prettyURL ); else if ( prettyURL.endsWith( ".ps", FALSE ) ) @@ -702,14 +702,14 @@ namespace KBibTeX KPopupMenu * popup = m_assignKeywordsActionMenu->popupMenu(); popup->clear(); m_assignKeywordsActionMenuURLs.clear(); - QStringList entryKeywords; - QStringList fileKeywords; + TQStringList entryKeywords; + TQStringList fileKeywords; /** * Fetch keywords from selected entries into entryKeywords list */ - QValueList entryList; - for ( QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); it.current(); ++it ) + TQValueList entryList; + for ( TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); it.current(); ++it ) { BibTeX::Element * currentElement = NULL; DocumentListViewItem * dlvi = dynamic_cast( it.current() ); @@ -721,17 +721,17 @@ namespace KBibTeX } } - for ( QValueList::Iterator it = entryList.begin(); it != entryList.end(); ++it ) + for ( TQValueList::Iterator it = entryList.begin(); it != entryList.end(); ++it ) { BibTeX::Entry *entry = *it; BibTeX::EntryField *field = NULL; BibTeX::Value *valueKeywords = NULL; if (( field = entry->getField( BibTeX::EntryField::ftKeywords ) ) != NULL && ( valueKeywords = field->value() ) != NULL ) - for ( QValueList::ConstIterator it = valueKeywords->items.begin();it != valueKeywords->items.end();++it ) + for ( TQValueList::ConstIterator it = valueKeywords->items.begin();it != valueKeywords->items.end();++it ) { BibTeX::KeywordContainer *container = dynamic_cast( *it ); if ( container != NULL ) - for ( QValueList::ConstIterator kit = container->keywords.begin();kit != container->keywords.end();++kit ) + for ( TQValueList::ConstIterator kit = container->keywords.begin();kit != container->keywords.end();++kit ) entryKeywords.append(( *kit )->text() ); } } @@ -739,19 +739,19 @@ namespace KBibTeX /** * Fetch all keywords from current file into fileKeywords */ - for ( QValueList::ConstIterator eit = m_bibtexfile->constBegin(); eit != m_bibtexfile->constEnd(); ++eit ) + for ( TQValueList::ConstIterator eit = m_bibtexfile->constBegin(); eit != m_bibtexfile->constEnd(); ++eit ) { BibTeX::Entry *entry = dynamic_cast( *eit ); BibTeX::EntryField *field = NULL; BibTeX::Value *value = NULL; if ( entry != NULL && (( field = entry->getField( BibTeX::EntryField::ftKeywords ) ) != NULL ) && (( value = field->value() ) != NULL ) ) { - for ( QValueList::ConstIterator vit = value->items.constBegin(); vit != value->items.constEnd();++vit ) + for ( TQValueList::ConstIterator vit = value->items.constBegin(); vit != value->items.constEnd();++vit ) { BibTeX::KeywordContainer *container = dynamic_cast( *vit ); - for ( QValueList::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd();++kit ) + for ( TQValueList::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd();++kit ) { - QString text = ( *kit )->text(); + TQString text = ( *kit )->text(); if ( !fileKeywords.contains( text ) ) fileKeywords.append( text ); } @@ -763,8 +763,8 @@ namespace KBibTeX * Merge keyword lists */ Settings * settings = Settings::self( m_bibtexfile ); - QStringList allKeywords = QStringList( fileKeywords ); - for ( QStringList::Iterator it = settings->keyword_GlobalList.begin(); it != settings->keyword_GlobalList.end(); ++it ) + TQStringList allKeywords = TQStringList( fileKeywords ); + for ( TQStringList::Iterator it = settings->keyword_GlobalList.begin(); it != settings->keyword_GlobalList.end(); ++it ) if ( !allKeywords.contains( *it ) ) allKeywords.append( *it ); allKeywords.sort(); @@ -777,7 +777,7 @@ namespace KBibTeX popupEmpty = TRUE; else if ( allKeywords.count() < 24 ) { - for ( QStringList::Iterator it = allKeywords.begin(); it != allKeywords.end(); ++it ) + for ( TQStringList::Iterator it = allKeywords.begin(); it != allKeywords.end(); ++it ) { int i = popup->insertItem( *it ); popup->setItemChecked( i, entryKeywords.contains( *it ) ); @@ -790,8 +790,8 @@ namespace KBibTeX int countPerSubMenu = 0; KPopupMenu *subMenu = new KPopupMenu( popup ); connect( subMenu, SIGNAL( activated( int ) ), this, SLOT( slotAssignKeywords( int ) ) ); - QString startWord, endWord; - for ( QStringList::Iterator it = allKeywords.begin(); it != allKeywords.end(); ++it ) + TQString startWord, endWord; + for ( TQStringList::Iterator it = allKeywords.begin(); it != allKeywords.end(); ++it ) { if ( countPerSubMenu == 0 ) startWord = *it; @@ -803,7 +803,7 @@ namespace KBibTeX ++countPerSubMenu; if ( countPerSubMenu >= maxCountPerSubMenu ) { - popup->insertItem( QString( i18n( "%1 ... %2" ) ).arg( startWord ).arg( endWord ), subMenu ); + popup->insertItem( TQString( i18n( "%1 ... %2" ) ).arg( startWord ).arg( endWord ), subMenu ); subMenu = new KPopupMenu( popup ); connect( subMenu, SIGNAL( activated( int ) ), this, SLOT( slotAssignKeywords( int ) ) ); countPerSubMenu = 0; @@ -812,7 +812,7 @@ namespace KBibTeX if ( countPerSubMenu > 0 ) { - popup->insertItem( QString( i18n( "%1 ... %2" ) ).arg( startWord ).arg( endWord ), subMenu ); + popup->insertItem( TQString( i18n( "%1 ... %2" ) ).arg( startWord ).arg( endWord ), subMenu ); } else delete subMenu; @@ -821,16 +821,16 @@ namespace KBibTeX if ( !popupEmpty ) popup->insertSeparator(); - QWidget *container = new QWidget( popup ); + TQWidget *container = new TQWidget( popup ); container->setBackgroundColor( KGlobalSettings::baseColor() ); - QHBoxLayout *layout = new QHBoxLayout( container, 1, 1 ); - QLabel *label = new QLabel( i18n( "New keyword:" ), container ); + TQHBoxLayout *layout = new TQHBoxLayout( container, 1, 1 ); + TQLabel *label = new TQLabel( i18n( "New keyword:" ), container ); label->setBackgroundColor( KGlobalSettings::baseColor() ); layout->addWidget( label ); m_lineEditNewKeyword = new KLineEdit( container ); layout->addWidget( m_lineEditNewKeyword ); container->setFocusProxy( m_lineEditNewKeyword ); - container->setFocusPolicy( QWidget::ClickFocus ); + container->setFocusPolicy( TQWidget::ClickFocus ); popup->insertItem( container ); connect( m_lineEditNewKeyword, SIGNAL( returnPressed() ), this, SLOT( slotAddKeyword() ) ); @@ -864,7 +864,7 @@ namespace KBibTeX KPopupMenu * popup = m_searchWebsitesActionMenu->popupMenu(); popup->clear(); int i = 0; - for ( QValueList::ConstIterator it = settings->searchURLs.begin(); it != settings->searchURLs.end(); ++it ) + for ( TQValueList::ConstIterator it = settings->searchURLs.begin(); it != settings->searchURLs.end(); ++it ) popup->insertItem(( *it ) ->description, ++i ); } @@ -886,20 +886,20 @@ namespace KBibTeX if ( entry != NULL ) { /** prefer local urls over remote urls, so first check for file:// and use other protocols only if no file:// was found */ - QString protocol = "file"; + TQString protocol = "file"; KURL::List urls = getEntryURLs( entry ); KURL selected = KURL(); - while ( !selected.isValid() && protocol != QString::null ) + while ( !selected.isValid() && protocol != TQString::null ) { for ( KURL::List::Iterator it = urls.begin(); !selected.isValid() && it != urls.end(); ++it ) { KURL url = *it; - if ( url.isValid() && ( !url.isLocalFile() || QFile::exists( url.path() ) ) && url.protocol().startsWith( protocol ) ) + if ( url.isValid() && ( !url.isLocalFile() || TQFile::exists( url.path() ) ) && url.protocol().startsWith( protocol ) ) selected = url; } /** little trick setting protocol prefix in the first round to "file://", then to "", and setting to null to quit the loop */ if ( !protocol.isEmpty() ) protocol = ""; - else protocol = QString::null; + else protocol = TQString::null; } if ( selected.isValid() ) @@ -914,7 +914,7 @@ namespace KBibTeX bool DocumentWidget::editElement() { bool result = false; - QListViewItem * item = m_listViewElements->selectedItem(); + TQListViewItem * item = m_listViewElements->selectedItem(); if ( item == NULL ) item = m_listViewElements->currentItem(); DocumentListViewItem * dlvi = dynamic_cast( item ); @@ -950,7 +950,7 @@ namespace KBibTeX bool DocumentWidget::editElementDialog( BibTeX::Element *element ) { - QDialog::DialogCode dialogResult = QDialog::Rejected; + TQDialog::DialogCode dialogResult = TQDialog::Rejected; BibTeX::Entry * entry = dynamic_cast( element ); if ( entry ) dialogResult = KBibTeX::EntryWidget::execute( entry, m_bibtexfile, m_isReadOnly, FALSE ); @@ -973,10 +973,10 @@ namespace KBibTeX } } - if ( dialogResult == QDialog::Accepted ) + if ( dialogResult == TQDialog::Accepted ) slotModified(); - return dialogResult == QDialog::Accepted; + return dialogResult == TQDialog::Accepted; } void DocumentWidget::deleteElements() @@ -995,19 +995,19 @@ namespace KBibTeX { if ( m_editMode == emList ) { - QValueList elements = m_listViewElements->selectedItems(); - QString genericMsg = i18n( "\n\nEither LyX is not running or has not been correctly configured to send references to." ); - QString title = i18n( "Error communicating with LyX" ); + TQValueList elements = m_listViewElements->selectedItems(); + TQString genericMsg = i18n( "\n\nEither LyX is not running or has not been correctly configured to send references to." ); + TQString title = i18n( "Error communicating with LyX" ); Settings * settings = Settings::self( m_bibtexfile ); - QString lyxPipeFilename = settings->detectLyXInPipe(); + TQString lyxPipeFilename = settings->detectLyXInPipe(); kdDebug() << "sendSelectedToLyx: lyxPipeFilename= " << lyxPipeFilename << endl; if ( lyxPipeFilename.isNull() ) KMessageBox::error( this, i18n( "Cannot determine how to send references to LyX." ).append( genericMsg ), title ); else { - QFile pipe( lyxPipeFilename ); + TQFile pipe( lyxPipeFilename ); if ( !pipe.exists() ) KMessageBox::error( this, i18n( "The inpipe as configured in LyX does not exist." ).append( genericMsg ), title ); else @@ -1016,15 +1016,15 @@ namespace KBibTeX KMessageBox::error( this, i18n( "Cannot open the inpipe as configured in LyX." ).append( genericMsg ), title ); else { - QStringList refsToSend; - for ( QValueList::Iterator it = elements.begin(); it != elements.end(); ++it ) + TQStringList refsToSend; + for ( TQValueList::Iterator it = elements.begin(); it != elements.end(); ++it ) { BibTeX::Entry *entry = dynamic_cast( *it ); if ( entry != NULL ) refsToSend.append( entry->id() ); } - QTextStream * writer = new QTextStream( &pipe ); - QString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," ); + TQTextStream * writer = new TQTextStream( &pipe ); + TQString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," ); *writer << msg << endl; delete writer; pipe.close(); @@ -1133,29 +1133,29 @@ namespace KBibTeX if ( m_progressDialog != NULL ) { m_progressDialog->setProgress( current, total ); - qApp->processEvents(); + tqApp->processEvents(); } } - void DocumentWidget::startProgress( const QString & label, QObject * progressFrom ) + void DocumentWidget::startProgress( const TQString & label, TQObject * progressFrom ) { - m_progressDialog = new QProgressDialog( this ); + m_progressDialog = new TQProgressDialog( this ); m_progressDialog->setLabelText( label ); connect( progressFrom, SIGNAL( progress( int, int ) ), this, SLOT( slotShowProgress( int, int ) ) ); connect( m_progressDialog, SIGNAL( canceled() ), progressFrom, SLOT( cancel( ) ) ); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); } - void DocumentWidget::endProgress( QObject * progressFrom ) + void DocumentWidget::endProgress( TQObject * progressFrom ) { disconnect( progressFrom, SIGNAL( progress( int, int ) ), this, SLOT( slotShowProgress( int, int ) ) ); disconnect( m_progressDialog, SIGNAL( canceled() ), progressFrom, SLOT( cancel( ) ) ); delete m_progressDialog; m_progressDialog = NULL; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } - void DocumentWidget::searchWebsites( const QString& searchURL, bool includeAuthor ) + void DocumentWidget::searchWebsites( const TQString& searchURL, bool includeAuthor ) { DocumentListViewItem * item = dynamic_cast( m_listViewElements->selectedItem() ); if ( item == NULL ) @@ -1165,9 +1165,9 @@ namespace KBibTeX searchWebsites( item->element(), searchURL, includeAuthor ); } - void DocumentWidget::searchWebsites( BibTeX::Element * element, const QString& searchURL, bool includeAuthor ) + void DocumentWidget::searchWebsites( BibTeX::Element * element, const TQString& searchURL, bool includeAuthor ) { - QString queryString = QString::null; + TQString queryString = TQString::null; BibTeX::Entry* entry = dynamic_cast( element ); if ( entry != NULL ) @@ -1183,8 +1183,8 @@ namespace KBibTeX BibTeX::PersonContainer *personContainer = dynamic_cast( field->value()->items.first() ); if ( personContainer != NULL ) { - QValueList list = personContainer->persons; - for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + TQValueList list = personContainer->persons; + for ( TQValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) queryString = queryString.append( " " ).append(( *it )->lastName() ); } @@ -1206,10 +1206,10 @@ namespace KBibTeX } } - if ( queryString != QString::null ) + if ( queryString != TQString::null ) { queryString = queryString.stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ).replace( '{', "" ).replace( '}', "" ); - KURL url( QString( searchURL ).arg( queryString ) ); + KURL url( TQString( searchURL ).arg( queryString ) ); Settings::openUrl( url, this ); } } @@ -1219,30 +1219,30 @@ namespace KBibTeX if ( !m_isReadOnly ) { BibTeX::FileExporter * exporter = new BibTeX::FileExporterBibTeX( ); - QValueList list; - if ( WebQueryWizard::execute( this, list ) == QDialog::Accepted ) + TQValueList list; + if ( WebQueryWizard::execute( this, list ) == TQDialog::Accepted ) { Settings * settings = Settings::self( m_bibtexfile ); - for ( QValueList::Iterator it = list.begin(); it != list.end(); ++it ) + for ( TQValueList::Iterator it = list.begin(); it != list.end(); ++it ) { ( *it )->setId( IdSuggestions::resolveConflict( m_bibtexfile, ( *it )->id() ) ); if ( m_editMode == emList ) m_listViewElements->insertItem( new BibTeX::Entry( *it ) ); else { - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); bool result = exporter->save( &buffer, *it ); buffer.close(); if ( result ) { buffer.open( IO_ReadOnly ); - QTextStream textStream( &buffer ); - textStream.setEncoding( QTextStream::UnicodeUTF8 ); - QString text = textStream.read(); + TQTextStream textStream( &buffer ); + textStream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString text = textStream.read(); buffer.close(); - QStringList lines = QStringList::split( '\n', text ); - for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) + TQStringList lines = TQStringList::split( '\n', text ); + for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) m_sourceView->insertLines( *it ); m_sourceView->insertLines( "" ); } @@ -1260,7 +1260,7 @@ namespace KBibTeX void DocumentWidget::findDuplicates() { MergeElements *me = new MergeElements( this ); - if ( me->mergeDuplicates( m_bibtexfile ) == QDialog::Accepted ) + if ( me->mergeDuplicates( m_bibtexfile ) == TQDialog::Accepted ) { refreshBibTeXFile(); slotModified(); @@ -1283,14 +1283,14 @@ namespace KBibTeX } } - QString DocumentWidget::nextNewEntry() + TQString DocumentWidget::nextNewEntry() { - QString name = QString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewEntry%1" ) ).arg( m_newElementCounter++ ); + TQString name = TQString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewEntry%1" ) ).arg( m_newElementCounter++ ); while ( m_bibtexfile->containsKey( name ) != NULL ) { ++m_newElementCounter; - name = QString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewEntry%1" ) ).arg( m_newElementCounter++ ); + name = TQString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewEntry%1" ) ).arg( m_newElementCounter++ ); } return name; @@ -1298,10 +1298,10 @@ namespace KBibTeX KURL::List DocumentWidget::getEntryURLs( BibTeX::Entry *entry ) { - QStringList urls = entry->urls(); + TQStringList urls = entry->urls(); KURL::List result; - for ( QStringList::Iterator it = urls.begin(); it != urls.end(); ++it ) + for ( TQStringList::Iterator it = urls.begin(); it != urls.end(); ++it ) { KURL url = Settings::locateFile( *it, m_bibtexfile->fileName, this ); if ( url.isValid() ) @@ -1314,7 +1314,7 @@ namespace KBibTeX void DocumentWidget::slotSelectionChanged() { int numSelected = 0; - QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); while ( it.current() && numSelected < 3 ) { numSelected++; @@ -1324,7 +1324,7 @@ namespace KBibTeX emit listViewSelectionChanged( numSelected ); } - BibTeX::FileImporter *DocumentWidget::fileImporterFactory( const QString &fileName ) + BibTeX::FileImporter *DocumentWidget::fileImporterFactory( const TQString &fileName ) { Settings * settings = Settings::self( NULL ); BibTeX::FileImporter * importer = NULL; @@ -1340,9 +1340,9 @@ namespace KBibTeX format = BibTeX::File::formatRIS; else if ( fileName.endsWith( ".xml", FALSE ) ) { - QStringList options = QStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "MODS|EndNote XML|internal XML" : "internal XML" ) ); + TQStringList options = TQStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "MODS|EndNote XML|internal XML" : "internal XML" ) ); bool ok = false; - QString answer = KInputDialog::getItem( i18n( "Choose file format" ), QString( i18n( "Choose file format of file '%1':" ) ).arg( fileName ), options, 0, false, &ok, this ); + TQString answer = KInputDialog::getItem( i18n( "Choose file format" ), TQString( i18n( "Choose file format of file '%1':" ) ).arg( fileName ), options, 0, false, &ok, this ); if ( ok && !answer.isNull() && answer == "DocBook5" ) format = BibTeX::File::formatDocBook5; else if ( ok && !answer.isNull() && answer == "MODS" ) @@ -1354,9 +1354,9 @@ namespace KBibTeX } else { - QStringList options = QStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "BibTeX|EndNote|ISI|RIS" : "BibTeX|RIS" ) ); + TQStringList options = TQStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "BibTeX|EndNote|ISI|RIS" : "BibTeX|RIS" ) ); bool ok = false; - QString answer = KInputDialog::getItem( i18n( "Choose file format" ), QString( i18n( "Choose file format of file '%1':" ) ).arg( fileName ), options, 0, false, &ok, this ); + TQString answer = KInputDialog::getItem( i18n( "Choose file format" ), TQString( i18n( "Choose file format of file '%1':" ) ).arg( fileName ), options, 0, false, &ok, this ); if ( ok && !answer.isNull() && answer == "BibTeX" ) format = BibTeX::File::formatBibTeX; else if ( ok && !answer.isNull() && answer == "EndNote" ) @@ -1395,7 +1395,7 @@ namespace KBibTeX break; default: { - KMessageBox::sorry( this, QString( i18n( "The file '%1' does not contain a known type of bibliography." ) ).arg( fileName ), i18n( "Unknown file format" ) ); + KMessageBox::sorry( this, TQString( i18n( "The file '%1' does not contain a known type of bibliography." ) ).arg( fileName ), i18n( "Unknown file format" ) ); } } } @@ -1403,7 +1403,7 @@ namespace KBibTeX return importer; } - void DocumentWidget::slotPreviewElement( QListViewItem * item ) + void DocumentWidget::slotPreviewElement( TQListViewItem * item ) { if ( item == NULL ) item = m_listViewElements->selectedItem(); @@ -1425,7 +1425,7 @@ namespace KBibTeX if ( transform != NULL ) { BibTeX::FileExporterXSLT * exporter = new BibTeX::FileExporterXSLT( transform ); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); bool result = exporter->save( &buffer, currentElement ); buffer.close(); @@ -1433,11 +1433,11 @@ namespace KBibTeX if ( result ) { buffer.open( IO_ReadOnly ); - QTextStream htmlTS( &buffer ); - htmlTS.setEncoding( QTextStream::UnicodeUTF8 ); - QString htmlText = htmlTS.read(); + TQTextStream htmlTS( &buffer ); + htmlTS.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString htmlText = htmlTS.read(); buffer.close(); - QString text = htmlText.remove( "\n" ).append( "" ).prepend( "" ).replace( QRegExp( "\\\\emph\\{([^}]+)\\}" ), "\\1" ).replace( QRegExp( "\\\\[A-Za-z0-9]+" ), "" ).replace( '{', "" ).replace( '}', "" ); + TQString text = htmlText.remove( "\n" ).append( "" ).prepend( "" ).replace( TQRegExp( "\\\\emph\\{([^}]+)\\}" ), "\\1" ).replace( TQRegExp( "\\\\[A-Za-z0-9]+" ), "" ).replace( '{', "" ).replace( '}', "" ); m_preview->setText( text ); } else @@ -1457,10 +1457,10 @@ namespace KBibTeX } } - void DocumentWidget::slotTabChanged( QWidget *tab ) + void DocumentWidget::slotTabChanged( TQWidget *tab ) { setEnabled( FALSE ); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); BibTeX::File *bibTeXFile = NULL; if ( m_editMode == emSource ) @@ -1526,7 +1526,7 @@ namespace KBibTeX if ( m_actionEditCopyRef ) m_actionEditCopyRef->setEnabled( m_editMode == emList ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); emit undoChanged( m_editMode == emSource ); } @@ -1540,18 +1540,18 @@ namespace KBibTeX } } - void DocumentWidget::slotFileGotDirty( const QString& path ) + void DocumentWidget::slotFileGotDirty( const TQString& path ) { if ( path == m_filename ) { m_dirWatch.removeFile( m_filename ); - QTimer::singleShot( 100, this, SLOT( slotRefreshDirtyFile( ) ) ); + TQTimer::singleShot( 100, this, SLOT( slotRefreshDirtyFile( ) ) ); } } void DocumentWidget::slotRefreshDirtyFile() { - if ( KMessageBox::questionYesNo( this, QString( i18n( "File '%1' has been modified. Reload file to import changes or ignore changes?" ) ).arg( m_filename ), i18n( "Reload file?" ), KGuiItem( i18n( "Reload" ), "reload" ), KGuiItem( i18n( "Ignore" ), "ignore" ) ) == KMessageBox::Yes ) + if ( KMessageBox::questionYesNo( this, TQString( i18n( "File '%1' has been modified. Reload file to import changes or ignore changes?" ) ).arg( m_filename ), i18n( "Reload file?" ), KGuiItem( i18n( "Reload" ), "reload" ), KGuiItem( i18n( "Ignore" ), "ignore" ) ) == KMessageBox::Yes ) open( m_filename, FALSE ); else m_dirWatch.addFile( m_filename ); @@ -1564,7 +1564,7 @@ namespace KBibTeX void DocumentWidget::slotViewFirstDocument() { - for ( QStringList::Iterator it = m_viewDocumentActionMenuURLs.begin(); it != m_viewDocumentActionMenuURLs.end(); ++it ) + for ( TQStringList::Iterator it = m_viewDocumentActionMenuURLs.begin(); it != m_viewDocumentActionMenuURLs.end(); ++it ) if (( *it ).endsWith( ".pdf" ) || ( *it ).endsWith( ".ps" ) || ( *it ).endsWith( ".djv" ) ) { Settings::openUrl( *it, this ); @@ -1574,7 +1574,7 @@ namespace KBibTeX void DocumentWidget::slotViewFirstDocumentsOnlineRef() { - for ( QStringList::Iterator it = m_viewDocumentActionMenuURLs.begin(); it != m_viewDocumentActionMenuURLs.end(); ++it ) + for ( TQStringList::Iterator it = m_viewDocumentActionMenuURLs.begin(); it != m_viewDocumentActionMenuURLs.end(); ++it ) if (( *it ).contains( "dx.doi.org" ) ) { Settings::openUrl( *it, this ); @@ -1584,12 +1584,12 @@ namespace KBibTeX void DocumentWidget::slotAssignKeywords( int id ) { - QValueList entryList; + TQValueList entryList; - QListViewItem * item = m_listViewElements->selectedItem(); + TQListViewItem * item = m_listViewElements->selectedItem(); if ( item == NULL ) item = m_listViewElements->currentItem(); - for ( QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); it.current(); ++it ) { BibTeX::Element * currentElement = NULL; DocumentListViewItem * dlvi = dynamic_cast( it.current() ); @@ -1601,7 +1601,7 @@ namespace KBibTeX } } - for ( QValueList::Iterator it = entryList.begin(); it != entryList.end(); ++it ) + for ( TQValueList::Iterator it = entryList.begin(); it != entryList.end(); ++it ) { BibTeX::Entry *entry = *it; BibTeX::EntryField *field = NULL; @@ -1630,10 +1630,10 @@ namespace KBibTeX void DocumentWidget::slotAddKeyword() { - QString newKeyword = m_lineEditNewKeyword->text(); + TQString newKeyword = m_lineEditNewKeyword->text(); - QValueList entryList; - for ( QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); it.current(); ++it ) + TQValueList entryList; + for ( TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); it.current(); ++it ) { BibTeX::Element * currentElement = NULL; DocumentListViewItem * dlvi = dynamic_cast( it.current() ); @@ -1645,7 +1645,7 @@ namespace KBibTeX } } - for ( QValueList::Iterator it = entryList.begin(); it != entryList.end(); ++it ) + for ( TQValueList::Iterator it = entryList.begin(); it != entryList.end(); ++it ) { BibTeX::Entry *entry = *it; BibTeX::EntryField *field = entry->getField( BibTeX::EntryField::ftKeywords ); @@ -1672,7 +1672,7 @@ namespace KBibTeX if ( m_lineEditNewKeyword->isVisible() && m_lineEditNewKeyword->parentWidget() && m_lineEditNewKeyword->parentWidget()->parentWidget() && - m_lineEditNewKeyword->parentWidget()->parentWidget()->inherits( "QPopupMenu" ) ) + m_lineEditNewKeyword->parentWidget()->parentWidget()->inherits( "TQPopupMenu" ) ) m_lineEditNewKeyword->parentWidget()->parentWidget()->close(); slotModified(); @@ -1682,9 +1682,9 @@ namespace KBibTeX void DocumentWidget::slotNormalizeIds() { Settings * settings = Settings::self(); - QMap entryToNewId; - QMap entryToItem; - QStringList msgList; + TQMap entryToNewId; + TQMap entryToItem; + TQStringList msgList; if ( settings->idSuggestions_default < 0 ) { @@ -1692,7 +1692,7 @@ namespace KBibTeX return; } - for ( QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); it.current(); ++it ) { BibTeX::Element * currentElement = NULL; DocumentListViewItem * dlvi = dynamic_cast( it.current() ); @@ -1701,7 +1701,7 @@ namespace KBibTeX BibTeX::Entry *entry = dynamic_cast( currentElement ); if ( entry != NULL ) { - QString newEntryId = IdSuggestions::createDefaultSuggestion( m_bibtexfile, entry ); + TQString newEntryId = IdSuggestions::createDefaultSuggestion( m_bibtexfile, entry ); entryToNewId[entry] = newEntryId; entryToItem[entry] = dlvi; msgList << "Replacing id of entry \"" + entry->id() + "\" with new id \"" + newEntryId + "\""; @@ -1713,20 +1713,20 @@ namespace KBibTeX KMessageBox::information( this, i18n( "No entries were selected." ) ); else if ( KMessageBox::questionYesNoList( this, i18n( "The following changes will be applied to the currently selected elements.\nConflicts with duplicate entry ids will be resolved when applying the new ids." ), msgList, i18n( "Normalize Entry Ids" ), KGuiItem( i18n( "Replace Entry Ids" ), "run" ), KGuiItem( i18n( "Cancel" ), "cancel" ) ) == KMessageBox::Yes ) { - QApplication::setOverrideCursor( Qt::waitCursor ); - QMap::Iterator itItem = entryToItem.begin(); - for ( QMap::Iterator it = entryToNewId.begin(); it != entryToNewId.end(); ++it, ++itItem ) + TQApplication::setOverrideCursor( TQt::waitCursor ); + TQMap::Iterator itItem = entryToItem.begin(); + for ( TQMap::Iterator it = entryToNewId.begin(); it != entryToNewId.end(); ++it, ++itItem ) { BibTeX::Entry *entry = it.key(); - QString newEntryId = it.data(); + TQString newEntryId = it.data(); newEntryId = IdSuggestions::resolveConflict( m_bibtexfile, newEntryId, entry ); - qDebug( "Replacing id of entry \"%s\" with new id \"%s\"", entry->id().latin1(), newEntryId.latin1() ); + tqDebug( "Replacing id of entry \"%s\" with new id \"%s\"", entry->id().latin1(), newEntryId.latin1() ); entry->setId( newEntryId ); itItem.data()->updateItem(); } slotModified(); m_sideBar->refreshLists( m_bibtexfile ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } } diff --git a/src/documentwidget.h b/src/documentwidget.h index cc6e344..abdd570 100644 --- a/src/documentwidget.h +++ b/src/documentwidget.h @@ -20,7 +20,7 @@ #ifndef KBIBTEXDOCUMENTWIDGET_H #define KBIBTEXDOCUMENTWIDGET_H -#include +#include #include @@ -28,11 +28,11 @@ #include #include -class QIODevice; -class QProgressDialog; -class QListViewItem; -class QWidget; -class QSplitter; +class TQIODevice; +class TQProgressDialog; +class TQListViewItem; +class TQWidget; +class TQSplitter; class KPopupMenu; class KActionMenu; @@ -49,20 +49,20 @@ namespace KBibTeX class SideBar; class WebQuery; - class DocumentWidget : public QTabWidget + class DocumentWidget : public TQTabWidget { Q_OBJECT public: - DocumentWidget( bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + DocumentWidget( bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~DocumentWidget(); - bool open( const QString &fileName, bool mergeOnly = FALSE ); - bool open( QIODevice *iodevice, bool mergeOnly = FALSE, const QString &label = QString::null, BibTeX::FileImporter *importer = NULL ); - bool save( const QString &fileName, QStringList *errorLog = NULL ); - bool save( QIODevice *iodevice, BibTeX::File::FileFormat format = BibTeX::File::formatBibTeX, const QString &label = QString::null, QStringList *errorLog = NULL ); + bool open( const TQString &fileName, bool mergeOnly = FALSE ); + bool open( TQIODevice *iodevice, bool mergeOnly = FALSE, const TQString &label = TQString::null, BibTeX::FileImporter *importer = NULL ); + bool save( const TQString &fileName, TQStringList *errorLog = NULL ); + bool save( TQIODevice *iodevice, BibTeX::File::FileFormat format = BibTeX::File::formatBibTeX, const TQString &label = TQString::null, TQStringList *errorLog = NULL ); - bool newElement( const QString& elementType ); - void searchWebsites( const QString& searchURL, bool includeAuthor ); + bool newElement( const TQString& elementType ); + void searchWebsites( const TQString& searchURL, bool includeAuthor ); void updateViews(); void showStatistics(); @@ -113,23 +113,23 @@ namespace KBibTeX KLineEdit *m_lineEditNewKeyword; bool m_isReadOnly; - QSplitter *m_horSplitter; - QSplitter *m_vertSplitter; - QWidget *m_container; + TQSplitter *m_horSplitter; + TQSplitter *m_vertSplitter; + TQWidget *m_container; SearchBar *m_searchBar; DocumentListView *m_listViewElements; KTextEdit * m_preview; DocumentSourceView *m_sourceView; SideBar* m_sideBar; BibTeX::File *m_bibtexfile; - QString m_filename; - QProgressDialog *m_progressDialog; + TQString m_filename; + TQProgressDialog *m_progressDialog; int m_newElementCounter; EditMode m_editMode; KActionMenu *m_viewDocumentActionMenu; KActionMenu *m_assignKeywordsActionMenu; - QStringList m_viewDocumentActionMenuURLs; - QMap m_assignKeywordsActionMenuURLs; + TQStringList m_viewDocumentActionMenuURLs; + TQMap m_assignKeywordsActionMenuURLs; KActionMenu *m_searchWebsitesActionMenu; KAction *m_actionEditCut; KAction *m_actionEditCopy; @@ -143,26 +143,26 @@ namespace KBibTeX void setupGUI(); - void startProgress( const QString &label, QObject *progressFrom ); - void endProgress( QObject *progressFrom ); + void startProgress( const TQString &label, TQObject *progressFrom ); + void endProgress( TQObject *progressFrom ); - void searchWebsites( BibTeX::Element *element, const QString& searchURL, bool includeAuthor ); + void searchWebsites( BibTeX::Element *element, const TQString& searchURL, bool includeAuthor ); bool editElementDialog( BibTeX::Element *element ); void updateFromGUI(); - QString nextNewEntry(); + TQString nextNewEntry(); KURL::List getEntryURLs( BibTeX::Entry *entry ); - BibTeX::FileImporter *fileImporterFactory( const QString &fileName ); + BibTeX::FileImporter *fileImporterFactory( const TQString &fileName ); private slots: void slotShowProgress( int current, int total ); void slotSelectionChanged(); - void slotPreviewElement( QListViewItem * item = NULL ); - void slotTabChanged( QWidget *tab ); + void slotPreviewElement( TQListViewItem * item = NULL ); + void slotTabChanged( TQWidget *tab ); void slotModified(); - void slotFileGotDirty( const QString& path ); + void slotFileGotDirty( const TQString& path ); void slotRefreshDirtyFile(); void slotViewDocument( int id ); void slotAssignKeywords( int id ); diff --git a/src/element.cpp b/src/element.cpp index 73b3178..e3e1a2e 100644 --- a/src/element.cpp +++ b/src/element.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include #include "element.h" @@ -36,10 +36,10 @@ namespace BibTeX // nothing } - bool Element::isSimpleString( const QString &text ) + bool Element::isSimpleString( const TQString &text ) { bool result = TRUE; - const QString goodChars = "abcdefghijklmnopqrstuvwxyz0123456789-_"; + const TQString goodChars = "abcdefghijklmnopqrstuvwxyz0123456789-_"; for ( unsigned int i = 0; result && i < text.length(); i++ ) result &= goodChars.contains( text.at( i ), FALSE ); diff --git a/src/element.h b/src/element.h index 1955383..c470f0d 100644 --- a/src/element.h +++ b/src/element.h @@ -23,7 +23,7 @@ #include #include -class QString; +class TQString; namespace BibTeX { @@ -36,11 +36,11 @@ namespace BibTeX Element(); virtual ~Element(); - virtual bool containsPattern( const QString& /* pattern */, BibTeX::EntryField::FieldType /* fieldType */, FilterType /* filterType */ = BibTeX::Element::ftExact, bool /* caseSensitive */ = false ) const = 0; + virtual bool containsPattern( const TQString& /* pattern */, BibTeX::EntryField::FieldType /* fieldType */, FilterType /* filterType */ = BibTeX::Element::ftExact, bool /* caseSensitive */ = false ) const = 0; virtual Element* clone() = 0; - virtual QString text() const = 0; + virtual TQString text() const = 0; - static bool isSimpleString( const QString &text ); + static bool isSimpleString( const TQString &text ); }; diff --git a/src/encoder.h b/src/encoder.h index 7997b8e..06567c0 100644 --- a/src/encoder.h +++ b/src/encoder.h @@ -22,7 +22,7 @@ #include -class QString; +class TQString; namespace BibTeX { @@ -35,17 +35,17 @@ namespace BibTeX public: virtual ~Encoder() { /* nothing */}; - virtual QString decode( const QString & /*text*/ ) + virtual TQString decode( const TQString & /*text*/ ) { - return QString::null; + return TQString::null; }; - virtual QString encode( const QString & /*text*/ ) + virtual TQString encode( const TQString & /*text*/ ) { - return QString::null; + return TQString::null; }; - virtual QString encodeSpecialized( const QString & /*text*/, const EntryField::FieldType /*fieldType*/ = EntryField::ftUnknown ) + virtual TQString encodeSpecialized( const TQString & /*text*/, const EntryField::FieldType /*fieldType*/ = EntryField::ftUnknown ) { - return QString::null; + return TQString::null; }; }; diff --git a/src/encoderlatex.cpp b/src/encoderlatex.cpp index f111848..4dc0326 100644 --- a/src/encoderlatex.cpp +++ b/src/encoderlatex.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "encoderlatex.h" @@ -497,23 +497,23 @@ namespace BibTeX // nothing } - QString EncoderLaTeX::decode( const QString & text ) + TQString EncoderLaTeX::decode( const TQString & text ) { - const QString splitMarker = "|KBIBTEX|"; + const TQString splitMarker = "|KBIBTEX|"; /** start-stop marker ensures that each text starts and stops * with plain text and not with an inline math environment. * This invariant is exploited implicitly in the code below. */ - const QString startStopMarker="|STARTSTOP|"; - QString result = startStopMarker + text + startStopMarker; + const TQString startStopMarker="|STARTSTOP|"; + TQString result = startStopMarker + text + startStopMarker; /** Collect (all?) urls from the BibTeX file and store them in urls */ /** Problem is that the replace function below will replace * character sequences in the URL rendering the URL invalid. * Later, all URLs will be replaced back to their original * in the hope nothing breaks ... */ - QStringList urls; - QRegExp httpRegExp( "(ht|f)tp://[^\"} ]+" ); + TQStringList urls; + TQRegExp httpRegExp( "(ht|f)tp://[^\"} ]+" ); httpRegExp.setMinimal( false ); int pos = 0; while ( pos >= 0 ) @@ -522,7 +522,7 @@ namespace BibTeX if ( pos >= 0 ) { ++pos; - QString url = httpRegExp.cap( 0 ); + TQString url = httpRegExp.cap( 0 ); urls << url; } } @@ -530,8 +530,8 @@ namespace BibTeX decomposedUTF8toLaTeX( result ); /** split text into math and non-math regions */ - QStringList intermediate = QStringList::split( '$', result, true ); - QStringList::Iterator it = intermediate.begin(); + TQStringList intermediate = TQStringList::split( '$', result, true ); + TQStringList::Iterator it = intermediate.begin(); while ( it != intermediate.end() ) { /** @@ -544,7 +544,7 @@ namespace BibTeX */ if (( *it ).endsWith( "\\" ) ) { - QStringList::Iterator cur = it; + TQStringList::Iterator cur = it; ++it; ( *cur ).append( '$' ).append( *it ); intermediate.remove( it ); @@ -554,10 +554,10 @@ namespace BibTeX ++it; } - qApp->processEvents(); + tqApp->processEvents(); result = ""; - for ( QStringList::Iterator it = intermediate.begin(); it != intermediate.end(); ++it ) + for ( TQStringList::Iterator it = intermediate.begin(); it != intermediate.end(); ++it ) { if ( !result.isEmpty() ) result.append( splitMarker ); result.append( *it ); @@ -567,22 +567,22 @@ namespace BibTeX break; if (( *it ).length() > 256 ) - qDebug( "Very long math equation using $ found, maybe due to broken inline math: %s", ( *it ).left( 48 ).latin1() ); + tqDebug( "Very long math equation using $ found, maybe due to broken inline math: %s", ( *it ).left( 48 ).latin1() ); } - qApp->processEvents(); + tqApp->processEvents(); - for ( QValueList::ConstIterator cmit = m_charMapping.begin(); cmit != m_charMapping.end(); ++cmit ) + for ( TQValueList::ConstIterator cmit = m_charMapping.begin(); cmit != m_charMapping.end(); ++cmit ) result.replace(( *cmit ).regExp, ( *cmit ).unicode ); - qApp->processEvents(); + tqApp->processEvents(); - QStringList transformed = QStringList::split( splitMarker, result, true ); + TQStringList transformed = TQStringList::split( splitMarker, result, true ); - qApp->processEvents(); + tqApp->processEvents(); result = ""; - for ( QStringList::Iterator itt = transformed.begin(), iti = intermediate.begin(); itt != transformed.end() && iti != intermediate.end(); ++itt, ++iti ) + for ( TQStringList::Iterator itt = transformed.begin(), iti = intermediate.begin(); itt != transformed.end() && iti != intermediate.end(); ++itt, ++iti ) { result.append( *itt ); @@ -593,7 +593,7 @@ namespace BibTeX result.append( "$" ).append( *iti ).append( "$" ); } - qApp->processEvents(); + tqApp->processEvents(); /** Reinserting original URLs as explained above */ pos = 0; @@ -612,23 +612,23 @@ namespace BibTeX return result.replace( startStopMarker,"" ); } - QString EncoderLaTeX::encode( const QString & text ) + TQString EncoderLaTeX::encode( const TQString & text ) { - const QString splitMarker = "|KBIBTEX|"; + const TQString splitMarker = "|KBIBTEX|"; /** start-stop marker ensures that each text starts and stops * with plain text and not with an inline math environment. * This invariant is exploited implicitly in the code below. */ - const QString startStopMarker="|STARTSTOP|"; - QString result = startStopMarker + text + startStopMarker; + const TQString startStopMarker="|STARTSTOP|"; + TQString result = startStopMarker + text + startStopMarker; /** Collect (all?) urls from the BibTeX file and store them in urls */ /** Problem is that the replace function below will replace * character sequences in the URL rendering the URL invalid. * Later, all URLs will be replaced back to their original * in the hope nothing breaks ... */ - QStringList urls; - QRegExp httpRegExp( "(ht|f)tp://[^\"} ]+" ); + TQStringList urls; + TQRegExp httpRegExp( "(ht|f)tp://[^\"} ]+" ); httpRegExp.setMinimal( false ); int pos = 0; while ( pos >= 0 ) @@ -637,14 +637,14 @@ namespace BibTeX if ( pos >= 0 ) { ++pos; - QString url = httpRegExp.cap( 0 ); + TQString url = httpRegExp.cap( 0 ); urls << url; } } /** split text into math and non-math regions */ - QStringList intermediate = QStringList::split( '$', result, true ); - QStringList::Iterator it = intermediate.begin(); + TQStringList intermediate = TQStringList::split( '$', result, true ); + TQStringList::Iterator it = intermediate.begin(); while ( it != intermediate.end() ) { /** @@ -657,7 +657,7 @@ namespace BibTeX */ if (( *it ).endsWith( "\\" ) ) { - QStringList::Iterator cur = it; + TQStringList::Iterator cur = it; ++it; ( *cur ).append( '$' ).append( *it ); intermediate.remove( it ); @@ -667,10 +667,10 @@ namespace BibTeX ++it; } - qApp->processEvents(); + tqApp->processEvents(); result = ""; - for ( QStringList::Iterator it = intermediate.begin(); it != intermediate.end(); ++it ) + for ( TQStringList::Iterator it = intermediate.begin(); it != intermediate.end(); ++it ) { if ( !result.isEmpty() ) result.append( splitMarker ); result.append( *it ); @@ -680,22 +680,22 @@ namespace BibTeX break; if (( *it ).length() > 256 ) - qDebug( "Very long math equation using $ found, maybe due to broken inline math: %s", ( *it ).left( 48 ).latin1() ); + tqDebug( "Very long math equation using $ found, maybe due to broken inline math: %s", ( *it ).left( 48 ).latin1() ); } - qApp->processEvents(); + tqApp->processEvents(); - for ( QValueList::ConstIterator cmit = m_charMapping.begin(); cmit != m_charMapping.end(); ++cmit ) + for ( TQValueList::ConstIterator cmit = m_charMapping.begin(); cmit != m_charMapping.end(); ++cmit ) result.replace(( *cmit ).unicode, ( *cmit ).latex ); - qApp->processEvents(); + tqApp->processEvents(); - QStringList transformed = QStringList::split( splitMarker, result, true ); + TQStringList transformed = TQStringList::split( splitMarker, result, true ); - qApp->processEvents(); + tqApp->processEvents(); result = ""; - for ( QStringList::Iterator itt = transformed.begin(), iti = intermediate.begin(); itt != transformed.end() && iti != intermediate.end(); ++itt, ++iti ) + for ( TQStringList::Iterator itt = transformed.begin(), iti = intermediate.begin(); itt != transformed.end() && iti != intermediate.end(); ++itt, ++iti ) { result.append( *itt ); @@ -706,12 +706,12 @@ namespace BibTeX result.append( "$" ).append( *iti ).append( "$" ); } - qApp->processEvents(); + tqApp->processEvents(); /** \url accepts unquotet & and _ May introduce new problem tough */ if ( result.contains( "\\url{" ) ) - result.replace( "\\&", "&" ).replace( "\\_", "_" ).replace( QChar( 0x2013 ), "--" ).replace( "\\#", "#" ); + result.replace( "\\&", "&" ).replace( "\\_", "_" ).replace( TQChar( 0x2013 ), "--" ).replace( "\\#", "#" ); decomposedUTF8toLaTeX( result ); @@ -732,27 +732,27 @@ namespace BibTeX return result.replace( startStopMarker,"" ); } - QString EncoderLaTeX::encode( const QString &text, const QChar &replace ) + TQString EncoderLaTeX::encode( const TQString &text, const TQChar &replace ) { - QString result = text; - for ( QValueList::ConstIterator it = m_charMapping.begin(); it != m_charMapping.end(); ++it ) + TQString result = text; + for ( TQValueList::ConstIterator it = m_charMapping.begin(); it != m_charMapping.end(); ++it ) if (( *it ).unicode == replace ) result.replace(( *it ).unicode, ( *it ).latex ); return result; } - QString EncoderLaTeX::encodeSpecialized( const QString & text, const EntryField::FieldType fieldType ) + TQString EncoderLaTeX::encodeSpecialized( const TQString & text, const EntryField::FieldType fieldType ) { - QString result = encode( text ); + TQString result = encode( text ); switch ( fieldType ) { case EntryField::ftPages: - result.replace( QChar( 0x2013 ), "--" ); + result.replace( TQChar( 0x2013 ), "--" ); break; case EntryField::ftURL: - result.replace( "\\&", "&" ).replace( "\\_", "_" ).replace( QChar( 0x2013 ), "--" ).replace( "\\#", "#" ); + result.replace( "\\&", "&" ).replace( "\\_", "_" ).replace( TQChar( 0x2013 ), "--" ).replace( "\\#", "#" ); break; default: @@ -762,14 +762,14 @@ namespace BibTeX return result; } - QString& EncoderLaTeX::decomposedUTF8toLaTeX( QString &text ) + TQString& EncoderLaTeX::decomposedUTF8toLaTeX( TQString &text ) { - for ( QValueList::Iterator it = m_combinedMapping.begin(); it != m_combinedMapping.end(); ++it ) + for ( TQValueList::Iterator it = m_combinedMapping.begin(); it != m_combinedMapping.end(); ++it ) { int i = ( *it ).regExp.search( text ); while ( i >= 0 ) { - QString a = ( *it ).regExp.cap( 1 ); + TQString a = ( *it ).regExp.cap( 1 ); text = text.left( i ) + "\\" + ( *it ).latex + "{" + a + "}" + text.mid( i + 2 ); i = ( *it ).regExp.search( text, i + 1 ); } @@ -783,7 +783,7 @@ namespace BibTeX for ( int i = 0; i < decompositionscount; i++ ) { CombinedMappingItem item; - item.regExp = QRegExp( "(.)" + QString( QChar( decompositions[i].unicode ) ) ); + item.regExp = TQRegExp( "(.)" + TQString( TQChar( decompositions[i].unicode ) ) ); item.latex = decompositions[i].latexCommand; m_combinedMapping.append( item ); } @@ -795,9 +795,9 @@ namespace BibTeX for ( int i = 0; i < charmappingdatalatexcount; i++ ) { CharMappingItem charMappingItem; - charMappingItem.regExp = QRegExp( charmappingdatalatex[ i ].regexp ); - charMappingItem.unicode = QChar( charmappingdatalatex[ i ].unicode ); - charMappingItem.latex = QString( charmappingdatalatex[ i ].latex ); + charMappingItem.regExp = TQRegExp( charmappingdatalatex[ i ].regexp ); + charMappingItem.unicode = TQChar( charmappingdatalatex[ i ].unicode ); + charMappingItem.latex = TQString( charmappingdatalatex[ i ].latex ); m_charMapping.append( charMappingItem ); } @@ -808,11 +808,11 @@ namespace BibTeX for ( int j = 0; j < expansionscmdcount; ++j ) { CharMappingItem charMappingItem; - charMappingItem.regExp = QRegExp( QString( expansionsCmd[j] ).arg( commandmappingdatalatex[i].letters ) ); - charMappingItem.unicode = QChar( commandmappingdatalatex[i].unicode ); + charMappingItem.regExp = TQRegExp( TQString( expansionsCmd[j] ).arg( commandmappingdatalatex[i].letters ) ); + charMappingItem.unicode = TQChar( commandmappingdatalatex[i].unicode ); if ( charMappingItem.regExp.numCaptures() > 0 ) - charMappingItem.unicode += QString( "\\1" ); - charMappingItem.latex = QString( "{\\%1}" ).arg( commandmappingdatalatex[i].letters ); + charMappingItem.unicode += TQString( "\\1" ); + charMappingItem.latex = TQString( "{\\%1}" ).arg( commandmappingdatalatex[i].letters ); m_charMapping.append( charMappingItem ); } } @@ -820,8 +820,8 @@ namespace BibTeX /** encoding and decoding for letters such as \"a */ for ( int i = 0; i < modcharmappingdatalatexcount; ++i ) { - QString modifierRegExp = QString( modcharmappingdatalatex[i].modifier ); - QString modifier = modifierRegExp; + TQString modifierRegExp = TQString( modcharmappingdatalatex[i].modifier ); + TQString modifier = modifierRegExp; modifier.replace( "\\^", "^" ).replace( "\\\\", "\\" ); /** first batch of replacement rules, where no separator is required between modifier and character (e.g. \"a) */ @@ -829,9 +829,9 @@ namespace BibTeX for ( int j = 0; j < expansionsmod2count; ++j ) { CharMappingItem charMappingItem; - charMappingItem.regExp = QRegExp( QString( expansionsMod2[j] ).arg( modifierRegExp ).arg( modcharmappingdatalatex[i].letter ) ); - charMappingItem.unicode = QChar( modcharmappingdatalatex[i].unicode ); - charMappingItem.latex = QString( "{%1%2}" ).arg( modifier ).arg( modcharmappingdatalatex[i].letter ); + charMappingItem.regExp = TQRegExp( TQString( expansionsMod2[j] ).arg( modifierRegExp ).arg( modcharmappingdatalatex[i].letter ) ); + charMappingItem.unicode = TQChar( modcharmappingdatalatex[i].unicode ); + charMappingItem.latex = TQString( "{%1%2}" ).arg( modifier ).arg( modcharmappingdatalatex[i].letter ); m_charMapping.append( charMappingItem ); } @@ -839,9 +839,9 @@ namespace BibTeX for ( int j = 0; j < expansionsmod1count; ++j ) { CharMappingItem charMappingItem; - charMappingItem.regExp = QRegExp( QString( expansionsMod1[j] ).arg( modifierRegExp ).arg( modcharmappingdatalatex[i].letter ) ); - charMappingItem.unicode = QChar( modcharmappingdatalatex[i].unicode ); - charMappingItem.latex = QString( "%1{%2}" ).arg( modifier ).arg( modcharmappingdatalatex[i].letter ); + charMappingItem.regExp = TQRegExp( TQString( expansionsMod1[j] ).arg( modifierRegExp ).arg( modcharmappingdatalatex[i].letter ) ); + charMappingItem.unicode = TQChar( modcharmappingdatalatex[i].unicode ); + charMappingItem.latex = TQString( "%1{%2}" ).arg( modifier ).arg( modcharmappingdatalatex[i].letter ); m_charMapping.append( charMappingItem ); } } diff --git a/src/encoderlatex.h b/src/encoderlatex.h index d301652..a9e4b12 100644 --- a/src/encoderlatex.h +++ b/src/encoderlatex.h @@ -20,13 +20,13 @@ #ifndef ENCODERLATEX_H #define ENCODERLATEX_H -#include -#include +#include +#include #include #include -class QString; +class TQString; namespace BibTeX { @@ -37,11 +37,11 @@ namespace BibTeX EncoderLaTeX(); ~EncoderLaTeX(); - QString decode( const QString &text ); - QString encode( const QString &text ); - QString encode( const QString &text, const QChar &replace ); - QString encodeSpecialized( const QString &text, const EntryField::FieldType fieldType = EntryField::ftUnknown ); - QString& decomposedUTF8toLaTeX( QString &text ); + TQString decode( const TQString &text ); + TQString encode( const TQString &text ); + TQString encode( const TQString &text, const TQChar &replace ); + TQString encodeSpecialized( const TQString &text, const EntryField::FieldType fieldType = EntryField::ftUnknown ); + TQString& decomposedUTF8toLaTeX( TQString &text ); static EncoderLaTeX *currentEncoderLaTeX(); static void deleteCurrentEncoderLaTeX(); @@ -53,22 +53,22 @@ namespace BibTeX struct CombinedMappingItem { - QRegExp regExp; - QString latex; + TQRegExp regExp; + TQString latex; }; - QValueList m_combinedMapping; + TQValueList m_combinedMapping; void buildCombinedMapping(); struct CharMappingItem { - QRegExp regExp; - QString unicode; - QString latex; + TQRegExp regExp; + TQString unicode; + TQString latex; }; - QValueList m_charMapping; + TQValueList m_charMapping; void buildCharMapping(); }; diff --git a/src/encoderxml.cpp b/src/encoderxml.cpp index bbb76dd..5c8d1ea 100644 --- a/src/encoderxml.cpp +++ b/src/encoderxml.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include "encoderxml.h" @@ -51,11 +51,11 @@ namespace BibTeX // nothing } - QString EncoderXML::decode( const QString &text ) + TQString EncoderXML::decode( const TQString &text ) { - QString result = text; + TQString result = text; - for ( QValueList::ConstIterator it = m_charMapping.begin(); it != m_charMapping.end(); ++it ) + for ( TQValueList::ConstIterator it = m_charMapping.begin(); it != m_charMapping.end(); ++it ) result.replace(( *it ).regExp, ( *it ).unicode ); /** @@ -69,7 +69,7 @@ namespace BibTeX bool ok = FALSE; int hex = result.mid( p + 3, p2 - p - 3 ).toInt( &ok, 16 ); if ( ok && hex > 0 ) - result.replace( result.mid( p, p2 - p + 1 ), QChar( hex ) ); + result.replace( result.mid( p, p2 - p + 1 ), TQChar( hex ) ); } /** @@ -83,23 +83,23 @@ namespace BibTeX bool ok = FALSE; int dec = result.mid( p + 2, p2 - p - 2 ).toInt( &ok, 10 ); if ( ok && dec > 0 ) - result.replace( result.mid( p, p2 - p + 1 ), QChar( dec ) ); + result.replace( result.mid( p, p2 - p + 1 ), TQChar( dec ) ); } return result; } - QString EncoderXML::encode( const QString &text ) + TQString EncoderXML::encode( const TQString &text ) { - QString result = text; + TQString result = text; - for ( QValueList::ConstIterator it = m_charMapping.begin(); it != m_charMapping.end(); ++it ) + for ( TQValueList::ConstIterator it = m_charMapping.begin(); it != m_charMapping.end(); ++it ) result.replace(( *it ).unicode, ( *it ).latex ); return result; } - QString EncoderXML::encodeSpecialized( const QString &text, const EntryField::FieldType /* fieldType */ ) + TQString EncoderXML::encodeSpecialized( const TQString &text, const EntryField::FieldType /* fieldType */ ) { return encode( text ); } @@ -109,9 +109,9 @@ namespace BibTeX for ( int i = 0; i < charmappingdataxmlcount; i++ ) { CharMappingItem charMappingItem; - charMappingItem.regExp = QRegExp( charmappingdataxml[ i ].regexp ); - charMappingItem.unicode = QChar( charmappingdataxml[ i ].unicode ); - charMappingItem.latex = QString( charmappingdataxml[ i ].latex ); + charMappingItem.regExp = TQRegExp( charmappingdataxml[ i ].regexp ); + charMappingItem.unicode = TQChar( charmappingdataxml[ i ].unicode ); + charMappingItem.latex = TQString( charmappingdataxml[ i ].latex ); m_charMapping.append( charMappingItem ); } } diff --git a/src/encoderxml.h b/src/encoderxml.h index 89e1be1..142c6f0 100644 --- a/src/encoderxml.h +++ b/src/encoderxml.h @@ -20,13 +20,13 @@ #ifndef BIBTEXENCODERXML_H #define BIBTEXENCODERXML_H -#include -#include +#include +#include #include -class QString; -class QRegExp; +class TQString; +class TQRegExp; namespace BibTeX { @@ -40,21 +40,21 @@ namespace BibTeX EncoderXML(); ~EncoderXML(); - QString decode( const QString &text ); - QString encode( const QString &text ); - QString encodeSpecialized( const QString &text, const EntryField::FieldType fieldType = EntryField::ftUnknown ); + TQString decode( const TQString &text ); + TQString encode( const TQString &text ); + TQString encodeSpecialized( const TQString &text, const EntryField::FieldType fieldType = EntryField::ftUnknown ); static EncoderXML *currentEncoderXML(); private: struct CharMappingItem { - QRegExp regExp; - QChar unicode; - QString latex; + TQRegExp regExp; + TQChar unicode; + TQString latex; }; - QValueList m_charMapping; + TQValueList m_charMapping; void buildCharMapping(); }; 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 -#include -#include +#include +#include +#include #include #include @@ -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( 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" ) diff --git a/src/entry.h b/src/entry.h index 6a8633c..4a6d970 100644 --- a/src/entry.h +++ b/src/entry.h @@ -20,14 +20,14 @@ #ifndef BIBTEXBIBTEXENTRY_H #define BIBTEXBIBTEXENTRY_H -#include -#include +#include +#include #include #include -class QString; -class QStringList; +class TQString; +class TQStringList; namespace BibTeX { @@ -35,7 +35,7 @@ namespace BibTeX class Entry : public Element { public: - typedef QValueList EntryFields; + typedef TQValueList EntryFields; enum EntryType {etArticle, etBook, etBooklet, etCollection, etElectronic, etInBook, etInCollection, etInProceedings, etManual, etMastersThesis, etMisc, etPhDThesis, etProceedings, etTechReport, etUnpublished, etUnknown}; @@ -44,29 +44,29 @@ namespace BibTeX enum MergeSemantics {msAddNew, msForceAdding}; Entry( ); - Entry( const EntryType entryType, const QString &id ); - Entry( const QString& entryTypeString, const QString& id ); + Entry( const EntryType entryType, const TQString &id ); + Entry( const TQString& entryTypeString, const TQString& id ); Entry( const Entry *other ); virtual ~Entry(); Element* clone(); bool equals( const Entry &other ); - QString text() const; + TQString text() const; void setEntryType( const EntryType elementType ); - void setEntryTypeString( const QString& elementTypeString ); + void setEntryTypeString( const TQString& elementTypeString ); EntryType entryType() const; - QString entryTypeString() const; - void setId( const QString& id ); - QString id() const; + TQString entryTypeString() const; + void setId( const TQString& id ); + TQString id() const; - bool containsPattern( const QString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, BibTeX::Element::FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; - QStringList urls() const; + bool containsPattern( const TQString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, BibTeX::Element::FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; + TQStringList urls() const; bool addField( EntryField *field ); BibTeX::EntryField* getField( const EntryField::FieldType fieldType ) const; - BibTeX::EntryField* getField( const QString& fieldName ) const; + BibTeX::EntryField* getField( const TQString& fieldName ) const; bool deleteField( const BibTeX::EntryField::FieldType fieldType ); - bool deleteField( const QString &fieldName ); + bool deleteField( const TQString &fieldName ); EntryFields::const_iterator begin() const; EntryFields::const_iterator end() const; @@ -76,14 +76,14 @@ namespace BibTeX void copyFrom( const BibTeX::Entry *other ); void merge( BibTeX::Entry *other, MergeSemantics mergeSemantics ); - static QString entryTypeToString( const EntryType entryType ); - static EntryType entryTypeFromString( const QString &entryTypeString ); + static TQString entryTypeToString( const EntryType entryType ); + static EntryType entryTypeFromString( const TQString &entryTypeString ); static Entry::FieldRequireStatus getRequireStatus( Entry::EntryType entryType, EntryField::FieldType fieldType ); private: EntryType m_entryType; - QString m_entryTypeString; - QString m_id; + TQString m_entryTypeString; + TQString m_id; EntryFields m_fields; }; diff --git a/src/entryfield.cpp b/src/entryfield.cpp index bb7cb9d..78c7a4a 100644 --- a/src/entryfield.cpp +++ b/src/entryfield.cpp @@ -28,7 +28,7 @@ namespace BibTeX m_value = new Value(); } - EntryField::EntryField( const QString &fieldTypeName ) : m_fieldTypeName( fieldTypeName ) + EntryField::EntryField( const TQString &fieldTypeName ) : m_fieldTypeName( fieldTypeName ) { m_fieldType = fieldTypeFromString( m_fieldTypeName ); m_value = new Value(); @@ -44,12 +44,12 @@ namespace BibTeX delete m_value; } - QString EntryField::fieldTypeName() const + TQString EntryField::fieldTypeName() const { return m_fieldTypeName; } - void EntryField::setFieldType( FieldType fieldType, const QString& fieldTypeName ) + void EntryField::setFieldType( FieldType fieldType, const TQString& fieldTypeName ) { m_fieldType = fieldType; m_fieldTypeName = fieldTypeName; @@ -60,82 +60,82 @@ namespace BibTeX return m_fieldType; } - QString EntryField::fieldTypeToString( const FieldType fieldType ) + TQString EntryField::fieldTypeToString( const FieldType fieldType ) { switch ( fieldType ) { case ftAbstract: - return QString( "abstract" ); + return TQString( "abstract" ); case ftAddress: - return QString( "address" ); + return TQString( "address" ); case ftAnnote: - return QString( "annote" ); + return TQString( "annote" ); case ftAuthor: - return QString( "author" ); + return TQString( "author" ); case ftBookTitle: - return QString( "booktitle" ); + return TQString( "booktitle" ); case ftChapter: - return QString( "chapter" ); + return TQString( "chapter" ); case ftCrossRef: - return QString( "crossref" ); + return TQString( "crossref" ); case ftDoi: - return QString( "doi" ); + return TQString( "doi" ); case ftEdition: - return QString( "edition" ); + return TQString( "edition" ); case ftEditor: - return QString( "editor" ); + return TQString( "editor" ); case ftHowPublished: - return QString( "howpublished" ); + return TQString( "howpublished" ); case ftInstitution: - return QString( "institution" ); + return TQString( "institution" ); case ftISBN: - return QString( "isbn" ); + return TQString( "isbn" ); case ftISSN: - return QString( "issn" ); + return TQString( "issn" ); case ftJournal: - return QString( "journal" ); + return TQString( "journal" ); case ftKey: - return QString( "key" ); + return TQString( "key" ); case ftKeywords: - return QString( "keywords" ); + return TQString( "keywords" ); case ftLocalFile: - return QString( "localfile" ); + return TQString( "localfile" ); case ftLocation: - return QString( "location" ); + return TQString( "location" ); case ftMonth: - return QString( "month" ); + return TQString( "month" ); case ftNote: - return QString( "note" ); + return TQString( "note" ); case ftNumber: - return QString( "number" ); + return TQString( "number" ); case ftOrganization: - return QString( "organization" ); + return TQString( "organization" ); case ftPages: - return QString( "pages" ); + return TQString( "pages" ); case ftPublisher: - return QString( "publisher" ); + return TQString( "publisher" ); case ftSeries: - return QString( "series" ); + return TQString( "series" ); case ftSchool: - return QString( "school" ); + return TQString( "school" ); case ftTitle: - return QString( "title" ); + return TQString( "title" ); case ftType: - return QString( "type" ); + return TQString( "type" ); case ftURL: - return QString( "url" ); + return TQString( "url" ); case ftVolume: - return QString( "volume" ); + return TQString( "volume" ); case ftYear: - return QString( "year" ); + return TQString( "year" ); default: - return QString( "unknown" ); + return TQString( "unknown" ); } } - EntryField::FieldType EntryField::fieldTypeFromString( const QString & fieldTypeString ) + EntryField::FieldType EntryField::fieldTypeFromString( const TQString & fieldTypeString ) { - QString fieldTypeStringLower = fieldTypeString.lower(); + TQString fieldTypeStringLower = fieldTypeString.lower(); if ( fieldTypeStringLower == "abstract" ) return ftAbstract; diff --git a/src/entryfield.h b/src/entryfield.h index 6b3af30..684045e 100644 --- a/src/entryfield.h +++ b/src/entryfield.h @@ -20,7 +20,7 @@ #ifndef BIBTEXBIBTEXENTRYFIELD_H #define BIBTEXBIBTEXENTRYFIELD_H -#include +#include #include @@ -32,23 +32,23 @@ namespace BibTeX enum FieldType {ftAbstract, ftAddress, ftAnnote, ftAuthor, ftBookTitle, ftChapter, ftCrossRef, ftDoi, ftEdition, ftEditor, ftHowPublished, ftInstitution, ftISBN, ftISSN, ftJournal, ftKey, ftKeywords, ftLocalFile, ftLocation, ftMonth, ftNote, ftNumber, ftOrganization, ftPages, ftPublisher, ftSchool, ftSeries, ftTitle, ftType, ftURL, ftVolume, ftYear, ftUnknown = -1}; EntryField( FieldType fieldType ); - EntryField( const QString &fieldTypeName ); + EntryField( const TQString &fieldTypeName ); EntryField( BibTeX::EntryField *other ); ~EntryField(); - QString fieldTypeName() const; + TQString fieldTypeName() const; FieldType fieldType() const; - void setFieldType( FieldType fieldType, const QString& fieldTypeName ); + void setFieldType( FieldType fieldType, const TQString& fieldTypeName ); - static QString fieldTypeToString( const FieldType fieldType ); - static FieldType fieldTypeFromString( const QString &fieldTypeString ); + static TQString fieldTypeToString( const FieldType fieldType ); + static FieldType fieldTypeFromString( const TQString &fieldTypeString ); BibTeX::Value *value(); void setValue( const BibTeX::Value *value ); private: FieldType m_fieldType; - QString m_fieldTypeName; + TQString m_fieldTypeName; Value *m_value; }; diff --git a/src/entrywidget.cpp b/src/entrywidget.cpp index cb4c7ff..377ae7c 100644 --- a/src/entrywidget.cpp +++ b/src/entrywidget.cpp @@ -17,19 +17,19 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -60,13 +60,13 @@ namespace KBibTeX { - QDialog::DialogCode EntryWidget::execute( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, QWidget *parent, const char *name ) + TQDialog::DialogCode EntryWidget::execute( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, TQWidget *parent, const char *name ) { EntryWidgetDialog *dlg = new EntryWidgetDialog( parent, name, TRUE, i18n( "Edit BibTeX Entry" ), KDialogBase::Ok | KDialogBase::Cancel ); EntryWidget *entryWidget = new EntryWidget( entry, bibtexfile, isReadOnly, isNew, dlg, "entryWidget" ); dlg->setMainWidget( entryWidget ); - QDialog::DialogCode result = ( QDialog::DialogCode ) dlg->exec(); + TQDialog::DialogCode result = ( TQDialog::DialogCode ) dlg->exec(); delete entryWidget; delete dlg; @@ -74,8 +74,8 @@ namespace KBibTeX return result; } - EntryWidget::EntryWidget( BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, QDialog *parent, const char *name ) - : QWidget( parent, name ), m_originalEntry( NULL ), m_bibtexfile( bibtexfile ), m_isReadOnly( isReadOnly ), m_isNew( isNew ), m_lastPage( NULL ), m_dlgParent( parent ), m_wqa( new WebQueryArXiv( NULL ) ) + EntryWidget::EntryWidget( BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, TQDialog *parent, const char *name ) + : TQWidget( parent, name ), m_originalEntry( NULL ), m_bibtexfile( bibtexfile ), m_isReadOnly( isReadOnly ), m_isNew( isNew ), m_lastPage( NULL ), m_dlgParent( parent ), m_wqa( new WebQueryArXiv( NULL ) ) { setupGUI( parent, FALSE ); @@ -89,8 +89,8 @@ namespace KBibTeX connect( m_wqa, SIGNAL( endSearch( WebQuery::Status ) ), this, SLOT( endExternalSearch( WebQuery::Status ) ) ); } - EntryWidget::EntryWidget( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, QDialog *parent, const char *name ) - : QWidget( parent, name ), m_originalEntry( entry ), m_bibtexfile( bibtexfile ), m_isReadOnly( isReadOnly ), m_isNew( isNew ), m_lastPage( NULL ), m_dlgParent( parent ), m_wqa( new WebQueryArXiv( NULL ) ) + EntryWidget::EntryWidget( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, TQDialog *parent, const char *name ) + : TQWidget( parent, name ), m_originalEntry( entry ), m_bibtexfile( bibtexfile ), m_isReadOnly( isReadOnly ), m_isNew( isNew ), m_lastPage( NULL ), m_dlgParent( parent ), m_wqa( new WebQueryArXiv( NULL ) ) { setupGUI( parent ); @@ -118,9 +118,9 @@ namespace KBibTeX saveWindowSize( config ); } - void EntryWidget::showEvent( QShowEvent *showev ) + void EntryWidget::showEvent( TQShowEvent *showev ) { - QWidget::showEvent( showev ); + TQWidget::showEvent( showev ); EntryWidgetTitle *ewt = dynamic_cast( m_tabWidget->page( 0 ) ); if ( ewt != NULL ) ewt->m_fieldLineEditTitle->setFocus(); @@ -134,7 +134,7 @@ namespace KBibTeX { bool isModified = m_lineEditID->isModified(); - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); !isModified && it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); !isModified && it != m_internalEntryWidgets.end(); ++it ) isModified = ( *it ) ->isModified(); isModified |= m_sourcePage->isModified(); @@ -161,7 +161,7 @@ namespace KBibTeX m_sourcePage->apply( entry ); else { - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->apply( entry ); } } @@ -186,7 +186,7 @@ namespace KBibTeX { internalReset( entry ); m_sourcePage->reset( entry ); - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->reset( entry ); updateGUI(); @@ -228,7 +228,7 @@ namespace KBibTeX updateGUI(); } - void EntryWidget::slotCurrentPageChanged( QWidget* newPage ) + void EntryWidget::slotCurrentPageChanged( TQWidget* newPage ) { BibTeX::Entry temporaryEntry; @@ -237,7 +237,7 @@ namespace KBibTeX // switching to source tab m_updateWarningsTimer->stop(); internalApply( &temporaryEntry ); - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->apply( &temporaryEntry ); m_sourcePage->reset( &temporaryEntry ); @@ -255,7 +255,7 @@ namespace KBibTeX { if ( KMessageBox::warningYesNo( this, i18n( "The source code does not contain valid BibTeX code.\n\nRestore previous version or continue editing?" ), i18n( "Invalid BibTeX code" ), KGuiItem( i18n( "Restore" ) ), KGuiItem( i18n( "Edit" ) ) ) == KMessageBox::No ) { - QString text = m_sourcePage->text(); + TQString text = m_sourcePage->text(); m_tabWidget->showPage( m_sourcePage ); m_sourcePage->setText( text ); doChange = false; @@ -271,7 +271,7 @@ namespace KBibTeX { m_sourcePage->apply( &temporaryEntry ); internalReset( &temporaryEntry ); - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->reset( &temporaryEntry ); updateWarnings(); } @@ -288,14 +288,14 @@ namespace KBibTeX m_lastPage = newPage; } - void EntryWidget::warningsExecute( QListViewItem* item ) + void EntryWidget::warningsExecute( TQListViewItem* item ) { EntryWidgetWarningsItem * ewwi = dynamic_cast( item ); if ( ewwi != NULL && ewwi->widget() != NULL ) { ewwi->widget() ->setFocus(); // find and activate corresponding tab page - QObject *parent = ewwi->widget(); + TQObject *parent = ewwi->widget(); KBibTeX::EntryWidgetTab *ewt = dynamic_cast( parent ); while ( ewt == NULL && parent != NULL ) { @@ -306,62 +306,62 @@ namespace KBibTeX } } - void EntryWidget::setupGUI( QWidget *parent, bool showWarnings ) + void EntryWidget::setupGUI( TQWidget *parent, bool showWarnings ) { - QGridLayout * layout = new QGridLayout( this, 4, 6, 0, KDialog::spacingHint() ); + TQGridLayout * layout = new TQGridLayout( this, 4, 6, 0, KDialog::spacingHint() ); // in the top row on the left, put an entry type label and combobox - QLabel *label = new QLabel( i18n( "E&ntry Type:" ), this ); + TQLabel *label = new TQLabel( i18n( "E&ntry Type:" ), this ); layout->addWidget( label, 0, 0 ); - m_comboBoxEntryType = new QComboBox( TRUE, this, "m_comboBoxEntryType" ); + m_comboBoxEntryType = new TQComboBox( TRUE, this, "m_comboBoxEntryType" ); label->setBuddy( m_comboBoxEntryType ); - m_comboBoxEntryType->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); + m_comboBoxEntryType->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed ); m_comboBoxEntryType->setEnabled( !m_isReadOnly ); layout->addWidget( m_comboBoxEntryType, 0, 1 ); setupEntryTypes(); // in the top row on the left, put an identifier label and combobox - label = new QLabel( i18n( "&Identifier" ), this ); + label = new TQLabel( i18n( "&Identifier" ), this ); layout->addWidget( label, 0, 2 ); - m_lineEditID = new QLineEdit( this, "m_lineEditID" ); + m_lineEditID = new TQLineEdit( this, "m_lineEditID" ); label->setBuddy( m_lineEditID ); m_lineEditID->setReadOnly( m_isReadOnly ); - m_lineEditID->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); + m_lineEditID->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed ); layout->addWidget( m_lineEditID, 0, 3 ); - m_pushButtonIdSuggestions = new QPushButton( QIconSet( BarIcon( "wizard" ) ), "", this, "m_pushButtonIdSuggestions" ); - m_menuIdSuggestions = new QPopupMenu( m_pushButtonIdSuggestions ); + m_pushButtonIdSuggestions = new TQPushButton( TQIconSet( BarIcon( "wizard" ) ), "", this, "m_pushButtonIdSuggestions" ); + m_menuIdSuggestions = new TQPopupMenu( m_pushButtonIdSuggestions ); connect( m_menuIdSuggestions, SIGNAL( activated( int ) ), this, SLOT( insertIdSuggestion( int ) ) ); m_pushButtonIdSuggestions->setPopup( m_menuIdSuggestions ); layout->addWidget( m_pushButtonIdSuggestions, 0, 4 ); - m_pushButtonForceDefaultIdSuggestion = new QPushButton( QIconSet( BarIcon( "favorites" ) ), "", this, "m_pushButtonForceDefaultIdSuggestion" ); + m_pushButtonForceDefaultIdSuggestion = new TQPushButton( TQIconSet( BarIcon( "favorites" ) ), "", this, "m_pushButtonForceDefaultIdSuggestion" ); m_pushButtonForceDefaultIdSuggestion->setToggleButton( TRUE ); layout->addWidget( m_pushButtonForceDefaultIdSuggestion, 0, 5 ); - QToolTip::add( m_pushButtonForceDefaultIdSuggestion, i18n( "Use the default id suggestion to set the entry id" ) ); - QWhatsThis::add( m_pushButtonForceDefaultIdSuggestion, i18n( "Use the default id suggestion to set the entry id.\nYou can edit and select the default id suggestion in the configuration dialog." ) ); + TQToolTip::add( m_pushButtonForceDefaultIdSuggestion, i18n( "Use the default id suggestion to set the entry id" ) ); + TQWhatsThis::add( m_pushButtonForceDefaultIdSuggestion, i18n( "Use the default id suggestion to set the entry id.\nYou can edit and select the default id suggestion in the configuration dialog." ) ); // central tab widget for all the tabs - m_tabWidget = new QTabWidget( this ); + m_tabWidget = new TQTabWidget( this ); layout->addMultiCellWidget( m_tabWidget, 1, 1, 0, 5 ); addTabWidgets(); // a check box if the user want to edit all fields - m_checkBoxEnableAll = new QCheckBox( i18n( "Enable all &fields for editing" ), this ); + m_checkBoxEnableAll = new TQCheckBox( i18n( "Enable all &fields for editing" ), this ); layout->addMultiCellWidget( m_checkBoxEnableAll, 2, 2, 0, 4 ); - m_pushButtonRefetch = new QPushButton( KGlobal::iconLoader() ->loadIconSet( "reload", KIcon::Small ), i18n( "Refetch" ), this ); + m_pushButtonRefetch = new TQPushButton( KGlobal::iconLoader() ->loadIconSet( "reload", KIcon::Small ), i18n( "Refetch" ), this ); layout->addWidget( m_pushButtonRefetch, 2, 5 ); connect( m_pushButtonRefetch, SIGNAL( clicked() ), this, SLOT( refreshFromURL() ) ); if ( showWarnings ) { // list view for warnings, errors and suggestions - m_listViewWarnings = new QListView( this ); + m_listViewWarnings = new TQListView( this ); m_listViewWarnings->addColumn( i18n( "Message" ) ); m_listViewWarnings->setAllColumnsShowFocus( true ); layout->addMultiCellWidget( m_listViewWarnings, 3, 3, 0, 5 ); - connect( m_listViewWarnings, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ), this, SLOT( warningsExecute( QListViewItem* ) ) ); + connect( m_listViewWarnings, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ), this, SLOT( warningsExecute( TQListViewItem* ) ) ); } else m_listViewWarnings = NULL; @@ -369,12 +369,12 @@ namespace KBibTeX connect( m_checkBoxEnableAll, SIGNAL( toggled( bool ) ), this, SLOT( slotEnableAllFields( ) ) ); connect( m_comboBoxEntryType, SIGNAL( activated( int ) ), this, SLOT( slotEntryTypeChanged( ) ) ); connect( m_pushButtonForceDefaultIdSuggestion, SIGNAL( toggled( bool ) ), this, SLOT( slotForceDefaultIdSuggestion() ) ); - connect( m_comboBoxEntryType, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotEntryTypeChanged() ) ); - connect( m_tabWidget, SIGNAL( currentChanged( QWidget* ) ), this, SLOT( slotCurrentPageChanged( QWidget* ) ) ); + connect( m_comboBoxEntryType, SIGNAL( textChanged( const TQString & ) ), this, SLOT( slotEntryTypeChanged() ) ); + connect( m_tabWidget, SIGNAL( currentChanged( TQWidget* ) ), this, SLOT( slotCurrentPageChanged( TQWidget* ) ) ); connect( parent, SIGNAL( okClicked() ), this, SLOT( apply() ) ); connect( m_menuIdSuggestions, SIGNAL( aboutToShow() ), this, SLOT( updateIdSuggestionsMenu() ) ); - m_updateWarningsTimer = new QTimer( this ); + m_updateWarningsTimer = new TQTimer( this ); connect( m_updateWarningsTimer, SIGNAL( timeout() ), this, SLOT( updateWarnings() ) ); if ( !m_isReadOnly ) m_updateWarningsTimer->start( 500 ); @@ -395,7 +395,7 @@ namespace KBibTeX m_tabWidget->insertTab( m_sourcePage, i18n( "Source" ) ); } - void EntryWidget::addTabWidget( EntryWidgetTab *widget, const QString& title ) + void EntryWidget::addTabWidget( EntryWidgetTab *widget, const TQString& title ) { m_tabWidget->insertTab( widget, title ); m_internalEntryWidgets.append( widget ); @@ -407,7 +407,7 @@ namespace KBibTeX BibTeX::Entry::EntryType entryType = ( BibTeX::Entry::EntryType ) i; while ( entryType != BibTeX::Entry::etUnknown ) { - QString currentString = BibTeX::Entry::entryTypeToString( entryType ); + TQString currentString = BibTeX::Entry::entryTypeToString( entryType ); m_comboBoxEntryType->insertItem( currentString ); entryType = ( BibTeX::Entry::EntryType ) ++i; } @@ -416,7 +416,7 @@ namespace KBibTeX void EntryWidget::updateGUI() { BibTeX::Entry::EntryType entryType = BibTeX::Entry::entryTypeFromString( m_comboBoxEntryType->currentText() ); - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->updateGUI( entryType, m_checkBoxEnableAll->isChecked() ); updateWarnings( ); } @@ -433,49 +433,49 @@ namespace KBibTeX { BibTeX::Entry temporaryEntry; apply( &temporaryEntry ); - QString id = IdSuggestions::createDefaultSuggestion( m_bibtexfile, &temporaryEntry ); + TQString id = IdSuggestions::createDefaultSuggestion( m_bibtexfile, &temporaryEntry ); if ( id.isNull() || id.isEmpty() ) new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, i18n( "Please supply more fields to use the default id" ), m_pushButtonForceDefaultIdSuggestion, m_listViewWarnings ); else { - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlInformation, QString( i18n( "Using '%1' as entry id" ) ).arg( id ), m_pushButtonForceDefaultIdSuggestion, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlInformation, TQString( i18n( "Using '%1' as entry id" ) ).arg( id ), m_pushButtonForceDefaultIdSuggestion, m_listViewWarnings ); m_lineEditID->setText( id ); } } else if ( m_lineEditID->text().isEmpty() ) new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlError, i18n( "An entry has to have an identifier" ), m_lineEditID, m_listViewWarnings ); else if (( p = m_lineEditID->text().find( Settings::noIdChars ) ) > 0 ) - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlError, QString( i18n( "The identifier contains invalid characters at position %1" ) ).arg( p + 1 ), m_lineEditID, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlError, TQString( i18n( "The identifier contains invalid characters at position %1" ) ).arg( p + 1 ), m_lineEditID, m_listViewWarnings ); BibTeX::Entry::EntryType entryType = BibTeX::Entry::entryTypeFromString( m_comboBoxEntryType->currentText() ); - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->updateWarnings( entryType, m_listViewWarnings ); - QString text = m_lineEditID->text(); + TQString text = m_lineEditID->text(); for ( unsigned int i = 0; i < text.length(); i++ ) if ( text.at( i ).unicode() > 127 ) { - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, QString( i18n( "The identifier contains non-ascii characters, first one is '%1'" ) ).arg( text.at( i ) ), m_lineEditID, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, TQString( i18n( "The identifier contains non-ascii characters, first one is '%1'" ) ).arg( text.at( i ) ), m_lineEditID, m_listViewWarnings ); break; } BibTeX::Entry temporaryEntry; /** fetch data from GUI elements */ - for ( QValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) + for ( TQValueList::iterator it( m_internalEntryWidgets.begin() ); it != m_internalEntryWidgets.end(); ++it ) ( *it ) ->apply( &temporaryEntry ); internalApply( &temporaryEntry ); /** check if entry with same id already exists */ - QString id = temporaryEntry.id(); + TQString id = temporaryEntry.id(); if ( m_bibtexfile != NULL && !id.isEmpty() ) { BibTeX::Entry *nameMatched = dynamic_cast( m_bibtexfile->containsKey( id ) ); if ( nameMatched != NULL && nameMatched != m_originalEntry ) - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlError, QString( i18n( "This BibTeX file already contains an entry with id '%1'." ) ).arg( id ), m_lineEditID, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlError, TQString( i18n( "This BibTeX file already contains an entry with id '%1'." ) ).arg( id ), m_lineEditID, m_listViewWarnings ); } BibTeX::Entry *crossRefEntry = NULL; - QString crossRefText = ""; + TQString crossRefText = ""; BibTeX::EntryField *crossRef = temporaryEntry.getField( BibTeX::EntryField::ftCrossRef ); if ( crossRef != NULL && m_bibtexfile != NULL ) { @@ -497,7 +497,7 @@ namespace KBibTeX { if ( crossRefEntry->getField( BibTeX::EntryField::ftEditor ) == NULL && crossRefEntry->getField( BibTeX::EntryField::ftKey ) == NULL && crossRefEntry->getField( BibTeX::EntryField::ftBookTitle ) == NULL ) { - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, QString( i18n( "Cross referenced entry '%1' must contain either 'Editor', 'Key', or 'Book Title'" ) ).arg( crossRefText ), NULL, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, TQString( i18n( "Cross referenced entry '%1' must contain either 'Editor', 'Key', or 'Book Title'" ) ).arg( crossRefText ), NULL, m_listViewWarnings ); } } } @@ -507,10 +507,10 @@ namespace KBibTeX if ( crossRefEntry != NULL ) { if ( crossRefEntry->getField( BibTeX::EntryField::ftVolume ) == NULL ) - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, QString( i18n( "Cross referenced entry '%1' must contain 'Volume'" ) ).arg( crossRefText ), NULL, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, TQString( i18n( "Cross referenced entry '%1' must contain 'Volume'" ) ).arg( crossRefText ), NULL, m_listViewWarnings ); if ( crossRefEntry->getField( BibTeX::EntryField::ftEditor ) == NULL && crossRefEntry->getField( BibTeX::EntryField::ftKey ) == NULL && crossRefEntry->getField( BibTeX::EntryField::ftSeries ) == NULL ) { - new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, QString( i18n( "Cross referenced entry '%1' must contain either 'Editor', 'Key', or 'Series'" ) ).arg( crossRefText ), NULL, m_listViewWarnings ); + new KBibTeX::EntryWidgetWarningsItem( KBibTeX::EntryWidgetWarningsItem::wlWarning, TQString( i18n( "Cross referenced entry '%1' must contain either 'Editor', 'Key', or 'Series'" ) ).arg( crossRefText ), NULL, m_listViewWarnings ); } } } @@ -529,8 +529,8 @@ namespace KBibTeX m_idToSuggestion.clear(); apply( &temporaryEntry ); - QStringList suggestions = IdSuggestions::createSuggestions( m_bibtexfile, &temporaryEntry ); - for ( QStringList::ConstIterator it = suggestions.begin(); it != suggestions.end(); ++it ) + TQStringList suggestions = IdSuggestions::createSuggestions( m_bibtexfile, &temporaryEntry ); + for ( TQStringList::ConstIterator it = suggestions.begin(); it != suggestions.end(); ++it ) m_idToSuggestion.insert( m_menuIdSuggestions->insertItem( *it ), *it ); if ( m_idToSuggestion.count() == 0 ) @@ -545,8 +545,8 @@ namespace KBibTeX /* This function was taken form KMainWindow of KDE 3.5 and modified to fit KBibTeX */ void EntryWidget::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 @@ -561,10 +561,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 @@ -580,22 +580,22 @@ namespace KBibTeX void EntryWidget::restoreWindowSize( KConfig *config ) { // restore the size - int scnum = QApplication::desktop()->screenNumber( parentWidget() ); - QRect desk = QApplication::desktop()->screenGeometry( scnum ); + int scnum = TQApplication::desktop()->screenNumber( parentWidget() ); + TQRect desk = TQApplication::desktop()->screenGeometry( scnum ); // if ( d->defaultWindowSize.isNull() ) // only once -// d->defaultWindowSize = QRect( desk.width(), width(), desk.height(), height() ); // store default values - QSize size( config->readNumEntry( QString::fromLatin1( "Width %1" ).arg( desk.width() ), 0 ), - config->readNumEntry( QString::fromLatin1( "Height %1" ).arg( desk.height() ), 0 ) ); +// d->defaultWindowSize = TQRect( desk.width(), width(), desk.height(), height() ); // store default values + 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() ) @@ -611,7 +611,7 @@ namespace KBibTeX m_dlgParent->resize( size.width(), height() ); else m_dlgParent->resize( size ); - // QWidget::showMaximized() is both insufficient and broken + // TQWidget::showMaximized() is both insufficient and broken KWin::setState( m_dlgParent->winId(), state ); #else if ( size.width() > desk.width() || size.height() > desk.height() ) @@ -633,7 +633,7 @@ namespace KBibTeX if ( url.isValid() && url.prettyURL().contains( "arxiv.org/abs/" ) ) { m_pushButtonRefetch->setEnabled( false ); - qDebug( "Refetching from url %s", url.prettyURL().latin1() ); + tqDebug( "Refetching from url %s", url.prettyURL().latin1() ); m_wqa->fetchFromAbstract( url ); } else diff --git a/src/entrywidget.h b/src/entrywidget.h index 10dfd13..3d9ad2f 100644 --- a/src/entrywidget.h +++ b/src/entrywidget.h @@ -20,10 +20,10 @@ #ifndef KBIBTEXENTRYWIDGET_H #define KBIBTEXENTRYWIDGET_H -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -31,13 +31,13 @@ #include #include -class QComboBox; -class QLineEdit; -class QCheckBox; -class QTabWidget; -class QString; -class QTimer; -class QListView; +class TQComboBox; +class TQLineEdit; +class TQCheckBox; +class TQTabWidget; +class TQString; +class TQTimer; +class TQListView; class KConfig; @@ -46,7 +46,7 @@ namespace KBibTeX class EntryWidgetTab; class WebQueryArXiv; - class EntryWidget : public QWidget + class EntryWidget : public TQWidget { Q_OBJECT @@ -55,11 +55,11 @@ namespace KBibTeX public: ~EntryWidget(); - static QDialog::DialogCode execute( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, QWidget *parent = 0, const char *name = 0 ); + static TQDialog::DialogCode execute( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, TQWidget *parent = 0, const char *name = 0 ); protected: - EntryWidget( BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, QDialog *parent, const char *name = 0 ); - void showEvent( QShowEvent * ); + EntryWidget( BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, TQDialog *parent, const char *name = 0 ); + void showEvent( TQShowEvent * ); bool queryClose(); private slots: @@ -70,8 +70,8 @@ namespace KBibTeX void slotEnableAllFields(); void slotForceDefaultIdSuggestion(); void slotEntryTypeChanged(); - void slotCurrentPageChanged( QWidget* newPage ); - void warningsExecute( QListViewItem* item ); + void slotCurrentPageChanged( TQWidget* newPage ); + void warningsExecute( TQListViewItem* item ); void updateWarnings(); void insertIdSuggestion( int id ); void updateIdSuggestionsMenu(); @@ -83,34 +83,34 @@ namespace KBibTeX void updateTabs( BibTeX::Entry::EntryType entryType, bool enableAll, bool isReadOnly ); private: - EntryWidget( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, QDialog *parent, const char *name = 0 ); + EntryWidget( BibTeX::Entry *entry, BibTeX::File *bibtexfile, bool isReadOnly, bool isNew, TQDialog *parent, const char *name = 0 ); BibTeX::Entry *m_originalEntry; BibTeX::File *m_bibtexfile; bool m_isReadOnly; bool m_isNew; bool m_defaultIdSuggestionAvailable; - QComboBox *m_comboBoxEntryType; - QLineEdit *m_lineEditID; - QPushButton *m_pushButtonForceDefaultIdSuggestion; - QPushButton *m_pushButtonIdSuggestions; - QPopupMenu *m_menuIdSuggestions; - QMap m_idToSuggestion; - QCheckBox *m_checkBoxEnableAll; - QPushButton *m_pushButtonRefetch; - QListView *m_listViewWarnings; - QTabWidget *m_tabWidget; + TQComboBox *m_comboBoxEntryType; + TQLineEdit *m_lineEditID; + TQPushButton *m_pushButtonForceDefaultIdSuggestion; + TQPushButton *m_pushButtonIdSuggestions; + TQPopupMenu *m_menuIdSuggestions; + TQMap m_idToSuggestion; + TQCheckBox *m_checkBoxEnableAll; + TQPushButton *m_pushButtonRefetch; + TQListView *m_listViewWarnings; + TQTabWidget *m_tabWidget; KBibTeX::EntryWidgetSource *m_sourcePage; - QValueList m_internalEntryWidgets; - QWidget *m_lastPage; - QTimer *m_updateWarningsTimer; - QDialog *m_dlgParent; + TQValueList m_internalEntryWidgets; + TQWidget *m_lastPage; + TQTimer *m_updateWarningsTimer; + TQDialog *m_dlgParent; WebQueryArXiv *m_wqa; - QString m_oldId; + TQString m_oldId; - void setupGUI( QWidget *parent, bool showWarnings = TRUE ); + void setupGUI( TQWidget *parent, bool showWarnings = TRUE ); void addTabWidgets(); - void addTabWidget( EntryWidgetTab *widget, const QString& title ); + void addTabWidget( EntryWidgetTab *widget, const TQString& title ); void setupEntryTypes(); void updateGUI(); void internalApply( BibTeX::Entry *entry ); @@ -123,7 +123,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetDialog( QWidget *parent = 0, const char *name = 0, bool modal = true, const QString &caption = QString::null, int buttonMask = Ok | Apply | Cancel ) : KDialogBase( parent, name, modal, caption, buttonMask ) {/* nothing */}; + EntryWidgetDialog( TQWidget *parent = 0, const char *name = 0, bool modal = true, const TQString &caption = TQString::null, int buttonMask = Ok | Apply | Cancel ) : KDialogBase( parent, name, modal, caption, buttonMask ) {/* nothing */}; ~EntryWidgetDialog() {/* nothing */}; void setMainWidget( EntryWidget *widget ) { @@ -132,7 +132,7 @@ namespace KBibTeX }; protected: - void closeEvent( QCloseEvent * e ) + void closeEvent( TQCloseEvent * e ) { if ( m_widget->queryClose() ) e->accept(); else e->ignore(); @@ -141,12 +141,12 @@ namespace KBibTeX protected slots: void slotCancel() { - if ( m_widget->queryClose() ) QDialog::done( Cancel ); + if ( m_widget->queryClose() ) TQDialog::done( Cancel ); } void slotClose() { - if ( m_widget->queryClose() ) QDialog::done( Cancel ); + if ( m_widget->queryClose() ) TQDialog::done( Cancel ); } private: diff --git a/src/entrywidgetauthor.cpp b/src/entrywidgetauthor.cpp index 32e2e18..578a9d8 100644 --- a/src/entrywidgetauthor.cpp +++ b/src/entrywidgetauthor.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ namespace KBibTeX { - EntryWidgetAuthor::EntryWidgetAuthor( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetAuthor::EntryWidgetAuthor( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) { setupGUI(); @@ -75,7 +75,7 @@ namespace KBibTeX m_fieldListViewEditor->setValue( field != NULL ? field->value() : NULL ); } - void EntryWidgetAuthor::updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ) + void EntryWidgetAuthor::updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ) { if ( entryType == BibTeX::Entry::etBook || entryType == BibTeX::Entry::etInBook ) { @@ -92,17 +92,17 @@ namespace KBibTeX void EntryWidgetAuthor::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 2, 3, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 2, 3, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setColSpacing( 1, KDialog::spacingHint() * 4 ); - QLabel *label = new QLabel( QString( "%1:" ).arg( i18n( "Author" ) ), this ); + TQLabel *label = new TQLabel( TQString( "%1:" ).arg( i18n( "Author" ) ), this ); gridLayout->addWidget( label, 0, 0 ); m_fieldListViewAuthor = new KBibTeX::FieldListView( i18n( "Author" ), i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewAuthor" ), m_isReadOnly, this ); m_fieldListViewAuthor->setFieldType( BibTeX::EntryField::ftAuthor ); gridLayout->addWidget( m_fieldListViewAuthor, 1, 0 ); label->setBuddy( m_fieldListViewAuthor ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Editor" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Editor" ) ), this ); gridLayout->addWidget( label, 0, 2 ); m_fieldListViewEditor = new KBibTeX::FieldListView( i18n( "Editor" ), i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewEditor" ), m_isReadOnly, this ); m_fieldListViewEditor->setFieldType( BibTeX::EntryField::ftEditor ); diff --git a/src/entrywidgetauthor.h b/src/entrywidgetauthor.h index 1986614..60f89f8 100644 --- a/src/entrywidgetauthor.h +++ b/src/entrywidgetauthor.h @@ -22,8 +22,8 @@ #include -class QWidget; -class QScrollView; +class TQWidget; +class TQScrollView; namespace KBibTeX { @@ -36,7 +36,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetAuthor( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetAuthor( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetAuthor(); bool isModified(); @@ -45,7 +45,7 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private: FieldListView *m_fieldListViewAuthor; diff --git a/src/entrywidgetexternal.cpp b/src/entrywidgetexternal.cpp index a672e25..f316c82 100644 --- a/src/entrywidgetexternal.cpp +++ b/src/entrywidgetexternal.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -39,9 +39,9 @@ namespace KBibTeX const int EntryWidgetExternal::m_menuIdCurrentDirectory = 8192; const int EntryWidgetExternal::m_menuIdPreviousDirectory = 8191; - QString EntryWidgetExternal::m_previousDirectory = QString::null; + TQString EntryWidgetExternal::m_previousDirectory = TQString::null; - EntryWidgetExternal::EntryWidgetExternal( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetExternal::EntryWidgetExternal( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) { setupGUI(); @@ -110,7 +110,7 @@ namespace KBibTeX connect( m_fieldLineEditLocalFile, SIGNAL( textChanged() ), this, SLOT( updateGUI() ) ); } - void EntryWidgetExternal::updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ) + void EntryWidgetExternal::updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ) { addMissingWarning( entryType, BibTeX::EntryField::ftURL, m_fieldLineEditURL->caption(), !m_fieldLineEditURL->isEmpty(), m_fieldLineEditURL, listViewWarnings ); @@ -135,7 +135,7 @@ namespace KBibTeX m_pushButtonOpenURL->setEnabled( FALSE ); } - void EntryWidgetExternal::openURL( const QString &url ) + void EntryWidgetExternal::openURL( const TQString &url ) { Settings::openUrl( KURL( url ), this ); } @@ -163,14 +163,14 @@ namespace KBibTeX void EntryWidgetExternal::browseLocalFile( int id ) { Settings * settings = Settings::self(); - QString startDir = QString::null; - if ( id == m_menuIdPreviousDirectory && m_previousDirectory != QString::null ) + TQString startDir = TQString::null; + if ( id == m_menuIdPreviousDirectory && m_previousDirectory != TQString::null ) startDir = m_previousDirectory; else if ( settings->editing_DocumentSearchPaths.size() > ( unsigned int )id ) startDir = *settings->editing_DocumentSearchPaths.at( id ); else - startDir = QDir::currentDirPath(); - QString filename = KFileDialog::getOpenFileName( startDir ); + startDir = TQDir::currentDirPath(); + TQString filename = KFileDialog::getOpenFileName( startDir ); if ( !filename.isEmpty() ) { @@ -191,12 +191,12 @@ namespace KBibTeX value->items.append( new BibTeX::PlainText( filename ) ); m_fieldLineEditLocalFile->setValue( value ); - if ( m_previousDirectory == QString::null ) + if ( m_previousDirectory == TQString::null ) { - QPopupMenu *menu = m_pushButtonBrowseLocalFile->popup(); - menu->insertItem( QIconSet( SmallIcon( "favorite" ) ), i18n( "Previously used directory" ), m_menuIdPreviousDirectory, 2 ); + TQPopupMenu *menu = m_pushButtonBrowseLocalFile->popup(); + menu->insertItem( TQIconSet( SmallIcon( "favorite" ) ), i18n( "Previously used directory" ), m_menuIdPreviousDirectory, 2 ); } - QFileInfo fileInfo( filename ); + TQFileInfo fileInfo( filename ); m_previousDirectory = fileInfo.dirPath( true ); } } @@ -217,10 +217,10 @@ namespace KBibTeX { Settings * settings = Settings::self(); - QGridLayout * gridLayout = new QGridLayout( this, 5, 3, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 5, 3, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 4, 10 ); - QLabel *label = new QLabel( QString( "%1:" ).arg( i18n( "URL" ) ), this ); + TQLabel *label = new TQLabel( TQString( "%1:" ).arg( i18n( "URL" ) ), this ); gridLayout->addWidget( label, 0, 0 ); m_fieldLineEditURL = new KBibTeX::FieldLineEdit( i18n( "URL" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditURL" ); m_fieldLineEditURL->setFieldType( BibTeX::EntryField::ftURL ); @@ -230,30 +230,30 @@ namespace KBibTeX m_pushButtonOpenURL = new KPushButton( this ); gridLayout->addWidget( m_pushButtonOpenURL, 0, 2 ); - m_pushButtonOpenURL->setIconSet( QIconSet( SmallIcon( "fileopen" ) ) ); - m_pushButtonOpenURL->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); - QToolTip::add( m_pushButtonOpenURL, QString( i18n( "Open %1" ) ).arg( i18n( "URL" ) ) ); + m_pushButtonOpenURL->setIconSet( TQIconSet( SmallIcon( "fileopen" ) ) ); + m_pushButtonOpenURL->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); + TQToolTip::add( m_pushButtonOpenURL, TQString( i18n( "Open %1" ) ).arg( i18n( "URL" ) ) ); connect( m_pushButtonOpenURL, SIGNAL( clicked() ), this, SLOT( openURL() ) ); - KURLLabel *urllabel = new KURLLabel( "http://www.doi.org/", QString( "%1:" ).arg( i18n( "DOI" ) ), this ); - QToolTip::add( urllabel, i18n( "Digital Object Identifier" ) ); - urllabel->setFocusPolicy( QWidget::NoFocus ); + KURLLabel *urllabel = new KURLLabel( "http://www.doi.org/", TQString( "%1:" ).arg( i18n( "DOI" ) ), this ); + TQToolTip::add( urllabel, i18n( "Digital Object Identifier" ) ); + urllabel->setFocusPolicy( TQWidget::NoFocus ); gridLayout->addWidget( urllabel, 1, 0 ); m_fieldLineEditDoi = new KBibTeX::FieldLineEdit( i18n( "DOI" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditDoi" ); m_fieldLineEditDoi->setFieldType( BibTeX::EntryField::ftDoi ); gridLayout->addWidget( m_fieldLineEditDoi, 1, 1 ); urllabel->setBuddy( m_fieldLineEditDoi ); connect( m_fieldLineEditDoi, SIGNAL( textChanged() ), this, SLOT( updateGUI() ) ); - connect( urllabel, SIGNAL( leftClickedURL( const QString& ) ), this, SLOT( openURL( const QString& ) ) ); + connect( urllabel, SIGNAL( leftClickedURL( const TQString& ) ), this, SLOT( openURL( const TQString& ) ) ); m_pushButtonOpenDoi = new KPushButton( this ); gridLayout->addWidget( m_pushButtonOpenDoi, 1, 2 ); - m_pushButtonOpenDoi->setIconSet( QIconSet( SmallIcon( "fileopen" ) ) ); - m_pushButtonOpenDoi->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); - QToolTip::add( m_pushButtonOpenDoi, i18n( "Open DOI" ) ); + m_pushButtonOpenDoi->setIconSet( TQIconSet( SmallIcon( "fileopen" ) ) ); + m_pushButtonOpenDoi->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); + TQToolTip::add( m_pushButtonOpenDoi, i18n( "Open DOI" ) ); connect( m_pushButtonOpenDoi, SIGNAL( clicked() ), this, SLOT( openDoi() ) ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Local File" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Local File" ) ), this ); gridLayout->addWidget( label, 2, 0 ); m_fieldLineEditLocalFile = new KBibTeX::FieldLineEdit( i18n( "Local File" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditLocalFile" ); m_fieldLineEditLocalFile->setFieldType( BibTeX::EntryField::ftLocalFile ); @@ -263,32 +263,32 @@ namespace KBibTeX m_pushButtonOpenLocalFile = new KPushButton( this ); gridLayout->addWidget( m_pushButtonOpenLocalFile, 2, 2 ); - m_pushButtonOpenLocalFile->setIconSet( QIconSet( SmallIcon( "fileopen" ) ) ); - m_pushButtonOpenLocalFile->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); - QToolTip::add( m_pushButtonOpenLocalFile, QString( i18n( "Open %1" ) ).arg( i18n( "Local File" ) ) ); + m_pushButtonOpenLocalFile->setIconSet( TQIconSet( SmallIcon( "fileopen" ) ) ); + m_pushButtonOpenLocalFile->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); + TQToolTip::add( m_pushButtonOpenLocalFile, TQString( i18n( "Open %1" ) ).arg( i18n( "Local File" ) ) ); connect( m_pushButtonOpenLocalFile, SIGNAL( clicked() ), this, SLOT( openLocalFile() ) ); - QWidget *container = new QWidget( this ); - QHBoxLayout *containerLayout = new QHBoxLayout( container ); + TQWidget *container = new TQWidget( this ); + TQHBoxLayout *containerLayout = new TQHBoxLayout( container ); gridLayout->addWidget( container, 3, 1 ); m_pushButtonBrowseLocalFile = new KPushButton( i18n( "&Browse..." ), container ); - QToolTip::add( m_pushButtonBrowseLocalFile, i18n( "Browse for a local file" ) ); - m_pushButtonBrowseLocalFile->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + TQToolTip::add( m_pushButtonBrowseLocalFile, i18n( "Browse for a local file" ) ); + m_pushButtonBrowseLocalFile->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); containerLayout->addWidget( m_pushButtonBrowseLocalFile ); containerLayout->addStretch( 10 ); - m_pushButtonBrowseLocalFile->setIconSet( QIconSet( SmallIcon( "fileopen" ) ) ); + m_pushButtonBrowseLocalFile->setIconSet( TQIconSet( SmallIcon( "fileopen" ) ) ); KPopupMenu *menu = new KPopupMenu( m_pushButtonBrowseLocalFile ); menu->insertTitle( i18n( "Select base directory" ) ); - menu->insertItem( QIconSet( SmallIcon( "favorite" ) ), i18n( "Current directory" ), m_menuIdCurrentDirectory ); - if ( m_previousDirectory != QString::null ) - menu->insertItem( QIconSet( SmallIcon( "favorite" ) ), i18n( "Previously used directory" ), m_menuIdPreviousDirectory ); + menu->insertItem( TQIconSet( SmallIcon( "favorite" ) ), i18n( "Current directory" ), m_menuIdCurrentDirectory ); + if ( m_previousDirectory != TQString::null ) + menu->insertItem( TQIconSet( SmallIcon( "favorite" ) ), i18n( "Previously used directory" ), m_menuIdPreviousDirectory ); if ( !settings->editing_DocumentSearchPaths.isEmpty() ) { menu->insertSeparator(); int i = 0; - for ( QStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it, ++i ) - menu->insertItem( QIconSet( SmallIcon( "folder" ) ), *it, i ); + for ( TQStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it, ++i ) + menu->insertItem( TQIconSet( SmallIcon( "folder" ) ), *it, i ); } m_pushButtonBrowseLocalFile->setPopup( menu ); connect( menu, SIGNAL( activated( int ) ), this, SLOT( browseLocalFile( int ) ) ); diff --git a/src/entrywidgetexternal.h b/src/entrywidgetexternal.h index 16cb608..525b9b7 100644 --- a/src/entrywidgetexternal.h +++ b/src/entrywidgetexternal.h @@ -37,7 +37,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetExternal( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetExternal( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetExternal(); bool isModified(); @@ -46,11 +46,11 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private slots: void openURL(); - void openURL( const QString & ); + void openURL( const TQString & ); void openDoi(); void openLocalFile(); void browseLocalFile( int id ); @@ -65,7 +65,7 @@ namespace KBibTeX KPushButton *m_pushButtonOpenLocalFile; KPushButton *m_pushButtonBrowseLocalFile; - static QString m_previousDirectory; + static TQString m_previousDirectory; static const int m_menuIdCurrentDirectory, m_menuIdPreviousDirectory; void setupGUI(); diff --git a/src/entrywidgetkeyword.cpp b/src/entrywidgetkeyword.cpp index b61acc0..da34947 100644 --- a/src/entrywidgetkeyword.cpp +++ b/src/entrywidgetkeyword.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -38,7 +38,7 @@ namespace KBibTeX { - KeywordListViewItem::KeywordListViewItem( KListView * parent, const QString & text, bool global ) : QCheckListItem( parent, text, QCheckListItem::CheckBox ) + KeywordListViewItem::KeywordListViewItem( KListView * parent, const TQString & text, bool global ) : TQCheckListItem( parent, text, TQCheckListItem::CheckBox ) { setGlobal( global ); } @@ -63,7 +63,7 @@ namespace KBibTeX } } - EntryWidgetKeyword::EntryWidgetKeyword( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ), m_bibtexfile( bibtexfile ), m_isModified( FALSE ), m_numKeywords( 0 ) + EntryWidgetKeyword::EntryWidgetKeyword( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ), m_bibtexfile( bibtexfile ), m_isModified( FALSE ), m_numKeywords( 0 ) { setupGUI(); } @@ -119,7 +119,7 @@ namespace KBibTeX BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftKeywords ); BibTeX::KeywordContainer *keywordContainer = NULL; if ( field != NULL && ( keywordContainer = dynamic_cast( field->value()->items.first() ) ) != NULL ) - for ( QValueList::Iterator it = keywordContainer->keywords.begin(); it != keywordContainer->keywords.end(); ++it ) + for ( TQValueList::Iterator it = keywordContainer->keywords.begin(); it != keywordContainer->keywords.end(); ++it ) m_usedKeywords.append(( *it )->text() ); if ( m_bibtexfile != NULL ) @@ -128,18 +128,18 @@ namespace KBibTeX KBibTeX::Settings * settings = KBibTeX::Settings::self(); m_globalKeywords = settings->keyword_GlobalList; - m_availableKeywords = QStringList( m_globalKeywords ); - for ( QStringList::Iterator it = m_fileKeywords.begin(); it != m_fileKeywords.end(); ++it ) + m_availableKeywords = TQStringList( m_globalKeywords ); + for ( TQStringList::Iterator it = m_fileKeywords.begin(); it != m_fileKeywords.end(); ++it ) if ( !m_availableKeywords.contains( *it ) ) m_availableKeywords.append( *it ); - for ( QStringList::Iterator it = m_usedKeywords.begin(); it != m_usedKeywords.end(); ++it ) + for ( TQStringList::Iterator it = m_usedKeywords.begin(); it != m_usedKeywords.end(); ++it ) if ( !m_availableKeywords.contains( *it ) ) m_availableKeywords.append( *it ); setListView(); } - void EntryWidgetKeyword::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, QListView */*listViewWarnings*/ ) + void EntryWidgetKeyword::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, TQListView */*listViewWarnings*/ ) { // nothing } @@ -152,7 +152,7 @@ namespace KBibTeX m_buttonToggleGlobal->setEnabled( hasCurrent ); } - void EntryWidgetKeyword::slotKeywordRenamed( QListViewItem * item, const QString & text, int /*col*/ ) + void EntryWidgetKeyword::slotKeywordRenamed( TQListViewItem * item, const TQString & text, int /*col*/ ) { KeywordListViewItem *kwlvi = dynamic_cast( item ); if ( text.isEmpty() ) @@ -165,7 +165,7 @@ namespace KBibTeX if ( m_availableKeywords.contains( text ) ) { item->setText( 0, m_beforeRenaming ); - KMessageBox::error( this, QString( i18n( "The keyword '%1' does already exist in the list of keywords.\nThe old name has been restored." ) ).arg( text ), i18n( "Renaming keyword failed" ) ); + KMessageBox::error( this, TQString( i18n( "The keyword '%1' does already exist in the list of keywords.\nThe old name has been restored." ) ).arg( text ), i18n( "Renaming keyword failed" ) ); } else { @@ -181,7 +181,7 @@ namespace KBibTeX m_fileKeywords.remove( m_beforeRenaming ); m_fileKeywords.append( text ); } - QCheckListItem *checkedItem = dynamic_cast( item ); + TQCheckListItem *checkedItem = dynamic_cast( item ); if ( checkedItem != NULL ) checkedItem->setOn( TRUE ); } @@ -190,14 +190,14 @@ namespace KBibTeX void EntryWidgetKeyword::slotNewKeyword() { - KeywordListViewItem * item = new KeywordListViewItem( m_listviewKeywords, QString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewKeyword%1" ) ).arg( ++m_numKeywords ), FALSE ); + KeywordListViewItem * item = new KeywordListViewItem( m_listviewKeywords, TQString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewKeyword%1" ) ).arg( ++m_numKeywords ), FALSE ); m_listviewKeywords->setSelected( item, TRUE ); - QTimer::singleShot( 100, this, SLOT( slotEditKeyword() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEditKeyword() ) ); } void EntryWidgetKeyword::slotEditKeyword() { - QListViewItem * item = m_listviewKeywords->selectedItem(); + TQListViewItem * item = m_listviewKeywords->selectedItem(); if ( item != NULL ) { m_beforeRenaming = item->text( 0 ); @@ -222,7 +222,7 @@ namespace KBibTeX void EntryWidgetKeyword::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 6, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 6, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 4, 1 ); m_listviewKeywords = new KListView( this ); @@ -231,33 +231,33 @@ namespace KBibTeX m_listviewKeywords->addColumn( i18n( "Origin" ) ); gridLayout->addMultiCellWidget( m_listviewKeywords, 0, 4, 0, 0 ); m_listviewKeywords->setAllColumnsShowFocus( TRUE ); - connect( m_listviewKeywords, SIGNAL( currentChanged( QListViewItem* ) ), this, SLOT( slotSelectionChanged() ) ); - connect( m_listviewKeywords, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( slotSelectionChanged() ) ); - connect( m_listviewKeywords, SIGNAL( itemRenamed( QListViewItem*, const QString&, int ) ), this, SLOT( slotKeywordRenamed( QListViewItem*, const QString&, int ) ) ); + connect( m_listviewKeywords, SIGNAL( currentChanged( TQListViewItem* ) ), this, SLOT( slotSelectionChanged() ) ); + connect( m_listviewKeywords, SIGNAL( clicked( TQListViewItem * ) ), this, SLOT( slotSelectionChanged() ) ); + connect( m_listviewKeywords, SIGNAL( itemRenamed( TQListViewItem*, const TQString&, int ) ), this, SLOT( slotKeywordRenamed( TQListViewItem*, const TQString&, int ) ) ); - m_buttonNew = new QPushButton( i18n( "keyword", "New" ), this ); + m_buttonNew = new TQPushButton( i18n( "keyword", "New" ), this ); m_buttonNew->setEnabled( !m_isReadOnly ); - m_buttonNew->setIconSet( QIconSet( SmallIcon( "add" ) ) ); - QToolTip::add( m_buttonNew, i18n( "Add a new keyword to the list" ) ); + m_buttonNew->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); + TQToolTip::add( m_buttonNew, i18n( "Add a new keyword to the list" ) ); gridLayout->addWidget( m_buttonNew, 0, 1 ); connect( m_buttonNew, SIGNAL( clicked() ), this, SLOT( slotNewKeyword() ) ); - m_buttonEdit = new QPushButton( i18n( "keyword", "Edit" ), this ); - m_buttonEdit->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); - QToolTip::add( m_buttonEdit, i18n( "Edit the selected keyword" ) ); + m_buttonEdit = new TQPushButton( i18n( "keyword", "Edit" ), this ); + m_buttonEdit->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); + TQToolTip::add( m_buttonEdit, i18n( "Edit the selected keyword" ) ); gridLayout->addWidget( m_buttonEdit, 1, 1 ); m_buttonEdit->setEnabled( FALSE ); connect( m_buttonEdit, SIGNAL( clicked() ), this, SLOT( slotEditKeyword() ) ); - m_buttonToggleGlobal = new QPushButton( i18n( "keyword", "Toggle &global" ), this ); - m_buttonToggleGlobal->setIconSet( QIconSet( SmallIcon( "package" ) ) ); - QToolTip::add( m_buttonToggleGlobal, i18n( "Add or remove the selected keyword to or from the global list" ) ); + m_buttonToggleGlobal = new TQPushButton( i18n( "keyword", "Toggle &global" ), this ); + m_buttonToggleGlobal->setIconSet( TQIconSet( SmallIcon( "package" ) ) ); + TQToolTip::add( m_buttonToggleGlobal, i18n( "Add or remove the selected keyword to or from the global list" ) ); gridLayout->addWidget( m_buttonToggleGlobal, 2, 1 ); m_buttonToggleGlobal->setEnabled( FALSE ); connect( m_buttonToggleGlobal, SIGNAL( clicked() ), this, SLOT( slotToggleGlobal() ) ); - QLabel *label = new QLabel( i18n( "There is no need to delete keywords. Simply uncheck unwanted keywords and make them non-global.\nGlobal keywords can also be edited in the settings dialog." ), this ); - label->setAlignment( QLabel::WordBreak | QLabel::AlignTop ); + TQLabel *label = new TQLabel( i18n( "There is no need to delete keywords. Simply uncheck unwanted keywords and make them non-global.\nGlobal keywords can also be edited in the settings dialog." ), this ); + label->setAlignment( TQLabel::WordBreak | TQLabel::AlignTop ); gridLayout->addMultiCellWidget( label, 5, 5, 0, 1 ); } @@ -265,7 +265,7 @@ namespace KBibTeX { m_availableKeywords.sort(); m_listviewKeywords->clear(); - for ( QStringList::Iterator it = m_availableKeywords.begin(); it != m_availableKeywords.end(); ++it ) + for ( TQStringList::Iterator it = m_availableKeywords.begin(); it != m_availableKeywords.end(); ++it ) { KeywordListViewItem *item = new KeywordListViewItem( m_listviewKeywords, *it, m_globalKeywords.contains( *it ) ); if ( m_usedKeywords.contains( *it ) ) @@ -276,7 +276,7 @@ namespace KBibTeX void EntryWidgetKeyword::readListView() { m_usedKeywords.clear(); - for ( QListViewItemIterator it = QListViewItemIterator( m_listviewKeywords, QListViewItemIterator::Checked ); it.current() != NULL; ++it ) + for ( TQListViewItemIterator it = TQListViewItemIterator( m_listviewKeywords, TQListViewItemIterator::Checked ); it.current() != NULL; ++it ) m_usedKeywords.append(( *it ) ->text( 0 ) ); } } diff --git a/src/entrywidgetkeyword.h b/src/entrywidgetkeyword.h index 88eae61..e8a7c75 100644 --- a/src/entrywidgetkeyword.h +++ b/src/entrywidgetkeyword.h @@ -22,15 +22,15 @@ #include -class QPushButton; +class TQPushButton; class KListView; namespace KBibTeX { - class KeywordListViewItem: public QCheckListItem + class KeywordListViewItem: public TQCheckListItem { public: - KeywordListViewItem( KListView * parent, const QString & text, bool isGlobal ); + KeywordListViewItem( KListView * parent, const TQString & text, bool isGlobal ); ~KeywordListViewItem(); bool isGlobal() @@ -50,7 +50,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetKeyword( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetKeyword( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetKeyword(); bool isModified(); @@ -59,33 +59,33 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private slots: void slotSelectionChanged(); - void slotKeywordRenamed( QListViewItem * item, const QString & text, int col ); + void slotKeywordRenamed( TQListViewItem * item, const TQString & text, int col ); void slotNewKeyword(); void slotEditKeyword(); void slotToggleGlobal(); private: BibTeX::File *m_bibtexfile; - QStringList m_availableKeywords; - QStringList m_globalKeywords; - QStringList m_fileKeywords; - QStringList m_usedKeywords; + TQStringList m_availableKeywords; + TQStringList m_globalKeywords; + TQStringList m_fileKeywords; + TQStringList m_usedKeywords; bool m_isModified; KListView *m_listviewKeywords; - QPushButton *m_buttonNew; - QPushButton *m_buttonEdit; - QPushButton *m_buttonToggleGlobal; + TQPushButton *m_buttonNew; + TQPushButton *m_buttonEdit; + TQPushButton *m_buttonToggleGlobal; int m_numKeywords; - QString m_beforeRenaming; + TQString m_beforeRenaming; void setupGUI(); void setListView(); void readListView(); - bool editKeywords( QStringList *keywords ); + bool editKeywords( TQStringList *keywords ); }; } diff --git a/src/entrywidgetmisc.cpp b/src/entrywidgetmisc.cpp index f2e4f5e..66ec617 100644 --- a/src/entrywidgetmisc.cpp +++ b/src/entrywidgetmisc.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -31,7 +31,7 @@ namespace KBibTeX { - EntryWidgetMisc::EntryWidgetMisc( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetMisc::EntryWidgetMisc( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) { setupGUI(); @@ -103,7 +103,7 @@ namespace KBibTeX m_fieldLineEditAbstract->setValue( field != NULL ? field->value() : NULL ); } - void EntryWidgetMisc::updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ) + void EntryWidgetMisc::updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ) { addMissingWarning( entryType, BibTeX::EntryField::ftType, m_fieldLineEditType->caption(), !m_fieldLineEditType->isEmpty(), m_fieldLineEditType, listViewWarnings ); @@ -128,39 +128,39 @@ namespace KBibTeX void EntryWidgetMisc::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 5, 5, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 5, 5, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setColSpacing( 2, KDialog::spacingHint() * 4 ); gridLayout->setRowStretch( 4, 1 ); - QLabel *label = new QLabel( QString( "%1:" ).arg( i18n( "Type" ) ), this ); + TQLabel *label = new TQLabel( TQString( "%1:" ).arg( i18n( "Type" ) ), this ); gridLayout->addWidget( label, 0, 0 ); m_fieldLineEditType = new KBibTeX::FieldLineEdit( i18n( "Type" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditType" ); m_fieldLineEditType->setFieldType( BibTeX::EntryField::ftType ); label->setBuddy( m_fieldLineEditType ); gridLayout->addWidget( m_fieldLineEditType, 0, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Key" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Key" ) ), this ); gridLayout->addWidget( label, 0, 3 ); m_fieldLineEditKey = new KBibTeX::FieldLineEdit( i18n( "Key" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditKey" ); m_fieldLineEditKey->setFieldType( BibTeX::EntryField::ftKey ); label->setBuddy( m_fieldLineEditKey ); gridLayout->addWidget( m_fieldLineEditKey, 0, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Note" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Note" ) ), this ); gridLayout->addWidget( label, 1, 0 ); m_fieldLineEditNote = new KBibTeX::FieldLineEdit( i18n( "Note" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditNote" ); m_fieldLineEditNote->setFieldType( BibTeX::EntryField::ftNote ); label->setBuddy( m_fieldLineEditNote ); gridLayout->addMultiCellWidget( m_fieldLineEditNote, 1, 1, 1, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Annote" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Annote" ) ), this ); gridLayout->addWidget( label, 2, 0 ); m_fieldLineEditAnnote = new KBibTeX::FieldLineEdit( i18n( "Annote" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditAnnote" ); m_fieldLineEditAnnote->setFieldType( BibTeX::EntryField::ftAnnote ); label->setBuddy( m_fieldLineEditAnnote ); gridLayout->addMultiCellWidget( m_fieldLineEditAnnote, 2, 2, 1, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Abstract" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Abstract" ) ), this ); gridLayout->addWidget( label, 3, 0 ); m_fieldLineEditAbstract = new KBibTeX::FieldLineEdit( i18n( "Abstract" ), KBibTeX::FieldLineEdit::itMultiLine, m_isReadOnly, this, "m_fieldLineEditAbstract" ); m_fieldLineEditAbstract->setFieldType( BibTeX::EntryField::ftAbstract ); diff --git a/src/entrywidgetmisc.h b/src/entrywidgetmisc.h index 5cb99b2..5cef564 100644 --- a/src/entrywidgetmisc.h +++ b/src/entrywidgetmisc.h @@ -30,7 +30,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetMisc( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetMisc( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetMisc(); bool isModified(); @@ -39,7 +39,7 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private: FieldLineEdit *m_fieldLineEditType; diff --git a/src/entrywidgetother.cpp b/src/entrywidgetother.cpp index 1c5d13b..cd165f2 100644 --- a/src/entrywidgetother.cpp +++ b/src/entrywidgetother.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -39,7 +39,7 @@ namespace KBibTeX { - EntryWidgetOther::EntryWidgetOther( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetOther::EntryWidgetOther( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ), m_isModified( FALSE ) { setupGUI(); @@ -63,24 +63,24 @@ namespace KBibTeX void EntryWidgetOther::apply( BibTeX::Entry *entry ) { Settings * settings = Settings::self(); - QStringList toBeDeleted; - for ( QValueList::ConstIterator it = entry->begin(); it != entry->end(); it++ ) + TQStringList toBeDeleted; + for ( TQValueList::ConstIterator it = entry->begin(); it != entry->end(); it++ ) { BibTeX::EntryField *field = *it; bool doDel = field->fieldType() == BibTeX::EntryField::ftUnknown; if ( !doDel ) continue; - QString ftn = field->fieldTypeName().lower(); + TQString ftn = field->fieldTypeName().lower(); for ( unsigned int i = 0; doDel && i < settings->userDefinedInputFields.count(); ++i ) doDel &= settings->userDefinedInputFields[i]->name.lower() != ftn; if ( doDel ) toBeDeleted.append( ftn ); } - for ( QStringList::ConstIterator it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) + for ( TQStringList::ConstIterator it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) entry->deleteField( *it ); - for ( QListViewItemIterator it( m_listViewFields ); it.current(); it++ ) + for ( TQListViewItemIterator it( m_listViewFields ); it.current(); it++ ) { ValueListViewItem *vlvi = dynamic_cast( it.current() ); if ( vlvi != NULL ) @@ -99,13 +99,13 @@ namespace KBibTeX m_listViewFields->clear(); Settings * settings = Settings::self(); - for ( QValueList::ConstIterator it = entry->begin(); it != entry->end(); it++ ) + for ( TQValueList::ConstIterator it = entry->begin(); it != entry->end(); it++ ) { BibTeX::EntryField *field = *it; bool doAdd = field->fieldType() == BibTeX::EntryField::ftUnknown; if ( !doAdd ) continue; - QString ftn = field->fieldTypeName().lower(); + TQString ftn = field->fieldTypeName().lower(); for ( unsigned int i = 0; doAdd && i < settings->userDefinedInputFields.count(); ++i ) doAdd &= settings->userDefinedInputFields[i]->name.lower() != ftn; @@ -116,37 +116,37 @@ namespace KBibTeX m_isModified = FALSE; } - void EntryWidgetOther::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, QListView * /*listViewWarnings*/ ) + void EntryWidgetOther::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, TQListView * /*listViewWarnings*/ ) { // no warnings neccessary for user fields } void EntryWidgetOther::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 5, 3, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 5, 3, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); m_lineEditKey = new KLineEdit( this, "m_lineEditKey" ); m_lineEditKey->setReadOnly( m_isReadOnly ); gridLayout->addWidget( m_lineEditKey, 0, 1 ); - QToolTip::add( m_lineEditKey, i18n( "Name of the user-defined field" ) ); - QWhatsThis::add( m_lineEditKey, i18n( "The name of the user-defined field. Should only contain letters and numbers." ) ); - QLabel *label = new QLabel( i18n( "&Name:" ), this ); + TQToolTip::add( m_lineEditKey, i18n( "Name of the user-defined field" ) ); + TQWhatsThis::add( m_lineEditKey, i18n( "The name of the user-defined field. Should only contain letters and numbers." ) ); + TQLabel *label = new TQLabel( i18n( "&Name:" ), this ); label->setBuddy( m_lineEditKey ); gridLayout->addWidget( label, 0, 0 ); m_pushButtonAdd = new KPushButton( i18n( "&Add" ), this, "m_pushButtonAdd" ); gridLayout->addWidget( m_pushButtonAdd, 0, 2 ); - m_pushButtonAdd->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_pushButtonAdd->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); m_fieldLineEditValue = new KBibTeX::FieldLineEdit( i18n( "Value" ), KBibTeX::FieldLineEdit::itMultiLine, m_isReadOnly, this, "m_fieldLineEditValue" ); gridLayout->addMultiCellWidget( m_fieldLineEditValue, 1, 2, 1, 2 ); - QToolTip::add( m_fieldLineEditValue, i18n( "Content of the user-defined field" ) ); - QWhatsThis::add( m_fieldLineEditValue, i18n( "The content of the user-defined field. May contain any text." ) ); - label = new QLabel( i18n( "&Content:" ), this ); + TQToolTip::add( m_fieldLineEditValue, i18n( "Content of the user-defined field" ) ); + TQWhatsThis::add( m_fieldLineEditValue, i18n( "The content of the user-defined field. May contain any text." ) ); + label = new TQLabel( i18n( "&Content:" ), this ); label->setBuddy( m_fieldLineEditValue ); gridLayout->addWidget( label, 1, 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 110, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 110, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); gridLayout->addItem( spacer, 2, 0 ); m_listViewFields = new KListView( this, "m_listViewFields" ); @@ -156,28 +156,28 @@ namespace KBibTeX m_listViewFields->setFullWidth( TRUE ); gridLayout->addMultiCellWidget( m_listViewFields, 3, 5, 1, 1 ); - label = new QLabel( i18n( "&List:" ), this ); + label = new TQLabel( i18n( "&List:" ), this ); label->setBuddy( m_listViewFields ); - label->setAlignment( Qt::AlignTop ); + label->setAlignment( TQt::AlignTop ); gridLayout->addWidget( label, 3, 0 ); m_pushButtonDelete = new KPushButton( i18n( "&Delete" ), this, "m_pushButtonDelete" ); gridLayout->addWidget( m_pushButtonDelete, 3, 2 ); - m_pushButtonDelete->setIconSet( QIconSet( SmallIcon( "delete" ) ) ); + m_pushButtonDelete->setIconSet( TQIconSet( SmallIcon( "delete" ) ) ); m_pushButtonOpen = new KPushButton( i18n( "Op&en" ), this, "m_pushButtonOpen" ); gridLayout->addWidget( m_pushButtonOpen, 4, 2 ); - m_pushButtonOpen->setIconSet( QIconSet( SmallIcon( "fileopen" ) ) ); + m_pushButtonOpen->setIconSet( TQIconSet( SmallIcon( "fileopen" ) ) ); - spacer = new QSpacerItem( 20, 110, QSizePolicy::Minimum, QSizePolicy::Expanding ); + spacer = new TQSpacerItem( 20, 110, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); gridLayout->addItem( spacer, 5, 2 ); m_pushButtonOpen->setEnabled( FALSE ); m_pushButtonAdd->setEnabled( FALSE ); m_pushButtonDelete->setEnabled( FALSE ); - connect( m_listViewFields, SIGNAL( clicked( QListViewItem*, const QPoint&, int ) ), this, SLOT( fieldExecute( QListViewItem* ) ) ); - connect( m_lineEditKey, SIGNAL( textChanged( const QString& ) ), this, SLOT( updateGUI() ) ); + connect( m_listViewFields, SIGNAL( clicked( TQListViewItem*, const TQPoint&, int ) ), this, SLOT( fieldExecute( TQListViewItem* ) ) ); + connect( m_lineEditKey, SIGNAL( textChanged( const TQString& ) ), this, SLOT( updateGUI() ) ); connect( m_fieldLineEditValue, SIGNAL( textChanged( ) ), this, SLOT( updateGUI() ) ); connect( m_pushButtonAdd, SIGNAL( clicked( ) ), this, SLOT( addClicked( ) ) ); connect( m_pushButtonDelete, SIGNAL( clicked( ) ), this, SLOT( deleteClicked( ) ) ); @@ -186,8 +186,8 @@ namespace KBibTeX void EntryWidgetOther::updateGUI() { - QString text = m_lineEditKey->text(); - QListViewItem * item = m_listViewFields->findItem( text, 0 ) ; + TQString text = m_lineEditKey->text(); + TQListViewItem * item = m_listViewFields->findItem( text, 0 ) ; bool contains = item != NULL; bool isUnknown = BibTeX::EntryField::fieldTypeFromString( text ) == BibTeX::EntryField::ftUnknown; @@ -199,7 +199,7 @@ namespace KBibTeX m_pushButtonDelete->setEnabled( !m_isReadOnly && contains ); m_pushButtonAdd->setEnabled( !m_isReadOnly && !text.isEmpty() && !m_fieldLineEditValue->isEmpty() && isUnknown ); m_pushButtonAdd->setText( contains ? i18n( "&Apply" ) : i18n( "&Add" ) ); - m_pushButtonAdd->setIconSet( QIconSet( SmallIcon( contains ? "apply" : "fileopen" ) ) ); + m_pushButtonAdd->setIconSet( TQIconSet( SmallIcon( contains ? "apply" : "fileopen" ) ) ); bool validURL = FALSE; if ( contains ) @@ -211,7 +211,7 @@ namespace KBibTeX m_pushButtonOpen->setEnabled( validURL ); } - void EntryWidgetOther::fieldExecute( QListViewItem * item ) + void EntryWidgetOther::fieldExecute( TQListViewItem * item ) { ValueListViewItem * vlvi = dynamic_cast( item ); if ( vlvi != NULL ) @@ -223,8 +223,8 @@ namespace KBibTeX void EntryWidgetOther::addClicked() { - QString key = m_lineEditKey->text(); - QListViewItem * item = m_listViewFields->findItem( key, 0 ) ; + TQString key = m_lineEditKey->text(); + TQListViewItem * item = m_listViewFields->findItem( key, 0 ) ; ValueListViewItem * vlvi = item != NULL ? dynamic_cast( item ) : NULL; if ( vlvi != NULL ) @@ -239,7 +239,7 @@ namespace KBibTeX void EntryWidgetOther::deleteClicked() { - QListViewItem * item = m_listViewFields->findItem( m_lineEditKey->text(), 0 ); + TQListViewItem * item = m_listViewFields->findItem( m_lineEditKey->text(), 0 ); if ( item != NULL ) { @@ -264,8 +264,8 @@ namespace KBibTeX m_fieldLineEditValue->setEnabled( FALSE ); } - ValueListViewItem::ValueListViewItem( const QString& title, BibTeX::Value *value, QListView *parent ) - : QListViewItem( parent ), m_title( title ) + ValueListViewItem::ValueListViewItem( const TQString& title, BibTeX::Value *value, TQListView *parent ) + : TQListViewItem( parent ), m_title( title ) { m_value = new BibTeX::Value( value ); setTexts( m_title ); @@ -281,7 +281,7 @@ namespace KBibTeX return m_value; } - QString ValueListViewItem::title() + TQString ValueListViewItem::title() { return m_title; } @@ -302,13 +302,13 @@ namespace KBibTeX setTexts( m_title ); } - void ValueListViewItem::setTitle( const QString &title ) + void ValueListViewItem::setTitle( const TQString &title ) { m_title = title; setTexts( title ); } - void ValueListViewItem::setTexts( const QString& title ) + void ValueListViewItem::setTexts( const TQString& title ) { setText( 0, title ); if ( m_value != NULL ) diff --git a/src/entrywidgetother.h b/src/entrywidgetother.h index 1119214..e8aae71 100644 --- a/src/entrywidgetother.h +++ b/src/entrywidgetother.h @@ -24,9 +24,9 @@ #include -class QPushButton; +class TQPushButton; class KListView; -class QLineEdit; +class TQLineEdit; namespace KBibTeX { @@ -40,7 +40,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetOther( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetOther( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetOther(); bool isModified(); @@ -49,15 +49,15 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType /*entryType*/, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView * /*listViewWarnings*/ ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView * /*listViewWarnings*/ ); private: bool m_isModified; - QPushButton *m_pushButtonAdd; - QPushButton *m_pushButtonDelete; - QPushButton *m_pushButtonOpen; - QLineEdit *m_lineEditKey; + TQPushButton *m_pushButtonAdd; + TQPushButton *m_pushButtonDelete; + TQPushButton *m_pushButtonOpen; + TQLineEdit *m_lineEditKey; FieldLineEdit *m_fieldLineEditValue; KListView *m_listViewFields; KURL m_internalURL; @@ -66,29 +66,29 @@ namespace KBibTeX private slots: void updateGUI(); - void fieldExecute( QListViewItem * item ); + void fieldExecute( TQListViewItem * item ); void addClicked(); void deleteClicked(); void openClicked(); }; - class ValueListViewItem : public QListViewItem + class ValueListViewItem : public TQListViewItem { public: - ValueListViewItem( const QString& title, BibTeX::Value *value, QListView *parent ); + ValueListViewItem( const TQString& title, BibTeX::Value *value, TQListView *parent ); ~ValueListViewItem(); const BibTeX::Value *value(); - QString title(); + TQString title(); void setValue( BibTeX::Value *value ); - void setTitle( const QString &title ); + void setTitle( const TQString &title ); private: - QString m_title; + TQString m_title; BibTeX::Value *m_value; - void setTexts( const QString& title ); + void setTexts( const TQString& title ); }; } diff --git a/src/entrywidgetpublication.cpp b/src/entrywidgetpublication.cpp index d1dfd14..b048970 100644 --- a/src/entrywidgetpublication.cpp +++ b/src/entrywidgetpublication.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -37,7 +37,7 @@ namespace KBibTeX { - EntryWidgetPublication::EntryWidgetPublication( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetPublication::EntryWidgetPublication( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) { setupGUI(); @@ -153,7 +153,7 @@ namespace KBibTeX { BibTeX::PlainText *plainText = dynamic_cast( value->items.first() ); if ( plainText != NULL ) - plainText->setText( plainText->text().replace( QRegExp( "\\s*--?\\s*" ), QChar( 0x2013 ) ) ); + plainText->setText( plainText->text().replace( TQRegExp( "\\s*--?\\s*" ), TQChar( 0x2013 ) ) ); } setValue( entry, BibTeX::EntryField::ftPages, value ); delete value; @@ -253,7 +253,7 @@ namespace KBibTeX slotSetCrossRefEntry(); } - void EntryWidgetPublication::updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ) + void EntryWidgetPublication::updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ) { bool crossRefValid = FALSE; BibTeX::Value *value = NULL; @@ -320,7 +320,7 @@ namespace KBibTeX BibTeX::MacroKey *key = dynamic_cast( value->items[0] ); if ( key != NULL ) { - QString jourText = key->text(); + TQString jourText = key->text(); if ( !jourText.isEmpty() && !m_bibtexfile->containsKey( jourText ) ) new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlWarning, i18n( "The field 'Journal' refers to a not existing entry" ), m_fieldLineEditJournal, listViewWarnings, "warning" ); } @@ -381,7 +381,7 @@ namespace KBibTeX m_crossRefEntry = NULL; if ( m_fieldLineEditCrossRef->value() != NULL && m_bibtexfile != NULL ) { - QString crossRefText = m_fieldLineEditCrossRef->value() ->text(); + TQString crossRefText = m_fieldLineEditCrossRef->value() ->text(); if ( !crossRefText.isEmpty() ) m_crossRefEntry = dynamic_cast( m_bibtexfile->containsKey( crossRefText ) ); } @@ -389,7 +389,7 @@ namespace KBibTeX void EntryWidgetPublication::slotOpenISBN() { - KURL url = KURL( QString( i18n( "http://en.wikipedia.org/w/index.php?title=Special:Booksources&isbn=%1" ) ).arg( isbn() ) ); + KURL url = KURL( TQString( i18n( "http://en.wikipedia.org/w/index.php?title=Special:Booksources&isbn=%1" ) ).arg( isbn() ) ); Settings::openUrl( url, this ); } @@ -398,38 +398,38 @@ namespace KBibTeX */ void EntryWidgetPublication::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 10, 5, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 10, 5, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setColSpacing( 2, KDialog::spacingHint() * 4 ); gridLayout->setRowStretch( 9, 1 ); - QLabel *label = new QLabel( QString( "%1:" ).arg( i18n( "Journal" ) ), this ); + TQLabel *label = new TQLabel( TQString( "%1:" ).arg( i18n( "Journal" ) ), this ); gridLayout->addWidget( label, 0, 0 ); m_fieldLineEditJournal = new KBibTeX::FieldLineEdit( i18n( "Journal" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditJournal" ); m_fieldLineEditJournal ->setFieldType( BibTeX::EntryField::ftJournal ); label->setBuddy( m_fieldLineEditJournal ); gridLayout->addWidget( m_fieldLineEditJournal, 0, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Volume" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Volume" ) ), this ); gridLayout->addWidget( label, 1, 0 ); m_fieldLineEditVolume = new KBibTeX::FieldLineEdit( i18n( "Volume" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditVolume" ); m_fieldLineEditVolume->setFieldType( BibTeX::EntryField::ftVolume ); label->setBuddy( m_fieldLineEditVolume ); gridLayout->addWidget( m_fieldLineEditVolume, 1, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Number" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Number" ) ), this ); gridLayout->addWidget( label, 2, 0 ); m_fieldLineEditNumber = new KBibTeX::FieldLineEdit( i18n( "Number" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditNumber" ); m_fieldLineEditNumber ->setFieldType( BibTeX::EntryField::ftNumber ); label->setBuddy( m_fieldLineEditNumber ); gridLayout->addWidget( m_fieldLineEditNumber, 2, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Month" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Month" ) ), this ); gridLayout->addWidget( label, 3, 0 ); - QHBoxLayout *innerLayout = new QHBoxLayout(); + TQHBoxLayout *innerLayout = new TQHBoxLayout(); gridLayout->addLayout( innerLayout, 3, 1 ); - m_pushButtonMonths = new QPushButton( this, "m_pushButtonMonths" ); - m_pushButtonMonths->setIconSet( QIconSet( SmallIcon( "vcalendar" ) ) ); - m_pushButtonMonths->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); + m_pushButtonMonths = new TQPushButton( this, "m_pushButtonMonths" ); + m_pushButtonMonths->setIconSet( TQIconSet( SmallIcon( "vcalendar" ) ) ); + m_pushButtonMonths->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum ); m_pushButtonMonths->setEnabled( !m_isReadOnly ); innerLayout->addWidget( m_pushButtonMonths ); m_fieldLineEditMonth = new KBibTeX::FieldLineEdit( i18n( "Month" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditMonth" ); @@ -437,35 +437,35 @@ namespace KBibTeX label->setBuddy( m_fieldLineEditMonth ); innerLayout->addWidget( m_fieldLineEditMonth ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Year" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Year" ) ), this ); gridLayout->addWidget( label, 4, 0 ); m_fieldLineEditYear = new KBibTeX::FieldLineEdit( i18n( "Year" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditYear" ); m_fieldLineEditYear->setFieldType( BibTeX::EntryField::ftYear ); label->setBuddy( m_fieldLineEditYear ); gridLayout->addWidget( m_fieldLineEditYear, 4, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Pages" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Pages" ) ), this ); gridLayout->addWidget( label, 5, 0 ); m_fieldLineEditPages = new KBibTeX::FieldLineEdit( i18n( "Pages" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditPages" ); m_fieldLineEditPages->setFieldType( BibTeX::EntryField::ftPages ); label->setBuddy( m_fieldLineEditPages ); gridLayout->addWidget( m_fieldLineEditPages, 5, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Edition" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Edition" ) ), this ); gridLayout->addWidget( label, 6, 0 ); m_fieldLineEditEdition = new KBibTeX::FieldLineEdit( i18n( "Edition" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditEdition" ); m_fieldLineEditEdition->setFieldType( BibTeX::EntryField::ftEdition ); label->setBuddy( m_fieldLineEditEdition ); gridLayout->addWidget( m_fieldLineEditEdition, 6, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Chapter" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Chapter" ) ), this ); gridLayout->addWidget( label, 7, 0 ); m_fieldLineEditChapter = new KBibTeX::FieldLineEdit( i18n( "Chapter" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditChapter" ); m_fieldLineEditChapter ->setFieldType( BibTeX::EntryField::ftChapter ); label->setBuddy( m_fieldLineEditChapter ); gridLayout->addWidget( m_fieldLineEditChapter, 7, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Cross Reference" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Cross Reference" ) ), this ); gridLayout->addWidget( label, 8, 0 ); m_fieldLineEditCrossRef = new KBibTeX::FieldLineEdit( i18n( "Cross Reference" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditCrossRef" ); m_fieldLineEditCrossRef->setFieldType( BibTeX::EntryField::ftCrossRef ); @@ -473,56 +473,56 @@ namespace KBibTeX gridLayout->addWidget( m_fieldLineEditCrossRef, 8, 1 ); connect( m_fieldLineEditCrossRef, SIGNAL( textChanged() ), this, SLOT( slotSetCrossRefEntry() ) ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Organization" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Organization" ) ), this ); gridLayout->addWidget( label, 0, 3 ); m_fieldLineEditOrganization = new KBibTeX::FieldLineEdit( i18n( "Organization" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditOrganization" ); m_fieldLineEditOrganization->setFieldType( BibTeX::EntryField::ftOrganization ); label->setBuddy( m_fieldLineEditOrganization ); gridLayout->addWidget( m_fieldLineEditOrganization, 0, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Publisher" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Publisher" ) ), this ); gridLayout->addWidget( label, 1, 3 ); m_fieldLineEditPublisher = new KBibTeX::FieldLineEdit( i18n( "Publisher" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditPublisher" ); m_fieldLineEditPublisher->setFieldType( BibTeX::EntryField::ftPublisher ); label->setBuddy( m_fieldLineEditPublisher ); gridLayout->addWidget( m_fieldLineEditPublisher, 1, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "School" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "School" ) ), this ); gridLayout->addWidget( label, 2, 3 ); m_fieldLineEditSchool = new KBibTeX::FieldLineEdit( i18n( "School" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditSchool" ); m_fieldLineEditSchool->setFieldType( BibTeX::EntryField::ftSchool ); label->setBuddy( m_fieldLineEditSchool ); gridLayout->addWidget( m_fieldLineEditSchool, 2, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Institution" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Institution" ) ), this ); gridLayout->addWidget( label, 3, 3 ); m_fieldLineEditInstitution = new KBibTeX::FieldLineEdit( i18n( "Institution" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditInstitution" ); m_fieldLineEditInstitution->setFieldType( BibTeX::EntryField::ftInstitution ); label->setBuddy( m_fieldLineEditInstitution ); gridLayout->addWidget( m_fieldLineEditInstitution, 3, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Location" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Location" ) ), this ); gridLayout->addWidget( label, 4, 3 ); m_fieldLineEditLocation = new KBibTeX::FieldLineEdit( i18n( "Location" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditLocation" ); m_fieldLineEditLocation->setFieldType( BibTeX::EntryField::ftLocation ); label->setBuddy( m_fieldLineEditLocation ); gridLayout->addWidget( m_fieldLineEditLocation, 4, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Address" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Address" ) ), this ); gridLayout->addWidget( label, 5, 3 ); m_fieldLineEditAddress = new KBibTeX::FieldLineEdit( i18n( "Address" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditAddress" ); m_fieldLineEditAddress->setFieldType( BibTeX::EntryField::ftAddress ); label->setBuddy( m_fieldLineEditAddress ); gridLayout->addWidget( m_fieldLineEditAddress, 5, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "ISBN" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "ISBN" ) ), this ); gridLayout->addWidget( label, 6, 3 ); - innerLayout = new QHBoxLayout(); + innerLayout = new TQHBoxLayout(); gridLayout->addLayout( innerLayout, 6, 4 ); - m_pushButtonISBN = new QPushButton( this, "m_pushButtonMonths" ); - m_pushButtonISBN->setIconSet( QIconSet( SmallIcon( "find" ) ) ); - m_pushButtonISBN->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); - QToolTip::add( m_pushButtonISBN, i18n( "Lookup ISBN number in Wikipedia" ) ); + m_pushButtonISBN = new TQPushButton( this, "m_pushButtonMonths" ); + m_pushButtonISBN->setIconSet( TQIconSet( SmallIcon( "find" ) ) ); + m_pushButtonISBN->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum ); + TQToolTip::add( m_pushButtonISBN, i18n( "Lookup ISBN number in Wikipedia" ) ); innerLayout->addWidget( m_pushButtonISBN ); m_fieldLineEditISBN = new KBibTeX::FieldLineEdit( i18n( "ISBN" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditISBN" ); m_fieldLineEditISBN ->setFieldType( BibTeX::EntryField::ftISBN ); @@ -530,34 +530,34 @@ namespace KBibTeX innerLayout->addWidget( m_fieldLineEditISBN ); connect( m_pushButtonISBN, SIGNAL( clicked() ), this, SLOT( slotOpenISBN() ) ); - label = new QLabel( QString( "%1:" ).arg( i18n( "ISSN" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "ISSN" ) ), this ); gridLayout->addWidget( label, 7, 3 ); m_fieldLineEditISSN = new KBibTeX::FieldLineEdit( i18n( "ISSN" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditISSN" ); m_fieldLineEditISSN->setFieldType( BibTeX::EntryField::ftISSN ); label->setBuddy( m_fieldLineEditISSN ); gridLayout->addWidget( m_fieldLineEditISSN, 7, 4 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "How Published" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "How Published" ) ), this ); gridLayout->addWidget( label, 8, 3 ); m_fieldLineEditHowPublished = new KBibTeX::FieldLineEdit( i18n( "How Published" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditHowPublished" ); m_fieldLineEditHowPublished->setFieldType( BibTeX::EntryField::ftHowPublished ); label->setBuddy( m_fieldLineEditHowPublished ); gridLayout->addWidget( m_fieldLineEditHowPublished, 8, 4 ); - QPopupMenu *menuMonths = new QPopupMenu( this, "menuMonths" ); + TQPopupMenu *menuMonths = new TQPopupMenu( this, "menuMonths" ); for ( int i = 0; i < 12; i++ ) menuMonths->insertItem( BibTeX::Months[ i ], i ); m_pushButtonMonths->setPopup( menuMonths ); connect( menuMonths, SIGNAL( activated( int ) ), this, SLOT( slotSetMonth( int ) ) ); } - QString EntryWidgetPublication::isbn() const + TQString EntryWidgetPublication::isbn() const { BibTeX::Value *value = m_fieldLineEditISBN->value(); if ( value == NULL ) return ""; - return value->text().replace( QRegExp( "[^0-9X]" ), "" ); + return value->text().replace( TQRegExp( "[^0-9X]" ), "" ); } } #include "entrywidgetpublication.moc" diff --git a/src/entrywidgetpublication.h b/src/entrywidgetpublication.h index e0e21ca..dedf0cb 100644 --- a/src/entrywidgetpublication.h +++ b/src/entrywidgetpublication.h @@ -22,7 +22,7 @@ #include -class QPushButton; +class TQPushButton; namespace KBibTeX { @@ -32,7 +32,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetPublication( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetPublication( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetPublication(); bool isModified(); @@ -41,7 +41,7 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private slots: void slotSetMonth( int month ); @@ -62,16 +62,16 @@ namespace KBibTeX KBibTeX::FieldLineEdit *m_fieldLineEditVolume; KBibTeX::FieldLineEdit *m_fieldLineEditNumber; KBibTeX::FieldLineEdit *m_fieldLineEditMonth; - QPushButton *m_pushButtonMonths; + TQPushButton *m_pushButtonMonths; KBibTeX::FieldLineEdit *m_fieldLineEditYear; KBibTeX::FieldLineEdit *m_fieldLineEditISBN; - QPushButton *m_pushButtonISBN; + TQPushButton *m_pushButtonISBN; KBibTeX::FieldLineEdit *m_fieldLineEditISSN; KBibTeX::FieldLineEdit *m_fieldLineEditCrossRef; KBibTeX::FieldLineEdit *m_fieldLineEditHowPublished; void setupGUI(); - QString isbn() const; + TQString isbn() const; }; diff --git a/src/entrywidgetsource.cpp b/src/entrywidgetsource.cpp index 27d95a6..f3f03d9 100644 --- a/src/entrywidgetsource.cpp +++ b/src/entrywidgetsource.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -35,7 +35,7 @@ namespace KBibTeX { - EntryWidgetSource::EntryWidgetSource( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetSource::EntryWidgetSource( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ), m_entry( NULL ) { setupGUI(); @@ -53,17 +53,17 @@ namespace KBibTeX bool EntryWidgetSource::containsValidText() { - BibTeX::Entry dummy( BibTeX::Entry::etArticle, "iaKWjDMVuB2vQDuYRK49Y85tyxa9" ); + BibTeX::Entry dummy( BibTeX::Entry::etArticle, "iaKWjDMVuB2vTQDuYRK49Y85tyxa9" ); apply( &dummy ); - return dummy.id().compare( "iaKWjDMVuB2vQDuYRK49Y85tyxa9" ) != 0; + return dummy.id().compare( "iaKWjDMVuB2vTQDuYRK49Y85tyxa9" ) != 0; } - QString EntryWidgetSource::text() + TQString EntryWidgetSource::text() { return m_textEditSource->text(); } - void EntryWidgetSource::setText( const QString& text ) + void EntryWidgetSource::setText( const TQString& text ) { m_textEditSource->setText( text ); } @@ -76,12 +76,12 @@ namespace KBibTeX void EntryWidgetSource::apply( BibTeX::Entry *entry ) { Settings * settings = Settings::self(); - QBuffer buffer; + TQBuffer buffer; BibTeX::FileImporterBibTeX importer( settings->editing_FirstNameFirst ); buffer.open( IO_WriteOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << m_textEditSource->text() << endl; buffer.close(); @@ -113,7 +113,7 @@ namespace KBibTeX Settings * settings = Settings::self(); - QBuffer buffer; + TQBuffer buffer; BibTeX::FileExporterBibTeX exporter; exporter.setEncoding( "latex" ); exporter.setStringDelimiter( settings->fileIO_BibtexStringOpenDelimiter, settings->fileIO_BibtexStringCloseDelimiter ); @@ -125,8 +125,8 @@ namespace KBibTeX buffer.close(); buffer.open( IO_ReadOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); m_textEditSource->setText( ts.read() ); buffer.close(); } @@ -136,18 +136,18 @@ namespace KBibTeX reset( m_entry ); } - void EntryWidgetSource::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, QListView * /*listViewWarnings*/ ) + void EntryWidgetSource::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, TQListView * /*listViewWarnings*/ ) { // nothing } void EntryWidgetSource::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 0, 5 ); gridLayout->setColStretch( 0, 5 ); - m_textEditSource = new QTextEdit( this ); + m_textEditSource = new TQTextEdit( this ); gridLayout->addMultiCellWidget( m_textEditSource, 0, 0, 0, 1 ); m_textEditSource->setFont( KGlobalSettings::fixedFont() ); m_textEditSource->setReadOnly( m_isReadOnly ); diff --git a/src/entrywidgetsource.h b/src/entrywidgetsource.h index 77b98e2..48a35bb 100644 --- a/src/entrywidgetsource.h +++ b/src/entrywidgetsource.h @@ -22,7 +22,7 @@ #include -class QTextEdit; +class TQTextEdit; namespace KBibTeX { @@ -34,23 +34,23 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetSource( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetSource( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetSource(); bool isModified(); bool containsValidText(); - QString text(); - void setText( const QString& text ); + TQString text(); + void setText( const TQString& text ); public slots: void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); void restore(); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private: - QTextEdit *m_textEditSource; + TQTextEdit *m_textEditSource; BibTeX::Entry *m_entry; void setupGUI(); diff --git a/src/entrywidgettab.cpp b/src/entrywidgettab.cpp index c4efc51..6d0ac07 100644 --- a/src/entrywidgettab.cpp +++ b/src/entrywidgettab.cpp @@ -28,8 +28,8 @@ namespace KBibTeX { BibTeX::Entry *EntryWidgetTab::m_crossRefEntry = NULL; - EntryWidgetTab::EntryWidgetTab(BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_isReadOnly( isReadOnly ), m_bibtexfile( bibtexfile ) + EntryWidgetTab::EntryWidgetTab(BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_isReadOnly( isReadOnly ), m_bibtexfile( bibtexfile ) { // nothing } @@ -59,24 +59,24 @@ namespace KBibTeX } } - void EntryWidgetTab::addMissingWarning( BibTeX::Entry::EntryType entryType, BibTeX::EntryField::FieldType fieldType, const QString& label, bool valid, QWidget *widget, QListView *listView ) + void EntryWidgetTab::addMissingWarning( BibTeX::Entry::EntryType entryType, BibTeX::EntryField::FieldType fieldType, const TQString& label, bool valid, TQWidget *widget, TQListView *listView ) { if ( BibTeX::Entry::getRequireStatus( entryType, fieldType ) == BibTeX::Entry::frsRequired && !valid ) - new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlWarning, QString( i18n( "The field '%1' is required, but missing" ) ).arg( label ), widget, listView, "warning" ); + new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlWarning, TQString( i18n( "The field '%1' is required, but missing" ) ).arg( label ), widget, listView, "warning" ); } - void EntryWidgetTab::addCrossRefInfo( const QString& label, QWidget *widget, QListView *listView ) + void EntryWidgetTab::addCrossRefInfo( const TQString& label, TQWidget *widget, TQListView *listView ) { - QString crossRefId = m_crossRefEntry != NULL ? m_crossRefEntry->id() : "???"; - new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlInformation, QString( i18n( "Using cross referenced entry '%1' for field '%2'" ) ).arg( crossRefId ).arg( label ), widget, listView, "information" ); + TQString crossRefId = m_crossRefEntry != NULL ? m_crossRefEntry->id() : "???"; + new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlInformation, TQString( i18n( "Using cross referenced entry '%1' for field '%2'" ) ).arg( crossRefId ).arg( label ), widget, listView, "information" ); } - void EntryWidgetTab::addFieldLineEditWarning( FieldLineEdit *fieldLineEdit, const QString& label, QListView *listView ) + void EntryWidgetTab::addFieldLineEditWarning( FieldLineEdit *fieldLineEdit, const TQString& label, TQListView *listView ) { switch ( fieldLineEdit->error() ) { case FieldLineEdit::etInvalidStringKey: - new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlError, QString( i18n( "The field '%1' contains string keys with invalid characters" ) ).arg( label ), fieldLineEdit, listView, "error" ); + new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlError, TQString( i18n( "The field '%1' contains string keys with invalid characters" ) ).arg( label ), fieldLineEdit, listView, "error" ); break; case FieldLineEdit::etNoError: { @@ -84,7 +84,7 @@ namespace KBibTeX } break; default: - new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlError, QString( i18n( "The field '%1' contains some unknown error" ) ).arg( label ), fieldLineEdit, listView, "error" ); + new EntryWidgetWarningsItem( EntryWidgetWarningsItem::wlError, TQString( i18n( "The field '%1' contains some unknown error" ) ).arg( label ), fieldLineEdit, listView, "error" ); } } } diff --git a/src/entrywidgettab.h b/src/entrywidgettab.h index 8e63252..1eace4f 100644 --- a/src/entrywidgettab.h +++ b/src/entrywidgettab.h @@ -20,22 +20,22 @@ #ifndef KBIBTEXENTRYWIDGETTAB_H #define KBIBTEXENTRYWIDGETTAB_H -#include +#include #include #include -class QListView; +class TQListView; namespace KBibTeX { class FieldLineEdit; - class EntryWidgetTab : public QWidget + class EntryWidgetTab : public TQWidget { Q_OBJECT public: - EntryWidgetTab( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetTab( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetTab(); virtual bool isModified() = 0; @@ -44,13 +44,13 @@ namespace KBibTeX virtual void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ) = 0; virtual void apply( BibTeX::Entry *entry ) = 0; virtual void reset( BibTeX::Entry *entry ) = 0; - virtual void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ) = 0; + virtual void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ) = 0; protected: void setValue( BibTeX::Entry *entry, const BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value ); - void addMissingWarning( BibTeX::Entry::EntryType entryType, BibTeX::EntryField::FieldType fieldType, const QString& label, bool valid, QWidget *widget, QListView *listView ); - void addCrossRefInfo( const QString& label, QWidget *widget, QListView *listView ); - void addFieldLineEditWarning( FieldLineEdit *fieldLineEdit, const QString& label, QListView *listView ); + void addMissingWarning( BibTeX::Entry::EntryType entryType, BibTeX::EntryField::FieldType fieldType, const TQString& label, bool valid, TQWidget *widget, TQListView *listView ); + void addCrossRefInfo( const TQString& label, TQWidget *widget, TQListView *listView ); + void addFieldLineEditWarning( FieldLineEdit *fieldLineEdit, const TQString& label, TQListView *listView ); bool m_isReadOnly; static BibTeX::Entry *m_crossRefEntry; diff --git a/src/entrywidgettitle.cpp b/src/entrywidgettitle.cpp index f72bb71..06164b2 100644 --- a/src/entrywidgettitle.cpp +++ b/src/entrywidgettitle.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ namespace KBibTeX { - EntryWidgetTitle::EntryWidgetTitle( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) + EntryWidgetTitle::EntryWidgetTitle( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) { setupGUI(); @@ -88,7 +88,7 @@ namespace KBibTeX m_fieldLineEditSeries->setValue( field != NULL ? field->value() : NULL ); } - void EntryWidgetTitle::updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ) + void EntryWidgetTitle::updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ) { bool crossRefValid = FALSE; @@ -110,22 +110,22 @@ namespace KBibTeX void EntryWidgetTitle::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 4, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 4, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 3, 1 ); - QLabel *label = new QLabel( QString( "%1:" ).arg( i18n( "Title" ) ), this ); + TQLabel *label = new TQLabel( TQString( "%1:" ).arg( i18n( "Title" ) ), this ); gridLayout->addWidget( label, 0, 0 ); m_fieldLineEditTitle = new KBibTeX::FieldLineEdit( i18n( "Title" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditTitle" ); label->setBuddy( m_fieldLineEditTitle ); gridLayout->addWidget( m_fieldLineEditTitle, 0, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Book Title" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Book Title" ) ), this ); gridLayout->addWidget( label, 1, 0 ); m_fieldLineEditBookTitle = new KBibTeX::FieldLineEdit( i18n( "Book Title" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditBookTitle" ); label->setBuddy( m_fieldLineEditBookTitle ); gridLayout->addWidget( m_fieldLineEditBookTitle, 1, 1 ); - label = new QLabel( QString( "%1:" ).arg( i18n( "Series" ) ), this ); + label = new TQLabel( TQString( "%1:" ).arg( i18n( "Series" ) ), this ); gridLayout->addWidget( label, 2, 0 ); m_fieldLineEditSeries = new KBibTeX::FieldLineEdit( i18n( "Series" ), KBibTeX::FieldLineEdit::itSingleLine, m_isReadOnly, this, "m_fieldLineEditSeries" ); label->setBuddy( m_fieldLineEditSeries ); diff --git a/src/entrywidgettitle.h b/src/entrywidgettitle.h index c43bb57..a26e2b1 100644 --- a/src/entrywidgettitle.h +++ b/src/entrywidgettitle.h @@ -30,7 +30,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetTitle( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetTitle( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetTitle(); bool isModified(); @@ -39,7 +39,7 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply( BibTeX::Entry *entry ); void reset( BibTeX::Entry *entry ); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private: friend class EntryWidget; diff --git a/src/entrywidgetuserdefined.cpp b/src/entrywidgetuserdefined.cpp index 6479f73..b231938 100644 --- a/src/entrywidgetuserdefined.cpp +++ b/src/entrywidgetuserdefined.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -31,7 +31,7 @@ namespace KBibTeX { - EntryWidgetUserDefined::EntryWidgetUserDefined( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) + EntryWidgetUserDefined::EntryWidgetUserDefined( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent, const char *name ) : EntryWidgetTab( bibtexfile, isReadOnly, parent, name ) { setupGUI(); } @@ -44,7 +44,7 @@ namespace KBibTeX bool EntryWidgetUserDefined::isModified() { bool result = FALSE; - for ( QValueList::iterator it = m_widgets.begin(); !FALSE && it != m_widgets.end(); ++it ) + for ( TQValueList::iterator it = m_widgets.begin(); !FALSE && it != m_widgets.end(); ++it ) result |= ( *it )->isModified(); return result; } @@ -97,7 +97,7 @@ namespace KBibTeX } } - void EntryWidgetUserDefined::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, QListView */*listViewWarnings*/ ) + void EntryWidgetUserDefined::updateWarnings( BibTeX::Entry::EntryType /*entryType*/, TQListView */*listViewWarnings*/ ) { // nothing } @@ -107,16 +107,16 @@ namespace KBibTeX Settings * settings = Settings::self(); int rows = settings->userDefinedInputFields.count() + 1; if ( rows < 2 ) rows = 2; - QGridLayout *gridLayout = new QGridLayout( this, rows, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); + TQGridLayout *gridLayout = new TQGridLayout( this, rows, 2, KDialog::marginHint(), KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( rows - 1, 1 ); if ( settings->userDefinedInputFields.count() > 0 ) for ( unsigned int i = 0; i < settings->userDefinedInputFields.count(); ++i ) { - QLabel *label = new QLabel( settings->userDefinedInputFields[i]->label, this ); + TQLabel *label = new TQLabel( settings->userDefinedInputFields[i]->label, this ); gridLayout->addWidget( label, i, 0 ); if ( settings->userDefinedInputFields[i]->inputType == FieldLineEdit::itMultiLine ) - label->setAlignment( Qt::AlignTop ); + label->setAlignment( TQt::AlignTop ); FieldLineEdit *widget = new FieldLineEdit( settings->userDefinedInputFields[i]->label, settings->userDefinedInputFields[i]->inputType, m_isReadOnly, this ); gridLayout->addWidget( widget, i, 1 ); @@ -129,13 +129,13 @@ namespace KBibTeX gridLayout->setColStretch( 0, 0 ); gridLayout->setColStretch( 1, 1 ); - QLabel *label = new QLabel( this ); + TQLabel *label = new TQLabel( this ); gridLayout->addWidget( label, 0, 0 ); label->setPixmap( BarIcon( "messagebox_info" ) ); - label->setAlignment( Qt::AlignVCenter | Qt::AlignLeft | Qt::WordBreak ); + label->setAlignment( TQt::AlignVCenter | TQt::AlignLeft | TQt::WordBreak ); - label = new QLabel( i18n( "Please use the settings dialog to add user-defined fields here." ), this ); - label->setAlignment( Qt::AlignVCenter | Qt::AlignLeft | Qt::WordBreak ); + label = new TQLabel( i18n( "Please use the settings dialog to add user-defined fields here." ), this ); + label->setAlignment( TQt::AlignVCenter | TQt::AlignLeft | TQt::WordBreak ); gridLayout->addWidget( label, 0, 1 ); } } diff --git a/src/entrywidgetuserdefined.h b/src/entrywidgetuserdefined.h index bc5e238..e7855d6 100644 --- a/src/entrywidgetuserdefined.h +++ b/src/entrywidgetuserdefined.h @@ -32,7 +32,7 @@ namespace KBibTeX { Q_OBJECT public: - EntryWidgetUserDefined( BibTeX::File *bibtexfile, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + EntryWidgetUserDefined( BibTeX::File *bibtexfile, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~EntryWidgetUserDefined(); bool isModified(); @@ -41,10 +41,10 @@ namespace KBibTeX void updateGUI( BibTeX::Entry::EntryType entryType, bool enableAll ); void apply(BibTeX::Entry *entry); void reset(BibTeX::Entry *entry); - void updateWarnings( BibTeX::Entry::EntryType entryType, QListView *listViewWarnings ); + void updateWarnings( BibTeX::Entry::EntryType entryType, TQListView *listViewWarnings ); private: - QValueList m_widgets; + TQValueList m_widgets; void setupGUI(); }; diff --git a/src/entrywidgetwarningsitem.cpp b/src/entrywidgetwarningsitem.cpp index 741d1a0..92346fc 100644 --- a/src/entrywidgetwarningsitem.cpp +++ b/src/entrywidgetwarningsitem.cpp @@ -25,8 +25,8 @@ namespace KBibTeX { - EntryWidgetWarningsItem::EntryWidgetWarningsItem( WarningLevel level, const QString &message, QWidget *widget, QListView *parent, const char* name ) - : QListViewItem( parent, name ), m_widget( widget ) + EntryWidgetWarningsItem::EntryWidgetWarningsItem( WarningLevel level, const TQString &message, TQWidget *widget, TQListView *parent, const char* name ) + : TQListViewItem( parent, name ), m_widget( widget ) { KIconLoader * loader = KGlobal::instance() ->iconLoader(); switch ( level ) @@ -54,7 +54,7 @@ namespace KBibTeX // nothing } - QWidget *EntryWidgetWarningsItem::widget() + TQWidget *EntryWidgetWarningsItem::widget() { return m_widget; } diff --git a/src/entrywidgetwarningsitem.h b/src/entrywidgetwarningsitem.h index 2aa2044..f65beec 100644 --- a/src/entrywidgetwarningsitem.h +++ b/src/entrywidgetwarningsitem.h @@ -20,25 +20,25 @@ #ifndef KBIBTEXENTRYWIDGETWARNINGSITEM_H #define KBIBTEXENTRYWIDGETWARNINGSITEM_H -#include +#include -class QString; +class TQString; namespace KBibTeX { - class EntryWidgetWarningsItem : public QListViewItem + class EntryWidgetWarningsItem : public TQListViewItem { public: enum WarningLevel {wlInformation = 1, wlWarning = 2, wlError = 3}; - EntryWidgetWarningsItem( WarningLevel level, const QString &message, QWidget *widget, QListView *parent, const char* name = NULL ); + EntryWidgetWarningsItem( WarningLevel level, const TQString &message, TQWidget *widget, TQListView *parent, const char* name = NULL ); ~EntryWidgetWarningsItem(); - QWidget *widget(); + TQWidget *widget(); private: - QWidget *m_widget; + TQWidget *m_widget; }; } diff --git a/src/fieldlineedit.cpp b/src/fieldlineedit.cpp index ba36fe7..03296ca 100644 --- a/src/fieldlineedit.cpp +++ b/src/fieldlineedit.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -37,8 +37,8 @@ namespace KBibTeX { - FieldLineEdit::FieldLineEdit( const QString& caption, InputType inputType, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_value( new BibTeX::Value() ), m_caption( caption ), m_lineEdit( NULL ), m_textEdit( NULL ), m_isReadOnly( isReadOnly ), m_enabled( TRUE ), m_inputType( inputType ), m_isModified( FALSE ), m_fieldType( BibTeX::EntryField::ftUnknown ), m_completion( NULL ) + FieldLineEdit::FieldLineEdit( const TQString& caption, InputType inputType, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_value( new BibTeX::Value() ), m_caption( caption ), m_lineEdit( NULL ), m_textEdit( NULL ), m_isReadOnly( isReadOnly ), m_enabled( TRUE ), m_inputType( inputType ), m_isModified( FALSE ), m_fieldType( BibTeX::EntryField::ftUnknown ), m_completion( NULL ) { setupGUI( name ); } @@ -88,18 +88,18 @@ namespace KBibTeX m_lineEdit->setCompletionObject( m_completion ); else m_lineEdit->setCompletionObject( settings->completionMacro ); - QToolTip::add( m_lineEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); - QWhatsThis::add( m_lineEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); + TQToolTip::add( m_lineEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); + TQWhatsThis::add( m_lineEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); } else if ( m_textEdit != NULL ) { - QToolTip::add( m_textEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); - QWhatsThis::add( m_textEdit, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); + TQToolTip::add( m_textEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); + TQWhatsThis::add( m_textEdit, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); } } - QString FieldLineEdit::caption() + TQString FieldLineEdit::caption() { return m_caption; } @@ -117,7 +117,7 @@ namespace KBibTeX FieldLineEdit::ErrorType FieldLineEdit::error() { ErrorType result = etNoError; - for ( QValueList::ConstIterator it = m_value->items.begin(); result == etNoError && it != m_value->items.end(); ++it ) + for ( TQValueList::ConstIterator it = m_value->items.begin(); result == etNoError && it != m_value->items.end(); ++it ) { BibTeX::MacroKey *macroKey = dynamic_cast( *it ); result = ( macroKey != NULL && !macroKey->isValid() ) ? etInvalidStringKey : etNoError; @@ -128,7 +128,7 @@ namespace KBibTeX void FieldLineEdit::slotTextChanged( ) { - QString text; + TQString text; switch ( m_inputType ) { case itSingleLine: @@ -161,7 +161,7 @@ namespace KBibTeX { if ( m_value->items.count() == 1 ) { - QString text = m_value->items.first()->text(); + TQString text = m_value->items.first()->text(); if ( m_pushButtonString->isOn() ) { BibTeX::PlainText *plainText = dynamic_cast( m_value->items.first() ); @@ -200,7 +200,7 @@ namespace KBibTeX void FieldLineEdit::slotComplexClicked() { - if ( ValueWidget::execute( m_caption, m_fieldType, m_value, m_isReadOnly, this ) == QDialog::Accepted ) + if ( ValueWidget::execute( m_caption, m_fieldType, m_value, m_isReadOnly, this ) == TQDialog::Accepted ) { updateGUI(); emit textChanged(); @@ -221,11 +221,11 @@ namespace KBibTeX strcpy( subname, name ); strcat( subname, "_pbstring" ); } - m_pushButtonString = new QPushButton( this, subname ); - m_pushButtonString->setIconSet( QIconSet( SmallIcon( "flag" ) ) ); - m_pushButtonString->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + m_pushButtonString = new TQPushButton( this, subname ); + m_pushButtonString->setIconSet( TQIconSet( SmallIcon( "flag" ) ) ); + m_pushButtonString->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); m_pushButtonString->setToggleButton( TRUE ); - QToolTip::add( m_pushButtonString, QString( i18n( "Set '%1' to be a string key" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonString, TQString( i18n( "Set '%1' to be a string key" ) ).arg( m_caption ) ); m_pushButtonString->setEnabled( !m_isReadOnly ); connect( m_pushButtonString, SIGNAL( clicked() ), this, SLOT( slotStringToggled() ) ); @@ -234,18 +234,18 @@ namespace KBibTeX strcpy( subname, name ); strcat( subname, "_pbcomplex" ); } - m_pushButtonComplex = new QPushButton( this, subname ); - m_pushButtonComplex->setIconSet( QIconSet( SmallIcon( "leftjust" ) ) ); - m_pushButtonComplex->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); - QToolTip::add( m_pushButtonComplex, QString( i18n( "Edit '%1' as a concatenated value" ) ).arg( m_caption ) ); + m_pushButtonComplex = new TQPushButton( this, subname ); + m_pushButtonComplex->setIconSet( TQIconSet( SmallIcon( "leftjust" ) ) ); + m_pushButtonComplex->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); + TQToolTip::add( m_pushButtonComplex, TQString( i18n( "Edit '%1' as a concatenated value" ) ).arg( m_caption ) ); connect( m_pushButtonComplex, SIGNAL( clicked() ), this, SLOT( slotComplexClicked() ) ); - QGridLayout * layout = NULL; + TQGridLayout * layout = NULL; switch ( m_inputType ) { case itSingleLine: { - layout = new QGridLayout( this, 2, 3, 0, KDialog::spacingHint() ); + layout = new TQGridLayout( this, 2, 3, 0, KDialog::spacingHint() ); if ( subname != NULL ) { strcpy( subname, name ); @@ -259,19 +259,19 @@ namespace KBibTeX setFocusProxy( m_lineEdit ); layout->addWidget( m_pushButtonString, 0, 1 ); layout->addWidget( m_pushButtonComplex, 0, 2 ); - QWidget::setTabOrder( m_lineEdit, m_pushButtonString ); + TQWidget::setTabOrder( m_lineEdit, m_pushButtonString ); } break; case itMultiLine: { - layout = new QGridLayout( this, 3, 2, 0, KDialog::spacingHint() ); + layout = new TQGridLayout( this, 3, 2, 0, KDialog::spacingHint() ); layout->setRowStretch( 2, 1 ); if ( subname != NULL ) { strcpy( subname, name ); strcat( subname, "_textedit" ); } - m_textEdit = new QTextEdit( this, subname ); + m_textEdit = new TQTextEdit( this, subname ); m_textEdit->setReadOnly( m_isReadOnly ); if ( settings->editing_UseSpecialFont ) m_textEdit->setFont( settings->editing_SpecialFont ); @@ -279,12 +279,12 @@ namespace KBibTeX setFocusProxy( m_textEdit ); layout->addWidget( m_pushButtonString, 0, 1 ); layout->addWidget( m_pushButtonComplex, 1, 1 ); - QWidget::setTabOrder( m_textEdit, m_pushButtonString ); + TQWidget::setTabOrder( m_textEdit, m_pushButtonString ); } break; } - QWidget::setTabOrder( m_pushButtonString, m_pushButtonComplex ); + TQWidget::setTabOrder( m_pushButtonString, m_pushButtonComplex ); layout->setRowStretch( layout->numRows() - 1, 1 ); if ( subname != NULL ) @@ -308,11 +308,11 @@ namespace KBibTeX switch ( m_inputType ) { case itSingleLine: - if ( QString::compare( m_lineEdit->text(), item->text() ) != 0 ) + if ( TQString::compare( m_lineEdit->text(), item->text() ) != 0 ) m_lineEdit->setText( item->text() ); break; case itMultiLine: - if ( QString::compare( m_textEdit->text(), item->text() ) != 0 ) + if ( TQString::compare( m_textEdit->text(), item->text() ) != 0 ) m_textEdit->setText( item->text() ); break; } @@ -353,9 +353,9 @@ namespace KBibTeX { case itSingleLine: if ( enabled ) - connect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( ) ) ); + connect( m_lineEdit, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( ) ) ); else - disconnect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( ) ) ); + disconnect( m_lineEdit, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( ) ) ); break; case itMultiLine: if ( enabled ) diff --git a/src/fieldlineedit.h b/src/fieldlineedit.h index e17dde1..ebff73f 100644 --- a/src/fieldlineedit.h +++ b/src/fieldlineedit.h @@ -20,26 +20,26 @@ #ifndef KBIBTEXFIELDLINEEDIT_H #define KBIBTEXFIELDLINEEDIT_H -#include +#include #include #include class KLineEdit; -class QTextEdit; -class QPushButton; +class TQTextEdit; +class TQPushButton; class KCompletion; namespace KBibTeX { - class FieldLineEdit : public QWidget + class FieldLineEdit : public TQWidget { Q_OBJECT public: enum InputType {itSingleLine, itMultiLine}; enum ErrorType {etNoError, etInvalidStringKey}; - FieldLineEdit( const QString& caption, InputType inputType = itSingleLine, bool readOnly = FALSE, QWidget *parent = 0, const char *name = 0 ); + FieldLineEdit( const TQString& caption, InputType inputType = itSingleLine, bool readOnly = FALSE, TQWidget *parent = 0, const char *name = 0 ); ~FieldLineEdit(); /** @@ -64,7 +64,7 @@ namespace KBibTeX void setFieldType( BibTeX::EntryField::FieldType fieldType ); - QString caption(); + TQString caption(); bool isEmpty(); @@ -85,11 +85,11 @@ namespace KBibTeX private: BibTeX::Value *m_value; - QString m_caption; + TQString m_caption; KLineEdit *m_lineEdit; - QTextEdit *m_textEdit; - QPushButton *m_pushButtonString; - QPushButton *m_pushButtonComplex; + TQTextEdit *m_textEdit; + TQPushButton *m_pushButtonString; + TQPushButton *m_pushButtonComplex; bool m_isReadOnly; bool m_enabled; InputType m_inputType; diff --git a/src/fieldlistview.cpp b/src/fieldlistview.cpp index 62ba8a6..edb21a4 100644 --- a/src/fieldlistview.cpp +++ b/src/fieldlistview.cpp @@ -17,15 +17,15 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -42,8 +42,8 @@ namespace KBibTeX { - FieldListView::FieldListView( const QString& caption, const QString& prefixNew, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_value( new BibTeX::Value() ), m_caption( caption ), m_prefixNew( prefixNew ), m_isReadOnly( isReadOnly ), m_enabled( TRUE ), m_isComplex( FALSE ), m_isModified( FALSE ), m_newValueCounter( 0 ), m_fieldType( BibTeX::EntryField::ftUnknown ) + FieldListView::FieldListView( const TQString& caption, const TQString& prefixNew, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_value( new BibTeX::Value() ), m_caption( caption ), m_prefixNew( prefixNew ), m_isReadOnly( isReadOnly ), m_enabled( TRUE ), m_isComplex( FALSE ), m_isModified( FALSE ), m_newValueCounter( 0 ), m_fieldType( BibTeX::EntryField::ftUnknown ) { setupGUI(); m_listViewElements->installEventFilter( this ); @@ -97,13 +97,13 @@ namespace KBibTeX Settings * settings = Settings::self(); m_listViewElements->renameLineEdit() ->setCompletionObject( settings->completion( m_fieldType ) ); - QToolTip::add( m_listViewElements, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); - QWhatsThis::add( m_listViewElements, QString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); + TQToolTip::add( m_listViewElements, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); + TQWhatsThis::add( m_listViewElements, TQString( i18n( "BibTeX field '%1'" ) ).arg( BibTeX::EntryField::fieldTypeToString( fieldType ) ) ); m_value->items.clear(); } - QString FieldListView::caption() + TQString FieldListView::caption() { return m_caption; } @@ -118,16 +118,16 @@ namespace KBibTeX return m_isModified; } - bool FieldListView::eventFilter( QObject *o, QEvent * e ) + bool FieldListView::eventFilter( TQObject *o, TQEvent * e ) { if ( o == m_listViewElements->renameLineEdit() ) { - if ( e->type() == QEvent::Hide ) + if ( e->type() == TQEvent::Hide ) itemRenameDone(); } - else if ( e->type() == QEvent::AccelOverride ) + else if ( e->type() == TQEvent::AccelOverride ) { - QKeyEvent * ke = static_cast( e ); + TQKeyEvent * ke = static_cast( e ); //override delete action if ( ke->key() == Key_Delete && ke->state() == NoButton ) { @@ -201,10 +201,10 @@ namespace KBibTeX { if ( isSimple() ) { - KListViewItem * item = new KListViewItem( m_listViewElements, m_listViewElements->lastItem(), QString( "%1%2" ).arg( m_prefixNew ).arg( ++m_newValueCounter ) ); + KListViewItem * item = new KListViewItem( m_listViewElements, m_listViewElements->lastItem(), TQString( "%1%2" ).arg( m_prefixNew ).arg( ++m_newValueCounter ) ); m_listViewElements->setSelected( item, TRUE ); updateGUI(); - QTimer::singleShot( 100, this, SLOT( slotEdit() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEdit() ) ); } } @@ -220,7 +220,7 @@ namespace KBibTeX void FieldListView::slotDelete() { - QListViewItem * item = m_listViewElements->selectedItem(); + TQListViewItem * item = m_listViewElements->selectedItem(); if ( isSimple() && item != NULL ) { delete item; @@ -233,7 +233,7 @@ namespace KBibTeX void FieldListView::slotUp() { - QListViewItem * item = m_listViewElements->selectedItem(); + TQListViewItem * item = m_listViewElements->selectedItem(); if ( isSimple() && !m_listViewElements->isRenaming() && item != NULL && item -> itemAbove() != NULL ) { item->itemAbove() ->moveItem( item ); @@ -246,7 +246,7 @@ namespace KBibTeX void FieldListView::slotDown() { - QListViewItem * item = m_listViewElements->selectedItem(); + TQListViewItem * item = m_listViewElements->selectedItem(); if ( isSimple() && !m_listViewElements->isRenaming() && item != NULL && item -> itemBelow() != NULL ) { item->moveItem( item->itemBelow() ); @@ -259,7 +259,7 @@ namespace KBibTeX void FieldListView::slotComplex() { - if ( !m_listViewElements->isRenaming() && ValueWidget::execute( m_caption, m_fieldType, m_value, m_isReadOnly, this ) == QDialog::Accepted ) + if ( !m_listViewElements->isRenaming() && ValueWidget::execute( m_caption, m_fieldType, m_value, m_isReadOnly, this ) == TQDialog::Accepted ) { reset(); updateGUI(); @@ -268,13 +268,13 @@ namespace KBibTeX } } - void FieldListView::slotListViewDoubleClicked( QListViewItem * lvi ) + void FieldListView::slotListViewDoubleClicked( TQListViewItem * lvi ) { if ( lvi == NULL ) slotAdd(); } - void FieldListView::slotItemRenamed( QListViewItem * item, int /*col*/, const QString & text ) + void FieldListView::slotItemRenamed( TQListViewItem * item, int /*col*/, const TQString & text ) { if ( text.isEmpty() && isSimple() && item != NULL ) { @@ -290,7 +290,7 @@ namespace KBibTeX { Settings * settings = Settings::self(); - QGridLayout * layout = new QGridLayout( this, 8, 2, 0, KDialog::spacingHint() ); + TQGridLayout * layout = new TQGridLayout( this, 8, 2, 0, KDialog::spacingHint() ); layout->setRowStretch( 5, 1 ); m_listViewElements = new KListView( this ); @@ -298,7 +298,7 @@ namespace KBibTeX m_listViewElements->renameLineEdit() ->setCompletionObject( settings->completion( m_fieldType ) ); m_listViewElements->renameLineEdit() ->setCompletionMode( KGlobalSettings::CompletionPopup ); m_listViewElements->renameLineEdit() ->completionObject() ->setIgnoreCase( true ); - m_listViewElements->setDefaultRenameAction( QListView::Accept ); + m_listViewElements->setDefaultRenameAction( TQListView::Accept ); m_listViewElements->addColumn( m_caption ); m_listViewElements->setSorting( -1, TRUE ); m_listViewElements->setItemsRenameable( TRUE ); @@ -309,62 +309,62 @@ namespace KBibTeX m_listViewElements->header() ->setClickEnabled( FALSE ); m_listViewElements->header() ->setStretchEnabled( TRUE, 0 ); connect( m_listViewElements, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listViewElements, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listViewElements, SIGNAL( doubleClicked( QListViewItem * ) ), this, SLOT( slotListViewDoubleClicked( QListViewItem * ) ) ); - connect( m_listViewElements, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listViewElements, SIGNAL( itemRenamed( QListViewItem*, int, const QString& ) ), this, SLOT( slotItemRenamed( QListViewItem*, int, const QString& ) ) ); + connect( m_listViewElements, SIGNAL( clicked( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listViewElements, SIGNAL( doubleClicked( TQListViewItem * ) ), this, SLOT( slotListViewDoubleClicked( TQListViewItem * ) ) ); + connect( m_listViewElements, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listViewElements, SIGNAL( itemRenamed( TQListViewItem*, int, const TQString& ) ), this, SLOT( slotItemRenamed( TQListViewItem*, int, const TQString& ) ) ); - m_pushButtonAdd = new QPushButton( i18n( "Add" ), this ); + m_pushButtonAdd = new TQPushButton( i18n( "Add" ), this ); layout->addWidget( m_pushButtonAdd, 0, 1 ); - m_pushButtonAdd->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_pushButtonAdd->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); connect( m_pushButtonAdd, SIGNAL( clicked() ), this, SLOT( slotAdd() ) ); - QToolTip::add( m_pushButtonAdd, QString( i18n( "Add new '%1' item (Ctrl+A)" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonAdd, TQString( i18n( "Add new '%1' item (Ctrl+A)" ) ).arg( m_caption ) ); - m_pushButtonEdit = new QPushButton( i18n( "Edit" ), this ); + m_pushButtonEdit = new TQPushButton( i18n( "Edit" ), this ); layout->addWidget( m_pushButtonEdit, 1, 1 ); - m_pushButtonEdit->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_pushButtonEdit->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); connect( m_pushButtonEdit, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); - QToolTip::add( m_pushButtonEdit, QString( i18n( "Edit current '%1' item (F2)" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonEdit, TQString( i18n( "Edit current '%1' item (F2)" ) ).arg( m_caption ) ); - m_pushButtonDelete = new QPushButton( i18n( "Delete" ), this ); + m_pushButtonDelete = new TQPushButton( i18n( "Delete" ), this ); layout->addWidget( m_pushButtonDelete, 2, 1 ); - m_pushButtonDelete->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_pushButtonDelete->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); connect( m_pushButtonDelete, SIGNAL( clicked() ), this, SLOT( slotDelete() ) ); - QToolTip::add( m_pushButtonDelete, QString( i18n( "Delete current '%1' item (Del)" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonDelete, TQString( i18n( "Delete current '%1' item (Del)" ) ).arg( m_caption ) ); - m_pushButtonUp = new QPushButton( i18n( "Up" ), this ); + m_pushButtonUp = new TQPushButton( i18n( "Up" ), this ); layout->addWidget( m_pushButtonUp, 3, 1 ); - m_pushButtonUp->setIconSet( QIconSet( SmallIcon( "up" ) ) ); + m_pushButtonUp->setIconSet( TQIconSet( SmallIcon( "up" ) ) ); connect( m_pushButtonUp, SIGNAL( clicked() ), this, SLOT( slotUp() ) ); - QToolTip::add( m_pushButtonUp, QString( i18n( "Move current '%1' item up (Ctrl+Up)" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonUp, TQString( i18n( "Move current '%1' item up (Ctrl+Up)" ) ).arg( m_caption ) ); - m_pushButtonDown = new QPushButton( i18n( "Down" ), this ); + m_pushButtonDown = new TQPushButton( i18n( "Down" ), this ); layout->addWidget( m_pushButtonDown, 4, 1 ); - m_pushButtonDown->setIconSet( QIconSet( SmallIcon( "down" ) ) ); + m_pushButtonDown->setIconSet( TQIconSet( SmallIcon( "down" ) ) ); connect( m_pushButtonDown, SIGNAL( clicked() ), this, SLOT( slotDown() ) ); - QToolTip::add( m_pushButtonDown, QString( i18n( "Move current '%1' item down (Ctrl+Down)" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonDown, TQString( i18n( "Move current '%1' item down (Ctrl+Down)" ) ).arg( m_caption ) ); - m_pushButtonComplexEdit = new QPushButton( i18n( "Complex..." ), this ); + m_pushButtonComplexEdit = new TQPushButton( i18n( "Complex..." ), this ); layout->addWidget( m_pushButtonComplexEdit, 6, 1 ); - m_pushButtonComplexEdit->setIconSet( QIconSet( SmallIcon( "leftjust" ) ) ); + m_pushButtonComplexEdit->setIconSet( TQIconSet( SmallIcon( "leftjust" ) ) ); connect( m_pushButtonComplexEdit, SIGNAL( clicked() ), this, SLOT( slotComplex() ) ); - QToolTip::add( m_pushButtonComplexEdit, QString( i18n( "Edit current '%1' item as a concatenated string (Ctrl+Alt+C)" ) ).arg( m_caption ) ); + TQToolTip::add( m_pushButtonComplexEdit, TQString( i18n( "Edit current '%1' item as a concatenated string (Ctrl+Alt+C)" ) ).arg( m_caption ) ); - m_checkBoxEtAl = new QCheckBox( i18n( "... and others (et al.)" ), this ); + m_checkBoxEtAl = new TQCheckBox( i18n( "... and others (et al.)" ), this ); layout->addMultiCellWidget( m_checkBoxEtAl, 7, 7, 0, 1 ); connect( m_checkBoxEtAl, SIGNAL( toggled( bool ) ), this, SLOT( apply() ) ); } void FieldListView::apply() { - QStringList elements; + TQStringList elements; Settings * settings = Settings::self(); m_value->items.clear(); - for ( QListViewItemIterator it( m_listViewElements ); it.current(); it++ ) + for ( TQListViewItemIterator it( m_listViewElements ); it.current(); it++ ) { - QString text = it.current() ->text( 0 ); + TQString text = it.current() ->text( 0 ); elements.append( text ); } @@ -378,7 +378,7 @@ namespace KBibTeX case BibTeX::EntryField::ftAuthor: case BibTeX::EntryField::ftEditor: { - for ( QStringList::ConstIterator it = elements.constBegin(); it != elements.constEnd(); ++it ) + for ( TQStringList::ConstIterator it = elements.constBegin(); it != elements.constEnd(); ++it ) { BibTeX::Person *person = new BibTeX::Person( *it, settings->editing_FirstNameFirst ); container->persons.append( person ); @@ -408,7 +408,7 @@ namespace KBibTeX m_checkBoxEtAl->setChecked( FALSE ); m_isComplex = FALSE; - for ( QValueList::ConstIterator it = m_value->items.constBegin(); !m_isComplex && it != m_value->items.constEnd(); ++it ) + for ( TQValueList::ConstIterator it = m_value->items.constBegin(); !m_isComplex && it != m_value->items.constEnd(); ++it ) { BibTeX::MacroKey *macroKey = dynamic_cast( *it ); m_isComplex = macroKey != NULL; @@ -420,17 +420,17 @@ namespace KBibTeX case BibTeX::EntryField::ftAuthor: case BibTeX::EntryField::ftEditor: { - for ( QValueList::ConstIterator it = m_value->items.constBegin(); it != m_value->items.constEnd(); ++it ) + for ( TQValueList::ConstIterator it = m_value->items.constBegin(); it != m_value->items.constEnd(); ++it ) { BibTeX::PersonContainer *container = dynamic_cast( *it ); if ( container != NULL ) - for ( QValueList::ConstIterator pit = container->persons.constBegin(); pit != container->persons.constEnd(); ++pit ) + for ( TQValueList::ConstIterator pit = container->persons.constBegin(); pit != container->persons.constEnd(); ++pit ) { - QString text = ( *pit )->text(); + TQString text = ( *pit )->text(); if ( text == "others" ) m_checkBoxEtAl->setChecked( TRUE ); else - new QListViewItem( m_listViewElements, m_listViewElements->lastItem(), text ); + new TQListViewItem( m_listViewElements, m_listViewElements->lastItem(), text ); } } } diff --git a/src/fieldlistview.h b/src/fieldlistview.h index f8a3baa..9cfed77 100644 --- a/src/fieldlistview.h +++ b/src/fieldlistview.h @@ -20,16 +20,16 @@ #ifndef KBIBTEXFIELDLISTVIEW_H #define KBIBTEXFIELDLISTVIEW_H -#include +#include #include #include -class QString; +class TQString; class KListView; -class QListViewItem; -class QPushButton; -class QCheckBox; +class TQListViewItem; +class TQPushButton; +class TQCheckBox; namespace KBibTeX { @@ -37,11 +37,11 @@ namespace KBibTeX /** @author Thomas Fischer */ - class FieldListView : public QWidget + class FieldListView : public TQWidget { Q_OBJECT public: - FieldListView( const QString& caption, const QString& prefixNew, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + FieldListView( const TQString& caption, const TQString& prefixNew, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~FieldListView(); void setValue( const BibTeX::Value *value ); @@ -51,13 +51,13 @@ namespace KBibTeX void setFieldType( BibTeX::EntryField::FieldType fieldType ); - QString caption(); + TQString caption(); bool isEmpty(); bool isModified(); - virtual bool eventFilter( QObject *o, QEvent * e ); + virtual bool eventFilter( TQObject *o, TQEvent * e ); private slots: void updateGUI(); @@ -67,14 +67,14 @@ namespace KBibTeX void slotUp(); void slotDown(); void slotComplex(); - void slotListViewDoubleClicked( QListViewItem * ); - void slotItemRenamed( QListViewItem * item, int col, const QString & text ); + void slotListViewDoubleClicked( TQListViewItem * ); + void slotItemRenamed( TQListViewItem * item, int col, const TQString & text ); void apply(); private: BibTeX::Value *m_value; - QString m_caption; - QString m_prefixNew; + TQString m_caption; + TQString m_prefixNew; bool m_isReadOnly; bool m_enabled; bool m_isComplex; @@ -82,13 +82,13 @@ namespace KBibTeX int m_newValueCounter; BibTeX::EntryField::FieldType m_fieldType; KListView *m_listViewElements; - QPushButton *m_pushButtonAdd; - QPushButton *m_pushButtonEdit; - QPushButton *m_pushButtonDelete; - QPushButton *m_pushButtonUp; - QPushButton *m_pushButtonDown; - QPushButton *m_pushButtonComplexEdit; - QCheckBox *m_checkBoxEtAl; + TQPushButton *m_pushButtonAdd; + TQPushButton *m_pushButtonEdit; + TQPushButton *m_pushButtonDelete; + TQPushButton *m_pushButtonUp; + TQPushButton *m_pushButtonDown; + TQPushButton *m_pushButtonComplexEdit; + TQCheckBox *m_checkBoxEtAl; void setupGUI(); void reset(); diff --git a/src/file.cpp b/src/file.cpp index 8b6106e..c02ae79 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -34,7 +34,7 @@ namespace BibTeX { - File::File( ) : QObject( ), fileName( QString::null ) + File::File( ) : TQObject( ), fileName( TQString::null ) { // nothing } @@ -88,7 +88,7 @@ namespace BibTeX } if ( !found ) - qDebug( "BibTeX::File got told to delete an element which is not in this file." ); + tqDebug( "BibTeX::File got told to delete an element which is not in this file." ); } Element* File::cloneElement( Element *element ) @@ -112,7 +112,7 @@ namespace BibTeX } } - Element *File::containsKey( const QString &key ) + Element *File::containsKey( const TQString &key ) { for ( ElementList::iterator it = elements.begin(); it != elements.end(); it++ ) { @@ -136,7 +136,7 @@ namespace BibTeX return NULL; } - const Element *File::containsKeyConst( const QString &key ) const + const Element *File::containsKeyConst( const TQString &key ) const { for ( ElementList::const_iterator it = elements.begin(); it != elements.end(); it++ ) { @@ -160,9 +160,9 @@ namespace BibTeX return NULL; } - QStringList File::allKeys() + TQStringList File::allKeys() { - QStringList result; + TQStringList result; for ( ElementList::iterator it = elements.begin(); it != elements.end(); it++ ) { @@ -180,9 +180,9 @@ namespace BibTeX return result; } - QString File::text() + TQString File::text() { - QString result; + TQString result; for ( ElementList::iterator it = elements.begin(); it != elements.end(); it++ ) { @@ -213,17 +213,17 @@ namespace BibTeX return elements.constEnd(); } - QStringList File::getAllValuesAsStringList( const EntryField::FieldType fieldType ) const + TQStringList File::getAllValuesAsStringList( const EntryField::FieldType fieldType ) const { - QStringList result; + TQStringList result; for ( ElementList::ConstIterator eit = elements.constBegin(); eit != elements.constEnd(); ++eit ) { Entry* entry = dynamic_cast( *eit ); EntryField * field = NULL; if ( entry != NULL && ( field = entry->getField( fieldType ) ) != NULL ) { - QValueList valueItems = field->value()->items; - for ( QValueList::ConstIterator vit = valueItems.begin(); vit != valueItems.end(); ++vit ) + TQValueList valueItems = field->value()->items; + for ( TQValueList::ConstIterator vit = valueItems.begin(); vit != valueItems.end(); ++vit ) { switch ( fieldType ) { @@ -231,9 +231,9 @@ namespace BibTeX { KeywordContainer *container = dynamic_cast( *vit ); if ( container != NULL ) - for ( QValueList::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd(); ++kit ) + for ( TQValueList::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd(); ++kit ) { - QString text = ( *kit )->text(); + TQString text = ( *kit )->text(); if ( !result.contains( text ) ) result.append( text ); } @@ -244,9 +244,9 @@ namespace BibTeX { PersonContainer *container = dynamic_cast( *vit ); if ( container != NULL ) - for ( QValueList::ConstIterator pit = container->persons.constBegin(); pit != container->persons.constEnd(); ++pit ) + for ( TQValueList::ConstIterator pit = container->persons.constBegin(); pit != container->persons.constEnd(); ++pit ) { - QString text = ( *pit )->text(); + TQString text = ( *pit )->text(); if ( !result.contains( text ) ) result.append( text ); } @@ -254,7 +254,7 @@ namespace BibTeX break; default: { - QString text = ( *vit )->text(); + TQString text = ( *vit )->text(); if ( !result.contains( text ) ) result.append( text ); } @@ -267,17 +267,17 @@ namespace BibTeX return result; } - QMap File::getAllValuesAsStringListWithCount( const EntryField::FieldType fieldType ) const + TQMap File::getAllValuesAsStringListWithCount( const EntryField::FieldType fieldType ) const { - QMap result; + TQMap result; for ( ElementList::ConstIterator eit = elements.begin(); eit != elements.end(); ++eit ) { Entry* entry = dynamic_cast( *eit ); EntryField * field = NULL; if ( entry != NULL && ( field = entry->getField( fieldType ) ) != NULL ) { - QValueList valueItems = field->value()->items; - for ( QValueList::ConstIterator vit = valueItems.begin(); vit != valueItems.end(); ++vit ) + TQValueList valueItems = field->value()->items; + for ( TQValueList::ConstIterator vit = valueItems.begin(); vit != valueItems.end(); ++vit ) { switch ( fieldType ) { @@ -285,9 +285,9 @@ namespace BibTeX { KeywordContainer *container = dynamic_cast( *vit ); if ( container != NULL ) - for ( QValueList::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd(); ++kit ) + for ( TQValueList::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd(); ++kit ) { - QString text = ( *kit )->text(); + TQString text = ( *kit )->text(); if ( !result.contains( text ) ) result[text] = 1; else @@ -300,9 +300,9 @@ namespace BibTeX { PersonContainer *container = dynamic_cast( *vit ); if ( container != NULL ) - for ( QValueList::ConstIterator pit = container->persons.constBegin(); pit != container->persons.constEnd(); ++pit ) + for ( TQValueList::ConstIterator pit = container->persons.constBegin(); pit != container->persons.constEnd(); ++pit ) { - QString text = ( *pit )->text(); + TQString text = ( *pit )->text(); if ( !result.contains( text ) ) result[text] = 1; else @@ -312,7 +312,7 @@ namespace BibTeX break; default: { - QString text = ( *vit )->text(); + TQString text = ( *vit )->text(); if ( !result.contains( text ) ) result[text] = 1; else @@ -326,9 +326,9 @@ namespace BibTeX return result; } - void File::replaceValue( const QString& oldText, const QString& newText, const EntryField::FieldType fieldType ) + void File::replaceValue( const TQString& oldText, const TQString& newText, const EntryField::FieldType fieldType ) { - qDebug( "Renaming all occurrences of '%s' to '%s' for fields of type '%s'", oldText.latin1(), newText.latin1(), EntryField::fieldTypeToString( fieldType ).latin1() ); + tqDebug( "Renaming all occurrences of '%s' to '%s' for fields of type '%s'", oldText.latin1(), newText.latin1(), EntryField::fieldTypeToString( fieldType ).latin1() ); for ( ElementList::ConstIterator it = elements.begin(); it != elements.end(); it++ ) { diff --git a/src/file.h b/src/file.h index fcb797a..37c942b 100644 --- a/src/file.h +++ b/src/file.h @@ -20,18 +20,18 @@ #ifndef BIBTEXFILE_H #define BIBTEXFILE_H -#include -#include +#include +#include #include -class QDir; -class QString; -class QChar; -class QStringList; -class QWaitCondition; -class QProcess; -class QIODevice; +class TQDir; +class TQString; +class TQChar; +class TQStringList; +class TQWaitCondition; +class TQProcess; +class TQIODevice; namespace BibTeX { @@ -40,17 +40,17 @@ namespace BibTeX class String; class FileExporter; - static const QString Months[] = + static const TQString Months[] = { - QString( "January" ), QString( "February" ), QString( "March" ), QString( "April" ), QString( "May" ), QString( "June" ), QString( "July" ), QString( "August" ), QString( "September" ), QString( "October" ), QString( "November" ), QString( "December" ) + TQString( "January" ), TQString( "February" ), TQString( "March" ), TQString( "April" ), TQString( "May" ), TQString( "June" ), TQString( "July" ), TQString( "August" ), TQString( "September" ), TQString( "October" ), TQString( "November" ), TQString( "December" ) }; - static const QString MonthsTriple[] = + static const TQString MonthsTriple[] = { - QString( "jan" ), QString( "feb" ), QString( "mar" ), QString( "apr" ), QString( "may" ), QString( "jun" ), QString( "jul" ), QString( "aug" ), QString( "sep" ), QString( "oct" ), QString( "nov" ), QString( "dec" ) + TQString( "jan" ), TQString( "feb" ), TQString( "mar" ), TQString( "apr" ), TQString( "may" ), TQString( "jun" ), TQString( "jul" ), TQString( "aug" ), TQString( "sep" ), TQString( "oct" ), TQString( "nov" ), TQString( "dec" ) }; - class File : public QObject + class File : public TQObject { Q_OBJECT @@ -61,7 +61,7 @@ namespace BibTeX friend class FileParser; public: - typedef QValueList ElementList; + typedef TQValueList ElementList; enum FileFormat { formatUndefined = 0, formatBibTeX = 1, formatXML = 2, formatHTML = 3, formatPDF = 4, formatPS = 5, formatRTF = 6, formatRIS = 7, formatEndNote = 8, formatISI = 9, formatDocBook5 = 10, formatMODS = 11, formatWordBib = 12, formatAds = 13, formatEndNoteXML = 14 }; enum Encoding {encImplicit = 0, encLaTeX = 1, encUTF8 = 2}; @@ -77,23 +77,23 @@ namespace BibTeX void deleteElement( Element *element ); static Element* cloneElement( Element *element ); - Element *containsKey( const QString &key ); - const Element *containsKeyConst( const QString &key ) const; - QStringList allKeys(); - QString text(); + Element *containsKey( const TQString &key ); + const Element *containsKeyConst( const TQString &key ) const; + TQStringList allKeys(); + TQString text(); ElementList::iterator begin(); ElementList::iterator end(); ElementList::const_iterator constBegin() const; ElementList::const_iterator constEnd() const; - QStringList getAllValuesAsStringList( const EntryField::FieldType fieldType ) const; - QMap getAllValuesAsStringListWithCount( const EntryField::FieldType fieldType ) const; - void replaceValue( const QString& oldText, const QString& newText, const EntryField::FieldType fieldType ); + TQStringList getAllValuesAsStringList( const EntryField::FieldType fieldType ) const; + TQMap getAllValuesAsStringListWithCount( const EntryField::FieldType fieldType ) const; + void replaceValue( const TQString& oldText, const TQString& newText, const EntryField::FieldType fieldType ); BibTeX::Entry *completeReferencedFieldsConst( const BibTeX::Entry *entry ) const; void completeReferencedFields( BibTeX::Entry *entry ) const; - QString fileName; + TQString fileName; protected: ElementList elements; diff --git a/src/fileexporter.cpp b/src/fileexporter.cpp index b5fe73b..8d190b7 100644 --- a/src/fileexporter.cpp +++ b/src/fileexporter.cpp @@ -22,7 +22,7 @@ namespace BibTeX { - FileExporter::FileExporter() : QObject() + FileExporter::FileExporter() : TQObject() { // nothing } diff --git a/src/fileexporter.h b/src/fileexporter.h index cc60ac0..834310f 100644 --- a/src/fileexporter.h +++ b/src/fileexporter.h @@ -20,12 +20,12 @@ #ifndef BIBTEXFILEEXPORTER_H #define BIBTEXFILEEXPORTER_H -#include -#include +#include +#include #include -class QIODevice; +class TQIODevice; namespace BibTeX { @@ -35,15 +35,15 @@ namespace BibTeX /** @author Thomas Fischer */ - class FileExporter : public QObject + class FileExporter : public TQObject { Q_OBJECT public: FileExporter(); ~FileExporter(); - virtual bool save( QIODevice *iodevice, const File *bibtexfile, QStringList *errorLog = NULL ) = 0; - virtual bool save( QIODevice *iodevice, const Element* element, QStringList *errorLog = NULL ) = 0; + virtual bool save( TQIODevice *iodevice, const File *bibtexfile, TQStringList *errorLog = NULL ) = 0; + virtual bool save( TQIODevice *iodevice, const Element* element, TQStringList *errorLog = NULL ) = 0; signals: void progress( int current, int total ); @@ -55,7 +55,7 @@ namespace BibTeX }; protected: - QMutex m_mutex; + TQMutex m_mutex; }; } diff --git a/src/fileexporterbibtex.cpp b/src/fileexporterbibtex.cpp index 240754d..03ed618 100644 --- a/src/fileexporterbibtex.cpp +++ b/src/fileexporterbibtex.cpp @@ -42,7 +42,7 @@ namespace BibTeX delete[] m_iconvBuffer; } - bool FileExporterBibTeX::save( QIODevice* iodevice, const File* bibtexfile, QStringList * /*errorLog*/ ) + bool FileExporterBibTeX::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList * /*errorLog*/ ) { m_mutex.lock(); bool result = TRUE; @@ -53,11 +53,11 @@ namespace BibTeX * in the correct order. */ - QValueList parameterCommentsList; - QValueList preambleList; - QValueList macroList; - QValueList crossRefingEntryList; - QValueList remainingList; + TQValueList parameterCommentsList; + TQValueList preambleList; + TQValueList macroList; + TQValueList crossRefingEntryList; + TQValueList remainingList; for ( File::ElementList::const_iterator it = bibtexfile->elements.begin(); it != bibtexfile->elements.end() && result && !cancelFlag; it++ ) { @@ -77,12 +77,12 @@ namespace BibTeX else { Comment *comment = dynamic_cast( *it ); - QString commentText = QString::null; + TQString commentText = TQString::null; /** check if this file requests a special encoding */ if ( comment != NULL && comment->useCommand() && (( commentText = comment->text().lower() ) ).startsWith( "x-kbibtex-encoding=" ) ) { m_encoding = commentText.mid( 19 ); - qDebug( "Switching encoding to <%s>", m_encoding.latin1() ); + tqDebug( "Switching encoding to <%s>", m_encoding.latin1() ); parameterCommentsList.append( comment ); } else @@ -99,34 +99,34 @@ namespace BibTeX m_iconvHandle = iconv_open( encodingTo, "utf-8" ); /** before anything else, write parameter comments */ - for ( QValueList::iterator it = parameterCommentsList.begin(); it != parameterCommentsList.end() && result && !cancelFlag; it++ ) + for ( TQValueList::iterator it = parameterCommentsList.begin(); it != parameterCommentsList.end() && result && !cancelFlag; it++ ) { result &= writeComment( *iodevice, *it ); emit progress( ++currentPos, totalElements ); } /** first, write preambles and strings (macros) at the beginning */ - for ( QValueList::iterator it = preambleList.begin(); it != preambleList.end() && result && !cancelFlag; it++ ) + for ( TQValueList::iterator it = preambleList.begin(); it != preambleList.end() && result && !cancelFlag; it++ ) { result &= writePreamble( *iodevice, *it ); emit progress( ++currentPos, totalElements ); } - for ( QValueList::iterator it = macroList.begin(); it != macroList.end() && result && !cancelFlag; it++ ) + for ( TQValueList::iterator it = macroList.begin(); it != macroList.end() && result && !cancelFlag; it++ ) { result &= writeMacro( *iodevice, *it ); emit progress( ++currentPos, totalElements ); } /** second, write cross-referencing elements */ - for ( QValueList::iterator it = crossRefingEntryList.begin(); it != crossRefingEntryList.end() && result && !cancelFlag; it++ ) + for ( TQValueList::iterator it = crossRefingEntryList.begin(); it != crossRefingEntryList.end() && result && !cancelFlag; it++ ) { result &= writeEntry( *iodevice, *it ); emit progress( ++currentPos, totalElements ); } /** third, write remaining elements */ - for ( QValueList::iterator it = remainingList.begin(); it != remainingList.end() && result && !cancelFlag; it++ ) + for ( TQValueList::iterator it = remainingList.begin(); it != remainingList.end() && result && !cancelFlag; it++ ) { Entry *entry = dynamic_cast( *it ); if ( entry != NULL ) @@ -145,7 +145,7 @@ namespace BibTeX return result && !cancelFlag; } - bool FileExporterBibTeX::save( QIODevice* iodevice, const Element* element, QStringList * /*errorLog*/ ) + bool FileExporterBibTeX::save( TQIODevice* iodevice, const Element* element, TQStringList * /*errorLog*/ ) { m_mutex.lock(); bool result = FALSE; @@ -185,44 +185,44 @@ namespace BibTeX cancelFlag = TRUE; } - bool FileExporterBibTeX::writeEntry( QIODevice &device, const Entry* entry ) + bool FileExporterBibTeX::writeEntry( TQIODevice &device, const Entry* entry ) { - writeString( device, QString( "@%1{ %2" ).arg( applyKeywordCasing( entry->entryTypeString() ) ).arg( entry->id() ) ); + writeString( device, TQString( "@%1{ %2" ).arg( applyKeywordCasing( entry->entryTypeString() ) ).arg( entry->id() ) ); for ( Entry::EntryFields::ConstIterator it = entry->begin(); it != entry->end(); ++it ) { EntryField *field = *it; - QString text = valueToString( field->value(), field->fieldType(), field->fieldTypeName() ); + TQString text = valueToString( field->value(), field->fieldType(), field->fieldTypeName() ); if ( m_protectCasing && dynamic_cast( field->value()->items.first() ) != NULL && ( field->fieldType() == EntryField::ftTitle || field->fieldType() == EntryField::ftBookTitle || field->fieldType() == EntryField::ftSeries ) ) addProtectiveCasing( text ); - writeString( device, QString( ",\n\t%1 = %2" ).arg( field->fieldTypeName() ).arg( text ) ); + writeString( device, TQString( ",\n\t%1 = %2" ).arg( field->fieldTypeName() ).arg( text ) ); } writeString( device, "\n}\n\n" ); return TRUE; } - bool FileExporterBibTeX::writeMacro( QIODevice &device, const Macro *macro ) + bool FileExporterBibTeX::writeMacro( TQIODevice &device, const Macro *macro ) { - QString text = valueToString( macro->value() ); + TQString text = valueToString( macro->value() ); if ( m_protectCasing ) addProtectiveCasing( text ); - writeString( device, QString( "@%1{ %2 = %3 }\n\n" ).arg( applyKeywordCasing( "String" ) ).arg( macro->key() ).arg( text ) ); + writeString( device, TQString( "@%1{ %2 = %3 }\n\n" ).arg( applyKeywordCasing( "String" ) ).arg( macro->key() ).arg( text ) ); return TRUE; } - bool FileExporterBibTeX::writeComment( QIODevice &device, const Comment *comment ) + bool FileExporterBibTeX::writeComment( TQIODevice &device, const Comment *comment ) { if ( !comment->useCommand() ) { - QString text = comment->text() ; + TQString text = comment->text() ; if ( m_encoding == "latex" ) text = EncoderLaTeX::currentEncoderLaTeX() ->encode( text ); - QStringList commentLines = QStringList::split( '\n', text ); - for ( QStringList::Iterator it = commentLines.begin(); it != commentLines.end(); it++ ) + TQStringList commentLines = TQStringList::split( '\n', text ); + for ( TQStringList::Iterator it = commentLines.begin(); it != commentLines.end(); it++ ) { writeString( device, ( *it ).append( "\n" ) ); } @@ -230,27 +230,27 @@ namespace BibTeX } else { - QString text = comment->text() ; + TQString text = comment->text() ; if ( m_encoding == "latex" ) text = EncoderLaTeX::currentEncoderLaTeX() ->encode( text ); - writeString( device, QString( "@%1{%2}\n\n" ).arg( applyKeywordCasing( "Comment" ) ).arg( text ) ); + writeString( device, TQString( "@%1{%2}\n\n" ).arg( applyKeywordCasing( "Comment" ) ).arg( text ) ); } return TRUE; } - bool FileExporterBibTeX::writePreamble( QIODevice &device, const Preamble* preamble ) + bool FileExporterBibTeX::writePreamble( TQIODevice &device, const Preamble* preamble ) { - writeString( device, QString( "@%1{%2}\n\n" ).arg( applyKeywordCasing( "Preamble" ) ).arg( valueToString( preamble->value() ) ) ); + writeString( device, TQString( "@%1{%2}\n\n" ).arg( applyKeywordCasing( "Preamble" ) ).arg( valueToString( preamble->value() ) ) ); return TRUE; } - bool FileExporterBibTeX::writeString( QIODevice &device, const QString& text ) + bool FileExporterBibTeX::writeString( TQIODevice &device, const TQString& text ) { size_t utf8datasize = 1; - QCString utf8 = text.utf8(); + TQCString utf8 = text.utf8(); char *utf8data = utf8.data(); utf8datasize = utf8.length(); char *outputdata = m_iconvBuffer; @@ -259,20 +259,20 @@ namespace BibTeX size_t result = iconv( m_iconvHandle, &utf8data, &utf8datasize, &outputdata, &outputdatasize ); if ( result != 0 ) { - qWarning( "Cannot convert string using iconv" ); + tqWarning( "Cannot convert string using iconv" ); return false; } if ( device.writeBlock( m_iconvBuffer, m_iconvBufferSize - outputdatasize ) != ( int )( m_iconvBufferSize - outputdatasize ) ) { - qWarning( "Cannot write string to device" ); + tqWarning( "Cannot write string to device" ); return false; } return true; } - void FileExporterBibTeX::setStringDelimiter( const QChar& stringOpenDelimiter, const QChar& stringCloseDelimiter ) + void FileExporterBibTeX::setStringDelimiter( const TQChar& stringOpenDelimiter, const TQChar& stringCloseDelimiter ) { m_stringOpenDelimiter = stringOpenDelimiter; m_stringCloseDelimiter = stringCloseDelimiter; @@ -283,7 +283,7 @@ namespace BibTeX m_keywordCasing = keywordCasing; } - void FileExporterBibTeX::setEncoding( const QString& encoding ) + void FileExporterBibTeX::setEncoding( const TQString& encoding ) { m_encoding = encoding; } @@ -293,16 +293,16 @@ namespace BibTeX m_protectCasing = protectCasing; } - QString FileExporterBibTeX::valueToString( const Value *value, const EntryField::FieldType fieldType, const QString &fieldTypeName ) + TQString FileExporterBibTeX::valueToString( const Value *value, const EntryField::FieldType fieldType, const TQString &fieldTypeName ) { if ( value == NULL ) return ""; - QString result; + TQString result; bool isFirst = TRUE; EncoderLaTeX *encoder = EncoderLaTeX::currentEncoderLaTeX(); - for ( QValueList::ConstIterator it = value->items.begin(); it != value->items.end(); ++it ) + for ( TQValueList::ConstIterator it = value->items.begin(); it != value->items.end(); ++it ) { if ( !isFirst ) result.append( " # " ); @@ -314,7 +314,7 @@ namespace BibTeX result.append( macroKey->text() ); else { - QString text; + TQString text; BibTeX::PersonContainer *personContainer = dynamic_cast( *it ); BibTeX::PlainText *plainText = dynamic_cast( *it ); BibTeX::KeywordContainer *keywordContainer = dynamic_cast( *it ); @@ -324,7 +324,7 @@ namespace BibTeX else if ( keywordContainer != NULL ) { bool first = TRUE; - for ( QValueList::Iterator it = keywordContainer->keywords.begin(); it != keywordContainer->keywords.end(); ++it ) + for ( TQValueList::Iterator it = keywordContainer->keywords.begin(); it != keywordContainer->keywords.end(); ++it ) { if ( !first ) text.append( ", " ); @@ -336,14 +336,14 @@ namespace BibTeX else if ( personContainer != NULL ) { bool first = TRUE; - for ( QValueList::Iterator it = personContainer->persons.begin(); it != personContainer->persons.end(); ++it ) + for ( TQValueList::Iterator it = personContainer->persons.begin(); it != personContainer->persons.end(); ++it ) { if ( !first ) text.append( " and " ); else first = FALSE; - QString v = ( *it )->firstName(); + TQString v = ( *it )->firstName(); if ( !v.isEmpty() ) { bool requiresQuoting = requiresPersonQuoting( v, FALSE ); @@ -367,12 +367,12 @@ namespace BibTeX * Thus we split the von-Parts from the surname (= everything after the first upcase char). * FIXME: Make the personContainer aware of von-Parts and jr-Parts, instead. */ - QStringList list = QStringList::split( " ", v ); - QString von; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + TQStringList list = TQStringList::split( " ", v ); + TQString von; + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - QString str = *it; - if ( str != "others" && str[0].category() == QChar::Letter_Lowercase ) + TQString str = *it; + if ( str != "others" && str[0].category() == TQChar::Letter_Lowercase ) { von += *it; von += " "; @@ -404,8 +404,8 @@ namespace BibTeX * as quote chars as string delimiters would result * in parser failures */ - QChar stringOpenDelimiter = m_stringOpenDelimiter; - QChar stringCloseDelimiter = m_stringCloseDelimiter; + TQChar stringOpenDelimiter = m_stringOpenDelimiter; + TQChar stringCloseDelimiter = m_stringCloseDelimiter; if ( text.contains( '"' ) && ( m_stringOpenDelimiter == '"' || m_stringCloseDelimiter == '"' ) ) { stringOpenDelimiter = '{'; @@ -419,12 +419,12 @@ namespace BibTeX return result; } - void FileExporterBibTeX::removeBackslashQuoting( QString &text ) + void FileExporterBibTeX::removeBackslashQuoting( TQString &text ) { text.replace( "\\&", "&" ).replace( "\\#", "#" ).replace( "\\_", "_" ).replace( "\\%", "%" ); } - QString FileExporterBibTeX::applyKeywordCasing( const QString &keyword ) + TQString FileExporterBibTeX::applyKeywordCasing( const TQString &keyword ) { switch ( m_keywordCasing ) { @@ -435,12 +435,12 @@ namespace BibTeX } } - bool FileExporterBibTeX::requiresPersonQuoting( const QString &text, bool isLastName ) + bool FileExporterBibTeX::requiresPersonQuoting( const TQString &text, bool isLastName ) { if ( isLastName && !text.contains( " " ) ) /** Last name contains NO spaces, no quoting necessary */ return FALSE; - else if ( isLastName && text[0].category() == QChar::Letter_Lowercase ) + else if ( isLastName && text[0].category() == TQChar::Letter_Lowercase ) /** Last name starts with lower case character (e.g. as in "van der Linden") */ return FALSE; else if ( !isLastName && !text.contains( " and " ) ) @@ -464,7 +464,7 @@ namespace BibTeX return FALSE; } - void FileExporterBibTeX::addProtectiveCasing( QString &text ) + void FileExporterBibTeX::addProtectiveCasing( TQString &text ) { if (( text[0] != '"' || text[text.length()-1] != '"' ) && ( text[0] != '{' || text[text.length()-1] != '}' ) ) { diff --git a/src/fileexporterbibtex.h b/src/fileexporterbibtex.h index 6606283..b9d806e 100644 --- a/src/fileexporterbibtex.h +++ b/src/fileexporterbibtex.h @@ -26,7 +26,7 @@ #include #include -class QChar; +class TQChar; namespace BibTeX { @@ -46,12 +46,12 @@ namespace BibTeX FileExporterBibTeX(); ~FileExporterBibTeX(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); - void setStringDelimiter( const QChar& stringOpenDelimiter, const QChar& stringCloseDelimiter ); + void setStringDelimiter( const TQChar& stringOpenDelimiter, const TQChar& stringCloseDelimiter ); void setKeywordCasing( const KeywordCasing keywordCasing ); - void setEncoding( const QString& encoding ); + void setEncoding( const TQString& encoding ); void setEnclosingCurlyBrackets( bool protectCasing ); public slots: @@ -62,25 +62,25 @@ namespace BibTeX char *m_iconvBuffer; const int m_iconvBufferSize; - QChar m_stringOpenDelimiter; - QChar m_stringCloseDelimiter; + TQChar m_stringOpenDelimiter; + TQChar m_stringCloseDelimiter; KeywordCasing m_keywordCasing; - QString m_encoding; + TQString m_encoding; bool m_protectCasing; bool cancelFlag; - bool writeEntry( QIODevice &device, const Entry* entry ); - bool writeMacro( QIODevice &device, const Macro *macro ); - bool writeComment( QIODevice &device, const Comment *comment ); - bool writePreamble( QIODevice &device, const Preamble* preamble ); - bool writeString( QIODevice &device, const QString& text ); + bool writeEntry( TQIODevice &device, const Entry* entry ); + bool writeMacro( TQIODevice &device, const Macro *macro ); + bool writeComment( TQIODevice &device, const Comment *comment ); + bool writePreamble( TQIODevice &device, const Preamble* preamble ); + bool writeString( TQIODevice &device, const TQString& text ); - QString valueToString( const Value *value, const EntryField::FieldType fieldType = EntryField::ftUnknown, const QString &fieldTypeName = QString::null ); + TQString valueToString( const Value *value, const EntryField::FieldType fieldType = EntryField::ftUnknown, const TQString &fieldTypeName = TQString::null ); - void removeBackslashQuoting( QString &text ); - QString applyKeywordCasing( const QString &keyword ); - bool requiresPersonQuoting( const QString &text, bool isLastName ); - void addProtectiveCasing( QString &text ); + void removeBackslashQuoting( TQString &text ); + TQString applyKeywordCasing( const TQString &keyword ); + bool requiresPersonQuoting( const TQString &text, bool isLastName ); + void addProtectiveCasing( TQString &text ); }; } diff --git a/src/fileexporterbibutils.cpp b/src/fileexporterbibutils.cpp index 4de7aeb..c9bb51a 100644 --- a/src/fileexporterbibutils.cpp +++ b/src/fileexporterbibutils.cpp @@ -17,13 +17,13 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "fileexporterbibutils.h" @@ -35,7 +35,7 @@ namespace BibTeX : FileExporter(), m_outputFormat( outputFormat ), m_bibTeXExporter( new FileExporterBibTeX() ) { m_bibTeXExporter->setEncoding( "utf-8" ); - m_processBuffer = new QBuffer(); + m_processBuffer = new TQBuffer(); } FileExporterBibUtils::~FileExporterBibUtils() @@ -44,10 +44,10 @@ namespace BibTeX delete m_bibTeXExporter; } - bool FileExporterBibUtils::save( QIODevice* iodevice, const Element* element, QStringList* errorLog ) + bool FileExporterBibUtils::save( TQIODevice* iodevice, const Element* element, TQStringList* errorLog ) { m_cancelFlag = false; - QBuffer bibBuffer; + TQBuffer bibBuffer; if ( !toBuffer( element, &bibBuffer, errorLog ) ) return false; if ( !bufferToXMLbuffer( &bibBuffer ) || m_cancelFlag ) @@ -55,11 +55,11 @@ namespace BibTeX return !m_cancelFlag && xmlBufferToIOdevice( iodevice ); } - bool FileExporterBibUtils::save( QIODevice* iodevice, const File* bibtexfile, QStringList* errorLog ) + bool FileExporterBibUtils::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList* errorLog ) { emit progress( 0, 3 ); m_cancelFlag = false; - QBuffer bibBuffer; + TQBuffer bibBuffer; if ( !toBuffer( bibtexfile, &bibBuffer, errorLog ) ) return false; emit progress( 1, 3 ); @@ -78,7 +78,7 @@ namespace BibTeX m_cancelFlag = true; } - bool FileExporterBibUtils::toBuffer( const File *bibFile, QBuffer *buffer, QStringList* errorLog ) + bool FileExporterBibUtils::toBuffer( const File *bibFile, TQBuffer *buffer, TQStringList* errorLog ) { buffer->open( IO_WriteOnly ); bool result = m_bibTeXExporter->save( buffer, bibFile, errorLog ); @@ -86,7 +86,7 @@ namespace BibTeX return result; } - bool FileExporterBibUtils::toBuffer( const Element *bibElement, QBuffer *buffer, QStringList* errorLog ) + bool FileExporterBibUtils::toBuffer( const Element *bibElement, TQBuffer *buffer, TQStringList* errorLog ) { buffer->open( IO_WriteOnly ); bool result = m_bibTeXExporter->save( buffer, bibElement, errorLog ); @@ -94,13 +94,13 @@ namespace BibTeX return result; } - bool FileExporterBibUtils::bufferToXMLbuffer( QBuffer *bibBuffer ) + bool FileExporterBibUtils::bufferToXMLbuffer( TQBuffer *bibBuffer ) { - QWaitCondition wc; + TQWaitCondition wc; m_processBuffer->open( IO_WriteOnly ); m_waiting = true; - m_process = new QProcess( QStringList::split( ' ', "bib2xml -i utf8" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "bib2xml -i utf8" ) ); connect( m_process, SIGNAL( processExited() ), this, SLOT( wakeUp() ) ); connect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadyStdout() ) ); connect( m_process, SIGNAL( readyReadStderr() ), this, SLOT( slotReadyStderr() ) ); @@ -110,7 +110,7 @@ namespace BibTeX { bibBuffer->open( IO_ReadOnly ); m_process->writeToStdin( bibBuffer->readAll() ); - qApp->processEvents(); + tqApp->processEvents(); m_process->closeStdin(); bibBuffer->close(); @@ -118,7 +118,7 @@ namespace BibTeX while ( m_waiting ) { wc.wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); --nothingHappens; } @@ -127,14 +127,14 @@ namespace BibTeX if ( !m_process->normalExit() ) { - qDebug( "%s did not exit in a clean fashion", m_process->arguments()[0].latin1() ); + tqDebug( "%s did not exit in a clean fashion", m_process->arguments()[0].latin1() ); delete m_process; return false; } } else { - qDebug( "%s did not start", m_process->arguments()[0].latin1() ); + tqDebug( "%s did not start", m_process->arguments()[0].latin1() ); delete m_process; return false; } @@ -145,34 +145,34 @@ namespace BibTeX return true; } - bool FileExporterBibUtils::xmlBufferToIOdevice( QIODevice *iodevice ) + bool FileExporterBibUtils::xmlBufferToIOdevice( TQIODevice *iodevice ) { - QWaitCondition wc; + TQWaitCondition wc; m_waiting = true; m_process = NULL; switch ( m_outputFormat ) { case BibTeX::File::formatISI: - m_process = new QProcess( QStringList::split( ' ', "xml2isi" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "xml2isi" ) ); break; case BibTeX::File::formatWordBib: - m_process = new QProcess( QStringList::split( ' ', "xml2wordbib" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "xml2wordbib" ) ); break; case BibTeX::File::formatAds: - m_process = new QProcess( QStringList::split( ' ', "xml2ads" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "xml2ads" ) ); break; case BibTeX::File::formatEndNote: - m_process = new QProcess( QStringList::split( ' ', "xml2end" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "xml2end" ) ); break; case BibTeX::File::formatRIS: - m_process = new QProcess( QStringList::split( ' ', "xml2ris" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "xml2ris" ) ); break; case BibTeX::File::formatMODS: /* m_process = NULL; */ break; default: - qDebug( "Cannot handle output format %i", m_outputFormat ); + tqDebug( "Cannot handle output format %i", m_outputFormat ); return false; } @@ -184,12 +184,12 @@ namespace BibTeX if ( m_process->start() ) { - QBuffer *tempBuffer = m_processBuffer; - m_processBuffer = new QBuffer(); + TQBuffer *tempBuffer = m_processBuffer; + m_processBuffer = new TQBuffer(); tempBuffer->open( IO_ReadOnly ); m_process->writeToStdin( tempBuffer->readAll() ); - qApp->processEvents(); + tqApp->processEvents(); m_process->closeStdin(); tempBuffer->close(); @@ -198,7 +198,7 @@ namespace BibTeX while ( m_waiting ) { wc.wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); --nothingHappens; } m_processBuffer->close(); @@ -222,7 +222,7 @@ namespace BibTeX } else { - qDebug( "%s did not start", m_process->arguments()[0].latin1() ); + tqDebug( "%s did not start", m_process->arguments()[0].latin1() ); delete m_process; return false; } @@ -249,10 +249,10 @@ namespace BibTeX void FileExporterBibUtils::slotReadyStderr() { - QByteArray ba = m_process->readStderr(); - QTextStream bats( ba, IO_ReadOnly ); - bats.setEncoding( QTextStream::UnicodeUTF8 ); - qDebug( "%s", bats.read().latin1() ); + TQByteArray ba = m_process->readStderr(); + TQTextStream bats( ba, IO_ReadOnly ); + bats.setEncoding( TQTextStream::UnicodeUTF8 ); + tqDebug( "%s", bats.read().latin1() ); } } diff --git a/src/fileexporterbibutils.h b/src/fileexporterbibutils.h index 978a92d..fafefd6 100644 --- a/src/fileexporterbibutils.h +++ b/src/fileexporterbibutils.h @@ -22,8 +22,8 @@ #include -class QProcess; -class QBuffer; +class TQProcess; +class TQBuffer; namespace BibTeX { @@ -39,8 +39,8 @@ namespace BibTeX FileExporterBibUtils( BibTeX::File::FileFormat outputFormat ); ~FileExporterBibUtils(); - bool save( QIODevice* iodevice, const Element* element, QStringList* errorLog = NULL ); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList* errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList* errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList* errorLog = NULL ); public slots: void cancel(); @@ -51,13 +51,13 @@ namespace BibTeX FileExporterBibTeX *m_bibTeXExporter; bool m_waiting; - QProcess *m_process; - QBuffer *m_processBuffer; + TQProcess *m_process; + TQBuffer *m_processBuffer; - bool toBuffer( const File *bibFile, QBuffer *buffer, QStringList* errorLog); - bool toBuffer( const Element *bibFile, QBuffer *buffer, QStringList* errorLog); - bool bufferToXMLbuffer( QBuffer *buffer ); - bool xmlBufferToIOdevice( QIODevice *iodevice ); + bool toBuffer( const File *bibFile, TQBuffer *buffer, TQStringList* errorLog); + bool toBuffer( const Element *bibFile, TQBuffer *buffer, TQStringList* errorLog); + bool bufferToXMLbuffer( TQBuffer *buffer ); + bool xmlBufferToIOdevice( TQIODevice *iodevice ); private slots: void wakeUp(); diff --git a/src/fileexporterdocbook5.cpp b/src/fileexporterdocbook5.cpp index 7a962b6..b776391 100644 --- a/src/fileexporterdocbook5.cpp +++ b/src/fileexporterdocbook5.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -27,11 +27,11 @@ namespace BibTeX { - FileExporterDocBook5::FileExporterDocBook5( const QString& classPath ) + FileExporterDocBook5::FileExporterDocBook5( const TQString& classPath ) : FileExporterToolchain(), m_classPath( classPath ) { - bibTeXFilename = QString( workingDir ).append( "/bibtex-to-docbook5.bib" ); - outputFilename = QString( workingDir ).append( "/bibtex-to-docbook5.bib.xml" ); + bibTeXFilename = TQString( workingDir ).append( "/bibtex-to-docbook5.bib" ); + outputFilename = TQString( workingDir ).append( "/bibtex-to-docbook5.bib.xml" ); } @@ -40,12 +40,12 @@ namespace BibTeX // nothing } - bool FileExporterDocBook5::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterDocBook5::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -61,12 +61,12 @@ namespace BibTeX return result; } - bool FileExporterDocBook5::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterDocBook5::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -82,9 +82,9 @@ namespace BibTeX return result; } - bool FileExporterDocBook5::runBib2Db5( QIODevice* iodevice, QStringList *errorLog ) + bool FileExporterDocBook5::runBib2Db5( TQIODevice* iodevice, TQStringList *errorLog ) { - QStringList cmdLine; + TQStringList cmdLine; cmdLine << "java" << "-cp" << m_classPath << "net.sf.bib2db5.DB5Converter" << "-O" << "." << "bibtex-to-docbook5.bib"; if ( runProcess( cmdLine, errorLog ) && writeFileToIODevice( outputFilename, iodevice ) ) diff --git a/src/fileexporterdocbook5.h b/src/fileexporterdocbook5.h index 7b5f812..88742b5 100644 --- a/src/fileexporterdocbook5.h +++ b/src/fileexporterdocbook5.h @@ -31,21 +31,21 @@ namespace BibTeX class FileExporterDocBook5 : public FileExporterToolchain { public: - FileExporterDocBook5(const QString& classPath); + FileExporterDocBook5(const TQString& classPath); ~FileExporterDocBook5(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); - void setLaTeXLanguage( const QString& language ); - void setLaTeXBibliographyStyle( const QString& bibStyle ); + void setLaTeXLanguage( const TQString& language ); + void setLaTeXBibliographyStyle( const TQString& bibStyle ); private: -QString m_classPath; - QString bibTeXFilename; - QString outputFilename; +TQString m_classPath; + TQString bibTeXFilename; + TQString outputFilename; - bool runBib2Db5( QIODevice* iodevice, QStringList *errorLog ); + bool runBib2Db5( TQIODevice* iodevice, TQStringList *errorLog ); }; diff --git a/src/fileexporterexternal.cpp b/src/fileexporterexternal.cpp index 6b7e449..38e8e68 100644 --- a/src/fileexporterexternal.cpp +++ b/src/fileexporterexternal.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -32,7 +32,7 @@ namespace BibTeX FileExporterExternal::FileExporterExternal( Exporter exporter, File::FileFormat fileformat ) : FileExporter(), writeTo( NULL ), m_exporter( exporter ), m_fileformat( fileformat ) { - wc = new QWaitCondition(); + wc = new TQWaitCondition(); } FileExporterExternal::~FileExporterExternal() @@ -40,10 +40,10 @@ namespace BibTeX delete wc; } - bool FileExporterExternal::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterExternal::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); FileExporter * bibtexExporter = new FileExporterBibTeX(); bool result = bibtexExporter->save( &buffer, bibtexfile, errorLog ); @@ -57,10 +57,10 @@ namespace BibTeX return result; } - bool FileExporterExternal::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterExternal::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); FileExporter * bibtexExporter = new FileExporterBibTeX(); bool result = bibtexExporter->save( &buffer, element, errorLog ); @@ -74,11 +74,11 @@ namespace BibTeX return result; } - bool FileExporterExternal::generateOutput( QBuffer &input, QIODevice *output ) + bool FileExporterExternal::generateOutput( TQBuffer &input, TQIODevice *output ) { bool result = FALSE; - QString commandLine; + TQString commandLine; switch ( m_fileformat ) { case File::formatHTML: @@ -100,14 +100,14 @@ namespace BibTeX default: return FALSE; } - QStringList args = QStringList::split( ' ', commandLine ); + TQStringList args = TQStringList::split( ' ', commandLine ); - writeTo = new QTextStream( output ); - writeTo->setEncoding( QTextStream::UnicodeUTF8 ); + writeTo = new TQTextStream( output ); + writeTo->setEncoding( TQTextStream::UnicodeUTF8 ); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); - process = new QProcess( args ); + process = new TQProcess( args ); connect( process, SIGNAL( processExited() ), this, SLOT( slotProcessExited() ) ); connect( process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadProcessOutput() ) ); connect( process, SIGNAL( readyReadStderr() ), this, SLOT( slotReadProcessOutput() ) ); @@ -118,19 +118,19 @@ namespace BibTeX while ( !process->isRunning() ) { wc->wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); } - qApp->processEvents(); + tqApp->processEvents(); input.open( IO_ReadOnly ); - QByteArray buf = input.buffer(); - // qDebug( "buf.size=%i", buf.size() ); + TQByteArray buf = input.buffer(); + // tqDebug( "buf.size=%i", buf.size() ); process->writeToStdin( buf ); input.close(); - qApp->processEvents(); + tqApp->processEvents(); while ( process->isRunning() ) { wc->wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); } result = process->normalExit(); @@ -145,7 +145,7 @@ namespace BibTeX delete writeTo; writeTo = NULL; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return result; } @@ -159,14 +159,14 @@ namespace BibTeX if ( writeTo != NULL ) while ( process->canReadLineStdout() ) { - QString line = process->readLineStdout(); - // qDebug( "line=%s", line.latin1() ); + TQString line = process->readLineStdout(); + // tqDebug( "line=%s", line.latin1() ); ( *writeTo ) << line.latin1() << endl; } // while ( process->canReadLineStderr() ) // { - // QString line = process->readLineStderr(); - // qDebug( "stderr=%s", line.latin1() ); + // TQString line = process->readLineStderr(); + // tqDebug( "stderr=%s", line.latin1() ); // } } diff --git a/src/fileexporterexternal.h b/src/fileexporterexternal.h index 463f26a..50a28fc 100644 --- a/src/fileexporterexternal.h +++ b/src/fileexporterexternal.h @@ -23,9 +23,9 @@ #include #include -class QWaitCondition; -class QProcess; -class QBuffer; +class TQWaitCondition; +class TQProcess; +class TQBuffer; namespace BibTeX { @@ -42,17 +42,17 @@ namespace BibTeX FileExporterExternal( Exporter exporter, File::FileFormat fileformat ); ~FileExporterExternal(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); private: - QWaitCondition *wc; - QProcess *process; - QTextStream *writeTo; + TQWaitCondition *wc; + TQProcess *process; + TQTextStream *writeTo; Exporter m_exporter; File::FileFormat m_fileformat; - bool generateOutput( QBuffer &input, QIODevice* output ); + bool generateOutput( TQBuffer &input, TQIODevice* output ); private slots: void slotProcessExited(); diff --git a/src/fileexporterpdf.cpp b/src/fileexporterpdf.cpp index 47b8dad..9fff4b3 100644 --- a/src/fileexporterpdf.cpp +++ b/src/fileexporterpdf.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -33,9 +33,9 @@ namespace BibTeX FileExporterPDF::FileExporterPDF( bool embedFiles ) : FileExporterToolchain(), m_latexLanguage( "english" ), m_latexBibStyle( "plain" ), m_embedFiles( embedFiles ) { - laTeXFilename = QString( workingDir ).append( "/bibtex-to-pdf.tex" ); - bibTeXFilename = QString( workingDir ).append( "/bibtex-to-pdf.bib" ); - outputFilename = QString( workingDir ).append( "/bibtex-to-pdf.pdf" ); + laTeXFilename = TQString( workingDir ).append( "/bibtex-to-pdf.tex" ); + bibTeXFilename = TQString( workingDir ).append( "/bibtex-to-pdf.bib" ); + outputFilename = TQString( workingDir ).append( "/bibtex-to-pdf.pdf" ); } FileExporterPDF::~FileExporterPDF() @@ -43,18 +43,18 @@ namespace BibTeX // nothing } - bool FileExporterPDF::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterPDF::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; m_embeddedFileList.clear(); if ( m_embedFiles ) { - m_embeddedFileList.append( QString( "%1|%2" ).arg( "BibTeX source" ).arg( bibTeXFilename ) ); + m_embeddedFileList.append( TQString( "%1|%2" ).arg( "BibTeX source" ).arg( bibTeXFilename ) ); fillEmbeddedFileList( bibtexfile ); } - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -70,7 +70,7 @@ namespace BibTeX return result; } - bool FileExporterPDF::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterPDF::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; @@ -78,7 +78,7 @@ namespace BibTeX if ( m_embedFiles ) fillEmbeddedFileList( element ); - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -94,24 +94,24 @@ namespace BibTeX return result; } - void FileExporterPDF::setLaTeXLanguage( const QString& language ) + void FileExporterPDF::setLaTeXLanguage( const TQString& language ) { m_latexLanguage = language; } - void FileExporterPDF::setLaTeXBibliographyStyle( const QString& bibStyle ) + void FileExporterPDF::setLaTeXBibliographyStyle( const TQString& bibStyle ) { m_latexBibStyle = bibStyle; } - void FileExporterPDF::setDocumentSearchPaths( const QStringList& searchPaths ) + void FileExporterPDF::setDocumentSearchPaths( const TQStringList& searchPaths ) { m_searchPaths = searchPaths; } - bool FileExporterPDF::generatePDF( QIODevice* iodevice, QStringList *errorLog ) + bool FileExporterPDF::generatePDF( TQIODevice* iodevice, TQStringList *errorLog ) { - QStringList cmdLines = QStringList::split( '|', "pdflatex -halt-on-error bibtex-to-pdf.tex|bibtex bibtex-to-pdf|pdflatex -halt-on-error bibtex-to-pdf.tex|pdflatex -halt-on-error bibtex-to-pdf.tex" ); + TQStringList cmdLines = TQStringList::split( '|', "pdflatex -halt-on-error bibtex-to-pdf.tex|bibtex bibtex-to-pdf|pdflatex -halt-on-error bibtex-to-pdf.tex|pdflatex -halt-on-error bibtex-to-pdf.tex" ); if ( writeLatexFile( laTeXFilename ) && runProcesses( cmdLines, errorLog ) && writeFileToIODevice( outputFilename, iodevice ) ) return TRUE; @@ -119,14 +119,14 @@ namespace BibTeX return FALSE; } - bool FileExporterPDF::writeLatexFile( const QString &filename ) + bool FileExporterPDF::writeLatexFile( const TQString &filename ) { - QFile latexFile( filename ); + TQFile latexFile( filename ); if ( latexFile.open( IO_WriteOnly ) ) { m_embedFiles &= kpsewhich( "embedfile.sty" ); - QTextStream ts( &latexFile ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &latexFile ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << "\\documentclass{article}\n"; if ( kpsewhich( "t1enc.dfu" ) ) ts << "\\usepackage[T1]{fontenc}\n"; @@ -144,10 +144,10 @@ namespace BibTeX ts << "\\begin{document}\n"; if ( m_embedFiles ) - for ( QStringList::ConstIterator it = m_embeddedFileList.begin(); it != m_embeddedFileList.end(); ++it ) + for ( TQStringList::ConstIterator it = m_embeddedFileList.begin(); it != m_embeddedFileList.end(); ++it ) { - QStringList param = QStringList::split( "|", *it ); - QFile file( param[1] ); + TQStringList param = TQStringList::split( "|", *it ); + TQFile file( param[1] ); if ( file.exists() ) ts << "\\embedfile[desc={" << param[0] << "}]{" << param[1] << "}\n"; } @@ -173,20 +173,20 @@ namespace BibTeX const Entry *entry = dynamic_cast( element ); if ( entry != NULL ) { - QString id = entry->id(); - QStringList urls = entry->urls(); - for ( QStringList::Iterator it = urls.begin(); it != urls.end(); ++it ) + TQString id = entry->id(); + TQStringList urls = entry->urls(); + for ( TQStringList::Iterator it = urls.begin(); it != urls.end(); ++it ) { - QUrl url = QUrl( *it ); - if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && QFile( url.path() ).exists() ) - m_embeddedFileList.append( QString( "%1|%2" ).arg( id ).arg( url.path() ) ); + TQUrl url = TQUrl( *it ); + if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && TQFile( url.path() ).exists() ) + m_embeddedFileList.append( TQString( "%1|%2" ).arg( id ).arg( url.path() ) ); else - for ( QStringList::Iterator path_it = m_searchPaths.begin(); path_it != m_searchPaths.end(); ++path_it ) + for ( TQStringList::Iterator path_it = m_searchPaths.begin(); path_it != m_searchPaths.end(); ++path_it ) { - url = QUrl( QString( *path_it ).append( "/" ).append( *it ) ); - if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && QFile( url.path() ).exists() ) + url = TQUrl( TQString( *path_it ).append( "/" ).append( *it ) ); + if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && TQFile( url.path() ).exists() ) { - m_embeddedFileList.append( QString( "%1|%2" ).arg( id ).arg( url.path() ) ); + m_embeddedFileList.append( TQString( "%1|%2" ).arg( id ).arg( url.path() ) ); break; } } diff --git a/src/fileexporterpdf.h b/src/fileexporterpdf.h index 5641921..0d67350 100644 --- a/src/fileexporterpdf.h +++ b/src/fileexporterpdf.h @@ -34,25 +34,25 @@ namespace BibTeX FileExporterPDF( bool embedFiles = FALSE ); ~FileExporterPDF(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); - void setLaTeXLanguage( const QString& language ); - void setLaTeXBibliographyStyle( const QString& bibStyle ); - void setDocumentSearchPaths( const QStringList& searchPaths ); + void setLaTeXLanguage( const TQString& language ); + void setLaTeXBibliographyStyle( const TQString& bibStyle ); + void setDocumentSearchPaths( const TQStringList& searchPaths ); private: - QString laTeXFilename; - QString bibTeXFilename; - QString outputFilename; - QString m_latexLanguage; - QString m_latexBibStyle; + TQString laTeXFilename; + TQString bibTeXFilename; + TQString outputFilename; + TQString m_latexLanguage; + TQString m_latexBibStyle; bool m_embedFiles; - QStringList m_embeddedFileList; - QStringList m_searchPaths; + TQStringList m_embeddedFileList; + TQStringList m_searchPaths; - bool generatePDF( QIODevice* iodevice, QStringList *errorLog ); - bool writeLatexFile( const QString &filename ); + bool generatePDF( TQIODevice* iodevice, TQStringList *errorLog ); + bool writeLatexFile( const TQString &filename ); void fillEmbeddedFileList( const File* bibtexfile ); void fillEmbeddedFileList( const Element* element ); }; diff --git a/src/fileexporterps.cpp b/src/fileexporterps.cpp index 8627836..1da2601 100644 --- a/src/fileexporterps.cpp +++ b/src/fileexporterps.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -31,9 +31,9 @@ namespace BibTeX FileExporterPS::FileExporterPS() : FileExporterToolchain(), m_latexLanguage( "english" ), m_latexBibStyle( "plain" ) { - laTeXFilename = QString( workingDir ).append( "/bibtex-to-ps.tex" ); - bibTeXFilename = QString( workingDir ).append( "/bibtex-to-ps.bib" ); - outputFilename = QString( workingDir ).append( "/bibtex-to-ps.ps" ); + laTeXFilename = TQString( workingDir ).append( "/bibtex-to-ps.tex" ); + bibTeXFilename = TQString( workingDir ).append( "/bibtex-to-ps.bib" ); + outputFilename = TQString( workingDir ).append( "/bibtex-to-ps.ps" ); } FileExporterPS::~FileExporterPS() @@ -41,12 +41,12 @@ namespace BibTeX // nothing } - bool FileExporterPS::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterPS::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -62,12 +62,12 @@ namespace BibTeX return result; } - bool FileExporterPS::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterPS::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -83,19 +83,19 @@ namespace BibTeX return result; } - void FileExporterPS::setLaTeXLanguage( const QString& language ) + void FileExporterPS::setLaTeXLanguage( const TQString& language ) { m_latexLanguage = language; } - void FileExporterPS::setLaTeXBibliographyStyle( const QString& bibStyle ) + void FileExporterPS::setLaTeXBibliographyStyle( const TQString& bibStyle ) { m_latexBibStyle = bibStyle; } - bool FileExporterPS::generatePS( QIODevice* iodevice, QStringList *errorLog ) + bool FileExporterPS::generatePS( TQIODevice* iodevice, TQStringList *errorLog ) { - QStringList cmdLines = QStringList::split( '|', "latex -halt-on-error bibtex-to-ps.tex|bibtex bibtex-to-ps|latex -halt-on-error bibtex-to-ps.tex|latex -halt-on-error bibtex-to-ps.tex|dvips -o bibtex-to-ps.ps bibtex-to-ps.dvi" ); + TQStringList cmdLines = TQStringList::split( '|', "latex -halt-on-error bibtex-to-ps.tex|bibtex bibtex-to-ps|latex -halt-on-error bibtex-to-ps.tex|latex -halt-on-error bibtex-to-ps.tex|dvips -o bibtex-to-ps.ps bibtex-to-ps.dvi" ); if ( writeLatexFile( laTeXFilename ) && runProcesses( cmdLines, errorLog ) && writeFileToIODevice( outputFilename, iodevice ) ) return TRUE; @@ -103,13 +103,13 @@ namespace BibTeX return FALSE; } - bool FileExporterPS::writeLatexFile( const QString &filename ) + bool FileExporterPS::writeLatexFile( const TQString &filename ) { - QFile latexFile( filename ); + TQFile latexFile( filename ); if ( latexFile.open( IO_WriteOnly ) ) { - QTextStream ts( &latexFile ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &latexFile ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << "\\documentclass{article}\n"; if ( kpsewhich( "t1enc.dfu" ) ) ts << "\\usepackage[T1]{fontenc}\n"; diff --git a/src/fileexporterps.h b/src/fileexporterps.h index b252fd7..0393e7e 100644 --- a/src/fileexporterps.h +++ b/src/fileexporterps.h @@ -22,7 +22,7 @@ #include -class QStringList; +class TQStringList; namespace BibTeX { @@ -36,21 +36,21 @@ namespace BibTeX FileExporterPS(); ~FileExporterPS(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); - void setLaTeXLanguage( const QString& language ); - void setLaTeXBibliographyStyle( const QString& bibStyle ); + void setLaTeXLanguage( const TQString& language ); + void setLaTeXBibliographyStyle( const TQString& bibStyle ); private: - QString laTeXFilename; - QString bibTeXFilename; - QString outputFilename; - QString m_latexLanguage; - QString m_latexBibStyle; - - bool generatePS( QIODevice* iodevice, QStringList *errorLog ); - bool writeLatexFile( const QString &filename ); + TQString laTeXFilename; + TQString bibTeXFilename; + TQString outputFilename; + TQString m_latexLanguage; + TQString m_latexBibStyle; + + bool generatePS( TQIODevice* iodevice, TQStringList *errorLog ); + bool writeLatexFile( const TQString &filename ); }; } diff --git a/src/fileexporterris.cpp b/src/fileexporterris.cpp index 37908a7..88ff33c 100644 --- a/src/fileexporterris.cpp +++ b/src/fileexporterris.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include @@ -36,11 +36,11 @@ namespace BibTeX // nothing } - bool FileExporterRIS::save( QIODevice* iodevice, const Element* element, QStringList* /*errorLog*/ ) + bool FileExporterRIS::save( TQIODevice* iodevice, const Element* element, TQStringList* /*errorLog*/ ) { m_mutex.lock(); bool result = FALSE; - QTextStream stream( iodevice ); + TQTextStream stream( iodevice ); const Entry *entry = dynamic_cast( element ); if ( entry != NULL ) @@ -50,12 +50,12 @@ namespace BibTeX return result && !m_cancelFlag; } - bool FileExporterRIS::save( QIODevice* iodevice, const File* bibtexfile, QStringList* /*errorLog*/ ) + bool FileExporterRIS::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList* /*errorLog*/ ) { m_mutex.lock(); bool result = TRUE; m_cancelFlag = FALSE; - QTextStream stream( iodevice ); + TQTextStream stream( iodevice ); int numElements = (int) bibtexfile->count(), i = 0; emit progress( 0, numElements ); @@ -80,10 +80,10 @@ namespace BibTeX m_cancelFlag = TRUE; } - bool FileExporterRIS::writeEntry( QTextStream &stream, const Entry* entry ) + bool FileExporterRIS::writeEntry( TQTextStream &stream, const Entry* entry ) { bool result = TRUE; - qDebug( "Writing Entry" ); + tqDebug( "Writing Entry" ); switch ( entry->entryType() ) { @@ -109,8 +109,8 @@ namespace BibTeX writeKeyValue( stream, "TY", "GEN" ); } - QString year = ""; - QString month = ""; + TQString year = ""; + TQString month = ""; for ( Entry::EntryFields::ConstIterator it = entry->begin(); result && it != entry->end(); it++ ) { @@ -120,14 +120,14 @@ namespace BibTeX result &= writeKeyValue( stream, field->fieldTypeName().right( 2 ), field->value()->simplifiedText() ); else if ( field->fieldType() == EntryField::ftAuthor ) { - QStringList authors = QStringList::split( QRegExp( "\\s+(,|and|&)\\s+", FALSE ), field->value() ->simplifiedText() ); - for ( QStringList::Iterator it = authors.begin(); result && it != authors.end(); ++it ) + TQStringList authors = TQStringList::split( TQRegExp( "\\s+(,|and|&)\\s+", FALSE ), field->value() ->simplifiedText() ); + for ( TQStringList::Iterator it = authors.begin(); result && it != authors.end(); ++it ) result &= writeKeyValue( stream, "AU", *it ); } else if ( field->fieldType() == EntryField::ftEditor ) { - QStringList authors = QStringList::split( QRegExp( "\\s+(,|and|&)\\s+", FALSE ), field->value() ->simplifiedText() ); - for ( QStringList::Iterator it = authors.begin(); result && it != authors.end(); ++it ) + TQStringList authors = TQStringList::split( TQRegExp( "\\s+(,|and|&)\\s+", FALSE ), field->value() ->simplifiedText() ); + for ( TQStringList::Iterator it = authors.begin(); result && it != authors.end(); ++it ) result &= writeKeyValue( stream, "ED", *it ); } else if ( field->fieldType() == EntryField::ftTitle ) @@ -164,7 +164,7 @@ namespace BibTeX result &= writeKeyValue( stream, "UR", field->value() ->simplifiedText() ); else if ( field->fieldType() == EntryField::ftPages ) { - QStringList pageRange = QStringList::split( QRegExp( QString( "--|-|%1" ).arg( QChar( 0x2013 ) ) ), field->value() ->simplifiedText() ); + TQStringList pageRange = TQStringList::split( TQRegExp( TQString( "--|-|%1" ).arg( TQChar( 0x2013 ) ) ), field->value() ->simplifiedText() ); if ( pageRange.count() == 2 ) { result &= writeKeyValue( stream, "SP", pageRange[ 0 ] ); @@ -177,22 +177,22 @@ namespace BibTeX if ( !year.isEmpty() || !month.isEmpty() ) { - result &= writeKeyValue( stream, "PY", QString( "%1/%2//" ).arg( year ).arg( month ) ); + result &= writeKeyValue( stream, "PY", TQString( "%1/%2//" ).arg( year ).arg( month ) ); } - result &= writeKeyValue( stream, "ER", QString() ); + result &= writeKeyValue( stream, "ER", TQString() ); stream << endl; return result; } - bool FileExporterRIS::writeKeyValue( QTextStream &stream, const QString& key, const QString&value ) + bool FileExporterRIS::writeKeyValue( TQTextStream &stream, const TQString& key, const TQString&value ) { stream << key << " - "; if ( !value.isEmpty() ) stream << value; stream << endl; - qDebug( "%s - %s", key.latin1(), value.latin1() ); + tqDebug( "%s - %s", key.latin1(), value.latin1() ); return TRUE; } diff --git a/src/fileexporterris.h b/src/fileexporterris.h index d38107f..0063c21 100644 --- a/src/fileexporterris.h +++ b/src/fileexporterris.h @@ -32,8 +32,8 @@ namespace BibTeX ~FileExporterRIS(); - bool save( QIODevice* iodevice, const Element* element, QStringList* errorLog = NULL ); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList* errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList* errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList* errorLog = NULL ); public slots: void cancel(); @@ -41,8 +41,8 @@ namespace BibTeX private: bool m_cancelFlag; - bool writeEntry( QTextStream &stream, const Entry* entry ); - bool writeKeyValue( QTextStream &stream, const QString& key, const QString&value ); + bool writeEntry( TQTextStream &stream, const Entry* entry ); + bool writeKeyValue( TQTextStream &stream, const TQString& key, const TQString&value ); }; } diff --git a/src/fileexporterrtf.cpp b/src/fileexporterrtf.cpp index 2ed0c49..77b541a 100644 --- a/src/fileexporterrtf.cpp +++ b/src/fileexporterrtf.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -30,9 +30,9 @@ namespace BibTeX FileExporterRTF::FileExporterRTF() : FileExporterToolchain(), m_latexLanguage( "english" ), m_latexBibStyle( "plain" ) { - laTeXFilename = QString( workingDir ).append( "/bibtex-to-rtf.tex" ); - bibTeXFilename = QString( workingDir ).append( "/bibtex-to-rtf.bib" ); - outputFilename = QString( workingDir ).append( "/bibtex-to-rtf.rtf" ); + laTeXFilename = TQString( workingDir ).append( "/bibtex-to-rtf.tex" ); + bibTeXFilename = TQString( workingDir ).append( "/bibtex-to-rtf.bib" ); + outputFilename = TQString( workingDir ).append( "/bibtex-to-rtf.rtf" ); } FileExporterRTF::~FileExporterRTF() @@ -40,12 +40,12 @@ namespace BibTeX // nothing } - bool FileExporterRTF::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterRTF::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -61,12 +61,12 @@ namespace BibTeX return result; } - bool FileExporterRTF::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterRTF::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -82,19 +82,19 @@ namespace BibTeX return result; } - void FileExporterRTF::setLaTeXLanguage( const QString& language ) + void FileExporterRTF::setLaTeXLanguage( const TQString& language ) { m_latexLanguage = language; } - void FileExporterRTF::setLaTeXBibliographyStyle( const QString& bibStyle ) + void FileExporterRTF::setLaTeXBibliographyStyle( const TQString& bibStyle ) { m_latexBibStyle = bibStyle; } - bool FileExporterRTF::generateRTF( QIODevice* iodevice, QStringList *errorLog ) + bool FileExporterRTF::generateRTF( TQIODevice* iodevice, TQStringList *errorLog ) { - QStringList cmdLines = QStringList::split( '|', "latex bibtex-to-rtf.tex|bibtex bibtex-to-rtf|latex bibtex-to-rtf.tex|latex2rtf bibtex-to-rtf.tex" ); + TQStringList cmdLines = TQStringList::split( '|', "latex bibtex-to-rtf.tex|bibtex bibtex-to-rtf|latex bibtex-to-rtf.tex|latex2rtf bibtex-to-rtf.tex" ); if ( writeLatexFile( laTeXFilename ) && runProcesses( cmdLines, errorLog ) && writeFileToIODevice( outputFilename, iodevice ) ) return TRUE; @@ -102,13 +102,13 @@ namespace BibTeX return FALSE; } - bool FileExporterRTF::writeLatexFile( const QString &filename ) + bool FileExporterRTF::writeLatexFile( const TQString &filename ) { - QFile latexFile( filename ); + TQFile latexFile( filename ); if ( latexFile.open( IO_WriteOnly ) ) { - QTextStream ts( &latexFile ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &latexFile ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << "\\documentclass{article}\n"; if ( kpsewhich( "t1enc.dfu" ) ) ts << "\\usepackage[T1]{fontenc}\n"; diff --git a/src/fileexporterrtf.h b/src/fileexporterrtf.h index bb916e0..69bf098 100644 --- a/src/fileexporterrtf.h +++ b/src/fileexporterrtf.h @@ -34,21 +34,21 @@ namespace BibTeX FileExporterRTF(); ~FileExporterRTF(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); - void setLaTeXLanguage( const QString& language ); - void setLaTeXBibliographyStyle( const QString& bibStyle ); + void setLaTeXLanguage( const TQString& language ); + void setLaTeXBibliographyStyle( const TQString& bibStyle ); private: - QString laTeXFilename; - QString bibTeXFilename; - QString outputFilename; - QString m_latexLanguage; - QString m_latexBibStyle; - - bool generateRTF( QIODevice* iodevice, QStringList *errorLog ); - bool writeLatexFile( const QString &filename ); + TQString laTeXFilename; + TQString bibTeXFilename; + TQString outputFilename; + TQString m_latexLanguage; + TQString m_latexBibStyle; + + bool generateRTF( TQIODevice* iodevice, TQStringList *errorLog ); + bool writeLatexFile( const TQString &filename ); }; } diff --git a/src/fileexportertoolchain.cpp b/src/fileexportertoolchain.cpp index 8e51431..0883e60 100644 --- a/src/fileexportertoolchain.cpp +++ b/src/fileexportertoolchain.cpp @@ -18,10 +18,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include "fileexportertoolchain.h" @@ -31,7 +31,7 @@ namespace BibTeX FileExporterToolchain::FileExporterToolchain() : FileExporter(), m_errorLog( NULL ) { - m_waitCond = new QWaitCondition(); + m_waitCond = new TQWaitCondition(); workingDir = createTempDir(); } @@ -41,29 +41,29 @@ namespace BibTeX deleteTempDir( workingDir ); } - bool FileExporterToolchain::runProcesses( const QStringList &progs, QStringList *errorLog ) + bool FileExporterToolchain::runProcesses( const TQStringList &progs, TQStringList *errorLog ) { bool result = TRUE; int i = 0; emit progress( 0, progs.size() ); - for ( QStringList::ConstIterator it = progs.begin(); result && it != progs.end(); it++ ) + for ( TQStringList::ConstIterator it = progs.begin(); result && it != progs.end(); it++ ) { - qApp->processEvents(); - QStringList args = QStringList::split( ' ', *it ); + tqApp->processEvents(); + TQStringList args = TQStringList::split( ' ', *it ); result &= runProcess( args, errorLog ); emit progress( i++, progs.size() ); } - qApp->processEvents(); + tqApp->processEvents(); return result; } - bool FileExporterToolchain::runProcess( const QStringList &args, QStringList *errorLog ) + bool FileExporterToolchain::runProcess( const TQStringList &args, TQStringList *errorLog ) { bool result = FALSE; - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); - m_process = new QProcess( args ); + m_process = new TQProcess( args ); m_process->setWorkingDirectory( workingDir ); connect( m_process, SIGNAL( processExited() ), this, SLOT( slotProcessExited() ) ); connect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadProcessOutput() ) ); @@ -73,11 +73,11 @@ namespace BibTeX { m_errorLog = errorLog; int counter = 0; - qApp->processEvents(); + tqApp->processEvents(); while ( m_process->isRunning() ) { m_waitCond->wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); counter++; if ( counter > 400 ) @@ -86,10 +86,10 @@ namespace BibTeX result = m_process->normalExit() && counter < 400; if ( !result ) - errorLog->append( QString( "Process '%1' failed." ).arg( args.join( " " ) ) ); + errorLog->append( TQString( "Process '%1' failed." ).arg( args.join( " " ) ) ); } else - errorLog->append( QString( "Process '%1' was not started." ).arg( args.join( " " ) ) ); + errorLog->append( TQString( "Process '%1' was not started." ).arg( args.join( " " ) ) ); disconnect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadProcessOutput() ) ); @@ -98,18 +98,18 @@ namespace BibTeX delete( m_process ); m_process = NULL; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return result; } - bool FileExporterToolchain::writeFileToIODevice( const QString &filename, QIODevice *device ) + bool FileExporterToolchain::writeFileToIODevice( const TQString &filename, TQIODevice *device ) { - QFile file( filename ); + TQFile file( filename ); if ( file.open( IO_ReadOnly ) ) { bool result = TRUE; - Q_ULONG buffersize = 0x10000; - Q_LONG amount = 0; + TQ_ULONG buffersize = 0x10000; + TQ_LONG amount = 0; char* buffer = new char[ buffersize ]; do { @@ -125,20 +125,20 @@ namespace BibTeX return FALSE; } - QString FileExporterToolchain::createTempDir() + TQString FileExporterToolchain::createTempDir() { - QString result = QString::null; - QFile *devrandom = new QFile( "/dev/random" ); + TQString result = TQString::null; + TQFile *devrandom = new TQFile( "/dev/random" ); if ( devrandom->open( IO_ReadOnly ) ) { - Q_UINT32 randomNumber; + TQ_UINT32 randomNumber; if ( devrandom->readBlock(( char* ) & randomNumber, sizeof( randomNumber ) ) > 0 ) { randomNumber |= 0x10000000; - result = QString( "/tmp/bibtex-%1" ).arg( randomNumber, sizeof( randomNumber ) * 2, 16 ); - if ( !QDir().mkdir( result ) ) - result = QString::null; + result = TQString( "/tmp/bibtex-%1" ).arg( randomNumber, sizeof( randomNumber ) * 2, 16 ); + if ( !TQDir().mkdir( result ) ) + result = TQString::null; } devrandom->close(); } @@ -148,20 +148,20 @@ namespace BibTeX return result; } - void FileExporterToolchain::deleteTempDir( const QString& directory ) + void FileExporterToolchain::deleteTempDir( const TQString& directory ) { - QDir dir = QDir( directory ); - QStringList subDirs = dir.entryList( QDir::Dirs ); - for ( QStringList::Iterator it = subDirs.begin(); it != subDirs.end(); it++ ) + TQDir dir = TQDir( directory ); + TQStringList subDirs = dir.entryList( TQDir::Dirs ); + for ( TQStringList::Iterator it = subDirs.begin(); it != subDirs.end(); it++ ) { - if (( QString::compare( *it, "." ) != 0 ) && ( QString::compare( *it, ".." ) != 0 ) ) + if (( TQString::compare( *it, "." ) != 0 ) && ( TQString::compare( *it, ".." ) != 0 ) ) deleteTempDir( *it ); } - QStringList allEntries = dir.entryList( QDir::All ); - for ( QStringList::Iterator it = allEntries.begin(); it != allEntries.end(); it++ ) + TQStringList allEntries = dir.entryList( TQDir::All ); + for ( TQStringList::Iterator it = allEntries.begin(); it != allEntries.end(); it++ ) dir.remove( *it ); - QDir().rmdir( directory ); + TQDir().rmdir( directory ); } void FileExporterToolchain::slotProcessExited() @@ -173,7 +173,7 @@ namespace BibTeX { if ( m_process != NULL ) { - qDebug( "Canceling process" ); + tqDebug( "Canceling process" ); m_process->tryTerminate(); m_process->kill(); m_waitCond->wakeAll(); @@ -186,35 +186,35 @@ namespace BibTeX { while ( m_process->canReadLineStdout() ) { - QString line = m_process->readLineStdout(); + TQString line = m_process->readLineStdout(); if ( m_errorLog != NULL ) m_errorLog->append( line ); } while ( m_process->canReadLineStderr() ) { - QString line = m_process->readLineStderr(); + TQString line = m_process->readLineStderr(); if ( m_errorLog != NULL ) m_errorLog->append( line ); } } } - bool FileExporterToolchain::kpsewhich( const QString& filename ) + bool FileExporterToolchain::kpsewhich( const TQString& filename ) { bool result = FALSE; int counter = 0; - QWaitCondition waitCond; - QProcess kpsewhich; + TQWaitCondition waitCond; + TQProcess kpsewhich; kpsewhich.addArgument( "kpsewhich" ); kpsewhich.addArgument( filename ); if ( kpsewhich.start() ) { - qApp->processEvents(); + tqApp->processEvents(); while ( kpsewhich.isRunning() ) { waitCond.wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); counter++; if ( counter > 50 ) diff --git a/src/fileexportertoolchain.h b/src/fileexportertoolchain.h index 76000a1..7ea4cfb 100644 --- a/src/fileexportertoolchain.h +++ b/src/fileexportertoolchain.h @@ -22,10 +22,10 @@ #include -class QString; -class QWaitCondition; -class QProcess; -class QStringList; +class TQString; +class TQWaitCondition; +class TQProcess; +class TQStringList; namespace BibTeX { @@ -44,20 +44,20 @@ namespace BibTeX void cancel(); protected: - QString workingDir; + TQString workingDir; - bool runProcesses( const QStringList &progs, QStringList *errorLog = NULL ); - bool runProcess( const QStringList &args, QStringList *errorLog = NULL ); - bool writeFileToIODevice( const QString &filename, QIODevice *device ); - bool kpsewhich( const QString& filename ); + bool runProcesses( const TQStringList &progs, TQStringList *errorLog = NULL ); + bool runProcess( const TQStringList &args, TQStringList *errorLog = NULL ); + bool writeFileToIODevice( const TQString &filename, TQIODevice *device ); + bool kpsewhich( const TQString& filename ); private: - QWaitCondition *m_waitCond; - QProcess *m_process; - QStringList *m_errorLog; + TQWaitCondition *m_waitCond; + TQProcess *m_process; + TQStringList *m_errorLog; - QString createTempDir(); - void deleteTempDir( const QString& directory ); + TQString createTempDir(); + void deleteTempDir( const TQString& directory ); private slots: void slotProcessExited(); diff --git a/src/fileexporterxml.cpp b/src/fileexporterxml.cpp index 4dcbee4..ff2814e 100644 --- a/src/fileexporterxml.cpp +++ b/src/fileexporterxml.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -42,13 +42,13 @@ namespace BibTeX // nothing } - bool FileExporterXML::save( QIODevice* iodevice, const File* bibtexfile, QStringList * /*errorLog*/ ) + bool FileExporterXML::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList * /*errorLog*/ ) { m_mutex.lock(); bool result = TRUE; m_cancelFlag = FALSE; - QTextStream stream( iodevice ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( iodevice ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "" << endl; stream << "" << endl; @@ -68,10 +68,10 @@ namespace BibTeX return result && !m_cancelFlag; } - bool FileExporterXML::save( QIODevice* iodevice, const Element* element, QStringList * /*errorLog*/ ) + bool FileExporterXML::save( TQIODevice* iodevice, const Element* element, TQStringList * /*errorLog*/ ) { - QTextStream stream( iodevice ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( iodevice ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "" << endl; return write( stream, element ); @@ -82,7 +82,7 @@ namespace BibTeX m_cancelFlag = TRUE; } - bool FileExporterXML::write( QTextStream&stream, const Element *element, const File* bibtexfile ) + bool FileExporterXML::write( TQTextStream&stream, const Element *element, const File* bibtexfile ) { bool result = FALSE; @@ -117,7 +117,7 @@ namespace BibTeX return result; } - bool FileExporterXML::writeEntry( QTextStream &stream, const Entry* entry ) + bool FileExporterXML::writeEntry( TQTextStream &stream, const Entry* entry ) { stream << " encode( entry->id() ) << "\" type=\"" << entry->entryTypeString().lower() << "\">" << endl; for ( Entry::EntryFields::const_iterator it = entry->begin(); it != entry->end(); it++ ) @@ -128,10 +128,10 @@ namespace BibTeX case EntryField::ftAuthor: case EntryField::ftEditor: { - QString tag = field->fieldTypeName().lower(); + TQString tag = field->fieldTypeName().lower(); stream << " <" << tag << "s>" << endl; - QStringList persons = QStringList::split( QRegExp( "\\s+(,|and|&)+\\s+", FALSE ), EncoderXML::currentEncoderXML() ->encode( valueToString( field->value() ) ) ); - for ( QStringList::Iterator it = persons.begin(); it != persons.end(); it++ ) + TQStringList persons = TQStringList::split( TQRegExp( "\\s+(,|and|&)+\\s+", FALSE ), EncoderXML::currentEncoderXML() ->encode( valueToString( field->value() ) ) ); + for ( TQStringList::Iterator it = persons.begin(); it != persons.end(); it++ ) stream << " " << *it << "" << endl; stream << " " << endl; } @@ -142,14 +142,14 @@ namespace BibTeX bool ok = FALSE; int month = -1; - QString tag = ""; - QString content = ""; - for ( QValueList::ConstIterator it = field->value()->items.begin(); it != field->value()->items.end(); ++it ) + TQString tag = ""; + TQString content = ""; + for ( TQValueList::ConstIterator it = field->value()->items.begin(); it != field->value()->items.end(); ++it ) { if ( dynamic_cast( *it ) != NULL ) { for ( int i = 0; i < 12; i++ ) - if ( QString::compare(( *it )->text(), MonthsTriple[ i ] ) == 0 ) + if ( TQString::compare(( *it )->text(), MonthsTriple[ i ] ) == 0 ) { if ( month < 1 ) { @@ -177,7 +177,7 @@ namespace BibTeX break; default: { - QString tag = field->fieldTypeName().lower(); + TQString tag = field->fieldTypeName().lower(); stream << " <" << tag << ">" << EncoderXML::currentEncoderXML() ->encode( valueToString( field->value() ) ) << "" << endl; } break; @@ -189,7 +189,7 @@ namespace BibTeX return TRUE; } - bool FileExporterXML::writeMacro( QTextStream &stream, const Macro *macro ) + bool FileExporterXML::writeMacro( TQTextStream &stream, const Macro *macro ) { stream << " key() << "\">"; stream << EncoderXML::currentEncoderXML() ->encode( valueToString( macro->value() ) ); @@ -198,7 +198,7 @@ namespace BibTeX return TRUE; } - bool FileExporterXML::writeComment( QTextStream &stream, const Comment *comment ) + bool FileExporterXML::writeComment( TQTextStream &stream, const Comment *comment ) { stream << " " ; stream << EncoderXML::currentEncoderXML() ->encode( comment->text() ); @@ -207,12 +207,12 @@ namespace BibTeX return TRUE; } - QString FileExporterXML::valueToString( Value *value ) + TQString FileExporterXML::valueToString( Value *value ) { - QString result; + TQString result; bool isFirst = TRUE; - for ( QValueList::ConstIterator it = value->items.begin(); it != value->items.end(); it++ ) + for ( TQValueList::ConstIterator it = value->items.begin(); it != value->items.end(); it++ ) { if ( !isFirst ) result.append( ' ' ); diff --git a/src/fileexporterxml.h b/src/fileexporterxml.h index a4eff65..88f64f3 100644 --- a/src/fileexporterxml.h +++ b/src/fileexporterxml.h @@ -39,8 +39,8 @@ namespace BibTeX FileExporterXML(); ~FileExporterXML(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); public slots: void cancel(); @@ -48,12 +48,12 @@ namespace BibTeX private: bool m_cancelFlag; - bool write( QTextStream&stream, const Element *element, const File* bibtexfile = NULL ); - bool writeEntry( QTextStream &stream, const Entry* entry ); - bool writeMacro( QTextStream &stream, const Macro *macro ); - bool writeComment( QTextStream &stream, const Comment *comment ); + bool write( TQTextStream&stream, const Element *element, const File* bibtexfile = NULL ); + bool writeEntry( TQTextStream &stream, const Entry* entry ); + bool writeMacro( TQTextStream &stream, const Macro *macro ); + bool writeComment( TQTextStream &stream, const Comment *comment ); - QString valueToString( Value *value ); + TQString valueToString( Value *value ); }; } diff --git a/src/fileexporterxslt.cpp b/src/fileexporterxslt.cpp index a5a3255..14991e6 100644 --- a/src/fileexporterxslt.cpp +++ b/src/fileexporterxslt.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include #include @@ -40,23 +40,23 @@ namespace BibTeX delete m_exporterXML; } - bool FileExporterXSLT::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterXSLT::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); if ( m_exporterXML->save( &buffer, bibtexfile, errorLog ) ) { buffer.close(); buffer.open( IO_ReadOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); - QString xml = ts.read(); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString xml = ts.read(); buffer.close(); - QString html = m_transformer->transform( xml ); - QTextStream htmlTS( iodevice ); - htmlTS.setEncoding( QTextStream::UnicodeUTF8 ); + TQString html = m_transformer->transform( xml ); + TQTextStream htmlTS( iodevice ); + htmlTS.setEncoding( TQTextStream::UnicodeUTF8 ); htmlTS << html << endl; m_mutex.unlock(); return TRUE; @@ -66,23 +66,23 @@ namespace BibTeX return FALSE; } - bool FileExporterXSLT::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterXSLT::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); if ( m_exporterXML->save( &buffer, element, errorLog ) ) { buffer.close(); buffer.open( IO_ReadOnly ); - QTextStream xmlTS( &buffer ); - xmlTS.setEncoding( QTextStream::UnicodeUTF8 ); - QString xml = xmlTS.read(); + TQTextStream xmlTS( &buffer ); + xmlTS.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString xml = xmlTS.read(); buffer.close(); - QString html = m_transformer->transform( xml ); - QTextStream output( iodevice ); - output.setEncoding( QTextStream::UnicodeUTF8 ); + TQString html = m_transformer->transform( xml ); + TQTextStream output( iodevice ); + output.setEncoding( TQTextStream::UnicodeUTF8 ); output << html << endl; m_mutex.unlock(); return TRUE; diff --git a/src/fileexporterxslt.h b/src/fileexporterxslt.h index 0d11e58..a41c8f9 100644 --- a/src/fileexporterxslt.h +++ b/src/fileexporterxslt.h @@ -37,8 +37,8 @@ namespace BibTeX FileExporterXSLT( XSLTransform *transformer ); ~FileExporterXSLT(); - bool save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog = NULL ); - bool save( QIODevice* iodevice, const Element* element, QStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog = NULL ); + bool save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog = NULL ); private: XSLTransform *m_transformer; diff --git a/src/fileimporter.cpp b/src/fileimporter.cpp index 65ee792..2633d35 100644 --- a/src/fileimporter.cpp +++ b/src/fileimporter.cpp @@ -17,14 +17,14 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include "fileimporter.h" namespace BibTeX { - FileImporter::FileImporter() : QObject() + FileImporter::FileImporter() : TQObject() { // nothing } @@ -34,15 +34,15 @@ namespace BibTeX // nothing } - File* FileImporter::load( const QString& text ) + File* FileImporter::load( const TQString& text ) { if ( text.isNull() || text.isEmpty() ) return NULL; - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream stream( &buffer ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &buffer ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << text; buffer.close(); diff --git a/src/fileimporter.h b/src/fileimporter.h index 6dfdb2d..d99ade7 100644 --- a/src/fileimporter.h +++ b/src/fileimporter.h @@ -20,10 +20,10 @@ #ifndef BIBTEXFILEIMPORTER_H #define BIBTEXFILEIMPORTER_H -#include -#include +#include +#include -class QIODevice; +class TQIODevice; namespace BibTeX { @@ -32,17 +32,17 @@ namespace BibTeX /** @author Thomas Fischer */ - class FileImporter : public QObject + class FileImporter : public TQObject { Q_OBJECT public: FileImporter(); ~FileImporter(); - File* load( const QString& text ); - virtual File* load( QIODevice *iodevice ) = 0; + File* load( const TQString& text ); + virtual File* load( TQIODevice *iodevice ) = 0; - static bool guessCanDecode( const QString & ) + static bool guessCanDecode( const TQString & ) { return FALSE; }; @@ -58,7 +58,7 @@ namespace BibTeX }; protected: - QMutex m_mutex; + TQMutex m_mutex; }; } diff --git a/src/fileimporterbibtex.cpp b/src/fileimporterbibtex.cpp index 5312f0c..f1d3c2e 100644 --- a/src/fileimporterbibtex.cpp +++ b/src/fileimporterbibtex.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -36,10 +36,10 @@ namespace BibTeX { - const QString extraAlphaNumChars = QString( "?'`-_:.+/$\\\"&" ); - const QRegExp htmlRegExp = QRegExp( "]*>", false ); + const TQString extraAlphaNumChars = TQString( "?'`-_:.+/$\\\"&" ); + const TQRegExp htmlRegExp = TQRegExp( "]*>", false ); - FileImporterBibTeX::FileImporterBibTeX( bool personFirstNameFirst, QString encoding ) : FileImporter(), m_personFirstNameFirst( personFirstNameFirst ), m_currentChar( ' ' ), m_ignoreComments( FALSE ), m_lineBufferSize( 4096 ), m_encoding( encoding ) + FileImporterBibTeX::FileImporterBibTeX( bool personFirstNameFirst, TQString encoding ) : FileImporter(), m_personFirstNameFirst( personFirstNameFirst ), m_currentChar( ' ' ), m_ignoreComments( FALSE ), m_lineBufferSize( 4096 ), m_encoding( encoding ) { cancelFlag = FALSE; m_lineBuffer = new char[m_lineBufferSize]; @@ -52,12 +52,12 @@ namespace BibTeX delete[] m_lineBuffer; } - File* FileImporterBibTeX::load( QIODevice *iodevice ) + File* FileImporterBibTeX::load( TQIODevice *iodevice ) { m_mutex.lock(); cancelFlag = FALSE; - QString rawText; + TQString rawText; const char *encodingFrom = m_encoding == "latex" ? "utf-8\0" : m_encoding.append( "\0" ).ascii(); iconv_t iconvHandle = iconv_open( "utf-8", encodingFrom ); char *convertedLine = new char[m_lineBufferSize * 4]; @@ -72,19 +72,19 @@ namespace BibTeX size_t encLen = m_lineBufferSize, rawLen = ( size_t )len; size_t result = iconv( iconvHandle, &raw, &rawLen, &enc, &encLen ); - qApp->processEvents(); + tqApp->processEvents(); if ( result != 0 ) { - QString problematic = QString( m_lineBuffer ).mid( max( 0, m_lineBufferSize - encLen - 15 ), 30 ); - if ( problematic.isNull() || problematic.isEmpty() ) problematic = QString( m_lineBuffer ); - qDebug( "iconv resulted in error code %i for source encoding %s, maybe file is in different encoding? Problem is somewhere here: \"%s\"", result, encodingFrom, problematic.latin1() ); + TQString problematic = TQString( m_lineBuffer ).mid( max( 0, m_lineBufferSize - encLen - 15 ), 30 ); + if ( problematic.isNull() || problematic.isEmpty() ) problematic = TQString( m_lineBuffer ); + tqDebug( "iconv resulted in error code %i for source encoding %s, maybe file is in different encoding? Problem is somewhere here: \"%s\"", result, encodingFrom, problematic.latin1() ); encodingOk = false; break; } if ( rawLen > 0 ) { - qDebug( "iconv could not convert complete string, only %i out of %i chars", len - rawLen, len ); + tqDebug( "iconv could not convert complete string, only %i out of %i chars", len - rawLen, len ); encodingOk = false; break; } @@ -95,7 +95,7 @@ namespace BibTeX while (((( unsigned char )convertedLine[offset] ) == 0xef || (( unsigned char )convertedLine[offset] ) == 0xbb || (( unsigned char )convertedLine[offset] ) == 0xbf ) && offset < 4 ) ++offset; - QString line = QString::fromUtf8( convertedLine + offset ); + TQString line = TQString::fromUtf8( convertedLine + offset ); rawText.append( line ); } iconv_close( iconvHandle ); @@ -103,7 +103,7 @@ namespace BibTeX if ( !encodingOk ) { - qDebug( "Decoding failed, cannot load file. Please fix encoding manually." ); + tqDebug( "Decoding failed, cannot load file. Please fix encoding manually." ); m_mutex.unlock(); return NULL; } @@ -112,18 +112,18 @@ namespace BibTeX rawText = rawText.replace( htmlRegExp, "" ); rawText = EncoderLaTeX::currentEncoderLaTeX() ->decode( rawText ); unescapeLaTeXChars( rawText ); - m_textStream = new QTextStream( rawText, IO_ReadOnly ); - m_textStream->setEncoding( QTextStream::UnicodeUTF8 ); + m_textStream = new TQTextStream( rawText, IO_ReadOnly ); + m_textStream->setEncoding( TQTextStream::UnicodeUTF8 ); m_currentLineNumber = 0; m_posIntCurrentLine = 0; m_currentLine = ""; File *result = new File(); - QIODevice *streamDevice = m_textStream->device(); + TQIODevice *streamDevice = m_textStream->device(); while ( !cancelFlag && !m_textStream->atEnd() ) { emit progress( streamDevice->at(), streamDevice->size() ); - qApp->processEvents(); + tqApp->processEvents(); Element * element = nextElement(); if ( element != NULL ) { @@ -133,13 +133,13 @@ namespace BibTeX else delete element; } - qApp->processEvents(); + tqApp->processEvents(); } emit progress( streamDevice->size(), streamDevice->size() ); if ( cancelFlag ) { - qDebug( "Loading file has been canceled" ); + tqDebug( "Loading file has been canceled" ); delete result; result = NULL; } @@ -150,10 +150,10 @@ namespace BibTeX return result; } - bool FileImporterBibTeX::guessCanDecode( const QString & rawText ) + bool FileImporterBibTeX::guessCanDecode( const TQString & rawText ) { - QString text = EncoderLaTeX::currentEncoderLaTeX() ->decode( rawText ); - return text.find( QRegExp( "@\\w+\\{.+\\}" ) ) >= 0; + TQString text = EncoderLaTeX::currentEncoderLaTeX() ->decode( rawText ); + return text.find( TQRegExp( "@\\w+\\{.+\\}" ) ) >= 0; } void FileImporterBibTeX::setIgnoreComments( bool ignoreComments ) @@ -172,7 +172,7 @@ namespace BibTeX if ( token == tAt ) { - QString elementType = readSimpleString(); + TQString elementType = readSimpleString(); if ( elementType.lower() == "comment" ) return readCommentElement(); else if ( elementType.lower() == "string" ) @@ -183,18 +183,18 @@ namespace BibTeX return readEntryElement( elementType ); else { - qDebug( "ElementType is empty" ); + tqDebug( "ElementType is empty" ); return NULL; } } else if ( token == tUnknown ) { - qDebug( "Unknown token near line %i, treating as comment", m_currentLineNumber ); + tqDebug( "Unknown token near line %i, treating as comment", m_currentLineNumber ); return readPlainCommentElement(); } if ( token != tEOF ) - qDebug( "Don't know how to parse next token near line %i: %s", m_currentLineNumber, tokenidToString( token ).latin1() ); + tqDebug( "Don't know how to parse next token near line %i: %s", m_currentLineNumber, tokenidToString( token ).latin1() ); return NULL; } @@ -209,7 +209,7 @@ namespace BibTeX Comment *FileImporterBibTeX::readPlainCommentElement() { - QString result = m_currentChar; + TQString result = m_currentChar; result += readLine(); m_currentChar = nextChar(); while ( !m_textStream->atEnd() && m_currentChar != '@' && !m_currentChar.isSpace() ) @@ -229,16 +229,16 @@ namespace BibTeX { if ( token == tEOF ) { - qDebug( "Error in parsing unknown macro (near line %i): Opening curly brace ({) expected", m_currentLineNumber ); + tqDebug( "Error in parsing unknown macro (near line %i): Opening curly brace ({) expected", m_currentLineNumber ); return NULL; } token = nextToken(); } - QString key = readSimpleString(); + TQString key = readSimpleString(); if ( nextToken() != tAssign ) { - qDebug( "Error in parsing macro '%s' (near line %i): Assign symbol (=) expected", key.latin1(), m_currentLineNumber ); + tqDebug( "Error in parsing macro '%s' (near line %i): Assign symbol (=) expected", key.latin1(), m_currentLineNumber ); return NULL; } @@ -246,7 +246,7 @@ namespace BibTeX do { bool isStringKey = FALSE; - QString text = readString( isStringKey ).replace( QRegExp( "\\s+" ), " " ); + TQString text = readString( isStringKey ).replace( TQRegExp( "\\s+" ), " " ); if ( isStringKey ) macro->value()->items.append( new MacroKey( text ) ); else @@ -266,7 +266,7 @@ namespace BibTeX { if ( token == tEOF ) { - qDebug( "Error in parsing unknown preamble (near line %i): Opening curly brace ({) expected", m_currentLineNumber ); + tqDebug( "Error in parsing unknown preamble (near line %i): Opening curly brace ({) expected", m_currentLineNumber ); return NULL; } token = nextToken(); @@ -276,7 +276,7 @@ namespace BibTeX do { bool isStringKey = FALSE; - QString text = readString( isStringKey ).replace( QRegExp( "\\s+" ), " " ); + TQString text = readString( isStringKey ).replace( TQRegExp( "\\s+" ), " " ); if ( isStringKey ) preamble->value()->items.append( new MacroKey( text ) ); else @@ -289,20 +289,20 @@ namespace BibTeX return preamble; } - Entry *FileImporterBibTeX::readEntryElement( const QString& typeString ) + Entry *FileImporterBibTeX::readEntryElement( const TQString& typeString ) { Token token = nextToken(); while ( token != tBracketOpen ) { if ( token == tEOF ) { - qDebug( "Error in parsing unknown entry (near line %i): Opening curly brace ({) expected", m_currentLineNumber ); + tqDebug( "Error in parsing unknown entry (near line %i): Opening curly brace ({) expected", m_currentLineNumber ); return NULL; } token = nextToken(); } - QString key = readSimpleString(); + TQString key = readSimpleString(); Entry *entry = new Entry( typeString, key ); token = nextToken(); @@ -312,21 +312,21 @@ namespace BibTeX break; else if ( token != tComma ) { - qDebug( "Error in parsing entry '%s' (near line %i): Comma symbol (,) expected but got 0x%x (token %s)", key.latin1(), m_currentLineNumber, m_currentChar.unicode(), tokenidToString( token ).latin1() ); + tqDebug( "Error in parsing entry '%s' (near line %i): Comma symbol (,) expected but got 0x%x (token %s)", key.latin1(), m_currentLineNumber, m_currentChar.unicode(), tokenidToString( token ).latin1() ); delete entry; return NULL; } - QString fieldTypeName = readSimpleString(); + TQString fieldTypeName = readSimpleString(); token = nextToken(); - if ( fieldTypeName == QString::null || token == tBracketClose ) + if ( fieldTypeName == TQString::null || token == tBracketClose ) { // entry is buggy, but we still accept it break; } else if ( token != tAssign ) { - qDebug( "Error in parsing entry '%s' (near line %i): Assign symbol (=) expected after field name '%s'", key.latin1(), m_currentLineNumber, fieldTypeName.latin1() ); + tqDebug( "Error in parsing entry '%s' (near line %i): Assign symbol (=) expected after field name '%s'", key.latin1(), m_currentLineNumber, fieldTypeName.latin1() ); delete entry; return NULL; } @@ -335,11 +335,11 @@ namespace BibTeX if ( entry->getField( fieldTypeName ) != NULL ) { int i = 1; - QString appendix = QString::number( i ); + TQString appendix = TQString::number( i ); while ( entry->getField( fieldTypeName + appendix ) != NULL ) { ++i; - appendix = QString::number( i ); + appendix = TQString::number( i ); } fieldTypeName += appendix; } @@ -398,7 +398,7 @@ namespace BibTeX return curToken; } - QString FileImporterBibTeX::readString( bool &isStringKey ) + TQString FileImporterBibTeX::readString( bool &isStringKey ) { while ( m_currentChar.isSpace() ) m_currentChar = nextChar(); @@ -417,9 +417,9 @@ namespace BibTeX } } - QString FileImporterBibTeX::readSimpleString( QChar until ) + TQString FileImporterBibTeX::readSimpleString( TQChar until ) { - QString result; + TQString result; while ( m_currentChar.isSpace() ) m_currentChar = nextChar(); @@ -446,7 +446,7 @@ namespace BibTeX break; else { - qDebug( "Unknown letter or number: 0x%x", m_currentChar.unicode() ); + tqDebug( "Unknown letter or number: 0x%x", m_currentChar.unicode() ); // break; } m_currentChar = nextChar(); @@ -454,10 +454,10 @@ namespace BibTeX return result; } - QString FileImporterBibTeX::readQuotedString() + TQString FileImporterBibTeX::readQuotedString() { - QString result; - QChar lastChar = m_currentChar; + TQString result; + TQChar lastChar = m_currentChar; m_currentChar = nextChar(); while ( !m_textStream->atEnd() ) { @@ -475,17 +475,17 @@ namespace BibTeX return result; } - QString FileImporterBibTeX::readLine() + TQString FileImporterBibTeX::readLine() { - QString result = m_currentLine.mid( m_posIntCurrentLine ); + TQString result = m_currentLine.mid( m_posIntCurrentLine ); m_posIntCurrentLine = m_currentLine.length() + 2; return result; } - QString FileImporterBibTeX::readBracketString( const QChar openingBracket ) + TQString FileImporterBibTeX::readBracketString( const TQChar openingBracket ) { - QString result; - QChar closingBracket = '}'; + TQString result; + TQChar closingBracket = '}'; if ( openingBracket == '(' ) closingBracket = ')'; int counter = 1; @@ -514,14 +514,14 @@ namespace BibTeX do { bool isStringKey = FALSE; - QString text = readString( isStringKey ).replace( QRegExp( "\\s+" ), " " ); + TQString text = readString( isStringKey ).replace( TQRegExp( "\\s+" ), " " ); switch ( fieldType ) { case EntryField::ftKeywords: { if ( isStringKey ) - qDebug( "WARNING: Cannot handle keywords that are macros" ); + tqDebug( "WARNING: Cannot handle keywords that are macros" ); else value->items.append( new KeywordContainer( text ) ); } @@ -530,20 +530,20 @@ namespace BibTeX case EntryField::ftEditor: { if ( isStringKey ) - qDebug( "WARNING: Cannot handle authors/editors that are macros" ); + tqDebug( "WARNING: Cannot handle authors/editors that are macros" ); else { - QStringList persons; + TQStringList persons; splitPersons( text, persons ); PersonContainer *container = new PersonContainer( m_personFirstNameFirst ); - for ( QStringList::ConstIterator pit = persons.constBegin(); pit != persons.constEnd(); ++pit ) + for ( TQStringList::ConstIterator pit = persons.constBegin(); pit != persons.constEnd(); ++pit ) container->persons.append( new Person( *pit, m_personFirstNameFirst ) ); value->items.append( container ); } } break; case EntryField::ftPages: - text.replace( QRegExp( "\\s*--?\\s*" ), QChar( 0x2013 ) ); + text.replace( TQRegExp( "\\s*--?\\s*" ), TQChar( 0x2013 ) ); default: { if ( isStringKey ) @@ -560,15 +560,15 @@ namespace BibTeX return token; } - void FileImporterBibTeX::unescapeLaTeXChars( QString &text ) + void FileImporterBibTeX::unescapeLaTeXChars( TQString &text ) { text.replace( "\\&", "&" ); } - void FileImporterBibTeX::splitPersons( const QString& text, QStringList &persons ) + void FileImporterBibTeX::splitPersons( const TQString& text, TQStringList &persons ) { - QStringList wordList; - QString word; + TQStringList wordList; + TQString word; int bracketCounter = 0; for ( unsigned int pos = 0;pos < text.length();++pos ) @@ -600,15 +600,15 @@ namespace BibTeX void FileImporterBibTeX::evaluateParameterComments( iconv_t &iconvHandle, const char *cline ) { - /** simple preliminary checks before expensive conversion to QString */ + /** simple preliminary checks before expensive conversion to TQString */ if ( cline[0] == '@' && cline[1] == 'c' ) { - QString line = QString( cline ).lower(); + TQString line = TQString( cline ).lower(); /** check if this file requests a special encoding */ if ( line.startsWith( "@comment{x-kbibtex-encoding=" ) && line.endsWith( "}\n" ) ) { - QString newEncoding = line.mid( 28, line.length() - 30 ); - qDebug( "x-kbibtex-encoding=<%s>", newEncoding.latin1() ); + TQString newEncoding = line.mid( 28, line.length() - 30 ); + tqDebug( "x-kbibtex-encoding=<%s>", newEncoding.latin1() ); if ( newEncoding == "latex" ) newEncoding = "utf-8"; iconv_close( iconvHandle ); iconvHandle = iconv_open( "utf-8", newEncoding.append( '\0' ).ascii() ); @@ -616,7 +616,7 @@ namespace BibTeX } } - QChar FileImporterBibTeX::nextChar() + TQChar FileImporterBibTeX::nextChar() { bool atEndOfLine = m_posIntCurrentLine >= m_currentLine.length(); @@ -628,31 +628,31 @@ namespace BibTeX } if ( atEndOfLine ) - return QChar( ' ' ); + return TQChar( ' ' ); else if ( m_posIntCurrentLine < m_currentLine.length() ) { - QChar result = m_currentLine[m_posIntCurrentLine]; + TQChar result = m_currentLine[m_posIntCurrentLine]; ++m_posIntCurrentLine; return result; } - return QChar(); + return TQChar(); } - QString FileImporterBibTeX::tokenidToString( Token token ) + TQString FileImporterBibTeX::tokenidToString( Token token ) { switch ( token ) { - case tAt: return QString( "At" ); - case tBracketClose: return QString( "BracketClose" ); - case tBracketOpen: return QString( "BracketOpen" ); - case tAlphaNumText: return QString( "AlphaNumText" ); - case tAssign: return QString( "Assign" ); - case tComma: return QString( "Comma" ); - case tDoublecross: return QString( "Doublecross" ); - case tEOF: return QString( "EOF" ); - case tUnknown: return QString( "Unknown" ); - default: return QString( "" ); + case tAt: return TQString( "At" ); + case tBracketClose: return TQString( "BracketClose" ); + case tBracketOpen: return TQString( "BracketOpen" ); + case tAlphaNumText: return TQString( "AlphaNumText" ); + case tAssign: return TQString( "Assign" ); + case tComma: return TQString( "Comma" ); + case tDoublecross: return TQString( "Doublecross" ); + case tEOF: return TQString( "EOF" ); + case tUnknown: return TQString( "Unknown" ); + default: return TQString( "" ); } } } diff --git a/src/fileimporterbibtex.h b/src/fileimporterbibtex.h index 39ab911..a1dd89f 100644 --- a/src/fileimporterbibtex.h +++ b/src/fileimporterbibtex.h @@ -41,11 +41,11 @@ namespace BibTeX class FileImporterBibTeX : public FileImporter { public: - FileImporterBibTeX( bool personFirstNameFirst = FALSE, QString encoding = "latex" ); + FileImporterBibTeX( bool personFirstNameFirst = FALSE, TQString encoding = "latex" ); ~FileImporterBibTeX(); - File* load( QIODevice *iodevice ); - static bool guessCanDecode( const QString & text ); + File* load( TQIODevice *iodevice ); + static bool guessCanDecode( const TQString & text ); void setIgnoreComments( bool ignoreComments ); @@ -59,14 +59,14 @@ namespace BibTeX }; bool cancelFlag; - QTextStream *m_textStream; + TQTextStream *m_textStream; bool m_personFirstNameFirst; - QChar m_currentChar; + TQChar m_currentChar; bool m_ignoreComments; char *m_lineBuffer; const int m_lineBufferSize; - QString m_encoding; - QString m_currentLine; + TQString m_encoding; + TQString m_currentLine; unsigned int m_posIntCurrentLine; int m_currentLineNumber; @@ -74,21 +74,21 @@ namespace BibTeX Comment *readPlainCommentElement(); Macro *readMacroElement(); Preamble *readPreambleElement(); - Entry *readEntryElement( const QString& typeString ); + Entry *readEntryElement( const TQString& typeString ); Element *nextElement(); Token nextToken(); - QString readString( bool &isStringKey ); - QString readSimpleString( QChar until = '\0' ); - QString readQuotedString(); - QString readLine(); - QString readBracketString( const QChar openingBracket ); + TQString readString( bool &isStringKey ); + TQString readSimpleString( TQChar until = '\0' ); + TQString readQuotedString(); + TQString readLine(); + TQString readBracketString( const TQChar openingBracket ); Token readValue( Value *value, EntryField::FieldType fieldType ); - void unescapeLaTeXChars( QString &text ); - void splitPersons( const QString& test, QStringList &persons ); + void unescapeLaTeXChars( TQString &text ); + void splitPersons( const TQString& test, TQStringList &persons ); void evaluateParameterComments( iconv_t &iconvHandle, const char *line ); - QChar nextChar(); - QString tokenidToString( Token token ); + TQChar nextChar(); + TQString tokenidToString( Token token ); }; } diff --git a/src/fileimporterbibutils.cpp b/src/fileimporterbibutils.cpp index bd2b622..52195b3 100644 --- a/src/fileimporterbibutils.cpp +++ b/src/fileimporterbibutils.cpp @@ -19,13 +19,13 @@ ***************************************************************************/ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -37,7 +37,7 @@ namespace BibTeX FileImporterBibUtils::FileImporterBibUtils( BibTeX::File::FileFormat inputFormat ) : FileImporter(), m_workingDir( createTempDir() ), m_inputFormat( inputFormat ), m_bibTeXImporter( new FileImporterBibTeX( false, "utf-8" ) ) { - m_processBuffer = new QBuffer(); + m_processBuffer = new TQBuffer(); } FileImporterBibUtils::~FileImporterBibUtils() @@ -47,17 +47,17 @@ namespace BibTeX delete m_bibTeXImporter; } - File* FileImporterBibUtils::load( QIODevice *iodevice ) + File* FileImporterBibUtils::load( TQIODevice *iodevice ) { m_cancelFlag = false; if ( !iodevice->isReadable() ) { - qDebug( "iodevice is not readable" ); + tqDebug( "iodevice is not readable" ); return NULL; } if ( !iodevice->isOpen() ) { - qDebug( "iodevice is not open" ); + tqDebug( "iodevice is not open" ); return NULL; } @@ -67,12 +67,12 @@ namespace BibTeX return xmlBufferToBibTeXFile(); } - bool FileImporterBibUtils::guessCanDecode( const QString & text ) + bool FileImporterBibUtils::guessCanDecode( const TQString & text ) { return guessInputFormat( text ) != BibTeX::File::formatUndefined; } - File::FileFormat FileImporterBibUtils::guessInputFormat( const QString &text ) + File::FileFormat FileImporterBibUtils::guessInputFormat( const TQString &text ) { if ( text.find( "TY - " ) >= 0 ) return BibTeX::File::formatRIS; @@ -90,37 +90,37 @@ namespace BibTeX m_cancelFlag = true; } - bool FileImporterBibUtils::iodeviceToXMLbuffer( QIODevice *iodevice ) + bool FileImporterBibUtils::iodeviceToXMLbuffer( TQIODevice *iodevice ) { - QWaitCondition wc; + TQWaitCondition wc; m_processBuffer->open( IO_WriteOnly ); m_process = NULL; switch ( m_inputFormat ) { case BibTeX::File::formatISI: - m_process = new QProcess( QStringList::split( ' ', "isi2xml -i utf8 -u" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "isi2xml -i utf8 -u" ) ); break; case BibTeX::File::formatWordBib: - m_process = new QProcess( QStringList::split( ' ', "wordbib2xml -i utf8 -u" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "wordbib2xml -i utf8 -u" ) ); break; case BibTeX::File::formatAds: - m_process = new QProcess( QStringList::split( ' ', "ads2xml -i utf8 -u" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "ads2xml -i utf8 -u" ) ); break; case BibTeX::File::formatEndNote: - m_process = new QProcess( QStringList::split( ' ', "end2xml -i utf8 -u" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "end2xml -i utf8 -u" ) ); break; case BibTeX::File::formatEndNoteXML: - m_process = new QProcess( QStringList::split( ' ', "endx2xml -i utf8 -u" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "endx2xml -i utf8 -u" ) ); break; case BibTeX::File::formatRIS: - m_process = new QProcess( QStringList::split( ' ', "ris2xml -i utf8 -u" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "ris2xml -i utf8 -u" ) ); break; case BibTeX::File::formatMODS: /* m_process = NULL; */ break; default: - qDebug( "Cannot handle input format %i", m_inputFormat ); + tqDebug( "Cannot handle input format %i", m_inputFormat ); return false; } @@ -134,16 +134,16 @@ namespace BibTeX m_process->start(); if ( m_process->isRunning() ) { - QByteArray inData = iodevice->readAll(); + TQByteArray inData = iodevice->readAll(); m_process->writeToStdin( inData ); - qApp->processEvents(); + tqApp->processEvents(); m_process->closeStdin(); int nothingHappens = 20; while ( m_waiting ) { wc.wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); --nothingHappens; } @@ -152,14 +152,14 @@ namespace BibTeX if ( !m_process->normalExit() ) { - qDebug( "%s did not exit in a clean fashion", m_process->arguments()[0].latin1() ); + tqDebug( "%s did not exit in a clean fashion", m_process->arguments()[0].latin1() ); delete m_process; return false; } } else { - qDebug( "%s did not start", m_process->arguments()[0].latin1() ); + tqDebug( "%s did not start", m_process->arguments()[0].latin1() ); delete m_process; return false; } @@ -177,22 +177,22 @@ namespace BibTeX BibTeX::File* FileImporterBibUtils::xmlBufferToBibTeXFile() { - QWaitCondition wc; + TQWaitCondition wc; m_waiting = true; - m_process = new QProcess( QStringList::split( ' ', "xml2bib -i utf8 -o utf8 -sk" ) ); + m_process = new TQProcess( TQStringList::split( ' ', "xml2bib -i utf8 -o utf8 -sk" ) ); connect( m_process, SIGNAL( processExited() ), this, SLOT( wakeUp() ) ); connect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadyStdout() ) ); connect( m_process, SIGNAL( readyReadStderr() ), this, SLOT( slotReadyStderr() ) ); if ( m_process->start() ) { - QBuffer *tempBuffer = m_processBuffer; - m_processBuffer = new QBuffer(); + TQBuffer *tempBuffer = m_processBuffer; + m_processBuffer = new TQBuffer(); tempBuffer->open( IO_ReadOnly ); m_process->writeToStdin( tempBuffer->readAll() ); - qApp->processEvents(); + tqApp->processEvents(); m_process->closeStdin(); tempBuffer->close(); @@ -201,7 +201,7 @@ namespace BibTeX while ( m_waiting ) { wc.wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); --nothingHappens; } m_processBuffer->close(); @@ -234,20 +234,20 @@ namespace BibTeX return NULL; } - QString FileImporterBibUtils::createTempDir() + TQString FileImporterBibUtils::createTempDir() { - QString result = QString::null; - QFile *devrandom = new QFile( "/dev/random" ); + TQString result = TQString::null; + TQFile *devrandom = new TQFile( "/dev/random" ); if ( devrandom->open( IO_ReadOnly ) ) { - Q_UINT32 randomNumber; + TQ_UINT32 randomNumber; if ( devrandom->readBlock(( char* ) & randomNumber, sizeof( randomNumber ) ) > 0 ) { randomNumber |= 0x10000000; - result = QString( "/tmp/bibtex-%1" ).arg( randomNumber, sizeof( randomNumber ) * 2, 16 ); - if ( !QDir().mkdir( result ) ) - result = QString::null; + result = TQString( "/tmp/bibtex-%1" ).arg( randomNumber, sizeof( randomNumber ) * 2, 16 ); + if ( !TQDir().mkdir( result ) ) + result = TQString::null; } devrandom->close(); } @@ -257,20 +257,20 @@ namespace BibTeX return result; } - void FileImporterBibUtils::deleteTempDir( const QString& directory ) + void FileImporterBibUtils::deleteTempDir( const TQString& directory ) { - QDir dir = QDir( directory ); - QStringList subDirs = dir.entryList( QDir::Dirs ); - for ( QStringList::Iterator it = subDirs.begin(); it != subDirs.end(); it++ ) + TQDir dir = TQDir( directory ); + TQStringList subDirs = dir.entryList( TQDir::Dirs ); + for ( TQStringList::Iterator it = subDirs.begin(); it != subDirs.end(); it++ ) { - if (( QString::compare( *it, "." ) != 0 ) && ( QString::compare( *it, ".." ) != 0 ) ) + if (( TQString::compare( *it, "." ) != 0 ) && ( TQString::compare( *it, ".." ) != 0 ) ) deleteTempDir( *it ); } - QStringList allEntries = dir.entryList( QDir::All ); - for ( QStringList::Iterator it = allEntries.begin(); it != allEntries.end(); it++ ) + TQStringList allEntries = dir.entryList( TQDir::All ); + for ( TQStringList::Iterator it = allEntries.begin(); it != allEntries.end(); it++ ) dir.remove( *it ); - QDir().rmdir( directory ); + TQDir().rmdir( directory ); } void FileImporterBibUtils::wakeUp() @@ -285,10 +285,10 @@ namespace BibTeX void FileImporterBibUtils::slotReadyStderr() { - QByteArray ba = m_process->readStderr(); - QTextStream bats( ba, IO_ReadOnly ); - bats.setEncoding( QTextStream::UnicodeUTF8 ); - qDebug( "%s", bats.read().latin1() ); + TQByteArray ba = m_process->readStderr(); + TQTextStream bats( ba, IO_ReadOnly ); + bats.setEncoding( TQTextStream::UnicodeUTF8 ); + tqDebug( "%s", bats.read().latin1() ); } } diff --git a/src/fileimporterbibutils.h b/src/fileimporterbibutils.h index 8fd0635..11d06e7 100644 --- a/src/fileimporterbibutils.h +++ b/src/fileimporterbibutils.h @@ -24,7 +24,7 @@ #include #include -class QBuffer; +class TQBuffer; namespace BibTeX { @@ -39,27 +39,27 @@ namespace BibTeX FileImporterBibUtils( BibTeX::File::FileFormat inputFormat ); ~FileImporterBibUtils(); - File* load( QIODevice *iodevice ); - static bool guessCanDecode( const QString & text ); - static File::FileFormat guessInputFormat( const QString &text ); + File* load( TQIODevice *iodevice ); + static bool guessCanDecode( const TQString & text ); + static File::FileFormat guessInputFormat( const TQString &text ); public slots: void cancel(); private: bool m_cancelFlag; - QString m_workingDir; + TQString m_workingDir; BibTeX::File::FileFormat m_inputFormat; FileImporterBibTeX *m_bibTeXImporter; bool m_waiting; - QProcess *m_process; - QBuffer *m_processBuffer; + TQProcess *m_process; + TQBuffer *m_processBuffer; - bool iodeviceToXMLbuffer( QIODevice *iodevice ); + bool iodeviceToXMLbuffer( TQIODevice *iodevice ); File* xmlBufferToBibTeXFile(); - QString createTempDir(); - void deleteTempDir( const QString& directory ); + TQString createTempDir(); + void deleteTempDir( const TQString& directory ); private slots: void wakeUp(); diff --git a/src/fileimporterexternal.cpp b/src/fileimporterexternal.cpp index 3b23946..814f81d 100644 --- a/src/fileimporterexternal.cpp +++ b/src/fileimporterexternal.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include "fileimporterexternal.h" @@ -31,7 +31,7 @@ namespace BibTeX FileImporterExternal::FileImporterExternal( Importer importer, File::FileFormat fileformat ) : FileImporter(), m_importer( importer ), m_fileformat( fileformat ) { - wc = new QWaitCondition(); + wc = new TQWaitCondition(); } @@ -40,11 +40,11 @@ namespace BibTeX delete wc; } - File* FileImporterExternal::load( QIODevice *iodevice ) + File* FileImporterExternal::load( TQIODevice *iodevice ) { m_mutex.lock(); File * result = NULL; - QBuffer buffer; + TQBuffer buffer; if ( fetchInput( iodevice, buffer ) ) { @@ -65,25 +65,25 @@ namespace BibTeX process->kill(); } - bool FileImporterExternal::fetchInput( QIODevice *input, QBuffer &output ) + bool FileImporterExternal::fetchInput( TQIODevice *input, TQBuffer &output ) { bool result = FALSE; - QString commandLine; + TQString commandLine; switch ( m_fileformat ) { default: return FALSE; } - QStringList args = QStringList::split( ' ', commandLine ); + TQStringList args = TQStringList::split( ' ', commandLine ); output.open( IO_WriteOnly ); - writeTo = new QTextStream( &output ); - writeTo->setEncoding( QTextStream::UnicodeUTF8 ); + writeTo = new TQTextStream( &output ); + writeTo->setEncoding( TQTextStream::UnicodeUTF8 ); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); - process = new QProcess( args ); + process = new TQProcess( args ); connect( process, SIGNAL( processExited() ), this, SLOT( slotProcessExited() ) ); connect( process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadProcessOutput() ) ); connect( process, SIGNAL( readyReadStderr() ), this, SLOT( slotReadProcessOutput() ) ); @@ -94,16 +94,16 @@ namespace BibTeX while ( !process->isRunning() ) { wc->wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); } - qApp->processEvents(); - QByteArray buf = input->readAll(); + tqApp->processEvents(); + TQByteArray buf = input->readAll(); process->writeToStdin( buf ); - qApp->processEvents(); + tqApp->processEvents(); while ( process->isRunning() ) { wc->wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); } result = process->normalExit(); @@ -119,7 +119,7 @@ namespace BibTeX writeTo = NULL; output.close(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return result; } @@ -133,8 +133,8 @@ namespace BibTeX if ( writeTo != NULL ) while ( process->canReadLineStdout() ) { - QString line = process->readLineStdout(); - // qDebug( "line=%s", line.latin1() ); + TQString line = process->readLineStdout(); + // tqDebug( "line=%s", line.latin1() ); ( *writeTo ) << line.latin1(); ( *writeTo ) << endl; } diff --git a/src/fileimporterexternal.h b/src/fileimporterexternal.h index 423ee45..e9de4a5 100644 --- a/src/fileimporterexternal.h +++ b/src/fileimporterexternal.h @@ -24,8 +24,8 @@ #include #include -class QWaitCondition; -class QProcess; +class TQWaitCondition; +class TQProcess; namespace BibTeX { @@ -42,9 +42,9 @@ namespace BibTeX FileImporterExternal( Importer importer, File::FileFormat fileformat ); ~FileImporterExternal(); - File* load( QIODevice *iodevice ); + File* load( TQIODevice *iodevice ); // FIXME: this is a stub: - static bool guessCanDecode( const QString & ) + static bool guessCanDecode( const TQString & ) { return TRUE; }; @@ -53,13 +53,13 @@ namespace BibTeX void cancel(); private: - QWaitCondition *wc; - QProcess *process; - QTextStream *writeTo; + TQWaitCondition *wc; + TQProcess *process; + TQTextStream *writeTo; Importer m_importer; File::FileFormat m_fileformat; - bool fetchInput( QIODevice *input, QBuffer &output ); + bool fetchInput( TQIODevice *input, TQBuffer &output ); private slots: void slotProcessExited(); diff --git a/src/fileimporterris.cpp b/src/fileimporterris.cpp index 0e5e3da..2970095 100644 --- a/src/fileimporterris.cpp +++ b/src/fileimporterris.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include @@ -39,23 +39,23 @@ namespace BibTeX // TODO } - File* FileImporterRIS::load( QIODevice *iodevice ) + File* FileImporterRIS::load( TQIODevice *iodevice ) { m_mutex.lock(); cancelFlag = FALSE; m_refNr = 0; - QTextStream textStream( iodevice ); + TQTextStream textStream( iodevice ); File *result = new File(); - QIODevice *streamDevice = textStream.device(); + TQIODevice *streamDevice = textStream.device(); while ( !cancelFlag && !textStream.atEnd() ) { emit progress( streamDevice->at(), streamDevice->size() ); - qApp->processEvents(); + tqApp->processEvents(); Element * element = nextElement( textStream ); if ( element != NULL ) result->appendElement( element ); - qApp->processEvents(); + tqApp->processEvents(); } emit progress( streamDevice->size(), streamDevice->size() ); @@ -69,7 +69,7 @@ namespace BibTeX return result; } - bool FileImporterRIS::guessCanDecode( const QString & text ) + bool FileImporterRIS::guessCanDecode( const TQString & text ) { return text.find( "TY - " ) >= 0; } @@ -79,16 +79,16 @@ namespace BibTeX cancelFlag = TRUE; } - Element *FileImporterRIS::nextElement( QTextStream &textStream ) + Element *FileImporterRIS::nextElement( TQTextStream &textStream ) { RISitemList list = readElement( textStream ); if ( list.empty() ) return NULL; Entry::EntryType entryType = Entry::etMisc; - Entry *entry = new Entry( entryType, QString( "RIS_%1" ).arg( m_refNr++ ) ); - QStringList authorList, editorList, keywordList; - QString journalName, abstract, startPage, endPage, date; + Entry *entry = new Entry( entryType, TQString( "RIS_%1" ).arg( m_refNr++ ) ); + TQStringList authorList, editorList, keywordList; + TQString journalName, abstract, startPage, endPage, date; int fieldNr = 0; for ( RISitemList::iterator it = list.begin(); it != list.end(); ++it ) @@ -153,16 +153,16 @@ namespace BibTeX } else if (( *it ).key == "KW" ) { - QString text = ( *it ).value; - QRegExp splitRegExp; + TQString text = ( *it ).value; + TQRegExp splitRegExp; if ( text.contains( ";" ) ) - splitRegExp = QRegExp( "\\s*[;\\n]\\s*" ); + splitRegExp = TQRegExp( "\\s*[;\\n]\\s*" ); else if ( text.contains( "," ) ) - splitRegExp = QRegExp( "\\s*[,\\n]\\s*" ); + splitRegExp = TQRegExp( "\\s*[,\\n]\\s*" ); else - splitRegExp = QRegExp( "\\n" ); - QStringList newKeywords = QStringList::split( splitRegExp, text, FALSE ); - for ( QStringList::Iterator it = newKeywords.begin(); it != newKeywords.end(); + splitRegExp = TQRegExp( "\\n" ); + TQStringList newKeywords = TQStringList::split( splitRegExp, text, FALSE ); + for ( TQStringList::Iterator it = newKeywords.begin(); it != newKeywords.end(); ++it ) keywordList.append( *it ); } @@ -331,7 +331,7 @@ namespace BibTeX } else { - QString fieldName = QString( "RISfield_%1_%2" ).arg( fieldNr++ ).arg(( *it ).key.left( 2 ) ); + TQString fieldName = TQString( "RISfield_%1_%2" ).arg( fieldNr++ ).arg(( *it ).key.left( 2 ) ); BibTeX::EntryField * field = new BibTeX::EntryField( fieldName ); entry->addField( field ); BibTeX::Value *value = new BibTeX::Value(); @@ -351,7 +351,7 @@ namespace BibTeX BibTeX::Value *value = new BibTeX::Value(); BibTeX::PersonContainer *container = new BibTeX::PersonContainer(); value->items.append( container ); - for ( QStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) + for ( TQStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) container->persons.append( new BibTeX::Person( *pit ) ); field->setValue( value ); } @@ -367,7 +367,7 @@ namespace BibTeX BibTeX::Value *value = new BibTeX::Value(); BibTeX::PersonContainer *container = new BibTeX::PersonContainer(); value->items.append( container ); - for ( QStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) + for ( TQStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) container->persons.append( new BibTeX::Person( *pit ) ); field->setValue( value ); } @@ -383,7 +383,7 @@ namespace BibTeX BibTeX::Value *value = new BibTeX::Value(); BibTeX::KeywordContainer *container = new BibTeX::KeywordContainer(); value->items.append( container ); - for ( QStringList::Iterator pit = keywordList.begin(); pit != keywordList.end();++pit ) + for ( TQStringList::Iterator pit = keywordList.begin(); pit != keywordList.end();++pit ) container->keywords.append( new BibTeX::Keyword( *pit ) ); field->setValue( value ); } @@ -422,20 +422,20 @@ namespace BibTeX field = new BibTeX::EntryField( BibTeX::EntryField::ftPages ); entry->addField( field ); } - QString page; + TQString page; if ( startPage.isEmpty() ) page = endPage; else if ( endPage.isEmpty() ) page = startPage; else - page = startPage + QChar( 0x2013 ) + endPage; + page = startPage + TQChar( 0x2013 ) + endPage; BibTeX::Value *value = new BibTeX::Value(); value->items.append( new BibTeX::PlainText( page ) ); field->setValue( value ); } - QStringList dateFragments = QStringList::split( "/", date ); + TQStringList dateFragments = TQStringList::split( "/", date ); if ( dateFragments.count() > 0 ) { bool ok; @@ -449,7 +449,7 @@ namespace BibTeX entry->addField( field ); } BibTeX::Value *value = new BibTeX::Value(); - value->items.append( new BibTeX::PlainText( QString::number( year ) ) ); + value->items.append( new BibTeX::PlainText( TQString::number( year ) ) ); field->setValue( value ); } } @@ -466,7 +466,7 @@ namespace BibTeX entry->addField( field ); } BibTeX::Value *value = new BibTeX::Value(); - value->items.append( new BibTeX::PlainText( QString::number( month ) ) ); + value->items.append( new BibTeX::PlainText( TQString::number( month ) ) ); field->setValue( value ); } } @@ -474,16 +474,16 @@ namespace BibTeX return entry; } - FileImporterRIS::RISitemList FileImporterRIS::readElement( QTextStream &textStream ) + FileImporterRIS::RISitemList FileImporterRIS::readElement( TQTextStream &textStream ) { RISitemList result; - QString line = textStream.readLine(); + TQString line = textStream.readLine(); while ( !line.startsWith( "TY - " ) && !textStream.eof() ) line = textStream.readLine(); if ( textStream.eof() ) return result; - QString key, value; + TQString key, value; while ( !line.startsWith( "ER -" ) && !textStream.eof() ) { if ( line.mid( 2, 3 ) == " -" ) diff --git a/src/fileimporterris.h b/src/fileimporterris.h index 11c52e9..ba204f1 100644 --- a/src/fileimporterris.h +++ b/src/fileimporterris.h @@ -23,7 +23,7 @@ #include #include -class QTextStream; +class TQTextStream; namespace BibTeX { @@ -37,8 +37,8 @@ namespace BibTeX FileImporterRIS(); ~FileImporterRIS(); - File* load( QIODevice *iodevice ); - static bool guessCanDecode( const QString & text ); + File* load( TQIODevice *iodevice ); + static bool guessCanDecode( const TQString & text ); public slots: void cancel(); @@ -46,17 +46,17 @@ namespace BibTeX private: typedef struct { - QString key; - QString value; + TQString key; + TQString value; } RISitem; - typedef QValueList RISitemList; + typedef TQValueList RISitemList; bool cancelFlag; int m_refNr; - Element *nextElement( QTextStream &textStream ); - RISitemList readElement( QTextStream &textStream ); + Element *nextElement( TQTextStream &textStream ); + RISitemList readElement( TQTextStream &textStream ); }; } diff --git a/src/findduplicates.cpp b/src/findduplicates.cpp index ddcf5a8..0fd937b 100644 --- a/src/findduplicates.cpp +++ b/src/findduplicates.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -43,8 +43,8 @@ namespace KBibTeX { const unsigned int FindDuplicates::maxDistance = 0xffffff; - FindDuplicates::FindDuplicates( DuplicateCliqueList &result, unsigned int sensitivity, BibTeX::File *file, QWidget *parent ) - : QObject( NULL, NULL ), m_doCancel( false ) + FindDuplicates::FindDuplicates( DuplicateCliqueList &result, unsigned int sensitivity, BibTeX::File *file, TQWidget *parent ) + : TQObject( NULL, NULL ), m_doCancel( false ) { if ( file->count() < 2 ) return; @@ -52,9 +52,9 @@ namespace KBibTeX int len = file->count() * ( file->count() - 1 ) / 2; unsigned int *distVector = new unsigned int[len]; memset( distVector, 0xff, sizeof( unsigned int )*len ); - QMap mapElementToIndex; + TQMap mapElementToIndex; - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); KProgressDialog *progDlg = new KProgressDialog( parent, NULL, i18n( "Find Duplicates" ), i18n( "Searching for duplicates..." ), true ); connect( progDlg, SIGNAL( cancelClicked() ), this, SLOT( slotCancel() ) ); progDlg->progressBar()->setTotalSteps( len ); @@ -67,7 +67,7 @@ namespace KBibTeX delete progDlg; delete[] distVector; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } /** @@ -79,7 +79,7 @@ namespace KBibTeX * @param mapElementToIndex map from elements to indices (will be written) * @param progDlg progress dialog to write status information to */ - void FindDuplicates::determineDistances( BibTeX::File *file, unsigned int *distVector, QMap &mapElementToIndex, KProgressDialog *progDlg ) + void FindDuplicates::determineDistances( BibTeX::File *file, unsigned int *distVector, TQMap &mapElementToIndex, KProgressDialog *progDlg ) { int progress = 0, i = 0; for ( BibTeX::File::ElementList::ConstIterator it1 = file->constBegin(); !m_doCancel && it1 != file->constEnd(); ++it1, ++i ) @@ -99,7 +99,7 @@ namespace KBibTeX distVector[arrayOffset( i, j )] = d; progDlg->progressBar()->setValue( ++progress ); - qApp->processEvents(); + tqApp->processEvents(); } } else @@ -118,7 +118,7 @@ namespace KBibTeX distVector[arrayOffset( i, j )] = macroDistance( macroA, macroB ); progDlg->progressBar()->setValue( ++progress ); - qApp->processEvents(); + tqApp->processEvents(); } } else @@ -137,7 +137,7 @@ namespace KBibTeX distVector[arrayOffset( i, j )] = preambleDistance( preambleA, preambleB ); progDlg->progressBar()->setValue( ++progress ); - qApp->processEvents(); + tqApp->processEvents(); } } } @@ -155,12 +155,12 @@ namespace KBibTeX * @param mapElementToIndex map from elements to indices * @param sensitivity sensitivity threshold value */ - void FindDuplicates::buildClique( DuplicateCliqueList &cliqueList, BibTeX::File *file, unsigned int *distVector, QMap &mapElementToIndex, unsigned int sensitivity ) + void FindDuplicates::buildClique( DuplicateCliqueList &cliqueList, BibTeX::File *file, unsigned int *distVector, TQMap &mapElementToIndex, unsigned int sensitivity ) { int usedLen = file->count(); bool* used = new bool[usedLen]; memset( used, false, sizeof( bool ) * usedLen ); - QValueList queue; + TQValueList queue; for ( BibTeX::File::ElementList::ConstIterator it1 = file->constBegin(); it1 != file->constEnd(); ++it1 ) { /** current element must be either entry, preamble, or macro */ @@ -258,11 +258,11 @@ namespace KBibTeX * @param t second sentence * @return distance between both sentences */ - double FindDuplicates::levenshteinDistance( const QString &s, const QString &t ) + double FindDuplicates::levenshteinDistance( const TQString &s, const TQString &t ) { - const QRegExp nonWordRegExp( "[^a-zA-Z']+" ); - if ( s == QString::null || t == QString::null ) return 1.0; - return levenshteinDistance( QStringList::split( nonWordRegExp, s ), QStringList::split( nonWordRegExp, t ) ); + const TQRegExp nonWordRegExp( "[^a-zA-Z']+" ); + if ( s == TQString::null || t == TQString::null ) return 1.0; + return levenshteinDistance( TQStringList::split( nonWordRegExp, s ), TQStringList::split( nonWordRegExp, t ) ); } /** @@ -272,9 +272,9 @@ namespace KBibTeX * @param t second word * @return distance between both words */ - double FindDuplicates::levenshteinDistanceWord( const QString &s, const QString &t ) + double FindDuplicates::levenshteinDistanceWord( const TQString &s, const TQString &t ) { - QString mys = s.lower(), myt = t.lower(); + TQString mys = s.lower(), myt = t.lower(); int m = s.length(), n = t.length(); if ( m < 1 && n < 1 ) return 0.0; if ( m < 1 || n < 1 ) return 1.0; @@ -309,7 +309,7 @@ namespace KBibTeX * @param t second sentence * @return distance between both sentences */ - double FindDuplicates::levenshteinDistance( const QStringList &s, const QStringList &t ) + double FindDuplicates::levenshteinDistance( const TQStringList &s, const TQStringList &t ) { int m = s.size(), n = t.size(); if ( m < 1 && n < 1 ) return 0.0; @@ -358,17 +358,17 @@ namespace KBibTeX /** * Determine title for a given entry */ - QString FindDuplicates::extractTitle( BibTeX::Entry *entry ) + TQString FindDuplicates::extractTitle( BibTeX::Entry *entry ) { /** retrieve field holding title information for entry */ BibTeX::EntryField *field = entry->getField( BibTeX::EntryField::ftTitle ); if ( field == NULL ) - return QString::null; /** no title field available */ + return TQString::null; /** no title field available */ /** *fetch value item holding title */ BibTeX::ValueItem *valueItem = field->value()->items.isEmpty() ? NULL : field->value()->items.first(); if ( valueItem == NULL ) - return QString::null; /** no value item found or is empty */ + return TQString::null; /** no value item found or is empty */ return valueItem->text(); // TODO: Perform some postprocessing? } @@ -376,9 +376,9 @@ namespace KBibTeX /** * Determine list of authors for a given entry */ - QStringList FindDuplicates::authorsLastName( BibTeX::Entry *entry ) + TQStringList FindDuplicates::authorsLastName( BibTeX::Entry *entry ) { - QStringList result; + TQStringList result; /** retrieve field holding authors information for entry */ BibTeX::EntryField *field = entry->getField( BibTeX::EntryField::ftAuthor ); @@ -391,7 +391,7 @@ namespace KBibTeX return result; /** container not found or is empty */ /** iterate through container and fetch each author's last name */ - for ( QValueList::ConstIterator it = personContainer->persons.begin(); it != personContainer->persons.end(); ++it ) + for ( TQValueList::ConstIterator it = personContainer->persons.begin(); it != personContainer->persons.end(); ++it ) result.append(( *it )->lastName() ); return result; @@ -414,7 +414,7 @@ namespace KBibTeX /** parse value item's text */ bool ok = FALSE; - int year = QString( valueItem->text() ).toInt( &ok ); + int year = TQString( valueItem->text() ).toInt( &ok ); if ( !ok ) year = -1; return year; @@ -423,7 +423,7 @@ namespace KBibTeX /** * Determine key from a given macro */ - QString FindDuplicates::extractMacroKey( BibTeX::Macro *macro ) + TQString FindDuplicates::extractMacroKey( BibTeX::Macro *macro ) { return macro->key(); } @@ -431,7 +431,7 @@ namespace KBibTeX /** * Determine key from a given macro */ - QString FindDuplicates::extractMacroValue( BibTeX::Macro *macro ) + TQString FindDuplicates::extractMacroValue( BibTeX::Macro *macro ) { return macro->value()->text(); } diff --git a/src/findduplicates.h b/src/findduplicates.h index e1a2fce..c11dcf3 100644 --- a/src/findduplicates.h +++ b/src/findduplicates.h @@ -20,10 +20,10 @@ #ifndef KBIBTEXFINDDUPLICATES_H #define KBIBTEXFINDDUPLICATES_H -#include +#include class KProgressDialog; -class QWidget; +class TQWidget; namespace KBibTeX { @@ -31,12 +31,12 @@ namespace KBibTeX /** @author Thomas Fischer */ - class FindDuplicates : public QObject + class FindDuplicates : public TQObject { Q_OBJECT public: - typedef QValueList DuplicateClique; - typedef QValueList DuplicateCliqueList; + typedef TQValueList DuplicateClique; + typedef TQValueList DuplicateCliqueList; /** * Find duplicates in a given BibTeX file. The sensitivity parameter controls the distance between two elements where both elements are considered to be duplicates. The parent object is used as a progress dialog's parent. @@ -45,7 +45,7 @@ namespace KBibTeX * @param parent * @return */ - FindDuplicates( DuplicateCliqueList &result, unsigned int sensitivity, BibTeX::File *file, QWidget *parent ); + FindDuplicates( DuplicateCliqueList &result, unsigned int sensitivity, BibTeX::File *file, TQWidget *parent ); ~FindDuplicates(); @@ -55,24 +55,24 @@ namespace KBibTeX static const unsigned int maxDistance; protected: - void determineDistances( BibTeX::File *file, unsigned int *distVector, QMap &mapElementToIndex, KProgressDialog *progDlg ); - void buildClique( DuplicateCliqueList &result, BibTeX::File *file, unsigned int *distVector, QMap &mapElementToIndex, unsigned int sensitivity ); + void determineDistances( BibTeX::File *file, unsigned int *distVector, TQMap &mapElementToIndex, KProgressDialog *progDlg ); + void buildClique( DuplicateCliqueList &result, BibTeX::File *file, unsigned int *distVector, TQMap &mapElementToIndex, unsigned int sensitivity ); unsigned int entryDistance( BibTeX::Entry *entryA, BibTeX::Entry *entryB ); unsigned int macroDistance( BibTeX::Macro *macroA, BibTeX::Macro *macroB ); unsigned int preambleDistance( BibTeX::Preamble *preambleA, BibTeX::Preamble *preambleB ); - static QString extractTitle( BibTeX::Entry *entry ); - static QStringList authorsLastName( BibTeX::Entry *entry ); + static TQString extractTitle( BibTeX::Entry *entry ); + static TQStringList authorsLastName( BibTeX::Entry *entry ); static int extractYear( BibTeX::Entry *entry ); - static QString extractMacroKey( BibTeX::Macro *macro ); - static QString extractMacroValue( BibTeX::Macro *macro ); + static TQString extractMacroKey( BibTeX::Macro *macro ); + static TQString extractMacroValue( BibTeX::Macro *macro ); private: bool m_doCancel; - double levenshteinDistance( const QStringList &s, const QStringList &t ); - double levenshteinDistance( const QString &s, const QString &t ); - double levenshteinDistanceWord( const QString &s, const QString &t ); + double levenshteinDistance( const TQStringList &s, const TQStringList &t ); + double levenshteinDistance( const TQString &s, const TQString &t ); + double levenshteinDistanceWord( const TQString &s, const TQString &t ); int arrayOffset( int a, int b ); void sort( unsigned int *array, int len ); diff --git a/src/idsuggestions.cpp b/src/idsuggestions.cpp index 5704c1e..05d8a11 100644 --- a/src/idsuggestions.cpp +++ b/src/idsuggestions.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include @@ -29,7 +29,7 @@ namespace KBibTeX { - const QRegExp IdSuggestions::unwantedChars = QRegExp( "[^-_:/=+a-zA-Z0-9]+" ); + const TQRegExp IdSuggestions::unwantedChars = TQRegExp( "[^-_:/=+a-zA-Z0-9]+" ); IdSuggestions::IdSuggestions() { @@ -45,9 +45,9 @@ namespace KBibTeX /** * Determine list of authors or editors for a given entry */ - QStringList IdSuggestions::authorsLastName( BibTeX::Entry *entry ) + TQStringList IdSuggestions::authorsLastName( BibTeX::Entry *entry ) { - QStringList result; + TQStringList result; /** retrieve field holding authors information for entry */ BibTeX::EntryField *field = entry->getField( BibTeX::EntryField::ftAuthor ); @@ -68,7 +68,7 @@ namespace KBibTeX return result; /** container not found or is empty */ /** iterate through container and fetch each author's last name */ - for ( QValueList::ConstIterator it = personContainer->persons.begin(); it != personContainer->persons.end(); ++it ) + for ( TQValueList::ConstIterator it = personContainer->persons.begin(); it != personContainer->persons.end(); ++it ) { result.append( normalizeText(( *it )->lastName() ) ); } @@ -80,26 +80,26 @@ namespace KBibTeX * Normalize a given text by removing spaces or other unwanted characters, * replace some accented and special characters by plain ASCII transliterations */ - QString IdSuggestions::normalizeText( const QString& text ) + TQString IdSuggestions::normalizeText( const TQString& text ) { - QString result = text; + TQString result = text; for ( int i = text.length() - 1; i >= 0; --i ) - result[i] = QChar( BibTeX::EncoderLaTeX::unicodeToASCII( result[i].unicode() ) ); + result[i] = TQChar( BibTeX::EncoderLaTeX::unicodeToASCII( result[i].unicode() ) ); return result.replace( unwantedChars, "" ); } - QString IdSuggestions::resolveConflict( BibTeX::File *file, const QString &id, BibTeX::Element *element ) + TQString IdSuggestions::resolveConflict( BibTeX::File *file, const TQString &id, BibTeX::Element *element ) { - QString result = id; + TQString result = id; BibTeX::Element *hit = file->containsKey( id ) ; if ( hit != NULL && hit != element ) { int i = 0; do { - result = QString( "%1-%2" ).arg( id ).arg( ++i ); + result = TQString( "%1-%2" ).arg( id ).arg( ++i ); hit = file->containsKey( result ); } while ( hit != NULL && hit != element ); @@ -124,9 +124,9 @@ namespace KBibTeX /** parse value item's text */ bool ok = FALSE; - QRegExp yearRegExp( "\\b(\\d{2})?\\d{2}\\b" ); + TQRegExp yearRegExp( "\\b(\\d{2})?\\d{2}\\b" ); yearRegExp.search( valueItem->text() ); - int year = QString( yearRegExp.cap( 0 ) ).toInt( &ok ); + int year = TQString( yearRegExp.cap( 0 ) ).toInt( &ok ); if ( !ok ) year = -1; return year; @@ -135,34 +135,34 @@ namespace KBibTeX /** * Determine title for a given entry */ - QString IdSuggestions::extractTitle( BibTeX::Entry *entry ) + TQString IdSuggestions::extractTitle( BibTeX::Entry *entry ) { /** retrieve field holding title information for entry */ BibTeX::EntryField *field = entry->getField( BibTeX::EntryField::ftTitle ); if ( field == NULL ) - return QString::null; /** no title field available */ + return TQString::null; /** no title field available */ /** *fetch value item holding title */ BibTeX::ValueItem *valueItem = field->value()->items.isEmpty() ? NULL : field->value()->items.first(); if ( valueItem == NULL ) - return QString::null; /** no value item found or is empty */ + return TQString::null; /** no value item found or is empty */ return valueItem->text(); } - QStringList IdSuggestions::createSuggestions( BibTeX::File *file, BibTeX::Entry *entry ) + TQStringList IdSuggestions::createSuggestions( BibTeX::File *file, BibTeX::Entry *entry ) { Settings * settings = Settings::self(); - const QStringList& formatStrList = settings->idSuggestions_formatStrList; - QStringList result; - QStringList allKeys = file != NULL ? file->allKeys() : QStringList(); + const TQStringList& formatStrList = settings->idSuggestions_formatStrList; + TQStringList result; + TQStringList allKeys = file != NULL ? file->allKeys() : TQStringList(); entry = new BibTeX::Entry( entry ); if ( file != NULL ) file->completeReferencedFields( entry ); - for ( QStringList::ConstIterator it = formatStrList.begin(); it != formatStrList.end(); ++it ) + for ( TQStringList::ConstIterator it = formatStrList.begin(); it != formatStrList.end(); ++it ) { - QString id = formatId( entry, *it ); + TQString id = formatId( entry, *it ); if ( id.isEmpty() || result.contains( id ) ) continue; if ( !result.contains( id ) ) @@ -174,33 +174,33 @@ namespace KBibTeX return result; } - QString IdSuggestions::createDefaultSuggestion( BibTeX::File *file, BibTeX::Entry *entry ) + TQString IdSuggestions::createDefaultSuggestion( BibTeX::File *file, BibTeX::Entry *entry ) { Settings * settings = Settings::self(); if ( settings->idSuggestions_default < 0 || settings->idSuggestions_default >= ( int )settings->idSuggestions_formatStrList.size() ) - return QString::null; + return TQString::null; entry = new BibTeX::Entry( entry ); if ( file != NULL ) file->completeReferencedFields( entry ); - QString result = formatId( entry, settings->idSuggestions_formatStrList[settings->idSuggestions_default] ); + TQString result = formatId( entry, settings->idSuggestions_formatStrList[settings->idSuggestions_default] ); delete entry; return result; } - QString IdSuggestions::formatId( BibTeX::Entry *entry, const QString& formatStr ) + TQString IdSuggestions::formatId( BibTeX::Entry *entry, const TQString& formatStr ) { - QString id; - QStringList tokenList = QStringList::split( '|', formatStr ); - for ( QStringList::ConstIterator tit = tokenList.begin(); tit != tokenList.end(); ++tit ) + TQString id; + TQStringList tokenList = TQStringList::split( '|', formatStr ); + for ( TQStringList::ConstIterator tit = tokenList.begin(); tit != tokenList.end(); ++tit ) id.append( translateToken( entry, *tit ) ); return id; } - QString IdSuggestions::translateToken( BibTeX::Entry *entry, const QString& token ) + TQString IdSuggestions::translateToken( BibTeX::Entry *entry, const TQString& token ) { switch ( token[0] ) { @@ -211,34 +211,34 @@ namespace KBibTeX { int year = extractYear( entry ); if ( year > -1 ) - return QString::number( year % 100 + 100 ).mid( 1 ); + return TQString::number( year % 100 + 100 ).mid( 1 ); else - return QString::null; + return TQString::null; } case 'Y': { int year = extractYear( entry ); if ( year > -1 ) - return QString::number( year % 10000 + 10000 ).mid( 1 ); + return TQString::number( year % 10000 + 10000 ).mid( 1 ); else - return QString::null; + return TQString::null; } case 't': return translateTitleToken( entry, token.mid( 1 ), FALSE ); case 'T': return translateTitleToken( entry, token.mid( 1 ), TRUE ); case '"': return token.mid( 1 ); - default: return QString::null; + default: return TQString::null; } } - QString IdSuggestions::translateAuthorsToken( BibTeX::Entry *entry, const QString& token, Authors selectAuthors ) + TQString IdSuggestions::translateAuthorsToken( BibTeX::Entry *entry, const TQString& token, Authors selectAuthors ) { struct IdSuggestionTokenInfo ati = evalToken( token ); - QString result; + TQString result; bool first = true, firstInserted = true; - QStringList authors = authorsLastName( entry ); - for ( QStringList::ConstIterator it = authors.begin(); it != authors.end(); ++it ) + TQStringList authors = authorsLastName( entry ); + for ( TQStringList::ConstIterator it = authors.begin(); it != authors.end(); ++it ) { - QString author = normalizeText( *it ).left( ati.len ); + TQString author = normalizeText( *it ).left( ati.len ); if ( selectAuthors == aAll || ( selectAuthors == aOnlyFirst && first ) || ( selectAuthors == aNotFirst && !first ) ) { if ( !firstInserted ) @@ -257,14 +257,14 @@ namespace KBibTeX return result; } - struct IdSuggestionTokenInfo IdSuggestions::evalToken( const QString& token ) + struct IdSuggestionTokenInfo IdSuggestions::evalToken( const TQString& token ) { unsigned int pos = 0; struct IdSuggestionTokenInfo result; result.len = 0x00ffffff; result.toLower = FALSE; result.toUpper = FALSE; - result.inBetween = QString::null; + result.inBetween = TQString::null; if ( token.length() > pos ) { @@ -290,23 +290,23 @@ namespace KBibTeX return result; } - QString IdSuggestions::translateTitleToken( BibTeX::Entry *entry, const QString& token, bool removeSmallWords ) + TQString IdSuggestions::translateTitleToken( BibTeX::Entry *entry, const TQString& token, bool removeSmallWords ) { struct IdSuggestionTokenInfo tti = evalToken( token ); Settings * settings = Settings::self(); - const QStringList smallWords = settings->idSuggestions_smallWords; + const TQStringList smallWords = settings->idSuggestions_smallWords; - QString result; + TQString result; bool first = TRUE; - QStringList titleWords = QStringList::split( QRegExp( "\\s+" ), extractTitle( entry ) ); - for ( QStringList::ConstIterator it = titleWords.begin(); it != titleWords.end(); ++it ) + TQStringList titleWords = TQStringList::split( TQRegExp( "\\s+" ), extractTitle( entry ) ); + for ( TQStringList::ConstIterator it = titleWords.begin(); it != titleWords.end(); ++it ) { if ( first ) first = FALSE; else result.append( tti.inBetween ); - QString lowerText = ( *it ).lower(); + TQString lowerText = ( *it ).lower(); if ( !removeSmallWords || !smallWords.contains( lowerText ) ) result.append( normalizeText( *it ).left( tti.len ) ); } @@ -320,12 +320,12 @@ namespace KBibTeX } /** convert a formatting string into a human readable version (even translated) */ - QString IdSuggestions::formatStrToHuman( const QString& formatStr ) + TQString IdSuggestions::formatStrToHuman( const TQString& formatStr ) { bool first = TRUE; - QString text; - QStringList elements = QStringList::split( '|', formatStr ); - for ( QStringList::iterator it = elements.begin();it != elements.end();++it ) + TQString text; + TQStringList elements = TQStringList::split( '|', formatStr ); + for ( TQStringList::iterator it = elements.begin();it != elements.end();++it ) { if ( first ) first = FALSE; else text.append( "\n" ); if (( *it )[0] == 'a' || ( *it )[0] == 'A' || ( *it )[0] == 'z' ) @@ -339,7 +339,7 @@ namespace KBibTeX if ( info.len < 0x00ffffff ) text.append( i18n( ", but only first letter of each last name", ", but only first %n letters of each last name", n ) ); if ( info.toUpper ) text.append( i18n( ", in upper case" ) ); else if ( info.toLower ) text.append( i18n( ", in lower case" ) ); - if ( info.inBetween != QString::null ) text.append( QString( i18n( ", with '%1' in between" ) ).arg( info.inBetween ) ); + if ( info.inBetween != TQString::null ) text.append( TQString( i18n( ", with '%1' in between" ) ).arg( info.inBetween ) ); } else if (( *it )[0] == 'y' ) text.append( i18n( "Year (2 digits)" ) ); else if (( *it )[0] == 'Y' ) text.append( i18n( "Year (4 digits)" ) ); @@ -351,10 +351,10 @@ namespace KBibTeX if ( info.len < 0x00ffffff ) text.append( i18n( ", but only first letter of each word", ", but only first %n letters of each word", n ) ); if ( info.toUpper ) text.append( i18n( ", in upper case" ) ); else if ( info.toLower ) text.append( i18n( ", in lower case" ) ); - if ( info.inBetween != QString::null ) text.append( QString( i18n( ", with '%1' in between" ) ).arg( info.inBetween ) ); + if ( info.inBetween != TQString::null ) text.append( TQString( i18n( ", with '%1' in between" ) ).arg( info.inBetween ) ); if (( *it )[0] == 'T' ) text.append( i18n( ", small words removed" ) ); } - else if (( *it )[0] == '"' ) text.append( QString( i18n( "Text: '%1'" ) ).arg(( *it ).mid( 1 ) ) ); + else if (( *it )[0] == '"' ) text.append( TQString( i18n( "Text: '%1'" ) ).arg(( *it ).mid( 1 ) ) ); else text.append( "?" ); } diff --git a/src/idsuggestions.h b/src/idsuggestions.h index a1bd022..d4d110f 100644 --- a/src/idsuggestions.h +++ b/src/idsuggestions.h @@ -20,7 +20,7 @@ #ifndef KBIBTEXIDSUGGESTIONS_H #define KBIBTEXIDSUGGESTIONS_H -#include +#include #include #include @@ -32,7 +32,7 @@ namespace KBibTeX unsigned int len; bool toLower; bool toUpper; - QString inBetween; + TQString inBetween; }; /** @@ -41,33 +41,33 @@ namespace KBibTeX class IdSuggestions { public: - static QStringList createSuggestions( BibTeX::File *file, BibTeX::Entry *entry ); - static QString createDefaultSuggestion( BibTeX::File *file, BibTeX::Entry *entry ); - static QString formatStrToHuman( const QString& formatStr ); - static struct IdSuggestionTokenInfo evalToken( const QString& token ); - static QString formatId( BibTeX::Entry *entry, const QString& formatStr ); - static QString resolveConflict( BibTeX::File *file, const QString &id, BibTeX::Element *element = NULL ); + static TQStringList createSuggestions( BibTeX::File *file, BibTeX::Entry *entry ); + static TQString createDefaultSuggestion( BibTeX::File *file, BibTeX::Entry *entry ); + static TQString formatStrToHuman( const TQString& formatStr ); + static struct IdSuggestionTokenInfo evalToken( const TQString& token ); + static TQString formatId( BibTeX::Entry *entry, const TQString& formatStr ); + static TQString resolveConflict( BibTeX::File *file, const TQString &id, BibTeX::Element *element = NULL ); - static const QStringList smallWords; + static const TQStringList smallWords; private: enum Authors {aAll, aOnlyFirst, aNotFirst}; - static const QRegExp unwantedChars; - static const QChar asciiizeSource[]; - static const QString asciiizeTarget[]; + static const TQRegExp unwantedChars; + static const TQChar asciiizeSource[]; + static const TQString asciiizeTarget[]; IdSuggestions(); ~IdSuggestions(); - static QStringList authorsLastName( BibTeX::Entry *entry ); - static QString normalizeText( const QString& text ); - static QString asciiizeText( const QString& text ); + static TQStringList authorsLastName( BibTeX::Entry *entry ); + static TQString normalizeText( const TQString& text ); + static TQString asciiizeText( const TQString& text ); static int extractYear( BibTeX::Entry *entry ); - static QString extractTitle( BibTeX::Entry *entry ); - static QString translateToken( BibTeX::Entry *entry, const QString& token ); - static QString translateAuthorsToken( BibTeX::Entry *entry, const QString& token, Authors selectAuthors ); - static QString translateTitleToken( BibTeX::Entry *entry, const QString& token, bool removeSmallWords ); + static TQString extractTitle( BibTeX::Entry *entry ); + static TQString translateToken( BibTeX::Entry *entry, const TQString& token ); + static TQString translateAuthorsToken( BibTeX::Entry *entry, const TQString& token, Authors selectAuthors ); + static TQString translateTitleToken( BibTeX::Entry *entry, const TQString& token, bool removeSmallWords ); }; } diff --git a/src/idsuggestionswidget.cpp b/src/idsuggestionswidget.cpp index d2d371f..5faaff9 100644 --- a/src/idsuggestionswidget.cpp +++ b/src/idsuggestionswidget.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,22 +43,22 @@ namespace KBibTeX { - QString IdSuggestionsWidget::exampleBibTeXEntry = "@Article{ dijkstra1983terminationdetect,\nauthor = {Edsger W. Dijkstra and W. H. J. Feijen and A. J. M. {van Gasteren}},\ntitle = {{Derivation of a Termination Detection Algorithm for Distributed Computations}},\njournal = {Information Processing Letters},\nvolume = 16,\nnumber = 5,\npages = {217--219},\nmonth = jun,\nyear = 1983\n}"; + TQString IdSuggestionsWidget::exampleBibTeXEntry = "@Article{ dijkstra1983terminationdetect,\nauthor = {Edsger W. Dijkstra and W. H. J. Feijen and A. J. M. {van Gasteren}},\ntitle = {{Derivation of a Termination Detection Algorithm for Distributed Computations}},\njournal = {Information Processing Letters},\nvolume = 16,\nnumber = 5,\npages = {217--219},\nmonth = jun,\nyear = 1983\n}"; - IdSuggestionComponent::IdSuggestionComponent( const QString& title, QWidget *parent ): QFrame( parent ), m_toBeDeleted( false ), m_title( title ), m_parent( parent ) + IdSuggestionComponent::IdSuggestionComponent( const TQString& title, TQWidget *parent ): TQFrame( parent ), m_toBeDeleted( false ), m_title( title ), m_parent( parent ) { - setFrameShape( QFrame::Panel ); - setFrameShadow( QFrame::Sunken ); + setFrameShape( TQFrame::Panel ); + setFrameShadow( TQFrame::Sunken ); setLineWidth( 1 ); } - QWidget *IdSuggestionComponent::moveWidgets( QWidget *parent ) + TQWidget *IdSuggestionComponent::moveWidgets( TQWidget *parent ) { - QWidget *container = new QWidget( parent ); - QVBoxLayout *layout = new QVBoxLayout( container, 0, KDialog::spacingHint() ); - m_pushButtonUp = new KPushButton( QIconSet( SmallIcon( "up" ) ), i18n( "Up" ), container ); - m_pushButtonDown = new KPushButton( QIconSet( SmallIcon( "down" ) ), i18n( "Down" ), container ); - m_pushButtonDel = new KPushButton( QIconSet( SmallIcon( "remove" ) ), i18n( "Delete" ), container ); + TQWidget *container = new TQWidget( parent ); + TQVBoxLayout *layout = new TQVBoxLayout( container, 0, KDialog::spacingHint() ); + m_pushButtonUp = new KPushButton( TQIconSet( SmallIcon( "up" ) ), i18n( "Up" ), container ); + m_pushButtonDown = new KPushButton( TQIconSet( SmallIcon( "down" ) ), i18n( "Down" ), container ); + m_pushButtonDel = new KPushButton( TQIconSet( SmallIcon( "remove" ) ), i18n( "Delete" ), container ); layout->addWidget( m_pushButtonUp ); layout->addWidget( m_pushButtonDown ); layout->addWidget( m_pushButtonDel ); @@ -77,7 +77,7 @@ namespace KBibTeX void IdSuggestionComponent::slotUp() { - QVBoxLayout *layout = dynamic_cast( m_parent->layout() ); + TQVBoxLayout *layout = dynamic_cast( m_parent->layout() ); if ( layout == NULL ) return; int oldPos = layout->findWidget( this ); if ( oldPos > 0 ) @@ -90,7 +90,7 @@ namespace KBibTeX void IdSuggestionComponent::slotDown() { - QVBoxLayout *layout = dynamic_cast( m_parent->layout() ); + TQVBoxLayout *layout = dynamic_cast( m_parent->layout() ); if ( layout == NULL ) return; int oldPos = layout->findWidget( this ); int componentCount = dynamic_cast( m_parent->parent()->parent()->parent() )->numComponents(); @@ -109,17 +109,17 @@ namespace KBibTeX delete this; } - IdSuggestionComponentAuthor::IdSuggestionComponentAuthor( const QString &text, QWidget *parent ): IdSuggestionComponent( i18n( "Author" ), parent ) + IdSuggestionComponentAuthor::IdSuggestionComponentAuthor( const TQString &text, TQWidget *parent ): IdSuggestionComponent( i18n( "Author" ), parent ) { - QGridLayout *layout = new QGridLayout( this, 6, 4, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( this, 6, 4, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel *label = new QLabel( m_title, this ); - QFont labelFont( label->font() ); + TQLabel *label = new TQLabel( m_title, this ); + TQFont labelFont( label->font() ); labelFont.setBold( TRUE ); label->setFont( labelFont ); label->setBackgroundColor( KGlobalSettings::highlightColor() ); label->setPaletteForegroundColor( KGlobalSettings::highlightedTextColor() ); - label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); + label->setAlignment( TQt::AlignHCenter | TQt::AlignVCenter ); layout->addMultiCellWidget( label, 0, 0, 0, 2 ); m_comboBoxWhichAuthors = new KComboBox( false, this ); @@ -133,11 +133,11 @@ namespace KBibTeX case 'z': m_comboBoxWhichAuthors->setCurrentItem( 2 ); break; default: m_comboBoxWhichAuthors->setCurrentItem( 0 ); } - connect( m_comboBoxWhichAuthors, SIGNAL( activated( const QString& ) ), SIGNAL( modified() ) ); + connect( m_comboBoxWhichAuthors, SIGNAL( activated( const TQString& ) ), SIGNAL( modified() ) ); struct IdSuggestionTokenInfo info = IdSuggestions::evalToken( text.mid( 1 ) ); - label = new QLabel( i18n( "Casing:" ), this ); + label = new TQLabel( i18n( "Casing:" ), this ); layout->addWidget( label, 2, 0 ); m_comboBoxCasing = new KComboBox( FALSE, this ); label->setBuddy( m_comboBoxCasing ); @@ -151,11 +151,11 @@ namespace KBibTeX m_comboBoxCasing->setCurrentItem( 2 ); else m_comboBoxCasing->setCurrentItem( 0 ); - connect( m_comboBoxCasing, SIGNAL( activated( const QString& ) ), SIGNAL( modified() ) ); + connect( m_comboBoxCasing, SIGNAL( activated( const TQString& ) ), SIGNAL( modified() ) ); - label = new QLabel( i18n( "Only first letters:" ), this ); + label = new TQLabel( i18n( "Only first letters:" ), this ); layout->addWidget( label, 3, 0 ); - m_spinBoxLen = new QSpinBox( this ); + m_spinBoxLen = new TQSpinBox( this ); label->setBuddy( m_spinBoxLen ); layout->addWidget( m_spinBoxLen, 3, 1 ); m_spinBoxLen->setMinValue( 0 ); @@ -165,13 +165,13 @@ namespace KBibTeX m_spinBoxLen->setMinimumWidth( m_spinBoxLen->fontMetrics().width( i18n( "Complete name" ) ) + 32 ); connect( m_spinBoxLen, SIGNAL( valueChanged( int ) ), SIGNAL( modified() ) ); - label = new QLabel( i18n( "Text between authors:" ), this ); + label = new TQLabel( i18n( "Text between authors:" ), this ); layout->addWidget( label, 4, 0 ); m_lineEditInBetween = new KLineEdit( this ); label->setBuddy( m_lineEditInBetween ); layout->addWidget( m_lineEditInBetween, 4, 1 ); m_lineEditInBetween->setText( info.inBetween ); - connect( m_lineEditInBetween, SIGNAL( textChanged( const QString& ) ), SIGNAL( modified() ) ); + connect( m_lineEditInBetween, SIGNAL( textChanged( const TQString& ) ), SIGNAL( modified() ) ); layout->setRowStretch( 5, 1 ); layout->setColStretch( 1, 1 ); @@ -179,18 +179,18 @@ namespace KBibTeX layout->addMultiCellWidget( moveWidgets( this ), 0, 5, 3, 3 ); } - QString IdSuggestionComponentAuthor::text() const + TQString IdSuggestionComponentAuthor::text() const { - if ( m_toBeDeleted ) return QString::null; + if ( m_toBeDeleted ) return TQString::null; - QString result; + TQString result; switch ( m_comboBoxWhichAuthors->currentItem() ) { case 1: result = "a"; break; case 2: result = "z"; break; default: result = "A"; } - if ( m_spinBoxLen->value() > 0 && m_spinBoxLen->value() <= 9 ) result.append( QString::number( m_spinBoxLen->value() ) ); + if ( m_spinBoxLen->value() > 0 && m_spinBoxLen->value() <= 9 ) result.append( TQString::number( m_spinBoxLen->value() ) ); if ( m_comboBoxCasing->currentItem() == 1 ) result.append( "l" ); else if ( m_comboBoxCasing->currentItem() == 2 ) result.append( "u" ); if ( !m_lineEditInBetween->text().isEmpty() ) result.append( '"' ).append( m_lineEditInBetween->text() ); @@ -198,27 +198,27 @@ namespace KBibTeX return result; } - IdSuggestionComponentTitle::IdSuggestionComponentTitle( const QString &text, QWidget *parent ): IdSuggestionComponent( i18n( "Title" ), parent ) + IdSuggestionComponentTitle::IdSuggestionComponentTitle( const TQString &text, TQWidget *parent ): IdSuggestionComponent( i18n( "Title" ), parent ) { - QGridLayout *layout = new QGridLayout( this, 6, 4, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( this, 6, 4, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel *label = new QLabel( m_title, this ); - QFont labelFont( label->font() ); + TQLabel *label = new TQLabel( m_title, this ); + TQFont labelFont( label->font() ); labelFont.setBold( TRUE ); label->setFont( labelFont ); label->setBackgroundColor( KGlobalSettings::highlightColor() ); label->setPaletteForegroundColor( KGlobalSettings::highlightedTextColor() ); - label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); + label->setAlignment( TQt::AlignHCenter | TQt::AlignVCenter ); layout->addMultiCellWidget( label, 0, 0, 0, 2 ); - m_checkBoxRemoveSmallWords = new QCheckBox( i18n( "Remove small words" ), this ); + m_checkBoxRemoveSmallWords = new TQCheckBox( i18n( "Remove small words" ), this ); layout->addMultiCellWidget( m_checkBoxRemoveSmallWords, 1, 1, 0, 1 ); m_checkBoxRemoveSmallWords->setChecked( text[0] == 'T' ); connect( m_checkBoxRemoveSmallWords, SIGNAL( toggled( bool ) ), SIGNAL( modified() ) ); struct IdSuggestionTokenInfo info = IdSuggestions::evalToken( text.mid( 1 ) ); - label = new QLabel( i18n( "Casing:" ), this ); + label = new TQLabel( i18n( "Casing:" ), this ); layout->addWidget( label, 2, 0 ); m_comboBoxCasing = new KComboBox( FALSE, this ); label->setBuddy( m_comboBoxCasing ); @@ -232,11 +232,11 @@ namespace KBibTeX m_comboBoxCasing->setCurrentItem( 2 ); else m_comboBoxCasing->setCurrentItem( 0 ); - connect( m_comboBoxCasing, SIGNAL( textChanged( const QString& ) ), SIGNAL( modified() ) ); + connect( m_comboBoxCasing, SIGNAL( textChanged( const TQString& ) ), SIGNAL( modified() ) ); - label = new QLabel( i18n( "Only first letters:" ), this ); + label = new TQLabel( i18n( "Only first letters:" ), this ); layout->addWidget( label, 3, 0 ); - m_spinBoxLen = new QSpinBox( this ); + m_spinBoxLen = new TQSpinBox( this ); label->setBuddy( m_spinBoxLen ); layout->addWidget( m_spinBoxLen, 3, 1 ); m_spinBoxLen->setMinValue( 0 ); @@ -246,13 +246,13 @@ namespace KBibTeX m_spinBoxLen->setMinimumWidth( m_spinBoxLen->fontMetrics().width( i18n( "Complete title" ) ) + 32 ); connect( m_spinBoxLen, SIGNAL( valueChanged( int ) ), SIGNAL( modified() ) ); - label = new QLabel( i18n( "Text between words:" ), this ); + label = new TQLabel( i18n( "Text between words:" ), this ); layout->addWidget( label, 4, 0 ); m_lineEditInBetween = new KLineEdit( this ); label->setBuddy( m_lineEditInBetween ); layout->addWidget( m_lineEditInBetween, 4, 1 ); m_lineEditInBetween->setText( info.inBetween ); - connect( m_lineEditInBetween, SIGNAL( textChanged( const QString& ) ), SIGNAL( modified() ) ); + connect( m_lineEditInBetween, SIGNAL( textChanged( const TQString& ) ), SIGNAL( modified() ) ); layout->setRowStretch( 5, 1 ); layout->setColStretch( 1, 1 ); @@ -260,12 +260,12 @@ namespace KBibTeX layout->addMultiCellWidget( moveWidgets( this ), 0, 5, 3, 3 ); } - QString IdSuggestionComponentTitle::text() const + TQString IdSuggestionComponentTitle::text() const { - if ( m_toBeDeleted ) return QString::null; + if ( m_toBeDeleted ) return TQString::null; - QString result = m_checkBoxRemoveSmallWords->isChecked() ? "T" : "t"; - if ( m_spinBoxLen->value() > 0 && m_spinBoxLen->value() <= 9 ) result.append( QString::number( m_spinBoxLen->value() ) ); + TQString result = m_checkBoxRemoveSmallWords->isChecked() ? "T" : "t"; + if ( m_spinBoxLen->value() > 0 && m_spinBoxLen->value() <= 9 ) result.append( TQString::number( m_spinBoxLen->value() ) ); if ( m_comboBoxCasing->currentItem() == 1 ) result.append( "l" ); else if ( m_comboBoxCasing->currentItem() == 2 ) result.append( "u" ); if ( !m_lineEditInBetween->text().isEmpty() ) result.append( '"' ).append( m_lineEditInBetween->text() ); @@ -273,20 +273,20 @@ namespace KBibTeX return result; } - IdSuggestionComponentYear::IdSuggestionComponentYear( const QString &text, QWidget *parent ): IdSuggestionComponent( i18n( "Year" ), parent ) + IdSuggestionComponentYear::IdSuggestionComponentYear( const TQString &text, TQWidget *parent ): IdSuggestionComponent( i18n( "Year" ), parent ) { - QGridLayout *layout = new QGridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel *label = new QLabel( m_title, this ); - QFont labelFont( label->font() ); + TQLabel *label = new TQLabel( m_title, this ); + TQFont labelFont( label->font() ); labelFont.setBold( TRUE ); label->setFont( labelFont ); label->setBackgroundColor( KGlobalSettings::highlightColor() ); label->setPaletteForegroundColor( KGlobalSettings::highlightedTextColor() ); - label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); + label->setAlignment( TQt::AlignHCenter | TQt::AlignVCenter ); layout->addMultiCellWidget( label, 0, 0, 0, 2 ); - label = new QLabel( i18n( "Year:" ), this ); + label = new TQLabel( i18n( "Year:" ), this ); layout->addWidget( label, 1, 0 ); m_comboBoxDigits = new KComboBox( this ); label->setBuddy( m_comboBoxDigits ); @@ -302,32 +302,32 @@ namespace KBibTeX layout->addMultiCellWidget( moveWidgets( this ), 0, 2, 3, 3 ); } - QString IdSuggestionComponentYear::text() const + TQString IdSuggestionComponentYear::text() const { - if ( m_toBeDeleted ) return QString::null; + if ( m_toBeDeleted ) return TQString::null; return m_comboBoxDigits->currentItem() == 0 ? "y" : "Y"; } - IdSuggestionComponentText::IdSuggestionComponentText( const QString &text, QWidget *parent ): IdSuggestionComponent( i18n( "Text" ), parent ) + IdSuggestionComponentText::IdSuggestionComponentText( const TQString &text, TQWidget *parent ): IdSuggestionComponent( i18n( "Text" ), parent ) { - QGridLayout *layout = new QGridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel *label = new QLabel( m_title, this ); - QFont labelFont( label->font() ); + TQLabel *label = new TQLabel( m_title, this ); + TQFont labelFont( label->font() ); labelFont.setBold( TRUE ); label->setFont( labelFont ); label->setBackgroundColor( KGlobalSettings::highlightColor() ); label->setPaletteForegroundColor( KGlobalSettings::highlightedTextColor() ); - label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); + label->setAlignment( TQt::AlignHCenter | TQt::AlignVCenter ); layout->addMultiCellWidget( label, 0, 0, 0, 2 ); - label = new QLabel( i18n( "Text in between:" ), this ); + label = new TQLabel( i18n( "Text in between:" ), this ); layout->addWidget( label, 1, 0 ); m_lineEditInBetween = new KLineEdit( this ); label->setBuddy( m_lineEditInBetween ); layout->addWidget( m_lineEditInBetween, 1, 1 ); m_lineEditInBetween->setText( text.mid( 1 ) ); - connect( m_lineEditInBetween, SIGNAL( textChanged( const QString& ) ), SIGNAL( modified() ) ); + connect( m_lineEditInBetween, SIGNAL( textChanged( const TQString& ) ), SIGNAL( modified() ) ); layout->setColStretch( 1, 1 ); layout->setRowStretch( 2, 1 ); @@ -335,17 +335,17 @@ namespace KBibTeX layout->addMultiCellWidget( moveWidgets( this ), 0, 2, 3, 3 ); } - QString IdSuggestionComponentText::text() const + TQString IdSuggestionComponentText::text() const { - if ( m_toBeDeleted ) return QString::null; - return m_lineEditInBetween->text().isEmpty() ? QString::null : QString( "\"" ).append( m_lineEditInBetween->text() ); + if ( m_toBeDeleted ) return TQString::null; + return m_lineEditInBetween->text().isEmpty() ? TQString::null : TQString( "\"" ).append( m_lineEditInBetween->text() ); } - IdSuggestionsScrollView::IdSuggestionsScrollView( QWidget *parent, const char*name ): QScrollView( parent, name ), m_widget( NULL ) + IdSuggestionsScrollView::IdSuggestionsScrollView( TQWidget *parent, const char*name ): TQScrollView( parent, name ), m_widget( NULL ) { setMinimumHeight( 256 ); - setHScrollBarMode( QScrollView::AlwaysOff ); - setVScrollBarMode( QScrollView::AlwaysOn ); + setHScrollBarMode( TQScrollView::AlwaysOff ); + setVScrollBarMode( TQScrollView::AlwaysOn ); setLineWidth( 0 ); } @@ -354,14 +354,14 @@ namespace KBibTeX // nothing } - void IdSuggestionsScrollView::viewportResizeEvent( QResizeEvent * ) + void IdSuggestionsScrollView::viewportResizeEvent( TQResizeEvent * ) { if ( m_widget != NULL ) m_widget->setFixedWidth( viewport()->width() ); } - IdSuggestionsWidget::IdSuggestionsWidget( const QString &formatStr, KDialogBase *parent, const char *name ) - : QWidget( parent, name ), m_originalFormatStr( formatStr ), m_parent( parent ) + IdSuggestionsWidget::IdSuggestionsWidget( const TQString &formatStr, KDialogBase *parent, const char *name ) + : TQWidget( parent, name ), m_originalFormatStr( formatStr ), m_parent( parent ) { BibTeX::FileImporter *importer = new BibTeX::FileImporterBibTeX( false ); BibTeX::File *file = importer->load( exampleBibTeXEntry ); @@ -383,14 +383,14 @@ namespace KBibTeX return m_componentCount; } - QDialog::DialogCode IdSuggestionsWidget::execute( QString &formatStr, QWidget *parent, const char *name ) + TQDialog::DialogCode IdSuggestionsWidget::execute( TQString &formatStr, TQWidget *parent, const char *name ) { KDialogBase * dlg = new KDialogBase( parent, name, true, i18n( "Edit Id Suggestions" ), KDialogBase::Ok | KDialogBase::Cancel ); IdSuggestionsWidget* ui = new IdSuggestionsWidget( formatStr, dlg, "IdSuggestionsWidget" ); dlg->setMainWidget( ui ); - QDialog::DialogCode result = ( QDialog::DialogCode ) dlg->exec(); - if ( result == QDialog::Accepted ) + TQDialog::DialogCode result = ( TQDialog::DialogCode ) dlg->exec(); + if ( result == TQDialog::Accepted ) ui->apply( formatStr ); delete( ui ); @@ -399,10 +399,10 @@ namespace KBibTeX return result; } - void IdSuggestionsWidget::reset( const QString& formatStr ) + void IdSuggestionsWidget::reset( const TQString& formatStr ) { - QLayoutIterator it = m_listOfComponents->layout()->iterator(); - QLayoutItem *child; + TQLayoutIterator it = m_listOfComponents->layout()->iterator(); + TQLayoutItem *child; while (( child = it.current() ) != 0 ) { IdSuggestionComponent *component = dynamic_cast( child->widget() ); @@ -412,8 +412,8 @@ namespace KBibTeX } m_componentCount = 0; - QStringList lines = QStringList::split( '|', formatStr ); - for ( QStringList::Iterator it = lines.begin(); it != lines.end();++it ) + TQStringList lines = TQStringList::split( '|', formatStr ); + for ( TQStringList::Iterator it = lines.begin(); it != lines.end();++it ) { IdSuggestionComponent *component = NULL; if (( *it )[0] == 'a' || ( *it )[0] == 'A' ) @@ -440,17 +440,17 @@ namespace KBibTeX m_scrollViewComponents->resize( m_scrollViewComponents->width(), min( 384, m_listOfComponents->height() + 2 ) ); } - void IdSuggestionsWidget::apply( QString& formatStr ) + void IdSuggestionsWidget::apply( TQString& formatStr ) { bool first = TRUE; formatStr = ""; - QLayoutIterator it = m_listOfComponents->layout()->iterator(); - QLayoutItem *child; + TQLayoutIterator it = m_listOfComponents->layout()->iterator(); + TQLayoutItem *child; while (( child = it.current() ) != 0 ) { IdSuggestionComponent *component = dynamic_cast( child->widget() ); - QString text = QString::null; - if ( component != NULL && ( text = component->text() ) != QString::null ) + TQString text = TQString::null; + if ( component != NULL && ( text = component->text() ) != TQString::null ) { if ( first ) first = FALSE; else formatStr.append( "|" ); formatStr.append( text ); @@ -461,22 +461,22 @@ namespace KBibTeX void IdSuggestionsWidget::setupGUI() { - QGridLayout *gridLayout = new QGridLayout( this, 3, 2, 0, KDialog::spacingHint() ); + TQGridLayout *gridLayout = new TQGridLayout( this, 3, 2, 0, KDialog::spacingHint() ); gridLayout->setRowStretch( 2, 1 ); gridLayout->setColStretch( 0, 1 ); - m_labelExample = new QLabel( this ); + m_labelExample = new TQLabel( this ); gridLayout->addMultiCellWidget( m_labelExample, 0, 1, 0, 0 ); m_pushButtonAdd = new KPushButton( i18n( "Add" ), this ); gridLayout->addWidget( m_pushButtonAdd, 1, 1 ); m_scrollViewComponents = new IdSuggestionsScrollView( this ); - m_listOfComponents = new QWidget( m_scrollViewComponents->viewport() ); + m_listOfComponents = new TQWidget( m_scrollViewComponents->viewport() ); m_scrollViewComponents->setMainWidget( m_listOfComponents ); m_scrollViewComponents->addChild( m_listOfComponents ); gridLayout->addMultiCellWidget( m_scrollViewComponents, 2, 2, 0, 1 ); - QVBoxLayout *listLayout = new QVBoxLayout( m_listOfComponents, 0, KDialog::spacingHint() ); + TQVBoxLayout *listLayout = new TQVBoxLayout( m_listOfComponents, 0, KDialog::spacingHint() ); listLayout->setAutoAdd( TRUE ); KPopupMenu *addMenu = new KPopupMenu( m_pushButtonAdd ); @@ -517,8 +517,8 @@ namespace KBibTeX void IdSuggestionsWidget::updateGUI() { - QLayoutIterator it = m_listOfComponents->layout()->iterator(); - QLayoutItem *child = NULL; + TQLayoutIterator it = m_listOfComponents->layout()->iterator(); + TQLayoutItem *child = NULL; IdSuggestionComponent *lastComponent = NULL; bool first = TRUE; int i = 0; @@ -557,10 +557,10 @@ namespace KBibTeX void IdSuggestionsWidget::updateExample() { - QString formatStr; + TQString formatStr; apply( formatStr ); - QString formatted = IdSuggestions::formatId( m_example, formatStr ); - m_labelExample->setText( QString( i18n( "Example:
%1
" ) ).arg( formatted ) ); + TQString formatted = IdSuggestions::formatId( m_example, formatStr ); + m_labelExample->setText( TQString( i18n( "Example:
%1
" ) ).arg( formatted ) ); } } diff --git a/src/idsuggestionswidget.h b/src/idsuggestionswidget.h index 103029c..dc2a675 100644 --- a/src/idsuggestionswidget.h +++ b/src/idsuggestionswidget.h @@ -20,24 +20,24 @@ #ifndef KBIBTEXIDSUGGESTIONSWIDGET_H #define KBIBTEXIDSUGGESTIONSWIDGET_H -#include -#include +#include +#include -class QCheckBox; -class QScrollView; -class QSpinBox; +class TQCheckBox; +class TQScrollView; +class TQSpinBox; class KComboBox; class KLineEdit; class KPushButton; namespace KBibTeX { - class IdSuggestionComponent: public QFrame + class IdSuggestionComponent: public TQFrame { Q_OBJECT public: - IdSuggestionComponent( const QString& title, QWidget *parent ); - virtual QString text() const = 0; + IdSuggestionComponent( const TQString& title, TQWidget *parent ); + virtual TQString text() const = 0; void setEnableUpDown( bool enableUp, bool enableDown ); signals: @@ -46,11 +46,11 @@ namespace KBibTeX void deleted(); protected: - QWidget *moveWidgets( QWidget *parent ); + TQWidget *moveWidgets( TQWidget *parent ); bool m_toBeDeleted; - QString m_title; - QWidget *m_parent; + TQString m_title; + TQWidget *m_parent; KPushButton *m_pushButtonDel; KPushButton *m_pushButtonUp; KPushButton *m_pushButtonDown; @@ -64,32 +64,32 @@ namespace KBibTeX class IdSuggestionComponentAuthor: public IdSuggestionComponent { public: - IdSuggestionComponentAuthor( const QString &text, QWidget *parent ); - QString text() const; + IdSuggestionComponentAuthor( const TQString &text, TQWidget *parent ); + TQString text() const; protected: KComboBox *m_comboBoxWhichAuthors; KComboBox *m_comboBoxCasing; KLineEdit *m_lineEditInBetween; - QSpinBox *m_spinBoxLen; + TQSpinBox *m_spinBoxLen; }; class IdSuggestionComponentTitle: public IdSuggestionComponent { public: - IdSuggestionComponentTitle( const QString &text, QWidget *parent ); - QString text() const; + IdSuggestionComponentTitle( const TQString &text, TQWidget *parent ); + TQString text() const; protected: - QCheckBox *m_checkBoxRemoveSmallWords; + TQCheckBox *m_checkBoxRemoveSmallWords; KComboBox *m_comboBoxCasing; KLineEdit *m_lineEditInBetween; - QSpinBox *m_spinBoxLen; + TQSpinBox *m_spinBoxLen; }; class IdSuggestionComponentYear: public IdSuggestionComponent { public: - IdSuggestionComponentYear( const QString &text, QWidget *parent ); - QString text() const; + IdSuggestionComponentYear( const TQString &text, TQWidget *parent ); + TQString text() const; protected: KComboBox *m_comboBoxDigits; }; @@ -97,55 +97,55 @@ namespace KBibTeX class IdSuggestionComponentText: public IdSuggestionComponent { public: - IdSuggestionComponentText( const QString &text, QWidget *parent ); - QString text() const; + IdSuggestionComponentText( const TQString &text, TQWidget *parent ); + TQString text() const; protected: KLineEdit *m_lineEditInBetween; }; - class IdSuggestionsScrollView : public QScrollView + class IdSuggestionsScrollView : public TQScrollView { Q_OBJECT public: - IdSuggestionsScrollView( QWidget *parent, const char*name = NULL ); + IdSuggestionsScrollView( TQWidget *parent, const char*name = NULL ); ~IdSuggestionsScrollView(); - void setMainWidget( QWidget *widget ) {m_widget = widget;} + void setMainWidget( TQWidget *widget ) {m_widget = widget;} protected: - void viewportResizeEvent( QResizeEvent * ); + void viewportResizeEvent( TQResizeEvent * ); private: - QWidget *m_widget; + TQWidget *m_widget; }; /** @author Thomas Fischer */ - class IdSuggestionsWidget : public QWidget + class IdSuggestionsWidget : public TQWidget { Q_OBJECT public: ~IdSuggestionsWidget(); int numComponents(); - static QDialog::DialogCode execute( QString &formatStr, QWidget *parent = 0, const char *name = 0 ); + static TQDialog::DialogCode execute( TQString &formatStr, TQWidget *parent = 0, const char *name = 0 ); protected: - IdSuggestionsWidget( const QString &formatStr, KDialogBase *parent, const char *name = 0 ); + IdSuggestionsWidget( const TQString &formatStr, KDialogBase *parent, const char *name = 0 ); - QString m_originalFormatStr; + TQString m_originalFormatStr; int m_componentCount; - void reset( const QString& formatStr ); - void apply( QString& formatStr ); + void reset( const TQString& formatStr ); + void apply( TQString& formatStr ); private: - static QString exampleBibTeXEntry; + static TQString exampleBibTeXEntry; BibTeX::Entry *m_example; IdSuggestionsScrollView *m_scrollViewComponents; - QLabel *m_labelExample; - QWidget *m_listOfComponents; + TQLabel *m_labelExample; + TQWidget *m_listOfComponents; KPushButton *m_pushButtonAdd; KDialogBase *m_parent; diff --git a/src/iso5426converter.cpp b/src/iso5426converter.cpp index 3b40d5d..9dda16f 100644 --- a/src/iso5426converter.cpp +++ b/src/iso5426converter.cpp @@ -33,13 +33,13 @@ #include "iso5426converter.h" #include -#include +#include using KBibTeX::Iso5426Converter; -QString Iso5426Converter::toUtf8(const QCString& text_) { +TQString Iso5426Converter::toUtf8(const TQCString& text_) { const uint len = text_.length(); - QString result; + TQString result; result.reserve(len); uint pos = 0; for(uint i = 0; i < len; ++i) { @@ -53,7 +53,7 @@ QString Iso5426Converter::toUtf8(const QCString& text_) { if(c == 0xC9) { c = 0xC8; } - QChar d = getCombiningChar(c * 256 + text_[i + 1]); + TQChar d = getCombiningChar(c * 256 + text_[i + 1]); if(!d.isNull()) { result[pos++] = d; ++i; @@ -84,7 +84,7 @@ bool Iso5426Converter::isCombining(uchar c) { } // Source : http://www.itscj.ipsj.or.jp/ISO-IR/053.pdf -QChar Iso5426Converter::getChar(uchar c) { +TQChar Iso5426Converter::getChar(uchar c) { switch(c) { case 0xA1: return 0x00A1; // 2/1 inverted exclamation mark @@ -199,7 +199,7 @@ QChar Iso5426Converter::getChar(uchar c) { } } -QChar Iso5426Converter::getCombiningChar(uint c) { +TQChar Iso5426Converter::getCombiningChar(uint c) { switch(c) { // 4/0 low rising tone mark case 0xC041: @@ -887,6 +887,6 @@ QChar Iso5426Converter::getCombiningChar(uint c) { default: kdDebug() << "Iso5426Converter::getCombiningChar() - no match for " << c << endl; - return QChar(); + return TQChar(); } } diff --git a/src/iso5426converter.h b/src/iso5426converter.h index f13873b..442863e 100644 --- a/src/iso5426converter.h +++ b/src/iso5426converter.h @@ -23,11 +23,11 @@ #ifndef KBIBTEX_ISO5426CONVERTER_H #define KBIBTEX_ISO5426CONVERTER_H -class QCString; -class QString; -class QChar; +class TQCString; +class TQString; +class TQChar; -#include +#include namespace KBibTeX { @@ -36,15 +36,15 @@ namespace KBibTeX { */ class Iso5426Converter { public: - static QString toUtf8(const QCString& text); + static TQString toUtf8(const TQCString& text); private: static bool hasNext(uint pos, uint len); static bool isAscii(uchar c); static bool isCombining(uchar c); - static QChar getChar(uchar c); - static QChar getCombiningChar(uint i); + static TQChar getChar(uchar c); + static TQChar getCombiningChar(uint i); }; } // end namespace diff --git a/src/iso6937converter.cpp b/src/iso6937converter.cpp index 66a5154..d55b310 100644 --- a/src/iso6937converter.cpp +++ b/src/iso6937converter.cpp @@ -33,13 +33,13 @@ #include "iso6937converter.h" #include -#include +#include using KBibTeX::Iso6937Converter; -QString Iso6937Converter::toUtf8(const QCString& text_) { +TQString Iso6937Converter::toUtf8(const TQCString& text_) { const uint len = text_.length(); - QString result; + TQString result; result.reserve(len); uint pos = 0; for(uint i = 0; i < len; ++i) { @@ -47,7 +47,7 @@ QString Iso6937Converter::toUtf8(const QCString& text_) { if(isAscii(c)) { result[pos++] = c; } else if(isCombining(c) && hasNext(i, len)) { - QChar d = getCombiningChar(c * 256 + text_[i + 1]); + TQChar d = getCombiningChar(c * 256 + text_[i + 1]); if(!d.isNull()) { result[pos++] = d; ++i; @@ -78,7 +78,7 @@ bool Iso6937Converter::isCombining(uchar c) { } // Source : http://anubis.dkuug.dk/JTC1/SC2/WG3/docs/6937cd.pdf -QChar Iso6937Converter::getChar(uchar c) { +TQChar Iso6937Converter::getChar(uchar c) { switch(c) { case 0xA0: return 0x00A0; // 10/00 NO-BREAK SPACE @@ -240,7 +240,7 @@ QChar Iso6937Converter::getChar(uchar c) { } } -QChar Iso6937Converter::getCombiningChar(uint c) { +TQChar Iso6937Converter::getCombiningChar(uint c) { switch(c) { // 12/00 (This position shall not be used) @@ -601,6 +601,6 @@ QChar Iso6937Converter::getCombiningChar(uint c) { default: kdDebug() << "Iso6937Converter::getCombiningChar() - no match for " << c << endl; - return QChar(); + return TQChar(); } } diff --git a/src/iso6937converter.h b/src/iso6937converter.h index a72efcd..9645fba 100644 --- a/src/iso6937converter.h +++ b/src/iso6937converter.h @@ -23,9 +23,9 @@ #ifndef KBIBTEX_ISO6937CONVERTER_H #define KBIBTEX_ISO6937CONVERTER_H -class QCString; -class QString; -class QChar; +class TQCString; +class TQString; +class TQChar; namespace KBibTeX { @@ -34,15 +34,15 @@ namespace KBibTeX { */ class Iso6937Converter { public: - static QString toUtf8(const QCString& text); + static TQString toUtf8(const TQCString& text); private: static bool hasNext(unsigned int pos, unsigned int len); static bool isAscii(unsigned char c); static bool isCombining(unsigned char c); - static QChar getChar(unsigned char c); - static QChar getCombiningChar(unsigned int c); + static TQChar getChar(unsigned char c); + static TQChar getCombiningChar(unsigned int c); }; } // end namespace diff --git a/src/kbibtex_part.cpp b/src/kbibtex_part.cpp index 3a5f16a..eaf72b8 100644 --- a/src/kbibtex_part.cpp +++ b/src/kbibtex_part.cpp @@ -20,18 +20,18 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -70,10 +70,10 @@ #include #include "kbibtex_part.h" -const QString inPipeFilename = QDir::homeDirPath() + "/.kbibtex.in"; +const TQString inPipeFilename = TQDir::homeDirPath() + "/.kbibtex.in"; -KBibTeXPart::KBibTeXPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name ) +KBibTeXPart::KBibTeXPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name ) : KParts::ReadWritePart( parent, name ), m_defInitCounter( 0 ), m_settingsDlg( NULL ), m_initializationDone( FALSE ), m_inPipe( NULL ) { m_mainWindow = dynamic_cast( parent ); @@ -101,7 +101,7 @@ KBibTeXPart::KBibTeXPart( QWidget *parentWidget, const char *widgetName, // read configuration readSettings(); - QTimer::singleShot( 100, this, SLOT( slotDeferredInitialization() ) ); + TQTimer::singleShot( 100, this, SLOT( slotDeferredInitialization() ) ); } KBibTeXPart::~KBibTeXPart() @@ -151,7 +151,7 @@ bool KBibTeXPart::queryClose() if ( !isReadWrite() || !isModified() ) return TRUE; - QString docName = url().fileName(); + TQString docName = url().fileName(); if ( docName.isEmpty() ) docName = i18n( "Untitled" ); int res = KMessageBox::warningYesNoCancel( widget(), @@ -223,9 +223,9 @@ bool KBibTeXPart::saveFile() tempBibFile.close(); if ( success ) { - QString usedFileName = m_file; - QFileInfo fi( usedFileName ); - if ( !fi.readLink().isNull() && KMessageBox::questionYesNo( widget(), QString( i18n( "The selected filename \"%1\" is a symbolic link pointing to \"%2\".\nReplace the link with a new file or overwrite the existing file the link points to?" ) ).arg( usedFileName ).arg(KBibTeX::Settings::resolveLink( m_file, fi.readLink() ) ), i18n( "Symbolic Link" ), KGuiItem( i18n( "Replace link" ) ), KGuiItem( i18n( "Overwrite file the link points to" ) ) ) == KMessageBox::No ) + TQString usedFileName = m_file; + TQFileInfo fi( usedFileName ); + if ( !fi.readLink().isNull() && KMessageBox::questionYesNo( widget(), TQString( i18n( "The selected filename \"%1\" is a symbolic link pointing to \"%2\".\nReplace the link with a new file or overwrite the existing file the link points to?" ) ).arg( usedFileName ).arg(KBibTeX::Settings::resolveLink( m_file, fi.readLink() ) ), i18n( "Symbolic Link" ), KGuiItem( i18n( "Replace link" ) ), KGuiItem( i18n( "Overwrite file the link points to" ) ) ) == KMessageBox::No ) usedFileName = KBibTeX::Settings::resolveLink( m_file, fi.readLink() ); m_documentWidget->dirWatch().stopScan(); @@ -247,13 +247,13 @@ bool KBibTeXPart::saveAs() bool result = FALSE; KBibTeX::Settings * settings = KBibTeX::Settings::self( NULL ); - QString startDir = ! url().isEmpty() ? url().url() : QDir::currentDirPath(); + TQString startDir = ! url().isEmpty() ? url().url() : TQDir::currentDirPath(); KURL saveURL = KFileDialog::getSaveURL( startDir, "*.bib|" + i18n( "BibTeX (*.bib)" ) + "\n*.ris|" + i18n( "Reference Manager (*.ris)" ) + ( settings->external_xml2bibAvailable ? "\n*.ref *.refer *.rfr *.txt|" + i18n( "EndNote (Refer format) (*.ref *.refer *.rfr *.txt)" ) + "\n*.isi *.cgi|" + i18n( "ISI Web of Knowledge (*.isi *.cgi)" ) : "" ) + "\n*.xml|" + ( settings->external_xml2bibAvailable ? i18n( "DocBook 5 or MODS (*.xml)" ) : i18n( "DocBook 5 (*.xml)" ) ), widget() ); if ( saveURL.isValid() && !saveURL.isEmpty() ) { - if ( KIO::NetAccess::exists( saveURL, FALSE, widget() ) && KMessageBox::warningContinueCancel( widget(), i18n( "A file named '%1' already exists. Are you sure you want to overwrite it?" ).arg( saveURL.filename() ), QString::null, i18n( "Overwrite" ) ) != KMessageBox::Continue ) + if ( KIO::NetAccess::exists( saveURL, FALSE, widget() ) && KMessageBox::warningContinueCancel( widget(), i18n( "A file named '%1' already exists. Are you sure you want to overwrite it?" ).arg( saveURL.filename() ), TQString::null, i18n( "Overwrite" ) ) != KMessageBox::Continue ) return result; if ( ReadWritePart::saveAs( saveURL ) ) @@ -269,14 +269,14 @@ bool KBibTeXPart::saveAs() void KBibTeXPart::slotFileExport() { KBibTeX::Settings * settings = KBibTeX::Settings::self( NULL ); - QString startDir = ! url().isEmpty() ? url().url() : QDir::currentDirPath(); + TQString startDir = ! url().isEmpty() ? url().url() : TQDir::currentDirPath(); KURL exportURL = KFileDialog::getSaveURL( startDir, "*.pdf|" + i18n( "Portable Document File (*.pdf)" ) + "\n*.ps|" + i18n( "PostScript (*.ps)" ) + "\n*.ris|" + i18n( "Reference Manager (*.ris)" ) + ( settings->external_xml2bibAvailable ? "\n*.ref *.refer *.rfr *.txt|" + i18n( "EndNote (Refer format) (*.ref *.refer *.rfr *.txt)" ) + "\n*.isi *.cgi|" + i18n( "ISI Web of Knowledge (*.isi *.cgi)" ) : "" ) + "\n*.xml|" + ( settings->external_xml2bibAvailable ? i18n( "DocBook 5 or MODS (*.xml)" ) : i18n( "DocBook 5 (*.xml)" ) ) + "\n*.html|" + i18n( "Hypertext Markup Langage (*.html)" ) + "\n*.rtf|" + i18n( "Rich Text Format (*.rtf)" ), widget() ); if ( exportURL.isValid() && !exportURL.isEmpty() ) { if ( KIO::NetAccess::exists( exportURL, FALSE, widget() ) ) { - if ( KMessageBox::warningContinueCancel( widget(), i18n( "A file named '%1' already exists. Are you sure you want to overwrite it?" ).arg( exportURL.filename() ), QString::null, i18n( "Overwrite" ) ) != KMessageBox::Continue ) + if ( KMessageBox::warningContinueCancel( widget(), i18n( "A file named '%1' already exists. Are you sure you want to overwrite it?" ).arg( exportURL.filename() ), TQString::null, i18n( "Overwrite" ) ) != KMessageBox::Continue ) return ; /** make backup if defined by the user */ @@ -301,9 +301,9 @@ void KBibTeXPart::slotFileExport() format = BibTeX::File::formatRIS; else if ( exportURL.fileName().endsWith( ".xml", FALSE ) ) { - QStringList options = QStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "DocBook5|MODS|internal XML" : "DocBook5|internal XML" ) ); + TQStringList options = TQStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "DocBook5|MODS|internal XML" : "DocBook5|internal XML" ) ); bool ok = false; - QString answer = KInputDialog::getItem( i18n( "Choose file format" ), QString( i18n( "Choose file format of file '%1':" ) ).arg( exportURL.fileName() ), options, 0, false, &ok, widget() ); + TQString answer = KInputDialog::getItem( i18n( "Choose file format" ), TQString( i18n( "Choose file format of file '%1':" ) ).arg( exportURL.fileName() ), options, 0, false, &ok, widget() ); if ( ok && !answer.isNull() && answer == "DocBook5" ) format = BibTeX::File::formatDocBook5; else if ( ok && !answer.isNull() && answer == "MODS" ) @@ -315,9 +315,9 @@ void KBibTeXPart::slotFileExport() format = BibTeX::File::formatHTML; else { - QStringList options = QStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "BibTeX|EndNote|ISI|RIS" : "BibTeX|RIS" ) ); + TQStringList options = TQStringList::split( '|', ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "BibTeX|EndNote|ISI|RIS" : "BibTeX|RIS" ) ); bool ok = false; - QString answer = KInputDialog::getItem( i18n( "Choose file format" ), QString( i18n( "Choose file format of file '%1':" ) ).arg( exportURL.fileName() ), options, 0, false, &ok, widget() ); + TQString answer = KInputDialog::getItem( i18n( "Choose file format" ), TQString( i18n( "Choose file format of file '%1':" ) ).arg( exportURL.fileName() ), options, 0, false, &ok, widget() ); if ( ok && !answer.isNull() && answer == "BibTeX" ) format = BibTeX::File::formatBibTeX; else if ( ok && !answer.isNull() && answer == "EndNote" ) @@ -328,7 +328,7 @@ void KBibTeXPart::slotFileExport() format = BibTeX::File::formatRIS; } - QStringList errorLog; + TQStringList errorLog; bool error = !m_documentWidget->save( tempBibFile.file(), format, i18n( "Exporting" ), &errorLog ) ; if ( !error ) @@ -341,10 +341,10 @@ void KBibTeXPart::slotFileExport() { #if (KDE_VERSION_MINOR>=4) && (KDE_VERSION_MAJOR>=3) if ( !errorLog.empty() ) - KMessageBox::errorList( widget(), QString( i18n( "File could not be exported in '%1'." ) ).arg( exportURL.prettyURL() ).append( i18n( "\n\nSee the following error log for details." ) ), errorLog, i18n( "Exporting failed" ) ); + KMessageBox::errorList( widget(), TQString( i18n( "File could not be exported in '%1'." ) ).arg( exportURL.prettyURL() ).append( i18n( "\n\nSee the following error log for details." ) ), errorLog, i18n( "Exporting failed" ) ); else #endif - KMessageBox::error( widget(), QString( i18n( "File could not be exported to '%1'." ) ).arg( exportURL.prettyURL() ), i18n( "Exporting failed" ) ); + KMessageBox::error( widget(), TQString( i18n( "File could not be exported to '%1'." ) ).arg( exportURL.prettyURL() ), i18n( "Exporting failed" ) ); } } @@ -364,15 +364,15 @@ void KBibTeXPart::slotFileFindDups() void KBibTeXPart::slotFileMerge() { KBibTeX::Settings * settings = KBibTeX::Settings::self( NULL ); - QString startDir = ! url().isEmpty() ? url().url() : QDir::currentDirPath(); - KURL mergeURL = KFileDialog::getOpenURL( startDir, QString( "*.bib *.ris" ) + + TQString startDir = ! url().isEmpty() ? url().url() : TQDir::currentDirPath(); + KURL mergeURL = KFileDialog::getOpenURL( startDir, TQString( "*.bib *.ris" ) + ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? " *.xml *.ref *.refer *.rfr *.txt *.isi *.cgi" : "" ) + "|" + i18n( "Supported Bibliographies" ) + "\n*.bib|" + i18n( "BibTeX (*.bib)" ) + "\n*.ris|" + i18n( "Reference Manager (*.ris)" ) + ( settings->external_xml2bibAvailable && settings->external_end2xmlAvailable ? "\n*.ref *.refer *.rfr *.txt|" + i18n( "EndNote (Refer format) (*.ref *.refer *.rfr *.txt)" ) + "\n*.isi *.cgi|" + i18n( "ISI Web of Knowledge (*.isi *.cgi)" ) + "\n*.xml|" + i18n( "MODS or EndNote XML (*.xml)" ) : "" ) + "\n*|" + i18n( "All files (*.*)" ) , widget() ); if ( !mergeURL.isValid() || mergeURL.isEmpty() ) return; - QString extension = mergeURL.fileName(); + TQString extension = mergeURL.fileName(); int extPos = extension.find( '.' ); if ( extPos < 0 ) return; @@ -408,11 +408,11 @@ void KBibTeXPart::slotPreferences() m_settingsDlg = new KBibTeX::SettingsDlg( widget(), "settings_dlg" ); m_documentWidget->saveState(); - if ( m_settingsDlg->exec() == QDialog::Accepted ) + if ( m_settingsDlg->exec() == TQDialog::Accepted ) m_documentWidget->restoreState(); } -void KBibTeXPart::setupGUI( QWidget *parentWidget, const char *name ) +void KBibTeXPart::setupGUI( TQWidget *parentWidget, const char *name ) { m_documentWidget = new KBibTeX::DocumentWidget( !isReadWrite(), parentWidget, name ); @@ -473,9 +473,9 @@ void KBibTeXPart::setupActions() m_actionViewDocument->setToolTip( i18n( "View the documents associated with this BibTeX entry" ) ); m_actionViewDocument->setEnabled( FALSE ); m_actionViewFirstDocument = new KAction( i18n( "View Primary Document" ), 0, m_documentWidget, SLOT( slotViewFirstDocument() ), actionCollection(), "view_first_document" ); - m_actionViewFirstDocument->setShortcut( Qt::Key_F4 ); + m_actionViewFirstDocument->setShortcut( TQt::Key_F4 ); m_actionViewDocumentOnlineRef = new KAction( i18n( "View Primary Online Reference" ), 0, m_documentWidget, SLOT( slotViewFirstDocumentsOnlineRef() ), actionCollection(), "view_first_documents_online_ref" ); - m_actionViewDocumentOnlineRef->setShortcut( Qt::Key_F5 ); + m_actionViewDocumentOnlineRef->setShortcut( TQt::Key_F5 ); m_actionAssignKeywords = new KActionMenu( i18n( "Assign Keywords" ), actionCollection(), "assign_keywords" ); m_actionAssignKeywords->setToolTip( i18n( "Assign keywords to this entry" ) ); m_actionAssignKeywords->setEnabled( FALSE ); @@ -527,14 +527,14 @@ void KBibTeXPart::setupActions() KStatusBar * statusBar = m_mainWindow->statusBar(); if ( statusBar != NULL ) { - connect( actionCollection(), SIGNAL( actionStatusText( const QString & ) ), statusBar, SLOT( message( const QString & ) ) ); + connect( actionCollection(), SIGNAL( actionStatusText( const TQString & ) ), statusBar, SLOT( message( const TQString & ) ) ); connect( actionCollection(), SIGNAL( clearStatusText() ), statusBar, SLOT( clear() ) ); } } actionCollection() ->setHighlightingEnabled( true ); - KActionMenu *acmElementNew = new KActionMenu( i18n( "&New" ), QIconSet( SmallIcon( "filenew" ) ), actionCollection(), "element_new" ); + KActionMenu *acmElementNew = new KActionMenu( i18n( "&New" ), TQIconSet( SmallIcon( "filenew" ) ), actionCollection(), "element_new" ); acmElementNew->setToolTip( i18n( "Add a new element to this BibTeX document" ) ); acmElementNew->setEnabled( FALSE ); } @@ -543,10 +543,10 @@ bool KBibTeXPart::slotNewElement() { if ( isReadWrite() && sender() ) { - QString elementType; + TQString elementType; if ( strncmp( sender() ->name(), "element_new_entry_", 18 ) == 0 ) - elementType = QString( sender() ->name() + 18 ); + elementType = TQString( sender() ->name() + 18 ); else if ( strcmp( sender() ->name(), "element_new_comment" ) == 0 ) elementType = "comment"; else if ( strcmp( sender() ->name(), "element_new_macro" ) == 0 ) @@ -617,9 +617,9 @@ void KBibTeXPart::slotUndoChanged( bool undoAvailable ) void KBibTeXPart::slotUseInPipe() { - if ( m_inPipe == NULL && QFile::exists( inPipeFilename ) ) + if ( m_inPipe == NULL && TQFile::exists( inPipeFilename ) ) { - KMessageBox::error( widget(), QString( i18n( "Some other KBibTeX instance is using the pipe.\nIf this assumption is wrong, please delete '%1'." ) ).arg( inPipeFilename ), i18n( "Pipe already in use" ) ); + KMessageBox::error( widget(), TQString( i18n( "Some other KBibTeX instance is using the pipe.\nIf this assumption is wrong, please delete '%1'." ) ).arg( inPipeFilename ), i18n( "Pipe already in use" ) ); } else { @@ -630,25 +630,25 @@ void KBibTeXPart::slotUseInPipe() m_inPipe->remove(); delete m_inPipe; m_inPipe = NULL; - QFile::remove( inPipeFilename ); + TQFile::remove( inPipeFilename ); } else { // create pipe if ( ::mkfifo( inPipeFilename.latin1(), 0600 ) == 0 ) { - m_inPipe = new QFile( inPipeFilename ); + m_inPipe = new TQFile( inPipeFilename ); if ( !m_inPipe->open( IO_ReadOnly ) || fcntl( m_inPipe->handle(), F_SETFL, O_NONBLOCK ) < 0 ) { m_inPipe->close(); m_inPipe = NULL; } if ( m_inPipe == NULL ) - QFile::remove( inPipeFilename ); + TQFile::remove( inPipeFilename ); } if ( m_inPipe == NULL ) - KMessageBox::error( widget(), QString( i18n( "Could not create pipe at '%1'." ) ).arg( inPipeFilename ), i18n( "Error creating pipe" ) ); + KMessageBox::error( widget(), TQString( i18n( "Could not create pipe at '%1'." ) ).arg( inPipeFilename ), i18n( "Error creating pipe" ) ); } } @@ -695,7 +695,7 @@ void KBibTeXPart::slotDeferredInitialization() KMessageBox::sorry( widget(), i18n( "The KBibTeX part has problems to initialize itself. Only limited functionality will be available." ), i18n( "KBibTeX Part" ) ); return ; } - QTimer::singleShot( 250, this, SLOT( slotDeferredInitialization() ) ); + TQTimer::singleShot( 250, this, SLOT( slotDeferredInitialization() ) ); } } @@ -721,15 +721,15 @@ KBibTeXPartFactory::~KBibTeXPartFactory() s_instance = 0L; } -KParts::Part* KBibTeXPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList & /* args */ ) +KParts::Part* KBibTeXPartFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *classname, const TQStringList & /* args */ ) { // Create an instance of our Part KBibTeXPart * obj = new KBibTeXPart( parentWidget, widgetName, parent, name ); // See if we are to be read-write or not - if ( QCString( classname ) == "KParts::ReadOnlyPart" ) + if ( TQCString( classname ) == "KParts::ReadOnlyPart" ) obj->setReadWrite( false ); return obj; diff --git a/src/kbibtex_part.h b/src/kbibtex_part.h index f9a045a..05031e8 100644 --- a/src/kbibtex_part.h +++ b/src/kbibtex_part.h @@ -29,14 +29,14 @@ #include #include -class QWidget; -class QTextEdit; -class QFile; -class QLabel; -class QTabWidget; -class QPainter; -class QListViewItem; -class QProgressDialog; +class TQWidget; +class TQTextEdit; +class TQFile; +class TQLabel; +class TQTabWidget; +class TQPainter; +class TQListViewItem; +class TQProgressDialog; class KURL; class KListView; class KAction; @@ -49,8 +49,8 @@ class KBibTeXPart : public KParts::ReadWritePart Q_OBJECT public: - KBibTeXPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name ); + KBibTeXPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name ); virtual ~KBibTeXPart(); @@ -100,8 +100,8 @@ private: }; int m_defInitCounter; - QLabel *m_preview; - QProgressDialog *m_progressDialog; + TQLabel *m_preview; + TQProgressDialog *m_progressDialog; KBibTeX::DocumentWidget *m_documentWidget; KBibTeX::SettingsDlg *m_settingsDlg; KAction *m_actionFileMerge; @@ -133,14 +133,14 @@ private: KToggleAction *m_actionShowComments; KToggleAction *m_actionShowMacros; KMainWindow *m_mainWindow; - QValueList webQueryList; + TQValueList webQueryList; bool m_initializationDone; - QFile *m_inPipe; + TQFile *m_inPipe; void readSettings(); void writeSettings(); - void setupGUI( QWidget *parentWidget, const char *name ); + void setupGUI( TQWidget *parentWidget, const char *name ); void setupActions(); signals: @@ -156,9 +156,9 @@ class KBibTeXPartFactory : public KParts::Factory public: KBibTeXPartFactory(); virtual ~KBibTeXPartFactory(); - virtual KParts::Part* createPartObject( QWidget * parentWidget, const char * widgetName, - QObject * parent, const char * name, - const char * classname, const QStringList & /* args */ ); + virtual KParts::Part* createPartObject( TQWidget * parentWidget, const char * widgetName, + TQObject * parent, const char * name, + const char * classname, const TQStringList & /* args */ ); static KInstance* instance(); private: diff --git a/src/kbibtexshell.cpp b/src/kbibtexshell.cpp index e3182dd..531d4e2 100644 --- a/src/kbibtexshell.cpp +++ b/src/kbibtexshell.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include #include @@ -37,7 +37,7 @@ #include #include "kbibtexshell.h" -KBibTeXShell::KBibTeXShell( QWidget* parentWidget, const char* name ) +KBibTeXShell::KBibTeXShell( TQWidget* parentWidget, const char* name ) : KParts::MainWindow( parentWidget, name ), m_part( NULL ), m_parentWidget( parentWidget ) { // set the shell's ui resource file @@ -164,7 +164,7 @@ void KBibTeXShell::writeConfig() writeConfig( config ); } -QString KBibTeXShell::encoding() +TQString KBibTeXShell::encoding() { return "utf8"; } @@ -198,11 +198,11 @@ void KBibTeXShell::setupActions() KStdAction::keyBindings( this, SLOT( optionsConfigureKeys() ), actionCollection() ) ->setToolTip( i18n( "Configure key bindings for KBibTeX" ) ); KStdAction::configureToolbars( this, SLOT( optionsConfigureToolbars() ), actionCollection() ) ->setToolTip( i18n( "Configure the tool bar for KBibTeX" ) ); - connect( actionCollection(), SIGNAL( actionStatusText( const QString & ) ), this, SLOT( slotActionStatusText( const QString & ) ) ); + connect( actionCollection(), SIGNAL( actionStatusText( const TQString & ) ), this, SLOT( slotActionStatusText( const TQString & ) ) ); connect( actionCollection(), SIGNAL( clearStatusText( ) ), statusBar(), SLOT( clear() ) ); } -void KBibTeXShell::slotActionStatusText( const QString &text ) +void KBibTeXShell::slotActionStatusText( const TQString &text ) { KStatusBar * stb = statusBar(); @@ -238,8 +238,8 @@ void KBibTeXShell::optionsShowStatusbar() void KBibTeXShell::optionsConfigureKeys() { KKeyDialog dlg( false, this ); - QPtrList clients = guiFactory()->clients(); - for ( QPtrListIterator it( clients ); it.current(); ++it ) + TQPtrList clients = guiFactory()->clients(); + for ( TQPtrListIterator it( clients ); it.current(); ++it ) { dlg.insert(( *it )->actionCollection() ); } @@ -311,8 +311,8 @@ void KBibTeXShell::slotFileNew() void KBibTeXShell::slotFileOpen() { bool bibUtilsAvailable = checkExternalToolAvailable( "xml2bib" ) && checkExternalToolAvailable( "end2xml" ); - QString startDir = ! m_part->url().isEmpty() ? m_part->url().url() : QDir::currentDirPath(); - KURL mergeURL = KFileDialog::getOpenURL( startDir, QString( "*.bib *.ris" ) + + TQString startDir = ! m_part->url().isEmpty() ? m_part->url().url() : TQDir::currentDirPath(); + KURL mergeURL = KFileDialog::getOpenURL( startDir, TQString( "*.bib *.ris" ) + ( bibUtilsAvailable ? " *.xml *.ref *.refer *.rfr *.txt *.isi *.cgi" : "" ) + "|" + i18n( "Supported Bibliographies" ) + "\n*.bib|" + i18n( "BibTeX (*.bib)" ) + "\n*.ris|" + i18n( "Reference Manager (*.ris)" ) + ( bibUtilsAvailable ? "\n*.ref *.refer *.rfr *.txt|" + i18n( "EndNote (Refer format) (*.ref *.refer *.rfr *.txt)" ) + "\n*.isi *.cgi|" + i18n( "ISI Web of Knowledge (*.isi *.cgi)" ) + "\n*.xml|" + i18n( "MODS or EndNote XML (*.xml)" ) : "" ) + "\n*|" + i18n( "All files (*.*)" ) , widget() ); slotFileOpen( mergeURL ); @@ -369,9 +369,9 @@ void KBibTeXShell::initializePart( KParts::ReadWritePart* part ) } } -bool KBibTeXShell::checkExternalToolAvailable( const QString &binary ) +bool KBibTeXShell::checkExternalToolAvailable( const TQString &binary ) { - QProcess *process = new QProcess( binary ); + TQProcess *process = new TQProcess( binary ); bool ok = process->start(); ok &= process->normalExit(); if ( process->isRunning() ) diff --git a/src/kbibtexshell.h b/src/kbibtexshell.h index b52d577..bbf7a54 100644 --- a/src/kbibtexshell.h +++ b/src/kbibtexshell.h @@ -28,8 +28,8 @@ #include #include -class QWidget; -class QFrame; +class TQWidget; +class TQFrame; class KToggleAction; class KConfig; @@ -40,7 +40,7 @@ class KBibTeXShell : public KParts::MainWindow Q_OBJECT public: - KBibTeXShell( QWidget* parentWidget = 0, const char* name = 0 ); + KBibTeXShell( TQWidget* parentWidget = 0, const char* name = 0 ); virtual ~KBibTeXShell(); @@ -57,7 +57,7 @@ public: void writeConfig(); public: - static QString encoding(); + static TQString encoding(); public slots: void slotAddRecentURL( const KURL& ); @@ -76,11 +76,11 @@ private slots: void applyNewToolbarConfig(); - void slotActionStatusText( const QString &text ); + void slotActionStatusText( const TQString &text ); private: KParts::ReadWritePart *m_part; - QWidget* m_parentWidget; + TQWidget* m_parentWidget; KToggleAction *m_statusbarAction; @@ -94,7 +94,7 @@ private: void initializePart( KParts::ReadWritePart* ); - bool checkExternalToolAvailable( const QString &binary ); + bool checkExternalToolAvailable( const TQString &binary ); }; #endif // _KBIBTEXSHELL_H_ diff --git a/src/latin1literal.h b/src/latin1literal.h index 97c4cfc..1abcf6d 100644 --- a/src/latin1literal.h +++ b/src/latin1literal.h @@ -27,18 +27,18 @@ #ifndef LATIN1LITERAL_H #define LATIN1LITERAL_H -#include +#include namespace KBibTeX { /** * A class for explicit marking of string literals encoded in the ISO * 8859-1 character set. Allows for efficient, still (in terms of the - * chosen encoding) safe comparison with QString instances. To be used + * chosen encoding) safe comparison with TQString instances. To be used * like this: * * \code - * QString s = ..... + * TQString s = ..... * if (s == Latin1Literal("o")) { ..... } * \endcode * @@ -61,8 +61,8 @@ public: } // end namespace inline -bool operator==(const QString& s1, const KBibTeX::Latin1LiteralInternal& s2) { - const QChar* uc = s1.unicode(); +bool operator==(const TQString& s1, const KBibTeX::Latin1LiteralInternal& s2) { + const TQChar* uc = s1.unicode(); const char* c = s2.str; if(!c || !uc) { return (!c && !uc); @@ -82,17 +82,17 @@ bool operator==(const QString& s1, const KBibTeX::Latin1LiteralInternal& s2) { } inline -bool operator!=(const QString& s1, const KBibTeX::Latin1LiteralInternal& s2) { +bool operator!=(const TQString& s1, const KBibTeX::Latin1LiteralInternal& s2) { return !(s1 == s2); } inline -bool operator==(const KBibTeX::Latin1LiteralInternal& s1, const QString& s2) { +bool operator==(const KBibTeX::Latin1LiteralInternal& s1, const TQString& s2) { return s2 == s1; } inline -bool operator!=(const KBibTeX::Latin1LiteralInternal& s1, const QString& s2) { +bool operator!=(const KBibTeX::Latin1LiteralInternal& s1, const TQString& s2) { return !(s2 == s1); } diff --git a/src/macro.cpp b/src/macro.cpp index 4958e6f..a25d4d8 100644 --- a/src/macro.cpp +++ b/src/macro.cpp @@ -17,15 +17,15 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include "macro.h" namespace BibTeX { - Macro::Macro( const QString &key ) + Macro::Macro( const TQString &key ) : Element(), m_key( key ), m_value( new Value() ) { // nothing @@ -42,12 +42,12 @@ namespace BibTeX delete m_value; } - void Macro::setKey( const QString &key ) + void Macro::setKey( const TQString &key ) { m_key = key; } - QString Macro::key() const + TQString Macro::key() const { return m_key; } @@ -70,9 +70,9 @@ namespace BibTeX } } - bool Macro::containsPattern( const QString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const + bool Macro::containsPattern( const TQString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const { - QString text = QString( m_key ).append( m_value->simplifiedText() ); + TQString text = TQString( m_key ).append( m_value->simplifiedText() ); if ( filterType == ftExact ) { @@ -82,9 +82,9 @@ namespace BibTeX else { /** for each word in the search pattern ... */ - QStringList words = QStringList::split( QRegExp( "\\s+" ), pattern ); + TQStringList words = TQStringList::split( TQRegExp( "\\s+" ), pattern ); unsigned int hits = 0; - for ( QStringList::Iterator it = words.begin(); it != words.end(); ++it ) + for ( TQStringList::Iterator it = words.begin(); it != words.end(); ++it ) { /** check if word is contained in text */ if ( fieldType == EntryField::ftUnknown && text.contains( *it, caseSensitive ) ) @@ -108,7 +108,7 @@ namespace BibTeX m_value = new Value( other->m_value ); } - QString Macro::text() const + TQString Macro::text() const { return m_key + "=" + m_value->text(); } diff --git a/src/macro.h b/src/macro.h index ae42bdc..13168eb 100644 --- a/src/macro.h +++ b/src/macro.h @@ -24,31 +24,31 @@ #include #include -class QString; +class TQString; namespace BibTeX { class Macro : public Element { public: - Macro( const QString &key ); + Macro( const TQString &key ); Macro( Macro *other ); virtual ~Macro(); - void setKey( const QString &key ); - QString key() const; + void setKey( const TQString &key ); + TQString key() const; Value *value() const; void setValue( Value *value ); - bool containsPattern( const QString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; + bool containsPattern( const TQString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; Element* clone(); void copyFrom( Macro *other ); - QString text() const; + TQString text() const; private: - QString m_key; + TQString m_key; Value *m_value; }; diff --git a/src/macrowidget.cpp b/src/macrowidget.cpp index 5acca02..ce89e14 100644 --- a/src/macrowidget.cpp +++ b/src/macrowidget.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -34,7 +34,7 @@ namespace KBibTeX { - QDialog::DialogCode MacroWidget::execute( BibTeX::Macro *macro, bool isReadOnly, QWidget *parent, const char *name ) + TQDialog::DialogCode MacroWidget::execute( BibTeX::Macro *macro, bool isReadOnly, TQWidget *parent, const char *name ) { KDialogBase * dlg = new KDialogBase( parent, name, TRUE, i18n( "Edit BibTeX Macro" ), KDialogBase::Ok | KDialogBase::Cancel ); MacroWidget* macroWidget = new MacroWidget( macro, isReadOnly, dlg, "MacroWidget" ); @@ -42,7 +42,7 @@ namespace KBibTeX dlg->setMainWidget( macroWidget ); connect( dlg, SIGNAL( okClicked() ), macroWidget, SLOT( apply() ) ); - QDialog::DialogCode result = ( QDialog::DialogCode ) dlg->exec(); + TQDialog::DialogCode result = ( TQDialog::DialogCode ) dlg->exec(); delete( macroWidget ); delete( dlg ); @@ -50,8 +50,8 @@ namespace KBibTeX return result; } - MacroWidget::MacroWidget( BibTeX::Macro *bibtexmacro, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_isReadOnly( isReadOnly ), m_bibtexmacro( bibtexmacro ) + MacroWidget::MacroWidget( BibTeX::Macro *bibtexmacro, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_isReadOnly( isReadOnly ), m_bibtexmacro( bibtexmacro ) { setupGUI(); reset(); @@ -79,16 +79,16 @@ namespace KBibTeX { setMinimumWidth( 384 ); - QVBoxLayout * layout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout * layout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QLabel *label = new QLabel( i18n( "Macro &id:" ), this ); + TQLabel *label = new TQLabel( i18n( "Macro &id:" ), this ); layout->addWidget( label ); m_lineEditMacroId = new KLineEdit( this, "m_lineEditMacroId" ); m_lineEditMacroId->setReadOnly( m_isReadOnly ); layout->addWidget( m_lineEditMacroId ); label->setBuddy( m_lineEditMacroId ); - label = new QLabel( i18n( "Macro &value:" ), this ); + label = new TQLabel( i18n( "Macro &value:" ), this ); layout->addWidget( label ); m_fieldLineEditMacroValue = new KBibTeX::FieldLineEdit( i18n( "Macro" ), KBibTeX::FieldLineEdit::itMultiLine, m_isReadOnly, this, "m_fieldLineEditMacroValue" ); layout->addWidget( m_fieldLineEditMacroValue ); diff --git a/src/macrowidget.h b/src/macrowidget.h index 38d65ec..00fb9ff 100644 --- a/src/macrowidget.h +++ b/src/macrowidget.h @@ -20,7 +20,7 @@ #ifndef MACROWIDGET_H #define MACROWIDGET_H -#include +#include #include #include @@ -29,11 +29,11 @@ class KLineEdit; namespace KBibTeX { - class MacroWidget : public QWidget + class MacroWidget : public TQWidget { Q_OBJECT public: - static QDialog::DialogCode execute( BibTeX::Macro *macro, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + static TQDialog::DialogCode execute( BibTeX::Macro *macro, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); private slots: void apply(); @@ -45,7 +45,7 @@ namespace KBibTeX KLineEdit *m_lineEditMacroId; KBibTeX::FieldLineEdit *m_fieldLineEditMacroValue; - MacroWidget( BibTeX::Macro *bibtexmacro, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + MacroWidget( BibTeX::Macro *bibtexmacro, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~MacroWidget(); void setupGUI(); diff --git a/src/main.cpp b/src/main.cpp index ecec2b0..b4fc9df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,8 +20,8 @@ // #define UNIQUEAPP 1 -#include -#include +#include +#include #ifdef UNIQUEAPP #include #else // UNIQUEAPP 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 -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -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( *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( *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( *it ); BibTeX::Entry *entry = item->entry; BibTeX::Macro *macro = item->macro; BibTeX::Preamble *preamble = item->preamble; if ( entry != NULL ) - for ( QValueList::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->entries.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->entries.end(); ++it2 ) + for ( TQValueList::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::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->macros.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->macros.end(); ++it2 ) + for ( TQValueList::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::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->preambles.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->preambles.end(); ++it2 ) + for ( TQValueList::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( *it ); if ( item != NULL ) { - for ( QValueList::Iterator it2 = m_mergeSetList[m_currentCliqueIndex]->fields.begin(); it2 != m_mergeSetList[m_currentCliqueIndex]->fields.end(); ++it2 ) + for ( TQValueList::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::Iterator it = m_mergeSetList[i]->fields.begin(); it != m_mergeSetList[i]->fields.end(); ++it ) + for ( TQValueList::Iterator it = m_mergeSetList[i]->fields.begin(); it != m_mergeSetList[i]->fields.end(); ++it ) { newEntry->addField( new BibTeX::EntryField( *it ) ); } - for ( QValueList::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) - for ( QValueList::ConstIterator fIt = ( *it )->begin(); fIt != ( *it )->end(); ++fIt ) + for ( TQValueList::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) + for ( TQValueList::ConstIterator fIt = ( *it )->begin(); fIt != ( *it )->end(); ++fIt ) if ( newEntry->getField(( *fIt )->fieldTypeName() ) == NULL ) { newEntry->addField( new BibTeX::EntryField( *fIt ) ); } - for ( QValueList::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) + for ( TQValueList::Iterator it = m_mergeSetList[i]->entries.begin(); it != m_mergeSetList[i]->entries.end(); ++it ) { BibTeX::Entry *entry = dynamic_cast( 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::Iterator it = m_mergeSetList[i]->macros.begin(); it != m_mergeSetList[i]->macros.end(); ++it ) + for ( TQValueList::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::Iterator it = m_mergeSetList[i]->preambles.begin(); it != m_mergeSetList[i]->preambles.end(); ++it ) + for ( TQValueList::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 mapFieldToController; - QMap firstEntryData; + TQMap mapFieldToController; + TQMap 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( *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( 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( 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( 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( 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( 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( 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( 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() ) diff --git a/src/mergeelements.h b/src/mergeelements.h index 88c011e..4752175 100644 --- a/src/mergeelements.h +++ b/src/mergeelements.h @@ -29,15 +29,15 @@ class KPushButton; class KTextEdit; class KListView; -class QProgressBar; +class TQProgressBar; namespace KBibTeX { - class MergeElementsCliqueItem : public QObject, public QCheckListItem + class MergeElementsCliqueItem : public TQObject, public TQCheckListItem { Q_OBJECT public: - MergeElementsCliqueItem( BibTeX::Entry* entry, BibTeX::Macro* macro, BibTeX::Preamble* preamble, QListView *parent ); + MergeElementsCliqueItem( BibTeX::Entry* entry, BibTeX::Macro* macro, BibTeX::Preamble* preamble, TQListView *parent ); BibTeX::Entry* entry; BibTeX::Macro* macro; BibTeX::Preamble* preamble; @@ -49,71 +49,71 @@ namespace KBibTeX void stateChanged( MergeElementsCliqueItem* ); }; - class MergeEntriesAlternativesController: public QCheckListItem + class MergeEntriesAlternativesController: public TQCheckListItem { public: - MergeEntriesAlternativesController( const QString &label, QListView *parent ); - MergeEntriesAlternativesController( BibTeX::EntryField::FieldType fieldType, QListView *parent ); + MergeEntriesAlternativesController( const TQString &label, TQListView *parent ); + MergeEntriesAlternativesController( BibTeX::EntryField::FieldType fieldType, TQListView *parent ); BibTeX::EntryField::FieldType fieldType; - const QString fieldName; + const TQString fieldName; }; - class MergeMacrosAlternativesController: public QCheckListItem + class MergeMacrosAlternativesController: public TQCheckListItem { public: - MergeMacrosAlternativesController( bool isKey, QListView *parent ); + MergeMacrosAlternativesController( bool isKey, TQListView *parent ); }; - class MergeEntriesAlternativesItem: public QCheckListItem + class MergeEntriesAlternativesItem: public TQCheckListItem { public: MergeEntriesAlternativesItem( BibTeX::EntryField *field, MergeEntriesAlternativesController *parent ); BibTeX::EntryField *field; }; - class MergeMacrosAlternativesItem: public QCheckListItem + class MergeMacrosAlternativesItem: public TQCheckListItem { public: MergeMacrosAlternativesItem( BibTeX::Value *value, MergeMacrosAlternativesController *parent ); BibTeX::Value *value; }; - class MergeElementsAlternativesId: public QCheckListItem + class MergeElementsAlternativesId: public TQCheckListItem { public: - MergeElementsAlternativesId( const QString &id, MergeEntriesAlternativesController *parent ); - QString id; + MergeElementsAlternativesId( const TQString &id, MergeEntriesAlternativesController *parent ); + TQString id; }; - class MergeMacroAlternativesKey: public QCheckListItem + class MergeMacroAlternativesKey: public TQCheckListItem { public: - MergeMacroAlternativesKey( const QString &key, MergeMacrosAlternativesController *parent ); - QString key; + MergeMacroAlternativesKey( const TQString &key, MergeMacrosAlternativesController *parent ); + TQString key; }; - class MergeEntriesAlternativesEntryType: public QCheckListItem + class MergeEntriesAlternativesEntryType: public TQCheckListItem { public: - MergeEntriesAlternativesEntryType( const QString &typeString, MergeEntriesAlternativesController *parent ); + MergeEntriesAlternativesEntryType( const TQString &typeString, MergeEntriesAlternativesController *parent ); MergeEntriesAlternativesEntryType( BibTeX::Entry::EntryType type, MergeEntriesAlternativesController *parent ); - QString typeString; + TQString typeString; BibTeX::Entry::EntryType type; }; - class MergePreambleAlternativesController: public QCheckListItem + class MergePreambleAlternativesController: public TQCheckListItem { public: - MergePreambleAlternativesController( QListView *parent ); + MergePreambleAlternativesController( TQListView *parent ); }; - class MergePreambleAlternatives: public QCheckListItem + class MergePreambleAlternatives: public TQCheckListItem { public: - MergePreambleAlternatives( const QString &text, MergePreambleAlternativesController *parent ); - QString text; + MergePreambleAlternatives( const TQString &text, MergePreambleAlternativesController *parent ); + TQString text; }; /** @@ -123,18 +123,18 @@ namespace KBibTeX { Q_OBJECT public: - MergeElements( QWidget *parent ); + MergeElements( TQWidget *parent ); ~MergeElements(); int mergeDuplicates( BibTeX::File *bibTeXFile ); protected: - void showEvent( QShowEvent * ); + void showEvent( TQShowEvent * ); protected slots: void slotRefreshAlternatives(); void slotNextClique(); void slotPreviousClique(); - void slotPreviewElement( QListViewItem *item ); + void slotPreviewElement( TQListViewItem *item ); void saveCurrentMergeSet(); void slotRestore(); @@ -148,20 +148,20 @@ namespace KBibTeX typedef struct { - QValueList macros; - QValueList entries; - QValueList fields; - QValueList preambles; - QString macroKey; + TQValueList macros; + TQValueList entries; + TQValueList fields; + TQValueList preambles; + TQString macroKey; BibTeX::Value *macroValue; - QString id, typeString; + TQString id, typeString; BibTeX::Entry::EntryType type; - QString preambleText; + TQString preambleText; } MergeSet; KListView *m_listViewClique; KListView *m_listViewAlternatives; - QProgressBar *m_progressBar; + TQProgressBar *m_progressBar; FindDuplicates::DuplicateCliqueList m_duplicateCliqueList; MergeSet **m_mergeSetList; int m_currentCliqueIndex; diff --git a/src/messagehandler.cpp b/src/messagehandler.cpp index 273a5eb..941b53d 100644 --- a/src/messagehandler.cpp +++ b/src/messagehandler.cpp @@ -27,7 +27,7 @@ namespace KBibTeX { // all messages go to manager -void ManagerMessage::send(const QString& message_, Type type_) { +void ManagerMessage::send(const TQString& message_, Type type_) { // Fetch::Manager::self()->updateStatus(message_); // plus errors get a message box if(type_ == Error) { @@ -37,7 +37,7 @@ void ManagerMessage::send(const QString& message_, Type type_) { } } -void ManagerMessage::infoList(const QString& message_, const QStringList& list_) { +void ManagerMessage::infoList(const TQString& message_, const TQStringList& list_) { KMessageBox::informationList(NULL, message_, list_); // FIXME: some widget instead of NULL } diff --git a/src/messagehandler.h b/src/messagehandler.h index 00fcbe9..c76e7ea 100644 --- a/src/messagehandler.h +++ b/src/messagehandler.h @@ -23,8 +23,8 @@ #ifndef KBIBTEX_MESSAGEHANDLER_H #define KBIBTEX_MESSAGEHANDLER_H -class QString; -class QStringList; +class TQString; +class TQStringList; namespace KBibTeX { @@ -38,8 +38,8 @@ public: MessageHandler() {} virtual ~MessageHandler() {} - virtual void send(const QString& message, Type type) = 0; - virtual void infoList(const QString& message, const QStringList& list) = 0; + virtual void send(const TQString& message, Type type) = 0; + virtual void infoList(const TQString& message, const TQStringList& list) = 0; }; class ManagerMessage : public MessageHandler { @@ -47,8 +47,8 @@ public: ManagerMessage() : MessageHandler() {} virtual ~ManagerMessage() {} - virtual void send(const QString& message, Type type); - virtual void infoList(const QString& message, const QStringList& list); + virtual void send(const TQString& message, Type type); + virtual void infoList(const TQString& message, const TQStringList& list); }; } // end namespace diff --git a/src/preamble.cpp b/src/preamble.cpp index 1b03a0f..3df04f8 100644 --- a/src/preamble.cpp +++ b/src/preamble.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include "preamble.h" @@ -30,7 +30,7 @@ namespace BibTeX // TODO } - Preamble::Preamble( const QString& text ) : Element() + Preamble::Preamble( const TQString& text ) : Element() { m_value = new Value( text, false ); } @@ -63,9 +63,9 @@ namespace BibTeX } } - bool Preamble::containsPattern( const QString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const + bool Preamble::containsPattern( const TQString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const { - QString text = m_value->simplifiedText(); + TQString text = m_value->simplifiedText(); if ( filterType == ftExact ) { @@ -75,9 +75,9 @@ namespace BibTeX else { /** for each word in the search pattern ... */ - QStringList words = QStringList::split( QRegExp( "\\s+" ), pattern ); + TQStringList words = TQStringList::split( TQRegExp( "\\s+" ), pattern ); unsigned int hits = 0; - for ( QStringList::Iterator it = words.begin(); it != words.end(); ++it ) + for ( TQStringList::Iterator it = words.begin(); it != words.end(); ++it ) { /** check if word is contained in text */ if ( fieldType == EntryField::ftUnknown && text.contains( *it, caseSensitive ) ) @@ -100,7 +100,7 @@ namespace BibTeX m_value = new Value( other->m_value ); } - QString Preamble::text() const + TQString Preamble::text() const { return "Preamble: " + m_value->text(); } diff --git a/src/preamble.h b/src/preamble.h index fc6da9d..506096c 100644 --- a/src/preamble.h +++ b/src/preamble.h @@ -32,18 +32,18 @@ namespace BibTeX { public: Preamble( ); - Preamble( const QString& text ); + Preamble( const TQString& text ); Preamble( Preamble *other ); virtual ~Preamble(); Value *value() const; void setValue( Value *value ); - bool containsPattern( const QString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; + bool containsPattern( const TQString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const; Element* clone(); void copyFrom( Preamble *other ); - QString text() const; + TQString text() const; private: Value *m_value; diff --git a/src/preamblewidget.cpp b/src/preamblewidget.cpp index a1cc0c1..6b74ece 100644 --- a/src/preamblewidget.cpp +++ b/src/preamblewidget.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -28,7 +28,7 @@ namespace KBibTeX { - QDialog::DialogCode PreambleWidget::execute( BibTeX::Preamble *preamble, bool isReadOnly, QWidget *parent, const char *name ) + TQDialog::DialogCode PreambleWidget::execute( BibTeX::Preamble *preamble, bool isReadOnly, TQWidget *parent, const char *name ) { KDialogBase * dlg = new KDialogBase( parent, name, TRUE, i18n( "Edit BibTeX Preamble" ), KDialogBase::Ok | KDialogBase::Cancel ); PreambleWidget* preambleWidget = new PreambleWidget( preamble, isReadOnly, dlg, "PreambleWidget" ); @@ -36,7 +36,7 @@ namespace KBibTeX dlg->setMainWidget( preambleWidget ); connect( dlg, SIGNAL( okClicked() ), preambleWidget, SLOT( apply() ) ); - QDialog::DialogCode result = ( QDialog::DialogCode ) dlg->exec(); + TQDialog::DialogCode result = ( TQDialog::DialogCode ) dlg->exec(); delete( preambleWidget ); delete( dlg ); @@ -44,7 +44,7 @@ namespace KBibTeX return result; } - PreambleWidget::PreambleWidget( BibTeX::Preamble *bibtexpreamble, bool isReadOnly, QWidget *parent, const char *name ) : QWidget( parent, name ), m_isReadOnly( isReadOnly ), m_bibtexpreamble( bibtexpreamble ) + PreambleWidget::PreambleWidget( BibTeX::Preamble *bibtexpreamble, bool isReadOnly, TQWidget *parent, const char *name ) : TQWidget( parent, name ), m_isReadOnly( isReadOnly ), m_bibtexpreamble( bibtexpreamble ) { setupGUI(); reset(); @@ -71,9 +71,9 @@ namespace KBibTeX { setMinimumWidth( 384 ); - QVBoxLayout * layout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout * layout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QLabel *label = new QLabel( i18n( "&Preamble:" ), this ); + TQLabel *label = new TQLabel( i18n( "&Preamble:" ), this ); layout->addWidget( label ); m_fieldLineEditPreambleValue = new KBibTeX::FieldLineEdit( i18n( "Preamble" ), KBibTeX::FieldLineEdit::itMultiLine, m_isReadOnly, this, "m_fieldLineEditPreambleValue" ); layout->addWidget( m_fieldLineEditPreambleValue ); diff --git a/src/preamblewidget.h b/src/preamblewidget.h index f08ba47..779f6b0 100644 --- a/src/preamblewidget.h +++ b/src/preamblewidget.h @@ -20,8 +20,8 @@ #ifndef KBIBTEXPREAMBLEWIDGET_H #define KBIBTEXPREAMBLEWIDGET_H -#include -#include +#include +#include #include #include @@ -32,11 +32,11 @@ namespace KBibTeX /** @author Thomas Fischer */ - class PreambleWidget : public QWidget + class PreambleWidget : public TQWidget { Q_OBJECT public: - static QDialog::DialogCode execute( BibTeX::Preamble *preamble, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + static TQDialog::DialogCode execute( BibTeX::Preamble *preamble, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); private slots: void apply(); @@ -47,7 +47,7 @@ namespace KBibTeX BibTeX::Preamble* m_bibtexpreamble; KBibTeX::FieldLineEdit *m_fieldLineEditPreambleValue; - PreambleWidget( BibTeX::Preamble *bibtexpreamble, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + PreambleWidget( BibTeX::Preamble *bibtexpreamble, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~PreambleWidget(); void setupGUI(); diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 113bb4d..a77cf51 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -38,10 +38,10 @@ namespace KBibTeX { - SearchBar::SearchBar( QWidget *parent, const char *name ) - : QWidget( parent, name ) + SearchBar::SearchBar( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { - m_timerInput = new QTimer( this ); + m_timerInput = new TQTimer( this ); connect( m_timerInput, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); setupGUI(); @@ -69,7 +69,7 @@ namespace KBibTeX m_comboboxFilter->setFont( KGlobalSettings::generalFont() ); } - void SearchBar::setSearch( const QString&text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType ) + void SearchBar::setSearch( const TQString&text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType ) { m_comboboxFilter->setCurrentText( text ); switch ( filterType ) @@ -83,39 +83,39 @@ namespace KBibTeX void SearchBar::setupGUI() { - QBoxLayout * layout = new QHBoxLayout( this, 3 /* KDialog::marginHint()*/, KDialog::spacingHint() ); + TQBoxLayout * layout = new TQHBoxLayout( this, 3 /* KDialog::marginHint()*/, KDialog::spacingHint() ); KIconLoader iconLoader = KIconLoader( "kbibtex" ); m_pushButtonAddElement = new KPushButton( this ); - m_pushButtonAddElement->setIconSet( QIconSet( BarIcon( "add" ) ) ); + m_pushButtonAddElement->setIconSet( TQIconSet( BarIcon( "add" ) ) ); layout->addWidget( m_pushButtonAddElement ); - QToolTip::add( m_pushButtonAddElement, i18n( "Add a new BibTeX entry, comment or macro to this file" ) ); + TQToolTip::add( m_pushButtonAddElement, i18n( "Add a new BibTeX entry, comment or macro to this file" ) ); m_pushButtonSearchOnlineDatabases = new KPushButton( this ); - m_pushButtonSearchOnlineDatabases->setIconSet( QIconSet( BarIcon( "network" ) ) ); + m_pushButtonSearchOnlineDatabases->setIconSet( TQIconSet( BarIcon( "network" ) ) ); layout->addWidget( m_pushButtonSearchOnlineDatabases ); - QToolTip::add( m_pushButtonSearchOnlineDatabases, i18n( "Add a new BibTeX entry from an online database" ) ); + TQToolTip::add( m_pushButtonSearchOnlineDatabases, i18n( "Add a new BibTeX entry from an online database" ) ); connect( m_pushButtonSearchOnlineDatabases, SIGNAL( clicked() ), this, SIGNAL( onlineSearch() ) ); layout->insertSpacing( 2, KDialog::spacingHint() ); m_pushButtonClearSearchText = new KPushButton( this ); - m_pushButtonClearSearchText->setIconSet( QIconSet( BarIcon( "locationbar_erase" ) ) ); + m_pushButtonClearSearchText->setIconSet( TQIconSet( BarIcon( "locationbar_erase" ) ) ); layout->addWidget( m_pushButtonClearSearchText ); - QToolTip::add( m_pushButtonClearSearchText, i18n( "Erase current search pattern" ) ); - m_pushButtonClearSearchText->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); + TQToolTip::add( m_pushButtonClearSearchText, i18n( "Erase current search pattern" ) ); + m_pushButtonClearSearchText->setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred ); - QLabel *label = new QLabel( i18n( "&Search:" ), this ); + TQLabel *label = new TQLabel( i18n( "&Search:" ), this ); layout->addWidget( label ); m_comboboxFilter = new KHistoryCombo( TRUE, this, "search_combobox" ); layout->addWidget( m_comboboxFilter ); label->setBuddy( m_comboboxFilter ); - m_comboboxFilter->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred ); + m_comboboxFilter->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Preferred ); m_comboboxFilter->setMaxCount( 256 ); m_comboboxFilterType = new KComboBox( FALSE, this ); - m_comboboxFilterType->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); + m_comboboxFilterType->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Preferred ); layout->addWidget( m_comboboxFilterType ); m_comboboxFilterType->insertItem( i18n( "Exact" ) ); @@ -123,10 +123,10 @@ namespace KBibTeX m_comboboxFilterType->insertItem( i18n( "Any word" ) ); m_comboboxFilterType->setCurrentItem( 1 ); - label = new QLabel( i18n( "Restrict to:" ), this ); + label = new TQLabel( i18n( "Restrict to:" ), this ); layout->addWidget( label ); m_comboboxRestrictTo = new KComboBox( FALSE, this ); - m_comboboxRestrictTo->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); + m_comboboxRestrictTo->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Preferred ); layout->addWidget( m_comboboxRestrictTo ); label->setBuddy( m_comboboxRestrictTo ); @@ -137,16 +137,16 @@ namespace KBibTeX m_comboboxRestrictTo->insertItem( Settings::fieldTypeToI18NString( fieldType ) ); } - connect( m_comboboxFilter->lineEdit(), SIGNAL( textChanged( const QString & ) ), this, SLOT( slotKeyPressed() ) ); - connect( m_comboboxFilter, SIGNAL( activated( const QString& ) ), m_comboboxFilter, SLOT( addToHistory( const QString& ) ) ); + connect( m_comboboxFilter->lineEdit(), SIGNAL( textChanged( const TQString & ) ), this, SLOT( slotKeyPressed() ) ); + connect( m_comboboxFilter, SIGNAL( activated( const TQString& ) ), m_comboboxFilter, SLOT( addToHistory( const TQString& ) ) ); connect( m_pushButtonClearSearchText, SIGNAL( clicked() ), this, SLOT( slotClear() ) ); - connect( m_comboboxFilterType, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotAnnounceDoSearch() ) ); - connect( m_comboboxFilter, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotAnnounceDoSearch() ) ); + connect( m_comboboxFilterType, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotAnnounceDoSearch() ) ); + connect( m_comboboxFilter, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotAnnounceDoSearch() ) ); connect( m_comboboxFilter->lineEdit(), SIGNAL( returnPressed() ), this, SLOT( slotAnnounceDoSearch() ) ); connect( m_comboboxFilterType, SIGNAL( activated( int ) ), this, SLOT( slotTimeout() ) ); connect( m_comboboxRestrictTo, SIGNAL( activated( int ) ), this, SLOT( slotTimeout() ) ); - setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred ); + setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Preferred ); } void SearchBar::slotClear() diff --git a/src/searchbar.h b/src/searchbar.h index e733d42..7f31a38 100644 --- a/src/searchbar.h +++ b/src/searchbar.h @@ -20,14 +20,14 @@ #ifndef KBIBTEXSEARCHBAR_H #define KBIBTEXSEARCHBAR_H -#include +#include #include #include #include -class QTimer; +class TQTimer; class KPushButton; class KPopupMenu; class KHistoryCombo; @@ -38,27 +38,27 @@ namespace KBibTeX /** @author Thomas Fischer */ - class SearchBar : public QWidget + class SearchBar : public TQWidget { Q_OBJECT public: - SearchBar( QWidget *parent = 0, const char *name = "search_bar" ); + SearchBar( TQWidget *parent = 0, const char *name = "search_bar" ); ~SearchBar(); void setFactory( KXMLGUIFactory *factory, KXMLGUIClient *client ); void restoreState(); signals: - void doSearch( const QString &text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType ); + void doSearch( const TQString &text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType ); void onlineSearch(); public slots: - void setSearch( const QString&text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType ); + void setSearch( const TQString&text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType ); private: KPushButton *m_pushButtonClearSearchText; KHistoryCombo *m_comboboxFilter; - QTimer *m_timerInput; + TQTimer *m_timerInput; KPushButton *m_pushButtonAddElement; KPushButton *m_pushButtonSearchOnlineDatabases; KComboBox *m_comboboxFilterType; diff --git a/src/settings.cpp b/src/settings.cpp index 67b4d2f..653264e 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -17,14 +17,14 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,9 +43,9 @@ namespace KBibTeX { Settings* Settings::staticSettings = new Settings(); - QStringList Settings::m_lyxRcFileNames = QStringList::split( '|', QDir::home().canonicalPath() + "/.lyx/lyxrc" + '|' + QDir::home().canonicalPath() + "/.lyx/preferences" ); + TQStringList Settings::m_lyxRcFileNames = TQStringList::split( '|', TQDir::home().canonicalPath() + "/.lyx/lyxrc" + '|' + TQDir::home().canonicalPath() + "/.lyx/preferences" ); - const QRegExp Settings::noIdChars( "[^-.:/+_a-zA-Z0-9]" ); + const TQRegExp Settings::noIdChars( "[^-.:/+_a-zA-Z0-9]" ); Settings::Settings() { @@ -77,7 +77,7 @@ namespace KBibTeX delete[] m_completion; delete completionMacro; - for ( QValueList::ConstIterator it = searchURLs.begin(); it != searchURLs.end(); ++it ) + for ( TQValueList::ConstIterator it = searchURLs.begin(); it != searchURLs.end(); ++it ) delete *it; } @@ -102,7 +102,7 @@ namespace KBibTeX fileIO_EmbedFiles = config->readBoolEntry( "EmbedFiles", FALSE ); fileIO_EnclosingCurlyBrackets = config->readBoolEntry( "EnclosingCurlyBrackets", FALSE ); fileIO_useBibUtils = config->readBoolEntry( "UseBibUtils", TRUE ); - updateBib2Db5ClassPath( config->readEntry( "Bib2Db5BasePath", QString::null ) ); + updateBib2Db5ClassPath( config->readEntry( "Bib2Db5BasePath", TQString::null ) ); fileIO_NumberOfBackups = config->readNumEntry( "NumberOfBackups", 0 ); config->setGroup( "Editing" ); @@ -118,7 +118,7 @@ namespace KBibTeX editing_ShowMacros = config->readBoolEntry( "ShowMacros", TRUE ); editing_HorSplitterSizes = config->readIntListEntry( "HorizontalSplitterSizes" ); editing_VertSplitterSizes = config->readIntListEntry( "VerticalSplitterSizes" ); - QFont defaultFont = KGlobalSettings::generalFont(); + TQFont defaultFont = KGlobalSettings::generalFont(); editing_SpecialFont = config->readFontEntry( "SpecialFont", &defaultFont ); editing_UseSpecialFont = config->readBoolEntry( "UseSpecialFont", FALSE ); editing_FirstNameFirst = config->readBoolEntry( "FirstNameFirst", FALSE ); @@ -153,10 +153,10 @@ namespace KBibTeX searchURLs.clear(); for ( int i = 1; i < 1024; i++ ) { - QString descr = config->readEntry( QString( "SearchURLDescription%1" ).arg( i ), QString::null ); - QString url = config->readEntry( QString( "SearchURL%1" ).arg( i ), QString::null ); - bool includeAuthor = config->readBoolEntry( QString( "IncludeAuthor%1" ).arg( i ), FALSE ); - if ( descr != QString::null && url != QString::null ) + TQString descr = config->readEntry( TQString( "SearchURLDescription%1" ).arg( i ), TQString::null ); + TQString url = config->readEntry( TQString( "SearchURL%1" ).arg( i ), TQString::null ); + bool includeAuthor = config->readBoolEntry( TQString( "IncludeAuthor%1" ).arg( i ), FALSE ); + if ( descr != TQString::null && url != TQString::null ) { SearchURL * searchURL = new SearchURL; searchURL->description = descr; @@ -185,7 +185,7 @@ namespace KBibTeX idSuggestions_formatStrList = config->readListEntry( "FormatStrList" ); if ( idSuggestions_formatStrList.count() == 0 ) { - idSuggestions_formatStrList = QStringList::split( ',', "A,A2|y,A3|y,A4|y|\":|T5,al|\":|T,al|y,al|Y,Al\"-|\"-|y,Al\"+|Y,al|y|T,al|Y|T3,al|Y|T3l,a|\":|Y|\":|T1,a|y,A|\":|Y" ); + idSuggestions_formatStrList = TQStringList::split( ',', "A,A2|y,A3|y,A4|y|\":|T5,al|\":|T,al|y,al|Y,Al\"-|\"-|y,Al\"+|Y,al|y|T,al|Y|T3,al|Y|T3l,a|\":|Y|\":|T1,a|y,A|\":|Y" ); idSuggestions_default = -1; idSuggestions_forceDefault = FALSE; } @@ -196,13 +196,13 @@ namespace KBibTeX } idSuggestions_smallWords = config->readListEntry( "SmallWords" ); if ( idSuggestions_smallWords.count() == 0 ) - idSuggestions_smallWords = QStringList::split( '|', "and|on|in|the|of|at|a|an|with|for|from" ); + idSuggestions_smallWords = TQStringList::split( '|', "and|on|in|the|of|at|a|an|with|for|from" ); idSuggestions_smallWords.sort(); config->setGroup( "UserDefinedInputFields" ); - QStringList names = config->readListEntry( "Names" ); - QStringList labels = config->readListEntry( "Labels" ); - QStringList inputtypes = config->readListEntry( "InputTypes" ); + TQStringList names = config->readListEntry( "Names" ); + TQStringList labels = config->readListEntry( "Labels" ); + TQStringList inputtypes = config->readListEntry( "InputTypes" ); userDefinedInputFields.clear(); for ( unsigned int i = 0; i < names.size();++i ) @@ -231,8 +231,8 @@ namespace KBibTeX config->writeEntry( "ExportLanguage", fileIO_ExportLanguage ); config->writeEntry( "ExportBibliographyStyle", fileIO_ExportBibliographyStyle ); config->writeEntry( "ExporterHTML", ( int ) fileIO_ExporterHTML ); - config->writeEntry( "BibtexStringOpenDelimiter", QString( fileIO_BibtexStringOpenDelimiter ) ); - config->writeEntry( "BibtexStringCloseDelimiter", QString( fileIO_BibtexStringCloseDelimiter ) ); + config->writeEntry( "BibtexStringOpenDelimiter", TQString( fileIO_BibtexStringOpenDelimiter ) ); + config->writeEntry( "BibtexStringCloseDelimiter", TQString( fileIO_BibtexStringCloseDelimiter ) ); config->writeEntry( "KeywordCasing", ( int ) fileIO_KeywordCasing ); config->writeEntry( "EmbedFiles", fileIO_EmbedFiles ); config->writeEntry( "EnclosingCurlyBrackets", fileIO_EnclosingCurlyBrackets ); @@ -262,11 +262,11 @@ namespace KBibTeX config->setGroup( "SearchURLs" ); int i = 1; - for ( QValueList::ConstIterator it = searchURLs.begin(); it != searchURLs.end(); ++it, ++i ) + for ( TQValueList::ConstIterator it = searchURLs.begin(); it != searchURLs.end(); ++it, ++i ) { - config->writeEntry( QString( "SearchURLDescription%1" ).arg( i ), ( *it ) ->description ); - config->writeEntry( QString( "SearchURL%1" ).arg( i ), ( *it ) ->url ); - config->writeEntry( QString( "IncludeAuthor%1" ).arg( i ), ( *it ) ->includeAuthor ); + config->writeEntry( TQString( "SearchURLDescription%1" ).arg( i ), ( *it ) ->description ); + config->writeEntry( TQString( "SearchURL%1" ).arg( i ), ( *it ) ->url ); + config->writeEntry( TQString( "IncludeAuthor%1" ).arg( i ), ( *it ) ->includeAuthor ); } config->setGroup( "Keyword" ); @@ -285,8 +285,8 @@ namespace KBibTeX config->writeEntry( "SmallWords", idSuggestions_smallWords ); config->setGroup( "UserDefinedInputFields" ); - QStringList names, labels, inputtype; - for ( QValueList::iterator it = userDefinedInputFields.begin(); it != userDefinedInputFields.end();++it ) + TQStringList names, labels, inputtype; + for ( TQValueList::iterator it = userDefinedInputFields.begin(); it != userDefinedInputFields.end();++it ) { names << ( *it )->name; labels << ( *it )->label; @@ -297,7 +297,7 @@ namespace KBibTeX config->writeEntry( "InputTypes", inputtype ); config->setGroup( "WebQuery" ); - for ( QMap::Iterator it = m_webQueryDefaults.begin(); it != m_webQueryDefaults.end(); ++it ) + for ( TQMap::Iterator it = m_webQueryDefaults.begin(); it != m_webQueryDefaults.end(); ++it ) config->writeEntry( it.key(), it.data() ); #ifdef HAVE_YAZ @@ -316,11 +316,11 @@ namespace KBibTeX external_ris2xmlAvailable = checkExternalToolAvailable( "ris2xml" ); } - bool Settings::updateBib2Db5ClassPath( const QString& newBasePath, bool testOnly ) + bool Settings::updateBib2Db5ClassPath( const TQString& newBasePath, bool testOnly ) { - QString bib2db5ClassPath = QString::null; - QDir bib2db5BaseDir( newBasePath ); - QStringList list = bib2db5BaseDir.entryList( "antlr-runtime*.jar" ); + TQString bib2db5ClassPath = TQString::null; + TQDir bib2db5BaseDir( newBasePath ); + TQStringList list = bib2db5BaseDir.entryList( "antlr-runtime*.jar" ); if ( !list.isEmpty() ) { bib2db5ClassPath = bib2db5BaseDir.absPath() + "/" + list[0]; @@ -328,11 +328,11 @@ namespace KBibTeX if ( !list.isEmpty() ) bib2db5ClassPath += ":" + bib2db5BaseDir.absPath() + "/" + list[0]; else - bib2db5ClassPath = QString::null; + bib2db5ClassPath = TQString::null; } else - bib2db5ClassPath = QString::null; - if ( bib2db5ClassPath == QString::null ) + bib2db5ClassPath = TQString::null; + if ( bib2db5ClassPath == TQString::null ) kdDebug() << "Base path for bib2db5 is invalid (\"" << newBasePath << "\")" << endl; if ( !testOnly ) @@ -341,12 +341,12 @@ namespace KBibTeX fileIO_bib2db5ClassPath = bib2db5ClassPath; } - return bib2db5ClassPath != QString::null; + return bib2db5ClassPath != TQString::null; } - bool Settings::checkExternalToolAvailable( const QString &binary ) + bool Settings::checkExternalToolAvailable( const TQString &binary ) { - QProcess *process = new QProcess( binary ); + TQProcess *process = new TQProcess( binary ); bool ok = process->start(); ok &= process->normalExit(); if ( process->isRunning() ) @@ -358,29 +358,29 @@ namespace KBibTeX return ok; } - QString Settings::detectLyXInPipe() + TQString Settings::detectLyXInPipe() { - QString result = QString::null; - for ( QStringList::Iterator it = m_lyxRcFileNames.begin(); result.isNull() && it != m_lyxRcFileNames.end(); ++it ) + TQString result = TQString::null; + for ( TQStringList::Iterator it = m_lyxRcFileNames.begin(); result.isNull() && it != m_lyxRcFileNames.end(); ++it ) { - QString lyxRcFileName = *it; - QFile lyxRcFile( lyxRcFileName ); + TQString lyxRcFileName = *it; + TQFile lyxRcFile( lyxRcFileName ); kdDebug() << "detectLyXInPipe: looking for " << lyxRcFileName << endl; if ( lyxRcFile.exists() && lyxRcFile.open( IO_ReadOnly ) ) { - QTextStream input( &lyxRcFile ); + TQTextStream input( &lyxRcFile ); while ( result.isNull() && !input.atEnd() ) { - QString line = input.readLine(); + TQString line = input.readLine(); if ( line.startsWith( "\\serverpipe ", FALSE ) ) { - QStringList cols = QStringList::split( QRegExp( "\\s+\"|\"" ), line ); + TQStringList cols = TQStringList::split( TQRegExp( "\\s+\"|\"" ), line ); if ( cols.size() >= 2 ) { result = cols[ 1 ] + ".in"; kdDebug() << "detectLyXInPipe: testing " << result << " from config file" << endl; - if ( !QFile::exists( result ) ) + if ( !TQFile::exists( result ) ) kdDebug() << "LyX in pipe '" << result << "' from " << lyxRcFileName << " does not exist" << endl; } } @@ -391,38 +391,38 @@ namespace KBibTeX if ( result.isNull() ) { - result = QDir::home().canonicalPath() + "/.lyx/lyxpipe.in"; + result = TQDir::home().canonicalPath() + "/.lyx/lyxpipe.in"; kdDebug() << "detectLyXInPipe: testing " << result << endl; - if ( !QFile::exists( result ) ) - result = QString::null; + if ( !TQFile::exists( result ) ) + result = TQString::null; } if ( result.isNull() ) { - result = QDir::home().canonicalPath() + "/.lyx/.lyxpipe.in"; + result = TQDir::home().canonicalPath() + "/.lyx/.lyxpipe.in"; kdDebug() << "detectLyXInPipe: testing " << result << endl; - if ( !QFile::exists( result ) ) - result = QString::null; + if ( !TQFile::exists( result ) ) + result = TQString::null; } if ( result.isNull() ) { - result = QDir::home().canonicalPath() + "/.lyxpipe.in"; + result = TQDir::home().canonicalPath() + "/.lyxpipe.in"; kdDebug() << "detectLyXInPipe: testing " << result << endl; - if ( !QFile::exists( result ) ) - result = QString::null; + if ( !TQFile::exists( result ) ) + result = TQString::null; } kdDebug() << "detectLyXInPipe: using " << ( result.isNull() ? "" : result ) << endl; return result; } - QString Settings::getWebQueryDefault( const QString &key ) + TQString Settings::getWebQueryDefault( const TQString &key ) { return m_webQueryDefaults[key]; } - void Settings::setWebQueryDefault( const QString &key, const QString& value ) + void Settings::setWebQueryDefault( const TQString &key, const TQString& value ) { m_webQueryDefaults[key] = value; } @@ -454,7 +454,7 @@ namespace KBibTeX { int index = completionFieldTypeToIndex( fieldType ); - for ( QValueList::ConstIterator itv = value->items.begin(); itv != value->items.end(); itv++ ) + for ( TQValueList::ConstIterator itv = value->items.begin(); itv != value->items.end(); itv++ ) { BibTeX::PlainText *plainText = dynamic_cast( *itv ); if ( plainText != NULL ) @@ -463,7 +463,7 @@ namespace KBibTeX { BibTeX::PersonContainer *personContainer = dynamic_cast( *itv ); if ( personContainer != NULL ) - for ( QValueList::Iterator itp = personContainer->persons.begin();itp != personContainer->persons.end(); ++itp ) + for ( TQValueList::Iterator itp = personContainer->persons.begin();itp != personContainer->persons.end(); ++itp ) { m_completion[ index ] ->addItem(( *itp )->text( TRUE ) ); m_completion[ index ] ->addItem(( *itp )->text( FALSE ) ); @@ -472,7 +472,7 @@ namespace KBibTeX { BibTeX::KeywordContainer *keywordContainer = dynamic_cast( *itv ); if ( keywordContainer != NULL ) - for ( QValueList::Iterator itk = keywordContainer->keywords.begin();itk != keywordContainer->keywords.end(); ++itk ) + for ( TQValueList::Iterator itk = keywordContainer->keywords.begin();itk != keywordContainer->keywords.end(); ++itk ) m_completion[ index ] ->addItem(( *itk )->text() ); } } @@ -496,7 +496,7 @@ namespace KBibTeX void Settings::restoreDefaultSearchURLs() { - QStringList defaultDescriptions; + TQStringList defaultDescriptions; defaultDescriptions.append( "Google Scholar" ); defaultDescriptions.append( "Google .bib Search" ); defaultDescriptions.append( "Google Document Search" ); @@ -513,8 +513,8 @@ namespace KBibTeX defaultDescriptions.append( "Amatex (US)" ); defaultDescriptions.append( "SpringerLink" ); - QValueList toDelete; - for ( QValueList::ConstIterator it = searchURLs.begin(); it != searchURLs.end(); ++it ) + TQValueList toDelete; + for ( TQValueList::ConstIterator it = searchURLs.begin(); it != searchURLs.end(); ++it ) { if ( defaultDescriptions.contains(( *it ) ->description ) ) { @@ -522,7 +522,7 @@ namespace KBibTeX } } - for ( QValueList::ConstIterator it = toDelete.begin(); it != toDelete.end(); ++it ) + for ( TQValueList::ConstIterator it = toDelete.begin(); it != toDelete.end(); ++it ) { delete *it; searchURLs.remove( *it ); @@ -619,147 +619,147 @@ namespace KBibTeX searchURLs.append( searchURL ); } - QString Settings::fieldTypeToI18NString( const BibTeX::EntryField::FieldType fieldType ) + TQString Settings::fieldTypeToI18NString( const BibTeX::EntryField::FieldType fieldType ) { switch ( fieldType ) { case BibTeX::EntryField::ftAbstract: - return QString( i18n( "Abstract" ) ); + return TQString( i18n( "Abstract" ) ); case BibTeX::EntryField::ftAddress: - return QString( i18n( "Address" ) ); + return TQString( i18n( "Address" ) ); case BibTeX::EntryField::ftAnnote: - return QString( i18n( "Annote" ) ); + return TQString( i18n( "Annote" ) ); case BibTeX::EntryField::ftAuthor: - return QString( i18n( "Author" ) ); + return TQString( i18n( "Author" ) ); case BibTeX::EntryField::ftBookTitle: - return QString( i18n( "Book Title" ) ); + return TQString( i18n( "Book Title" ) ); case BibTeX::EntryField::ftChapter: - return QString( i18n( "Chapter" ) ); + return TQString( i18n( "Chapter" ) ); case BibTeX::EntryField::ftCrossRef: - return QString( i18n( "Crossref" ) ); + return TQString( i18n( "Crossref" ) ); case BibTeX::EntryField::ftDoi: - return QString( i18n( "DOI" ) ); + return TQString( i18n( "DOI" ) ); case BibTeX::EntryField::ftEdition: - return QString( i18n( "Edition" ) ); + return TQString( i18n( "Edition" ) ); case BibTeX::EntryField::ftEditor: - return QString( i18n( "Editor" ) ); + return TQString( i18n( "Editor" ) ); case BibTeX::EntryField::ftHowPublished: - return QString( i18n( "How Published" ) ); + return TQString( i18n( "How Published" ) ); case BibTeX::EntryField::ftInstitution: - return QString( i18n( "Institution" ) ); + return TQString( i18n( "Institution" ) ); case BibTeX::EntryField::ftISBN: - return QString( i18n( "ISBN" ) ); + return TQString( i18n( "ISBN" ) ); case BibTeX::EntryField::ftISSN: - return QString( i18n( "ISSN" ) ); + return TQString( i18n( "ISSN" ) ); case BibTeX::EntryField::ftJournal: - return QString( i18n( "Journal" ) ); + return TQString( i18n( "Journal" ) ); case BibTeX::EntryField::ftKey: - return QString( i18n( "Key" ) ); + return TQString( i18n( "Key" ) ); case BibTeX::EntryField::ftKeywords: - return QString( i18n( "Keywords" ) ); + return TQString( i18n( "Keywords" ) ); case BibTeX::EntryField::ftLocalFile: - return QString( i18n( "Local File" ) ); + return TQString( i18n( "Local File" ) ); case BibTeX::EntryField::ftLocation: - return QString( i18n( "Location" ) ); + return TQString( i18n( "Location" ) ); case BibTeX::EntryField::ftMonth: - return QString( i18n( "Month" ) ); + return TQString( i18n( "Month" ) ); case BibTeX::EntryField::ftNote: - return QString( i18n( "Note" ) ); + return TQString( i18n( "Note" ) ); case BibTeX::EntryField::ftNumber: - return QString( i18n( "Number" ) ); + return TQString( i18n( "Number" ) ); case BibTeX::EntryField::ftOrganization: - return QString( i18n( "Organization" ) ); + return TQString( i18n( "Organization" ) ); case BibTeX::EntryField::ftPages: - return QString( i18n( "Pages" ) ); + return TQString( i18n( "Pages" ) ); case BibTeX::EntryField::ftPublisher: - return QString( i18n( "Publisher" ) ); + return TQString( i18n( "Publisher" ) ); case BibTeX::EntryField::ftSeries: - return QString( i18n( "Series" ) ); + return TQString( i18n( "Series" ) ); case BibTeX::EntryField::ftSchool: - return QString( i18n( "School" ) ); + return TQString( i18n( "School" ) ); case BibTeX::EntryField::ftTitle: - return QString( i18n( "Title" ) ); + return TQString( i18n( "Title" ) ); case BibTeX::EntryField::ftType: - return QString( i18n( "Type" ) ); + return TQString( i18n( "Type" ) ); case BibTeX::EntryField::ftURL: - return QString( i18n( "URL" ) ); + return TQString( i18n( "URL" ) ); case BibTeX::EntryField::ftVolume: - return QString( i18n( "Volume" ) ); + return TQString( i18n( "Volume" ) ); case BibTeX::EntryField::ftYear: - return QString( i18n( "Year" ) ); + return TQString( i18n( "Year" ) ); default: - return QString( i18n( "Unknown" ) ); + return TQString( i18n( "Unknown" ) ); } } - QString Settings::entryTypeToI18NString( const BibTeX::Entry::EntryType entryType ) + TQString Settings::entryTypeToI18NString( const BibTeX::Entry::EntryType entryType ) { switch ( entryType ) { case BibTeX::Entry::etArticle: - return QString( i18n( "Article" ) ); + return TQString( i18n( "Article" ) ); case BibTeX::Entry::etBook: - return QString( i18n( "Book" ) ); + return TQString( i18n( "Book" ) ); case BibTeX::Entry::etBooklet: - return QString( i18n( "Booklet" ) ); + return TQString( i18n( "Booklet" ) ); case BibTeX::Entry::etCollection: - return QString( i18n( "Collection" ) ); + return TQString( i18n( "Collection" ) ); case BibTeX::Entry::etElectronic: - return QString( i18n( "Electronic" ) ); + return TQString( i18n( "Electronic" ) ); case BibTeX::Entry::etInBook: - return QString( i18n( "InBook" ) ); + return TQString( i18n( "InBook" ) ); case BibTeX::Entry::etInCollection: - return QString( i18n( "InCollection" ) ); + return TQString( i18n( "InCollection" ) ); case BibTeX::Entry::etInProceedings: - return QString( i18n( "InProceedings" ) ); + return TQString( i18n( "InProceedings" ) ); case BibTeX::Entry::etManual: - return QString( i18n( "Manual" ) ); + return TQString( i18n( "Manual" ) ); case BibTeX::Entry::etMastersThesis: - return QString( i18n( "MastersThesis" ) ); + return TQString( i18n( "MastersThesis" ) ); case BibTeX::Entry::etMisc: - return QString( i18n( "Misc" ) ); + return TQString( i18n( "Misc" ) ); case BibTeX::Entry::etPhDThesis: - return QString( i18n( "PhDThesis" ) ); + return TQString( i18n( "PhDThesis" ) ); case BibTeX::Entry::etProceedings: - return QString( i18n( "Proceedings" ) ); + return TQString( i18n( "Proceedings" ) ); case BibTeX::Entry::etTechReport: - return QString( i18n( "TechReport" ) ); + return TQString( i18n( "TechReport" ) ); case BibTeX::Entry::etUnpublished: - return QString( i18n( "Unpublished" ) ); + return TQString( i18n( "Unpublished" ) ); default: - return QString( i18n( "Unknown" ) ); + return TQString( i18n( "Unknown" ) ); } } - KURL Settings::doiURL( const QString& doiText ) + KURL Settings::doiURL( const TQString& doiText ) { KURL result( doiText ); if ( result.isValid() ) return result; - result = KURL( QString( "http://dx.doi.org/%1" ).arg( doiText ) ); + result = KURL( TQString( "http://dx.doi.org/%1" ).arg( doiText ) ); if ( result.isValid() ) return result; return KURL(); } - bool Settings::kpsewhich( const QString& filename ) + bool Settings::kpsewhich( const TQString& filename ) { bool result = FALSE; int counter = 0; - QWaitCondition waitCond; - QProcess kpsewhich; + TQWaitCondition waitCond; + TQProcess kpsewhich; kpsewhich.addArgument( "kpsewhich" ); kpsewhich.addArgument( filename ); if ( kpsewhich.start() ) { - qApp->processEvents(); + tqApp->processEvents(); while ( kpsewhich.isRunning() ) { waitCond.wait( 250 ); - qApp->processEvents(); + tqApp->processEvents(); counter++; if ( counter > 50 ) @@ -772,26 +772,26 @@ namespace KBibTeX return result; } - KURL Settings::locateFile( const QString& filename, const QString& bibTeXFileName, QWidget *window ) + KURL Settings::locateFile( const TQString& filename, const TQString& bibTeXFileName, TQWidget *window ) { - QString _filename = filename; - QString userHome = QString( getenv( "HOME" ) ); + TQString _filename = filename; + TQString userHome = TQString( getenv( "HOME" ) ); if ( _filename.contains( "~/" ) && !userHome.isEmpty() ) _filename = _filename.replace( "~/", userHome.append( "/" ) ); KURL url( _filename ); if ( url.isValid() && ( !url.isLocalFile() || KIO::NetAccess::exists( url, TRUE, window ) ) ) return url; - if ( bibTeXFileName != QString::null ) + if ( bibTeXFileName != TQString::null ) { - QString path = KURL( bibTeXFileName ).directory( FALSE, FALSE ); + TQString path = KURL( bibTeXFileName ).directory( FALSE, FALSE ); url = KURL( path + "/" + _filename ); if ( url.isValid() && KIO::NetAccess::exists( url, TRUE, window ) ) return url; } Settings* settings = self( NULL ); - for ( QStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it ) + for ( TQStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it ) { url = KURL( *it + "/" + _filename ); if ( url.isValid() && KIO::NetAccess::exists( url, TRUE, window ) ) @@ -801,25 +801,25 @@ namespace KBibTeX return KURL(); } - KURL Settings::locateFile( const QString& filename, QWidget *window ) + KURL Settings::locateFile( const TQString& filename, TQWidget *window ) { - return locateFile( filename, currentBibTeXFile == NULL ? QString::null : currentBibTeXFile->fileName, window ); + return locateFile( filename, currentBibTeXFile == NULL ? TQString::null : currentBibTeXFile->fileName, window ); } - QString Settings::resolveLink( const QString& originalFilename, const QString& linkFilename ) + TQString Settings::resolveLink( const TQString& originalFilename, const TQString& linkFilename ) { if ( linkFilename[0] == '/' ) return linkFilename; - QFileInfo fiO( originalFilename ); - QFileInfo fiL( fiO.dirPath( TRUE ) + "/" + linkFilename ); + TQFileInfo fiO( originalFilename ); + TQFileInfo fiL( fiO.dirPath( TRUE ) + "/" + linkFilename ); return fiL.absFilePath(); } - bool Settings::openUrl( const KURL& url, QWidget *parent ) + bool Settings::openUrl( const KURL& url, TQWidget *parent ) { - QStringList args; + TQStringList args; args << "xdg-open" << url.prettyURL(); - QProcess proc( args, parent, "Settings::openUrl" ); + TQProcess proc( args, parent, "Settings::openUrl" ); return proc.start(); } @@ -832,12 +832,12 @@ namespace KBibTeX void Settings::z3950loadDefault() { - QString z3950serverConfigFile = locate( "appdata", "z3950-servers.cfg" ); + TQString z3950serverConfigFile = locate( "appdata", "z3950-servers.cfg" ); if ( !z3950serverConfigFile.isEmpty() ) { KConfig z3950serverConfig( z3950serverConfigFile, true, false ); - QStringList serverList = z3950serverConfig.groupList(); - for ( QStringList::ConstIterator it = serverList.begin(); it != serverList.end(); ++it ) + TQStringList serverList = z3950serverConfig.groupList(); + for ( TQStringList::ConstIterator it = serverList.begin(); it != serverList.end(); ++it ) if ( !z3950_ServerList.contains( *it ) ) { z3950serverConfig.setGroup( *it ); @@ -862,23 +862,23 @@ namespace KBibTeX { config->setGroup( "Z3950Server" ); int i = 0; - QString key = config->readEntry( QString( "Key%1" ).arg( i ) ); - while ( key != QString::null ) + TQString key = config->readEntry( TQString( "Key%1" ).arg( i ) ); + while ( key != TQString::null ) { Z3950Server server; - server.name = config->readEntry( QString( "Name%1" ).arg( i ) ); - server.host = config->readEntry( QString( "Host%1" ).arg( i ) ); - server.port = config->readNumEntry( QString( "Port%1" ).arg( i ), 2100 ); - server.database = config->readEntry( QString( "Database%1" ).arg( i ) ); - server.charset = config->readEntry( QString( "Charset%1" ).arg( i ) ); - server.syntax = config->readEntry( QString( "Syntax%1" ).arg( i ) ); - server.user = config->readEntry( QString( "User%1" ).arg( i ) ); - server.password = config->readEntry( QString( "Password%1" ).arg( i ) ); - server.locale = config->readEntry( QString( "Locale%1" ).arg( i ) ); + server.name = config->readEntry( TQString( "Name%1" ).arg( i ) ); + server.host = config->readEntry( TQString( "Host%1" ).arg( i ) ); + server.port = config->readNumEntry( TQString( "Port%1" ).arg( i ), 2100 ); + server.database = config->readEntry( TQString( "Database%1" ).arg( i ) ); + server.charset = config->readEntry( TQString( "Charset%1" ).arg( i ) ); + server.syntax = config->readEntry( TQString( "Syntax%1" ).arg( i ) ); + server.user = config->readEntry( TQString( "User%1" ).arg( i ) ); + server.password = config->readEntry( TQString( "Password%1" ).arg( i ) ); + server.locale = config->readEntry( TQString( "Locale%1" ).arg( i ) ); z3950_ServerList[key] = server; ++i; - key = config->readEntry( QString( "Key%1" ).arg( i ) ); + key = config->readEntry( TQString( "Key%1" ).arg( i ) ); } } @@ -888,11 +888,11 @@ namespace KBibTeX config->setGroup( "Z3950Server" ); int i = 0; - QString z3950serverConfigFile = locate( "appdata", "z3950-servers.cfg" ); + TQString z3950serverConfigFile = locate( "appdata", "z3950-servers.cfg" ); if ( !z3950serverConfigFile.isEmpty() ) { KConfig z3950serverConfig( z3950serverConfigFile, true, false ); - for ( QMap::Iterator it = z3950_ServerList.begin(); it != z3950_ServerList.end(); ++it ) + for ( TQMap::Iterator it = z3950_ServerList.begin(); it != z3950_ServerList.end(); ++it ) { bool notInDefault = !z3950serverConfig.hasGroup( it.key() ); if ( !notInDefault ) @@ -903,16 +903,16 @@ namespace KBibTeX if ( notInDefault ) { - config->writeEntry( QString( "Key%1" ).arg( i ), it.key() ); - config->writeEntry( QString( "Name%1" ).arg( i ), it.data().name ); - config->writeEntry( QString( "Host%1" ).arg( i ), it.data().host ); - config->writeEntry( QString( "Port%1" ).arg( i ), it.data().port ); - config->writeEntry( QString( "Database%1" ).arg( i ), it.data().database ); - config->writeEntry( QString( "Charset%1" ).arg( i ), it.data().charset ); - config->writeEntry( QString( "Syntax%1" ).arg( i ), it.data().syntax ); - config->writeEntry( QString( "User%1" ).arg( i ), it.data().user ); - config->writeEntry( QString( "Password%1" ).arg( i ), it.data().password ); - config->writeEntry( QString( "Locale%1" ).arg( i ), it.data().locale ); + config->writeEntry( TQString( "Key%1" ).arg( i ), it.key() ); + config->writeEntry( TQString( "Name%1" ).arg( i ), it.data().name ); + config->writeEntry( TQString( "Host%1" ).arg( i ), it.data().host ); + config->writeEntry( TQString( "Port%1" ).arg( i ), it.data().port ); + config->writeEntry( TQString( "Database%1" ).arg( i ), it.data().database ); + config->writeEntry( TQString( "Charset%1" ).arg( i ), it.data().charset ); + config->writeEntry( TQString( "Syntax%1" ).arg( i ), it.data().syntax ); + config->writeEntry( TQString( "User%1" ).arg( i ), it.data().user ); + config->writeEntry( TQString( "Password%1" ).arg( i ), it.data().password ); + config->writeEntry( TQString( "Locale%1" ).arg( i ), it.data().locale ); ++i; } } @@ -922,16 +922,16 @@ namespace KBibTeX #endif // HAVE_YAZ /** Create backup of file as specified in fileIO_NumberOfBackups */ - bool Settings::createBackup( const KURL &url, QWidget *window ) + bool Settings::createBackup( const KURL &url, TQWidget *window ) { - QString basename = url.prettyURL(); + TQString basename = url.prettyURL(); - qDebug( "Making %i backups of URL %s", fileIO_NumberOfBackups, basename.latin1() ); + tqDebug( "Making %i backups of URL %s", fileIO_NumberOfBackups, basename.latin1() ); for ( int i = fileIO_NumberOfBackups; i > 2; --i ) { - KURL backupN( basename + "~" + QString::number( i ) ); - KURL backupNmm( basename + "~" + QString::number( i - 1 ) ); + KURL backupN( basename + "~" + TQString::number( i ) ); + KURL backupNmm( basename + "~" + TQString::number( i - 1 ) ); if ( KIO::NetAccess::exists( backupNmm, true, window ) ) { if ( !KIO::NetAccess::file_copy( backupNmm, backupN, -1, true, false, false ) ) diff --git a/src/settings.h b/src/settings.h index ff8275b..c68bcab 100644 --- a/src/settings.h +++ b/src/settings.h @@ -24,7 +24,7 @@ #include #endif -#include +#include #include @@ -38,10 +38,10 @@ class KConfig; class KStandardDirs; class KURL; -class QString; -class QRegExp; -class QChar; -class QFont; +class TQString; +class TQRegExp; +class TQChar; +class TQFont; namespace KBibTeX { @@ -50,15 +50,15 @@ namespace KBibTeX public: struct SearchURL { - QString description; - QString url; + TQString description; + TQString url; bool includeAuthor; }; struct UserDefinedInputFields { - QString name; - QString label; + TQString name; + TQString label; FieldLineEdit::InputType inputType; }; @@ -67,15 +67,15 @@ namespace KBibTeX void load( KConfig * config ); void save( KConfig * config ); - static QString fieldTypeToI18NString( const BibTeX::EntryField::FieldType fieldType ); - static QString entryTypeToI18NString( const BibTeX::Entry::EntryType entryType ); + static TQString fieldTypeToI18NString( const BibTeX::EntryField::FieldType fieldType ); + static TQString entryTypeToI18NString( const BibTeX::Entry::EntryType entryType ); - static KURL doiURL( const QString& doiText ); - static bool kpsewhich( const QString& filename ); - static KURL locateFile( const QString& filename, const QString& bibTeXFileName = QString::null, QWidget *window = NULL ); - KURL locateFile( const QString& filename, QWidget *window = NULL ); - static QString resolveLink( const QString& originalFilename, const QString& linkFilename ); - static bool openUrl( const KURL& url, QWidget *parent ); + static KURL doiURL( const TQString& doiText ); + static bool kpsewhich( const TQString& filename ); + static KURL locateFile( const TQString& filename, const TQString& bibTeXFileName = TQString::null, TQWidget *window = NULL ); + KURL locateFile( const TQString& filename, TQWidget *window = NULL ); + static TQString resolveLink( const TQString& originalFilename, const TQString& linkFilename ); + static bool openUrl( const KURL& url, TQWidget *parent ); #ifdef HAVE_YAZ void z3950clearAll(); @@ -84,30 +84,30 @@ namespace KBibTeX void z3950saveUser( KConfig *config ); typedef struct Z3950Server_ { - QString charset, database, host, locale, name, syntax, user, password; + TQString charset, database, host, locale, name, syntax, user, password; int port; } Z3950Server; - QMap z3950_ServerList; + TQMap z3950_ServerList; #endif // HAVE_YAZ enum DragAction {COPYREFERENCE = 1, COPYBIBTEX = 2}; // FileIO section - QString fileIO_Encoding; - QString fileIO_ExportLanguage; - QString fileIO_ExportBibliographyStyle; - QChar fileIO_BibtexStringOpenDelimiter; - QChar fileIO_BibtexStringCloseDelimiter; + TQString fileIO_Encoding; + TQString fileIO_ExportLanguage; + TQString fileIO_ExportBibliographyStyle; + TQChar fileIO_BibtexStringOpenDelimiter; + TQChar fileIO_BibtexStringCloseDelimiter; BibTeX::FileExporterBibTeX::KeywordCasing fileIO_KeywordCasing; BibTeX::FileExporterExternal::Exporter fileIO_ExporterHTML; bool fileIO_EmbedFiles; bool fileIO_EnclosingCurlyBrackets; bool fileIO_useBibUtils; - QString fileIO_bib2db5BasePath; - QString fileIO_bib2db5ClassPath; + TQString fileIO_bib2db5BasePath; + TQString fileIO_bib2db5ClassPath; int fileIO_NumberOfBackups; - bool updateBib2Db5ClassPath( const QString& newBasePath, bool testOnly = false ); + bool updateBib2Db5ClassPath( const TQString& newBasePath, bool testOnly = false ); // Editing section bool editing_SearchBarClearField; @@ -115,28 +115,28 @@ namespace KBibTeX int editing_MainListDoubleClickAction; int editing_MainListSortingColumn; int editing_MainListSortingOrder; - QStringList editing_FilterHistory; + TQStringList editing_FilterHistory; bool editing_ShowMacros; bool editing_ShowComments; - QValueList editing_MainListColumnsWidth; - QValueList editing_MainListColumnsIndex; - QValueList editing_HorSplitterSizes; - QValueList editing_VertSplitterSizes; - QFont editing_SpecialFont; + TQValueList editing_MainListColumnsWidth; + TQValueList editing_MainListColumnsIndex; + TQValueList editing_HorSplitterSizes; + TQValueList editing_VertSplitterSizes; + TQFont editing_SpecialFont; bool editing_UseSpecialFont; bool editing_FirstNameFirst; - QStringList editing_DocumentSearchPaths; + TQStringList editing_DocumentSearchPaths; DragAction editing_DragAction; int editing_findDuplicatesSensitivity; // SearchURLs section - QValueList searchURLs; + TQValueList searchURLs; // UserDefinedInputFields section - QValueList userDefinedInputFields; + TQValueList userDefinedInputFields; // External section - QString external_XSLTStylesheetHTML; + TQString external_XSLTStylesheetHTML; bool external_bibconvAvailable; bool external_bibtex2htmlAvailable; bool external_bib2xhtmlAvailable; @@ -146,10 +146,10 @@ namespace KBibTeX bool external_ris2xmlAvailable; // Id Suggestions - QStringList idSuggestions_formatStrList; + TQStringList idSuggestions_formatStrList; int idSuggestions_default; bool idSuggestions_forceDefault; - QStringList idSuggestions_smallWords; + TQStringList idSuggestions_smallWords; // Auto-completion for user fields (non-persistant) void addToCompletion( BibTeX::File *file ); @@ -159,11 +159,11 @@ namespace KBibTeX KCompletion* completionMacro; // Keyword list - QStringList keyword_GlobalList; + TQStringList keyword_GlobalList; // Online Database Search; int webQuery_LastEngine; - QString webQuery_LastSearchTerm; + TQString webQuery_LastSearchTerm; int webQuery_LastNumberOfResults; bool webQuery_ImportAll; @@ -172,30 +172,30 @@ namespace KBibTeX void restoreDefaultSearchURLs(); - QString detectLyXInPipe(); + TQString detectLyXInPipe(); // web query history/default values - QString getWebQueryDefault( const QString &key ); - void setWebQueryDefault( const QString &key, const QString& value ); + TQString getWebQueryDefault( const TQString &key ); + void setWebQueryDefault( const TQString &key, const TQString& value ); // characters that do match this regexp are // not allowed in entry ids or macro keys - static const QRegExp noIdChars; + static const TQRegExp noIdChars; /** Create backup of file as specified in fileIO_NumberOfBackups */ - bool createBackup( const KURL &url, QWidget *window = NULL ); + bool createBackup( const KURL &url, TQWidget *window = NULL ); private: static Settings* staticSettings; KCompletion **m_completion; - static QStringList m_lyxRcFileNames; + static TQStringList m_lyxRcFileNames; - QMap m_webQueryDefaults; + TQMap m_webQueryDefaults; Settings(); ~Settings(); - bool checkExternalToolAvailable( const QString &binary ); + bool checkExternalToolAvailable( const TQString &binary ); void checkExternalToolsAvailable(); int completionFieldTypeToIndex( BibTeX::EntryField::FieldType fieldType ); diff --git a/src/settingsdlg.cpp b/src/settingsdlg.cpp index 938dc6b..2ad3bba 100644 --- a/src/settingsdlg.cpp +++ b/src/settingsdlg.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include #include @@ -36,48 +36,48 @@ namespace KBibTeX { - SettingsDlg::SettingsDlg( QWidget *parent, const char *name ) + SettingsDlg::SettingsDlg( TQWidget *parent, const char *name ) : KDialogBase( Tabbed, i18n( "Configure" ), Ok | Apply | Cancel, Ok, parent, name, true ) { - QFrame * page = addPage( i18n( "&Editing" ) ); - QVBoxLayout *layout = new QVBoxLayout( page, 0, spacingHint() ); + TQFrame * page = addPage( i18n( "&Editing" ) ); + TQVBoxLayout *layout = new TQVBoxLayout( page, 0, spacingHint() ); m_editing = new SettingsEditing( page ); layout->addWidget( m_editing ); connect( m_editing, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); page = addPage( i18n( "&File Open&&Save" ) ); - layout = new QVBoxLayout( page, 0, spacingHint() ); + layout = new TQVBoxLayout( page, 0, spacingHint() ); m_fileIO = new SettingsFileIO( page ); layout->addWidget( m_fileIO ); connect( m_fileIO, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); page = addPage( i18n( "&Search URLs" ) ); - layout = new QVBoxLayout( page, 0, spacingHint() ); + layout = new TQVBoxLayout( page, 0, spacingHint() ); m_searchURL = new SettingsSearchURL( page ); layout->addWidget( m_searchURL ); connect( m_searchURL, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); - page = addPage( i18n( "Global &Keywords" ), QString::null, SmallIcon( "package" ) ); - layout = new QVBoxLayout( page, 0, spacingHint() ); + page = addPage( i18n( "Global &Keywords" ), TQString::null, SmallIcon( "package" ) ); + layout = new TQVBoxLayout( page, 0, spacingHint() ); m_keyword = new SettingsKeyword( page ); layout->addWidget( m_keyword ); connect( m_keyword, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); page = addPage( i18n( "Id Suggestions" ) ); - layout = new QVBoxLayout( page, 0, spacingHint() ); + layout = new TQVBoxLayout( page, 0, spacingHint() ); m_idSuggestions = new SettingsIdSuggestions( page ); layout->addWidget( m_idSuggestions ); connect( m_idSuggestions, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); page = addPage( i18n( "User Defined Fields" ) ); - layout = new QVBoxLayout( page, 0, spacingHint() ); + layout = new TQVBoxLayout( page, 0, spacingHint() ); m_userDefinedInput = new SettingsUserDefinedInput( page ); layout->addWidget( m_userDefinedInput ); connect( m_userDefinedInput, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); #ifdef HAVE_YAZ page = addPage( i18n( "Z39.50" ) ); - layout = new QVBoxLayout( page, 0, spacingHint() ); + layout = new TQVBoxLayout( page, 0, spacingHint() ); m_z3950config = new SettingsZ3950( page ); layout->addWidget( m_z3950config ); connect( m_z3950config, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); diff --git a/src/settingsdlg.h b/src/settingsdlg.h index e256349..5097934 100644 --- a/src/settingsdlg.h +++ b/src/settingsdlg.h @@ -42,7 +42,7 @@ namespace KBibTeX { Q_OBJECT public: - SettingsDlg( QWidget *parent = 0, const char *name = "SETTINGsdlg" ); + SettingsDlg( TQWidget *parent = 0, const char *name = "SETTINGsdlg" ); ~SettingsDlg(); diff --git a/src/settingsediting.cpp b/src/settingsediting.cpp index e5c71fc..22f1868 100644 --- a/src/settingsediting.cpp +++ b/src/settingsediting.cpp @@ -17,17 +17,17 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -45,29 +45,29 @@ namespace KBibTeX { - const QChar SettingsEditing::pathListSeparator = QChar( ';' ); + const TQChar SettingsEditing::pathListSeparator = TQChar( ';' ); - SettingsEditingPaths::SettingsEditingPaths( QStringList& pathList, QWidget*parent, const char *name ) - : QWidget( parent, name ), m_pathList( pathList ) + SettingsEditingPaths::SettingsEditingPaths( TQStringList& pathList, TQWidget*parent, const char *name ) + : TQWidget( parent, name ), m_pathList( pathList ) { - QGridLayout *layout = new QGridLayout( this, 5, 3, 0, KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( this, 5, 3, 0, KDialog::spacingHint() ); setMinimumWidth( 480 ); - QLabel *label = new QLabel( i18n( "Path to add:" ), this ); + TQLabel *label = new TQLabel( i18n( "Path to add:" ), this ); layout->addWidget( label, 0, 0 ); m_urlRequesterNewPath = new KURLRequester( this ); m_urlRequesterNewPath->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly ); - m_urlRequesterNewPath->completionObject()->setDir( QDir::currentDirPath() ); + m_urlRequesterNewPath->completionObject()->setDir( TQDir::currentDirPath() ); label->setBuddy( m_urlRequesterNewPath ); layout->addWidget( m_urlRequesterNewPath, 1, 0 ); - QToolTip::add( m_urlRequesterNewPath->button(), i18n( "Select a path to add" ) ); + TQToolTip::add( m_urlRequesterNewPath->button(), i18n( "Select a path to add" ) ); m_pushButtonAddDir = new KPushButton( i18n( "Add" ), this ); - m_pushButtonAddDir->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_pushButtonAddDir->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); m_pushButtonAddDir->setEnabled( FALSE ); - QToolTip::add( m_pushButtonAddDir, i18n( "Add chosen path to list" ) ); + TQToolTip::add( m_pushButtonAddDir, i18n( "Add chosen path to list" ) ); layout->addWidget( m_pushButtonAddDir, 1, 2 ); - label = new QLabel( i18n( "List of paths:" ), this ); + label = new TQLabel( i18n( "List of paths:" ), this ); layout->addWidget( label, 2, 0 ); m_listViewPathList = new KListView( this ); m_listViewPathList->addColumn( i18n( "Path" ) ); @@ -78,23 +78,23 @@ namespace KBibTeX m_pushButtonDelDir = new KPushButton( i18n( "Delete" ), this ); layout->addWidget( m_pushButtonDelDir, 3, 2 ); m_pushButtonDelDir->setEnabled( FALSE ); - m_pushButtonDelDir->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); - QToolTip::add( m_pushButtonDelDir, i18n( "Remove selected path from list" ) ); + m_pushButtonDelDir->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); + TQToolTip::add( m_pushButtonDelDir, i18n( "Remove selected path from list" ) ); layout->setRowStretch( 4, 1 ); layout->setColStretch( 0, 1 ); - connect( m_urlRequesterNewPath, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); - connect( m_urlRequesterNewPath, SIGNAL( urlSelected( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( m_urlRequesterNewPath, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); + connect( m_urlRequesterNewPath, SIGNAL( urlSelected( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); connect( m_pushButtonAddDir, SIGNAL( clicked() ), this, SLOT( slotAddDir() ) ); connect( m_listViewPathList, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) ); connect( m_pushButtonDelDir, SIGNAL( clicked() ), this, SLOT( slotDelDir() ) ); - for ( QStringList::Iterator it = pathList.begin(); it != pathList.end(); ++it ) - new QListViewItem( m_listViewPathList, *it ); + for ( TQStringList::Iterator it = pathList.begin(); it != pathList.end(); ++it ) + new TQListViewItem( m_listViewPathList, *it ); } - bool SettingsEditingPaths::execute( QWidget *parent, QStringList &pathList ) + bool SettingsEditingPaths::execute( TQWidget *parent, TQStringList &pathList ) { KDialogBase *dlg = new KDialogBase( parent, "SettingsEditingPathsDialog", true, i18n( "Edit Document Search Paths" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, false ); SettingsEditingPaths *sep = new SettingsEditingPaths( pathList, dlg, "SettingsEditingPaths" ); @@ -102,7 +102,7 @@ namespace KBibTeX connect( dlg, SIGNAL( apply() ), sep, SLOT( slotApply() ) ); connect( dlg, SIGNAL( okClicked() ), sep, SLOT( slotApply() ) ); - bool result = dlg->exec() == QDialog::Accepted; + bool result = dlg->exec() == TQDialog::Accepted; delete dlg; return result; @@ -111,7 +111,7 @@ namespace KBibTeX void SettingsEditingPaths::slotApply() { m_pathList.clear(); - QListViewItem *item = m_listViewPathList->firstChild(); + TQListViewItem *item = m_listViewPathList->firstChild(); while ( item != NULL ) { m_pathList.append( item->text( 0 ) ); @@ -119,25 +119,25 @@ namespace KBibTeX } } - void SettingsEditingPaths::slotTextChanged( const QString&text ) + void SettingsEditingPaths::slotTextChanged( const TQString&text ) { - QDir pathObj( text ); + TQDir pathObj( text ); m_pushButtonAddDir->setEnabled( pathObj.exists() && pathObj.isReadable() ); } void SettingsEditingPaths::slotAddDir() { - QString path = m_urlRequesterNewPath->lineEdit()->text(); - QDir pathObj( path ); + TQString path = m_urlRequesterNewPath->lineEdit()->text(); + TQDir pathObj( path ); if ( pathObj.exists() && pathObj.isReadable() ) { - QListViewItem *item = new KListViewItem( m_listViewPathList, path ); + TQListViewItem *item = new KListViewItem( m_listViewPathList, path ); m_listViewPathList->ensureItemVisible( item ); m_listViewPathList->setSelected( item, TRUE ); slotSelectionChanged(); } else - KMessageBox::error( this, QString( i18n( "Folder '%1' does not exist or is not readable." ) ).arg( path ) ); + KMessageBox::error( this, TQString( i18n( "Folder '%1' does not exist or is not readable." ) ).arg( path ) ); } void SettingsEditingPaths::slotSelectionChanged() @@ -151,81 +151,81 @@ namespace KBibTeX slotSelectionChanged(); } - SettingsEditing::SettingsEditing( QWidget *parent, const char *name ) - : QWidget( parent, name ), m_findDuplicatesSensitivityMin( 3 ), m_findDuplicatesSensitivityMax( 13 ) + SettingsEditing::SettingsEditing( TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_findDuplicatesSensitivityMin( 3 ), m_findDuplicatesSensitivityMax( 13 ) { - QGroupBox * group = NULL; - QVBoxLayout *layout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQGroupBox * group = NULL; + TQVBoxLayout *layout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - group = new QGroupBox( 2, Qt::Horizontal, i18n( "Main List" ), this ); + group = new TQGroupBox( 2, TQt::Horizontal, i18n( "Main List" ), this ); layout->addWidget( group ); - QLabel *label = new QLabel( i18n( "&Sorting:" ), group ); - m_comboBoxSortingColumn = new QComboBox( FALSE, group ); + TQLabel *label = new TQLabel( i18n( "&Sorting:" ), group ); + m_comboBoxSortingColumn = new TQComboBox( FALSE, group ); m_comboBoxSortingColumn->insertItem( i18n( "Element Type" ) ); m_comboBoxSortingColumn->insertItem( i18n( "Entry Id" ) ); for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ ) { BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract ); - QString label = Settings::fieldTypeToI18NString( fieldType ); + TQString label = Settings::fieldTypeToI18NString( fieldType ); m_comboBoxSortingColumn->insertItem( label ); } label->setBuddy( m_comboBoxSortingColumn ); - label = new QLabel( i18n( "So&rting order:" ), group ); - m_comboBoxSortingOrder = new QComboBox( FALSE, group ); + label = new TQLabel( i18n( "So&rting order:" ), group ); + m_comboBoxSortingOrder = new TQComboBox( FALSE, group ); m_comboBoxSortingOrder->insertItem( i18n( "Ascending" ) ); m_comboBoxSortingOrder->insertItem( i18n( "Descending" ) ); label->setBuddy( m_comboBoxSortingOrder ); - label = new QLabel( i18n( "&Double click action:" ), group ); - m_comboBoxDoubleClickAction = new QComboBox( FALSE, group ); + label = new TQLabel( i18n( "&Double click action:" ), group ); + m_comboBoxDoubleClickAction = new TQComboBox( FALSE, group ); m_comboBoxDoubleClickAction->insertItem( i18n( "Edit element" ) ); m_comboBoxDoubleClickAction->insertItem( i18n( "Open document" ) ); label->setBuddy( m_comboBoxDoubleClickAction ); - label = new QLabel( i18n( "On dragging with mouse:" ), group ); - m_comboBoxDragAction = new QComboBox( FALSE, group ); + label = new TQLabel( i18n( "On dragging with mouse:" ), group ); + m_comboBoxDragAction = new TQComboBox( FALSE, group ); m_comboBoxDragAction->insertItem( i18n( "Copy reference (\\cite{...})" ) ); m_comboBoxDragAction->insertItem( i18n( "Copy BibTeX text (@article{...})" ) ); label->setBuddy( m_comboBoxDragAction ); - group = new QGroupBox( 1, Qt::Vertical, i18n( "Entry Editing" ), this ); + group = new TQGroupBox( 1, TQt::Vertical, i18n( "Entry Editing" ), this ); layout->addWidget( group ); - m_checkBoxEnableAllFields = new QCheckBox( i18n( "Enable all &fields for editing" ), group ); + m_checkBoxEnableAllFields = new TQCheckBox( i18n( "Enable all &fields for editing" ), group ); - group = new QGroupBox( 1, Qt::Vertical, i18n( "Search Bar" ), this ); + group = new TQGroupBox( 1, TQt::Vertical, i18n( "Search Bar" ), this ); layout->addWidget( group ); - m_checkBoxSearchBarClearField = new QCheckBox( i18n( "Reset field filter when changing filter text" ), group ); + m_checkBoxSearchBarClearField = new TQCheckBox( i18n( "Reset field filter when changing filter text" ), group ); - group = new QGroupBox( 2, Qt::Horizontal, i18n( "Presentation" ), this ); + group = new TQGroupBox( 2, TQt::Horizontal, i18n( "Presentation" ), this ); layout->addWidget( group ); - m_checkBoxUseSpecialFont = new QCheckBox( i18n( "Use special &font" ), group ); - m_pushButtonSpecialFont = new QPushButton( group ); - label = new QLabel( i18n( "Author and editor names:" ), group ); - m_comboBoxNameOrder = new QComboBox( group ); + m_checkBoxUseSpecialFont = new TQCheckBox( i18n( "Use special &font" ), group ); + m_pushButtonSpecialFont = new TQPushButton( group ); + label = new TQLabel( i18n( "Author and editor names:" ), group ); + m_comboBoxNameOrder = new TQComboBox( group ); label->setBuddy( m_comboBoxNameOrder ); m_comboBoxNameOrder->insertItem( i18n( "John Doe" ) ); m_comboBoxNameOrder->insertItem( i18n( "Doe, John" ) ); - QToolTip::add( m_comboBoxNameOrder, i18n( "Show names as 'John Doe' instead of 'Doe, John'" ) ); - QWhatsThis::add( m_comboBoxNameOrder, i18n( "Show names as 'John Doe' instead of 'Doe, John'.\n\nTakes only effect after the next start of KBibTeX." ) ); + TQToolTip::add( m_comboBoxNameOrder, i18n( "Show names as 'John Doe' instead of 'Doe, John'" ) ); + TQWhatsThis::add( m_comboBoxNameOrder, i18n( "Show names as 'John Doe' instead of 'Doe, John'.\n\nTakes only effect after the next start of KBibTeX." ) ); - group = new QGroupBox( 1, Qt::Vertical, i18n( "Document Search Paths" ), this ); + group = new TQGroupBox( 1, TQt::Vertical, i18n( "Document Search Paths" ), this ); layout->addWidget( group ); KPushButton *btnSelectDocumentSearchPath = new KPushButton( SmallIcon( "fileopen" ), i18n( "Edit Search Paths" ), group ); - group = new QGroupBox( 1, Qt::Vertical, i18n( "Find Duplicates" ), this ); + group = new TQGroupBox( 1, TQt::Vertical, i18n( "Find Duplicates" ), this ); layout->addWidget( group ); - label = new QLabel( i18n( "Sensitivity:" ), group ); - QWidget *spacer = new QWidget( group ); + label = new TQLabel( i18n( "Sensitivity:" ), group ); + TQWidget *spacer = new TQWidget( group ); spacer->setFixedSize( KDialog::spacingHint() * 3, KDialog::spacingHint() ); - QLabel *label2 = new QLabel( i18n( "Low" ), group ); - m_sliderBarFindDuplicatesSensitivity = new QSlider( Qt::Horizontal, group ); + TQLabel *label2 = new TQLabel( i18n( "Low" ), group ); + m_sliderBarFindDuplicatesSensitivity = new TQSlider( TQt::Horizontal, group ); m_sliderBarFindDuplicatesSensitivity->setMinValue( m_findDuplicatesSensitivityMin ); m_sliderBarFindDuplicatesSensitivity->setMaxValue( m_findDuplicatesSensitivityMax ); m_sliderBarFindDuplicatesSensitivity->setLineStep( 1 ); m_sliderBarFindDuplicatesSensitivity->setPageStep( 5 ); label->setBuddy( m_sliderBarFindDuplicatesSensitivity ); - label2 = new QLabel( i18n( "High" ), group ); + label2 = new TQLabel( i18n( "High" ), group ); layout->addStretch(); @@ -264,7 +264,7 @@ namespace KBibTeX settings->editing_FirstNameFirst = m_comboBoxNameOrder->currentItem() == 0; settings->editing_DocumentSearchPaths.clear(); - for ( QStringList::Iterator it = m_documentSearchPaths.begin(); it != m_documentSearchPaths.end(); ++it ) + for ( TQStringList::Iterator it = m_documentSearchPaths.begin(); it != m_documentSearchPaths.end(); ++it ) settings->editing_DocumentSearchPaths.append( *it ); settings->editing_findDuplicatesSensitivity = ( m_findDuplicatesSensitivityMin + m_findDuplicatesSensitivityMax ) - m_sliderBarFindDuplicatesSensitivity->value(); @@ -289,7 +289,7 @@ namespace KBibTeX m_comboBoxNameOrder->setCurrentItem( settings->editing_FirstNameFirst ? 0 : 1 ); m_documentSearchPaths.clear(); - for ( QStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it ) + for ( TQStringList::Iterator it = settings->editing_DocumentSearchPaths.begin(); it != settings->editing_DocumentSearchPaths.end(); ++it ) m_documentSearchPaths.append( *it ); m_sliderBarFindDuplicatesSensitivity->setValue(( m_findDuplicatesSensitivityMin + m_findDuplicatesSensitivityMax ) - settings->editing_findDuplicatesSensitivity ); @@ -322,7 +322,7 @@ namespace KBibTeX m_pushButtonSpecialFont->setFont( m_specialFont ); } - bool SettingsEditing::editPathList( QStringList &pathList ) + bool SettingsEditing::editPathList( TQStringList &pathList ) { return SettingsEditingPaths::execute( this, pathList ); } diff --git a/src/settingsediting.h b/src/settingsediting.h index b938f4e..ecb1f98 100644 --- a/src/settingsediting.h +++ b/src/settingsediting.h @@ -20,12 +20,12 @@ #ifndef SETTINGSEDITING_H #define SETTINGSEDITING_H -#include +#include -class QCheckBox; -class QPushButton; -class QComboBox; -class QSlider; +class TQCheckBox; +class TQPushButton; +class TQComboBox; +class TQSlider; class KPushButton; class KURLRequester; @@ -33,35 +33,35 @@ class KListView; namespace KBibTeX { - class SettingsEditingPaths: public QWidget + class SettingsEditingPaths: public TQWidget { Q_OBJECT protected: - SettingsEditingPaths( QStringList& pathList, QWidget*parent = 0, const char *name = 0 ); + SettingsEditingPaths( TQStringList& pathList, TQWidget*parent = 0, const char *name = 0 ); public: - static bool execute( QWidget *parent, QStringList &pathList ); + static bool execute( TQWidget *parent, TQStringList &pathList ); public slots: void slotApply(); - void slotTextChanged( const QString&text ); + void slotTextChanged( const TQString&text ); void slotAddDir(); void slotSelectionChanged(); void slotDelDir(); private: - QStringList &m_pathList; + TQStringList &m_pathList; KURLRequester *m_urlRequesterNewPath; KPushButton *m_pushButtonAddDir; KListView *m_listViewPathList; KPushButton *m_pushButtonDelDir; }; - class SettingsEditing : public QWidget + class SettingsEditing : public TQWidget { Q_OBJECT public: - SettingsEditing( QWidget *parent = 0, const char *name = 0 ); + SettingsEditing( TQWidget *parent = 0, const char *name = 0 ); ~SettingsEditing(); void applyData(); @@ -76,22 +76,22 @@ namespace KBibTeX void slotSelectDocumentSearchPath(); private: - QCheckBox *m_checkBoxEnableAllFields; - QCheckBox *m_checkBoxSearchBarClearField; - QComboBox *m_comboBoxSortingColumn; - QComboBox *m_comboBoxSortingOrder; - QComboBox *m_comboBoxDoubleClickAction; - QComboBox *m_comboBoxDragAction; - QCheckBox *m_checkBoxUseSpecialFont; - QPushButton *m_pushButtonSpecialFont; - QFont m_specialFont; - QComboBox *m_comboBoxNameOrder; - QStringList m_documentSearchPaths; - static const QChar pathListSeparator; - QSlider *m_sliderBarFindDuplicatesSensitivity; + TQCheckBox *m_checkBoxEnableAllFields; + TQCheckBox *m_checkBoxSearchBarClearField; + TQComboBox *m_comboBoxSortingColumn; + TQComboBox *m_comboBoxSortingOrder; + TQComboBox *m_comboBoxDoubleClickAction; + TQComboBox *m_comboBoxDragAction; + TQCheckBox *m_checkBoxUseSpecialFont; + TQPushButton *m_pushButtonSpecialFont; + TQFont m_specialFont; + TQComboBox *m_comboBoxNameOrder; + TQStringList m_documentSearchPaths; + static const TQChar pathListSeparator; + TQSlider *m_sliderBarFindDuplicatesSensitivity; void updateFontData(); - bool editPathList( QStringList &pathList ); + bool editPathList( TQStringList &pathList ); const int m_findDuplicatesSensitivityMin, m_findDuplicatesSensitivityMax; }; diff --git a/src/settingsfileio.cpp b/src/settingsfileio.cpp index 7cceedf..9a04b7c 100644 --- a/src/settingsfileio.cpp +++ b/src/settingsfileio.cpp @@ -18,17 +18,17 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -46,21 +46,21 @@ namespace KBibTeX { - static const QString encodingList[] = + static const TQString encodingList[] = { "LaTeX", "437", "500", "500V1", "850", "851", "852", "855", "856", "857", "860", "861", "862", "863", "864", "865", "866", "866NAV", "869", "874", "904", "1026", "1046", "1047", "8859_1", "8859_2", "8859_3", "8859_4", "8859_5", "8859_6", "8859_7", "8859_8", "8859_9", "10646-1:1993", "10646-1:1993/UCS4/", "ANSI_X3.4-1968", "ANSI_X3.4-1986", "ANSI_X3.4", "ANSI_X3.110-1983", "ANSI_X3.110", "ARABIC", "ARABIC7", "ARMSCII-8", "ASCII", "ASMO-708", "ASMO_449", "BALTIC", "BIG-5", "BIG-FIVE", "BIG5-HKSCS", "BIG5", "BIG5HKSCS", "BIGFIVE", "BRF", "BS_4730", "CA", "CN-BIG5", "CN-GB", "CN", "CP-AR", "CP-GR", "CP-HU", "CP037", "CP038", "CP273", "CP274", "CP275", "CP278", "CP280", "CP281", "CP282", "CP284", "CP285", "CP290", "CP297", "CP367", "CP420", "CP423", "CP424", "CP437", "CP500", "CP737", "CP775", "CP803", "CP813", "CP819", "CP850", "CP851", "CP852", "CP855", "CP856", "CP857", "CP860", "CP861", "CP862", "CP863", "CP864", "CP865", "CP866", "CP866NAV", "CP868", "CP869", "CP870", "CP871", "CP874", "CP875", "CP880", "CP891", "CP901", "CP902", "CP903", "CP904", "CP905", "CP912", "CP915", "CP916", "CP918", "CP920", "CP921", "CP922", "CP930", "CP932", "CP933", "CP935", "CP936", "CP937", "CP939", "CP949", "CP950", "CP1004", "CP1008", "CP1025", "CP1026", "CP1046", "CP1047", "CP1070", "CP1079", "CP1081", "CP1084", "CP1089", "CP1097", "CP1112", "CP1122", "CP1123", "CP1124", "CP1125", "CP1129", "CP1130", "CP1132", "CP1133", "CP1137", "CP1140", "CP1141", "CP1142", "CP1143", "CP1144", "CP1145", "CP1146", "CP1147", "CP1148", "CP1149", "CP1153", "CP1154", "CP1155", "CP1156", "CP1157", "CP1158", "CP1160", "CP1161", "CP1162", "CP1163", "CP1164", "CP1166", "CP1167", "CP1250", "CP1251", "CP1252", "CP1253", "CP1254", "CP1255", "CP1256", "CP1257", "CP1258", "CP1361", "CP1364", "CP1371", "CP1388", "CP1390", "CP1399", "CP4517", "CP4899", "CP4909", "CP4971", "CP5347", "CP9030", "CP9066", "CP9448", "CP10007", "CP12712", "CP16804", "CPIBM861", "CSA7-1", "CSA7-2", "CSASCII", "CSA_T500-1983", "CSA_T500", "CSA_Z243.4-1985-1", "CSA_Z243.4-1985-2", "CSA_Z243.419851", "CSA_Z243.419852", "CSDECMCS", "CSEBCDICATDE", "CSEBCDICATDEA", "CSEBCDICCAFR", "CSEBCDICDKNO", "CSEBCDICDKNOA", "CSEBCDICES", "CSEBCDICESA", "CSEBCDICESS", "CSEBCDICFISE", "CSEBCDICFISEA", "CSEBCDICFR", "CSEBCDICIT", "CSEBCDICPT", "CSEBCDICUK", "CSEBCDICUS", "CSEUCKR", "CSEUCPKDFMTJAPANESE", "CSGB2312", "CSHPROMAN8", "CSIBM037", "CSIBM038", "CSIBM273", "CSIBM274", "CSIBM275", "CSIBM277", "CSIBM278", "CSIBM280", "CSIBM281", "CSIBM284", "CSIBM285", "CSIBM290", "CSIBM297", "CSIBM420", "CSIBM423", "CSIBM424", "CSIBM500", "CSIBM803", "CSIBM851", "CSIBM855", "CSIBM856", "CSIBM857", "CSIBM860", "CSIBM863", "CSIBM864", "CSIBM865", "CSIBM866", "CSIBM868", "CSIBM869", "CSIBM870", "CSIBM871", "CSIBM880", "CSIBM891", "CSIBM901", "CSIBM902", "CSIBM903", "CSIBM904", "CSIBM905", "CSIBM918", "CSIBM921", "CSIBM922", "CSIBM930", "CSIBM932", "CSIBM933", "CSIBM935", "CSIBM937", "CSIBM939", "CSIBM943", "CSIBM1008", "CSIBM1025", "CSIBM1026", "CSIBM1097", "CSIBM1112", "CSIBM1122", "CSIBM1123", "CSIBM1124", "CSIBM1129", "CSIBM1130", "CSIBM1132", "CSIBM1133", "CSIBM1137", "CSIBM1140", "CSIBM1141", "CSIBM1142", "CSIBM1143", "CSIBM1144", "CSIBM1145", "CSIBM1146", "CSIBM1147", "CSIBM1148", "CSIBM1149", "CSIBM1153", "CSIBM1154", "CSIBM1155", "CSIBM1156", "CSIBM1157", "CSIBM1158", "CSIBM1160", "CSIBM1161", "CSIBM1163", "CSIBM1164", "CSIBM1166", "CSIBM1167", "CSIBM1364", "CSIBM1371", "CSIBM1388", "CSIBM1390", "CSIBM1399", "CSIBM4517", "CSIBM4899", "CSIBM4909", "CSIBM4971", "CSIBM5347", "CSIBM9030", "CSIBM9066", "CSIBM9448", "CSIBM12712", "CSIBM16804", "CSIBM11621162", "CSISO4UNITEDKINGDOM", "CSISO10SWEDISH", "CSISO11SWEDISHFORNAMES", "CSISO14JISC6220RO", "CSISO15ITALIAN", "CSISO16PORTUGESE", "CSISO17SPANISH", "CSISO18GREEK7OLD", "CSISO19LATINGREEK", "CSISO21GERMAN", "CSISO25FRENCH", "CSISO27LATINGREEK1", "CSISO49INIS", "CSISO50INIS8", "CSISO51INISCYRILLIC", "CSISO58GB1988", "CSISO60DANISHNORWEGIAN", "CSISO60NORWEGIAN1", "CSISO61NORWEGIAN2", "CSISO69FRENCH", "CSISO84PORTUGUESE2", "CSISO85SPANISH2", "CSISO86HUNGARIAN", "CSISO88GREEK7", "CSISO89ASMO449", "CSISO90", "CSISO92JISC62991984B", "CSISO99NAPLPS", "CSISO103T618BIT", "CSISO111ECMACYRILLIC", "CSISO121CANADIAN1", "CSISO122CANADIAN2", "CSISO139CSN369103", "CSISO141JUSIB1002", "CSISO143IECP271", "CSISO150", "CSISO150GREEKCCITT", "CSISO151CUBA", "CSISO153GOST1976874", "CSISO646DANISH", "CSISO2022CN", "CSISO2022JP", "CSISO2022JP2", "CSISO2022KR", "CSISO2033", "CSISO5427CYRILLIC", "CSISO5427CYRILLIC1981", "CSISO5428GREEK", "CSISO10367BOX", "CSISOLATIN1", "CSISOLATIN2", "CSISOLATIN3", "CSISOLATIN4", "CSISOLATIN5", "CSISOLATIN6", "CSISOLATINARABIC", "CSISOLATINCYRILLIC", "CSISOLATINGREEK", "CSISOLATINHEBREW", "CSKOI8R", "CSKSC5636", "CSMACINTOSH", "CSNATSDANO", "CSNATSSEFI", "CSN_369103", "CSPC8CODEPAGE437", "CSPC775BALTIC", "CSPC850MULTILINGUAL", "CSPC862LATINHEBREW", "CSPCP852", "CSSHIFTJIS", "CSUCS4", "CSUNICODE", "CSWINDOWS31J", "CUBA", "CWI-2", "CWI", "CYRILLIC", "DE", "DEC-MCS", "DEC", "DECMCS", "DIN_66003", "DK", "DS2089", "DS_2089", "E13B", "EBCDIC-AT-DE-A", "EBCDIC-AT-DE", "EBCDIC-BE", "EBCDIC-BR", "EBCDIC-CA-FR", "EBCDIC-CP-AR1", "EBCDIC-CP-AR2", "EBCDIC-CP-BE", "EBCDIC-CP-CA", "EBCDIC-CP-CH", "EBCDIC-CP-DK", "EBCDIC-CP-ES", "EBCDIC-CP-FI", "EBCDIC-CP-FR", "EBCDIC-CP-GB", "EBCDIC-CP-GR", "EBCDIC-CP-HE", "EBCDIC-CP-IS", "EBCDIC-CP-IT", "EBCDIC-CP-NL", "EBCDIC-CP-NO", "EBCDIC-CP-ROECE", "EBCDIC-CP-SE", "EBCDIC-CP-TR", "EBCDIC-CP-US", "EBCDIC-CP-WT", "EBCDIC-CP-YU", "EBCDIC-CYRILLIC", "EBCDIC-DK-NO-A", "EBCDIC-DK-NO", "EBCDIC-ES-A", "EBCDIC-ES-S", "EBCDIC-ES", "EBCDIC-FI-SE-A", "EBCDIC-FI-SE", "EBCDIC-FR", "EBCDIC-GREEK", "EBCDIC-INT", "EBCDIC-INT1", "EBCDIC-IS-FRISS", "EBCDIC-IT", "EBCDIC-JP-E", "EBCDIC-JP-KANA", "EBCDIC-PT", "EBCDIC-UK", "EBCDIC-US", "EBCDICATDE", "EBCDICATDEA", "EBCDICCAFR", "EBCDICDKNO", "EBCDICDKNOA", "EBCDICES", "EBCDICESA", "EBCDICESS", "EBCDICFISE", "EBCDICFISEA", "EBCDICFR", "EBCDICISFRISS", "EBCDICIT", "EBCDICPT", "EBCDICUK", "EBCDICUS", "ECMA-114", "ECMA-118", "ECMA-128", "ECMA-CYRILLIC", "ECMACYRILLIC", "ELOT_928", "ES", "ES2", "EUC-CN", "EUC-JISX0213", "EUC-JP-MS", "EUC-JP", "EUC-KR", "EUC-TW", "EUCCN", "EUCJP-MS", "EUCJP-OPEN", "EUCJP-WIN", "EUCJP", "EUCKR", "EUCTW", "FI", "FR", "GB", "GB2312", "GB13000", "GB18030", "GBK", "GB_1988-80", "GB_198880", "GEORGIAN-ACADEMY", "GEORGIAN-PS", "GOST_19768-74", "GOST_19768", "GOST_1976874", "GREEK-CCITT", "GREEK", "GREEK7-OLD", "GREEK7", "GREEK7OLD", "GREEK8", "GREEKCCITT", "HEBREW", "HP-ROMAN8", "HPROMAN8", "HU", "IBM-803", "IBM-856", "IBM-901", "IBM-902", "IBM-921", "IBM-922", "IBM-930", "IBM-932", "IBM-933", "IBM-935", "IBM-937", "IBM-939", "IBM-943", "IBM-1008", "IBM-1025", "IBM-1046", "IBM-1047", "IBM-1097", "IBM-1112", "IBM-1122", "IBM-1123", "IBM-1124", "IBM-1129", "IBM-1130", "IBM-1132", "IBM-1133", "IBM-1137", "IBM-1140", "IBM-1141", "IBM-1142", "IBM-1143", "IBM-1144", "IBM-1145", "IBM-1146", "IBM-1147", "IBM-1148", "IBM-1149", "IBM-1153", "IBM-1154", "IBM-1155", "IBM-1156", "IBM-1157", "IBM-1158", "IBM-1160", "IBM-1161", "IBM-1162", "IBM-1163", "IBM-1164", "IBM-1166", "IBM-1167", "IBM-1364", "IBM-1371", "IBM-1388", "IBM-1390", "IBM-1399", "IBM-4517", "IBM-4899", "IBM-4909", "IBM-4971", "IBM-5347", "IBM-9030", "IBM-9066", "IBM-9448", "IBM-12712", "IBM-16804", "IBM037", "IBM038", "IBM256", "IBM273", "IBM274", "IBM275", "IBM277", "IBM278", "IBM280", "IBM281", "IBM284", "IBM285", "IBM290", "IBM297", "IBM367", "IBM420", "IBM423", "IBM424", "IBM437", "IBM500", "IBM775", "IBM803", "IBM813", "IBM819", "IBM848", "IBM850", "IBM851", "IBM852", "IBM855", "IBM856", "IBM857", "IBM860", "IBM861", "IBM862", "IBM863", "IBM864", "IBM865", "IBM866", "IBM866NAV", "IBM868", "IBM869", "IBM870", "IBM871", "IBM874", "IBM875", "IBM880", "IBM891", "IBM901", "IBM902", "IBM903", "IBM904", "IBM905", "IBM912", "IBM915", "IBM916", "IBM918", "IBM920", "IBM921", "IBM922", "IBM930", "IBM932", "IBM933", "IBM935", "IBM937", "IBM939", "IBM943", "IBM1004", "IBM1008", "IBM1025", "IBM1026", "IBM1046", "IBM1047", "IBM1089", "IBM1097", "IBM1112", "IBM1122", "IBM1123", "IBM1124", "IBM1129", "IBM1130", "IBM1132", "IBM1133", "IBM1137", "IBM1140", "IBM1141", "IBM1142", "IBM1143", "IBM1144", "IBM1145", "IBM1146", "IBM1147", "IBM1148", "IBM1149", "IBM1153", "IBM1154", "IBM1155", "IBM1156", "IBM1157", "IBM1158", "IBM1160", "IBM1161", "IBM1162", "IBM1163", "IBM1164", "IBM1166", "IBM1167", "IBM1364", "IBM1371", "IBM1388", "IBM1390", "IBM1399", "IBM4517", "IBM4899", "IBM4909", "IBM4971", "IBM5347", "IBM9030", "IBM9066", "IBM9448", "IBM12712", "IBM16804", "IEC_P27-1", "IEC_P271", "INIS-8", "INIS-CYRILLIC", "INIS", "INIS8", "INISCYRILLIC", "ISIRI-3342", "ISIRI3342", "ISO-2022-CN-EXT", "ISO-2022-CN", "ISO-2022-JP-2", "ISO-2022-JP-3", "ISO-2022-JP", "ISO-2022-KR", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-11", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "ISO-8859-16", "ISO-10646", "ISO-10646/UCS2/", "ISO-10646/UCS4/", "ISO-10646/UTF-8/", "ISO-10646/UTF8/", "ISO-CELTIC", "ISO-IR-4", "ISO-IR-6", "ISO-IR-8-1", "ISO-IR-9-1", "ISO-IR-10", "ISO-IR-11", "ISO-IR-14", "ISO-IR-15", "ISO-IR-16", "ISO-IR-17", "ISO-IR-18", "ISO-IR-19", "ISO-IR-21", "ISO-IR-25", "ISO-IR-27", "ISO-IR-37", "ISO-IR-49", "ISO-IR-50", "ISO-IR-51", "ISO-IR-54", "ISO-IR-55", "ISO-IR-57", "ISO-IR-60", "ISO-IR-61", "ISO-IR-69", "ISO-IR-84", "ISO-IR-85", "ISO-IR-86", "ISO-IR-88", "ISO-IR-89", "ISO-IR-90", "ISO-IR-92", "ISO-IR-98", "ISO-IR-99", "ISO-IR-100", "ISO-IR-101", "ISO-IR-103", "ISO-IR-109", "ISO-IR-110", "ISO-IR-111", "ISO-IR-121", "ISO-IR-122", "ISO-IR-126", "ISO-IR-127", "ISO-IR-138", "ISO-IR-139", "ISO-IR-141", "ISO-IR-143", "ISO-IR-144", "ISO-IR-148", "ISO-IR-150", "ISO-IR-151", "ISO-IR-153", "ISO-IR-155", "ISO-IR-156", "ISO-IR-157", "ISO-IR-166", "ISO-IR-179", "ISO-IR-193", "ISO-IR-197", "ISO-IR-199", "ISO-IR-203", "ISO-IR-209", "ISO-IR-226", "ISO/TR_11548-1/", "ISO646-CA", "ISO646-CA2", "ISO646-CN", "ISO646-CU", "ISO646-DE", "ISO646-DK", "ISO646-ES", "ISO646-ES2", "ISO646-FI", "ISO646-FR", "ISO646-FR1", "ISO646-GB", "ISO646-HU", "ISO646-IT", "ISO646-JP-OCR-B", "ISO646-JP", "ISO646-KR", "ISO646-NO", "ISO646-NO2", "ISO646-PT", "ISO646-PT2", "ISO646-SE", "ISO646-SE2", "ISO646-US", "ISO646-YU", "ISO2022CN", "ISO2022CNEXT", "ISO2022JP", "ISO2022JP2", "ISO2022KR", "ISO6937", "ISO8859-1", "ISO8859-2", "ISO8859-3", "ISO8859-4", "ISO8859-5", "ISO8859-6", "ISO8859-7", "ISO8859-8", "ISO8859-9", "ISO8859-10", "ISO8859-11", "ISO8859-13", "ISO8859-14", "ISO8859-15", "ISO8859-16", "ISO11548-1", "ISO88591", "ISO88592", "ISO88593", "ISO88594", "ISO88595", "ISO88596", "ISO88597", "ISO88598", "ISO88599", "ISO885910", "ISO885911", "ISO885913", "ISO885914", "ISO885915", "ISO885916", "ISO_646.IRV:1991", "ISO_2033-1983", "ISO_2033", "ISO_5427-EXT", "ISO_5427", "ISO_5427:1981", "ISO_5427EXT", "ISO_5428", "ISO_5428:1980", "ISO_6937-2", "ISO_6937-2:1983", "ISO_6937", "ISO_6937:1992", "ISO_8859-1", "ISO_8859-1:1987", "ISO_8859-2", "ISO_8859-2:1987", "ISO_8859-3", "ISO_8859-3:1988", "ISO_8859-4", "ISO_8859-4:1988", "ISO_8859-5", "ISO_8859-5:1988", "ISO_8859-6", "ISO_8859-6:1987", "ISO_8859-7", "ISO_8859-7:1987", "ISO_8859-7:2003", "ISO_8859-8", "ISO_8859-8:1988", "ISO_8859-9", "ISO_8859-9:1989", "ISO_8859-10", "ISO_8859-10:1992", "ISO_8859-14", "ISO_8859-14:1998", "ISO_8859-15", "ISO_8859-15:1998", "ISO_8859-16", "ISO_8859-16:2001", "ISO_9036", "ISO_10367-BOX", "ISO_10367BOX", "ISO_11548-1", "ISO_69372", "IT", "JIS_C6220-1969-RO", "JIS_C6229-1984-B", "JIS_C62201969RO", "JIS_C62291984B", "JOHAB", "JP-OCR-B", "JP", "JS", "JUS_I.B1.002", "KOI-7", "KOI-8", "KOI8-R", "KOI8-T", "KOI8-U", "KOI8", "KOI8R", "KOI8U", "KSC5636", "L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8", "L10", "LATIN-9", "LATIN-GREEK-1", "LATIN-GREEK", "LATIN1", "LATIN2", "LATIN3", "LATIN4", "LATIN5", "LATIN6", "LATIN7", "LATIN8", "LATIN10", "LATINGREEK", "LATINGREEK1", "MAC-CYRILLIC", "MAC-IS", "MAC-SAMI", "MAC-UK", "MAC", "MACCYRILLIC", "MACINTOSH", "MACIS", "MACUK", "MACUKRAINIAN", "MIK", "MS-ANSI", "MS-ARAB", "MS-CYRL", "MS-EE", "MS-GREEK", "MS-HEBR", "MS-MAC-CYRILLIC", "MS-TURK", "MS932", "MS936", "MSCP949", "MSCP1361", "MSMACCYRILLIC", "MSZ_7795.3", "MS_KANJI", "NAPLPS", "NATS-DANO", "NATS-SEFI", "NATSDANO", "NATSSEFI", "NC_NC0010", "NC_NC00-10", "NC_NC00-10:81", "NF_Z_62-010", "NF_Z_62-010_(1973)", "NF_Z_62-010_1973", "NF_Z_62010", "NF_Z_62010_1973", "NO", "NO2", "NS_4551-1", "NS_4551-2", "NS_45511", "NS_45512", "OS2LATIN1", "OSF00010001", "OSF00010002", "OSF00010003", "OSF00010004", "OSF00010005", "OSF00010006", "OSF00010007", "OSF00010008", "OSF00010009", "OSF0001000A", "OSF00010020", "OSF00010100", "OSF00010101", "OSF00010102", "OSF00010104", "OSF00010105", "OSF00010106", "OSF00030010", "OSF0004000A", "OSF0005000A", "OSF05010001", "OSF100201A4", "OSF100201A8", "OSF100201B5", "OSF100201F4", "OSF100203B5", "OSF1002011C", "OSF1002011D", "OSF1002035D", "OSF1002035E", "OSF1002035F", "OSF1002036B", "OSF1002037B", "OSF10010001", "OSF10020025", "OSF10020111", "OSF10020115", "OSF10020116", "OSF10020118", "OSF10020122", "OSF10020129", "OSF10020352", "OSF10020354", "OSF10020357", "OSF10020359", "OSF10020360", "OSF10020364", "OSF10020365", "OSF10020366", "OSF10020367", "OSF10020370", "OSF10020387", "OSF10020388", "OSF10020396", "OSF10020402", "OSF10020417", "PT", "PT2", "PT154", "R8", "RK1048", "ROMAN8", "RUSCII", "SE", "SE2", "SEN_850200_B", "SEN_850200_C", "SHIFT-JIS", "SHIFT_JIS", "SHIFT_JISX0213", "SJIS-OPEN", "SJIS-WIN", "SJIS", "SS636127", "STRK1048-2002", "ST_SEV_358-88", "T.61-8BIT", "T.61", "T.618BIT", "TCVN-5712", "TCVN", "TCVN5712-1", "TCVN5712-1:1993", "TIS-620", "TIS620-0", "TIS620.2529-1", "TIS620.2533-0", "TIS620", "TS-5881", "TSCII", "UCS-2", "UCS-2BE", "UCS-2LE", "UCS-4", "UCS-4BE", "UCS-4LE", "UCS2", "UCS4", "UHC", "UJIS", "UK", "UNICODE", "UNICODEBIG", "UNICODELITTLE", "US-ASCII", "US", "UTF-7", "UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-32", "UTF-32BE", "UTF-32LE", "UTF7", "UTF8", "UTF16", "UTF16BE", "UTF16LE", "UTF32", "UTF32BE", "UTF32LE", "VISCII", "WCHAR_T", "WIN-SAMI-2", "WINBALTRIM", "WINDOWS-31J", "WINDOWS-874", "WINDOWS-936", "WINDOWS-1250", "WINDOWS-1251", "WINDOWS-1252", "WINDOWS-1253", "WINDOWS-1254", "WINDOWS-1255", "WINDOWS-1256", "WINDOWS-1257", "WINDOWS-1258", "WINSAMI2", "WS2", "YU" }; - static const QString LanguagesI18N = i18n( "English|German|French|Spanish|Swedish" ); - static const QString Languages[] = + static const TQString LanguagesI18N = i18n( "English|German|French|Spanish|Swedish" ); + static const TQString Languages[] = { "english", "german", "french", "spanish", "swedish" }; - static const QString BibliographyStyles = i18n( "plain|achemso (American Chemical Society)|alpha|unsrt|abbrv|acm (Association of Computing Machinery)|apacite|apalike|authordate|ieeetr|natbib|siam" ); - static const QString StringDelimiters = "\"...\"|{...}|(...)"; - static const QString KeywordCasing = "@inproceedings|@Inproceedings|@InProceedings|@INPROCEEDINGS"; + static const TQString BibliographyStyles = i18n( "plain|achemso (American Chemical Society)|alpha|unsrt|abbrv|acm (Association of Computing Machinery)|apacite|apalike|authordate|ieeetr|natbib|siam" ); + static const TQString StringDelimiters = "\"...\"|{...}|(...)"; + static const TQString KeywordCasing = "@inproceedings|@Inproceedings|@InProceedings|@INPROCEEDINGS"; - SettingsFileIO::SettingsFileIO( QWidget *parent, const char *name ) - : QWidget( parent, name ) + SettingsFileIO::SettingsFileIO( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { setupGUI(); } @@ -75,7 +75,7 @@ namespace KBibTeX Settings * settings = Settings::self(); settings->fileIO_Encoding = m_comboBoxEncoding->currentText().lower(); - QString delimiters = m_comboBoxStringDelimiters->currentText(); + TQString delimiters = m_comboBoxStringDelimiters->currentText(); settings->fileIO_BibtexStringOpenDelimiter = delimiters.at( 0 ) ; settings->fileIO_BibtexStringCloseDelimiter = delimiters.at( 4 ) ; @@ -101,7 +101,7 @@ namespace KBibTeX if ( m_comboBoxExportSystemHTML->isEnabled() ) { - QString text = m_comboBoxExportSystemHTML->currentText(); + TQString text = m_comboBoxExportSystemHTML->currentText(); if ( text == "bib2xhtml" ) settings->fileIO_ExporterHTML = BibTeX::FileExporterExternal::exporterBib2XHTML; else if ( text == "bibtex2html" ) @@ -136,10 +136,10 @@ namespace KBibTeX break; } - QString toMatch = QString( settings->fileIO_BibtexStringOpenDelimiter ).append( "..." ).append( settings->fileIO_BibtexStringCloseDelimiter ); - QStringList delimiterList = QStringList::split( '|', StringDelimiters ); + TQString toMatch = TQString( settings->fileIO_BibtexStringOpenDelimiter ).append( "..." ).append( settings->fileIO_BibtexStringCloseDelimiter ); + TQStringList delimiterList = TQStringList::split( '|', StringDelimiters ); int i = 0; - for ( QStringList::Iterator it = delimiterList.begin(); it != delimiterList.end(); ++it, i++ ) + for ( TQStringList::Iterator it = delimiterList.begin(); it != delimiterList.end(); ++it, i++ ) if (( *it ) == toMatch ) { m_comboBoxStringDelimiters->setCurrentItem( i ); @@ -223,7 +223,7 @@ namespace KBibTeX KURL newPath = KDirSelectDialog::selectDirectory( m_bib2db5BasePath, true, this, i18n( "Path to the jar files for bib2db5" ) ); if ( !newPath.isEmpty() && newPath.isValid() && newPath.isLocalFile() ) { - m_bib2db5BasePath = newPath.directory() + QDir::separator() + newPath.fileName(); + m_bib2db5BasePath = newPath.directory() + TQDir::separator() + newPath.fileName(); m_lineeditBib2Db5Path->setText( m_bib2db5BasePath ); slotCheckBib2Db5Path(); } @@ -239,45 +239,45 @@ namespace KBibTeX void SettingsFileIO::setupGUI() { - QVBoxLayout * layout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout * layout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QGroupBox *groupBox = new QGroupBox( 2, Horizontal, i18n( "BibTeX Import and Export" ), this ); + TQGroupBox *groupBox = new TQGroupBox( 2, Horizontal, i18n( "BibTeX Import and Export" ), this ); layout->addWidget( groupBox ); - QLabel *label = new QLabel( i18n( "&Encoding:" ), groupBox ); - m_comboBoxEncoding = new QComboBox( groupBox ); + TQLabel *label = new TQLabel( i18n( "&Encoding:" ), groupBox ); + m_comboBoxEncoding = new TQComboBox( groupBox ); label->setBuddy( m_comboBoxEncoding ); - label = new QLabel( i18n( "Text &delimiters:" ), groupBox ); - m_comboBoxStringDelimiters = new QComboBox( groupBox ); + label = new TQLabel( i18n( "Text &delimiters:" ), groupBox ); + m_comboBoxStringDelimiters = new TQComboBox( groupBox ); label->setBuddy( m_comboBoxStringDelimiters ); - label = new QLabel( i18n( "Keyword casing:" ), groupBox ); - m_comboBoxKeywordCasing = new QComboBox( groupBox ); + label = new TQLabel( i18n( "Keyword casing:" ), groupBox ); + m_comboBoxKeywordCasing = new TQComboBox( groupBox ); label->setBuddy( m_comboBoxKeywordCasing ); - label = new QLabel( i18n( "Protect title's casing:" ), groupBox ); - m_checkBoxProtectCasing = new QCheckBox( i18n( "Put curly brackets around" ), groupBox ); - QToolTip::add( m_checkBoxProtectCasing, i18n( "Put curly brackets around title and other selected fields." ) ); - QWhatsThis::add( m_checkBoxProtectCasing, i18n( "Put curly brackets around title and other selected fields to protect them from case changes in certain BibTeX styles." ) ); + label = new TQLabel( i18n( "Protect title's casing:" ), groupBox ); + m_checkBoxProtectCasing = new TQCheckBox( i18n( "Put curly brackets around" ), groupBox ); + TQToolTip::add( m_checkBoxProtectCasing, i18n( "Put curly brackets around title and other selected fields." ) ); + TQWhatsThis::add( m_checkBoxProtectCasing, i18n( "Put curly brackets around title and other selected fields to protect them from case changes in certain BibTeX styles." ) ); - groupBox = new QGroupBox( 2, Horizontal, i18n( "PDF, PostScript and Rich Text Format Export" ), this ); + groupBox = new TQGroupBox( 2, Horizontal, i18n( "PDF, PostScript and Rich Text Format Export" ), this ); layout->addWidget( groupBox ); - QWhatsThis::add( groupBox, i18n( "Select the layout of the resulting PDF, PostScript or Rich Text Format document when exporting a BibTeX file." ) ); - label = new QLabel( i18n( "&Language:" ), groupBox ); - m_comboBoxLanguage = new QComboBox( groupBox ); + TQWhatsThis::add( groupBox, i18n( "Select the layout of the resulting PDF, PostScript or Rich Text Format document when exporting a BibTeX file." ) ); + label = new TQLabel( i18n( "&Language:" ), groupBox ); + m_comboBoxLanguage = new TQComboBox( groupBox ); label->setBuddy( m_comboBoxLanguage ); - label = new QLabel( i18n( "&Biblography style:" ), groupBox ); - m_comboBoxBibliographyStyle = new QComboBox( TRUE, groupBox ); + label = new TQLabel( i18n( "&Biblography style:" ), groupBox ); + m_comboBoxBibliographyStyle = new TQComboBox( TRUE, groupBox ); label->setBuddy( m_comboBoxBibliographyStyle ); - groupBox = new QGroupBox( 1, Horizontal, i18n( "PDF Export" ), this ); + groupBox = new TQGroupBox( 1, Horizontal, i18n( "PDF Export" ), this ); layout->addWidget( groupBox ); - m_checkBoxEmbedFiles = new QCheckBox( i18n( "Embed local files into PDF if possible" ), groupBox ); - QWhatsThis::add( m_checkBoxEmbedFiles, i18n( "If checked, KBibTeX tries to embed all referenced files for the BibTeX entries into the exported PDF file.
This requires that you have installed embedfile.sty.
" ) ); + m_checkBoxEmbedFiles = new TQCheckBox( i18n( "Embed local files into PDF if possible" ), groupBox ); + TQWhatsThis::add( m_checkBoxEmbedFiles, i18n( "If checked, KBibTeX tries to embed all referenced files for the BibTeX entries into the exported PDF file.
This requires that you have installed embedfile.sty.
" ) ); - groupBox = new QGroupBox( 2, Horizontal, i18n( "XML Export" ), this ); + groupBox = new TQGroupBox( 2, Horizontal, i18n( "XML Export" ), this ); layout->addWidget( groupBox ); label->setBuddy( m_comboBoxEncoding ); - label = new QLabel( i18n( "Path to the jar files for bib2db5:" ), groupBox ); - QWidget *container = new QWidget( groupBox ); - QBoxLayout *containerLayout = new QHBoxLayout( container, 0, KDialog::spacingHint() ); + label = new TQLabel( i18n( "Path to the jar files for bib2db5:" ), groupBox ); + TQWidget *container = new TQWidget( groupBox ); + TQBoxLayout *containerLayout = new TQHBoxLayout( container, 0, KDialog::spacingHint() ); m_lineeditBib2Db5Path = new KLineEdit( container ); m_lineeditBib2Db5Path->setReadOnly( true ); containerLayout->addWidget( m_lineeditBib2Db5Path ); @@ -286,28 +286,28 @@ namespace KBibTeX label->setBuddy( buttonBib2Db5 ); containerLayout->addWidget( buttonBib2Db5 ); containerLayout->setStretchFactor( buttonBib2Db5, 1 ); - buttonBib2Db5->setIconSet( QIconSet( SmallIcon( "folder_open" ) ) ); + buttonBib2Db5->setIconSet( TQIconSet( SmallIcon( "folder_open" ) ) ); label->setBuddy( buttonBib2Db5 ); connect( buttonBib2Db5, SIGNAL( clicked() ), this, SLOT( slotBib2db5BasePath() ) ); - groupBox = new QGroupBox( 2, Horizontal, i18n( "Export Systems" ), this ); + groupBox = new TQGroupBox( 2, Horizontal, i18n( "Export Systems" ), this ); layout->addWidget( groupBox ); - label = new QLabel( i18n( "HTML:" ), groupBox ); - m_comboBoxExportSystemHTML = new QComboBox( FALSE, groupBox ); + label = new TQLabel( i18n( "HTML:" ), groupBox ); + m_comboBoxExportSystemHTML = new TQComboBox( FALSE, groupBox ); label->setBuddy( m_comboBoxExportSystemHTML ); - groupBox = new QGroupBox( 1, Horizontal, i18n( "BibUtils" ), this ); + groupBox = new TQGroupBox( 1, Horizontal, i18n( "BibUtils" ), this ); layout->addWidget( groupBox ); - m_checkBoxUseBibUtils = new QCheckBox( i18n( "Always use BibUtils" ), groupBox ); - QToolTip::add( m_checkBoxUseBibUtils, i18n( "If possible, use BibUtils to import and export alien bibliography." ) ); - QWhatsThis::add( m_checkBoxUseBibUtils, i18n( "If possible, use BibUtils to import and export alien bibliography such as RIS.\nIf unchecked, prefer internal import and export library." ) ); + m_checkBoxUseBibUtils = new TQCheckBox( i18n( "Always use BibUtils" ), groupBox ); + TQToolTip::add( m_checkBoxUseBibUtils, i18n( "If possible, use BibUtils to import and export alien bibliography." ) ); + TQWhatsThis::add( m_checkBoxUseBibUtils, i18n( "If possible, use BibUtils to import and export alien bibliography such as RIS.\nIf unchecked, prefer internal import and export library." ) ); /** command line tools from BibUtils must be available to enable this option */ m_checkBoxUseBibUtils->setEnabled( Settings::self()->external_xml2bibAvailable && Settings::self()->external_ris2xmlAvailable ); - groupBox = new QGroupBox( 2, Horizontal, i18n( "Backups" ), this ); + groupBox = new TQGroupBox( 2, Horizontal, i18n( "Backups" ), this ); layout->addWidget( groupBox ); - label = new QLabel( i18n( "Number of Backups:" ), groupBox ); - m_spinBoxNumberOfBackups = new QSpinBox( 0, 15, 1, groupBox, "m_spinBoxNumberOfBackups" ); + label = new TQLabel( i18n( "Number of Backups:" ), groupBox ); + m_spinBoxNumberOfBackups = new TQSpinBox( 0, 15, 1, groupBox, "m_spinBoxNumberOfBackups" ); m_spinBoxNumberOfBackups->setSpecialValueText( "No backups" ); label->setBuddy( m_spinBoxNumberOfBackups ); @@ -316,16 +316,16 @@ namespace KBibTeX for ( unsigned int i = 0; i < sizeof( encodingList ) / sizeof( encodingList[0] ); ++i ) m_comboBoxEncoding->insertItem( encodingList[i] ); - QStringList delimiterList = QStringList::split( '|', StringDelimiters ); + TQStringList delimiterList = TQStringList::split( '|', StringDelimiters ); m_comboBoxStringDelimiters->insertStringList( delimiterList ); - QStringList keywordCasingList = QStringList::split( '|', KeywordCasing ); + TQStringList keywordCasingList = TQStringList::split( '|', KeywordCasing ); m_comboBoxKeywordCasing->insertStringList( keywordCasingList ); - QStringList langList = QStringList::split( '|', LanguagesI18N ); + TQStringList langList = TQStringList::split( '|', LanguagesI18N ); m_comboBoxLanguage->insertStringList( langList ); - QStringList bibList = QStringList::split( '|', BibliographyStyles ); + TQStringList bibList = TQStringList::split( '|', BibliographyStyles ); bibList.sort(); m_comboBoxBibliographyStyle->insertStringList( bibList ); diff --git a/src/settingsfileio.h b/src/settingsfileio.h index 2697473..bb00a4f 100644 --- a/src/settingsfileio.h +++ b/src/settingsfileio.h @@ -24,20 +24,20 @@ #include #endif -#include +#include -class QComboBox; -class QCheckBox; -class QSpinBox; +class TQComboBox; +class TQCheckBox; +class TQSpinBox; class KLineEdit; namespace KBibTeX { - class SettingsFileIO : public QWidget + class SettingsFileIO : public TQWidget { Q_OBJECT public: - SettingsFileIO( QWidget *parent = 0, const char *name = 0 ); + SettingsFileIO( TQWidget *parent = 0, const char *name = 0 ); ~SettingsFileIO(); void applyData(); @@ -52,18 +52,18 @@ namespace KBibTeX void slotCheckBib2Db5Path(); private: - QComboBox *m_comboBoxEncoding; - QComboBox *m_comboBoxStringDelimiters; - QComboBox *m_comboBoxKeywordCasing; - QCheckBox *m_checkBoxProtectCasing; - QComboBox *m_comboBoxLanguage; - QComboBox *m_comboBoxBibliographyStyle; - QCheckBox *m_checkBoxEmbedFiles; - QComboBox *m_comboBoxExportSystemHTML; - QCheckBox *m_checkBoxUseBibUtils; + TQComboBox *m_comboBoxEncoding; + TQComboBox *m_comboBoxStringDelimiters; + TQComboBox *m_comboBoxKeywordCasing; + TQCheckBox *m_checkBoxProtectCasing; + TQComboBox *m_comboBoxLanguage; + TQComboBox *m_comboBoxBibliographyStyle; + TQCheckBox *m_checkBoxEmbedFiles; + TQComboBox *m_comboBoxExportSystemHTML; + TQCheckBox *m_checkBoxUseBibUtils; KLineEdit *m_lineeditBib2Db5Path; - QString m_bib2db5BasePath; - QSpinBox *m_spinBoxNumberOfBackups; + TQString m_bib2db5BasePath; + TQSpinBox *m_spinBoxNumberOfBackups; void setupGUI(); diff --git a/src/settingsidsuggestions.cpp b/src/settingsidsuggestions.cpp index 7d53327..af41919 100644 --- a/src/settingsidsuggestions.cpp +++ b/src/settingsidsuggestions.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,21 +41,21 @@ namespace KBibTeX { - QString SettingsIdSuggestions::exampleBibTeXEntry = "@Article{ dijkstra1983terminationdetect,\nauthor = {Edsger W. Dijkstra and W. H. J. Feijen and A. J. M. {van Gasteren}},\ntitle = {{Derivation of a Termination Detection Algorithm for Distributed Computations}},\njournal = {Information Processing Letters},\nvolume = 16,\nnumber = 5,\npages = {217--219},\nmonth = jun,\nyear = 1983\n}"; + TQString SettingsIdSuggestions::exampleBibTeXEntry = "@Article{ dijkstra1983terminationdetect,\nauthor = {Edsger W. Dijkstra and W. H. J. Feijen and A. J. M. {van Gasteren}},\ntitle = {{Derivation of a Termination Detection Algorithm for Distributed Computations}},\njournal = {Information Processing Letters},\nvolume = 16,\nnumber = 5,\npages = {217--219},\nmonth = jun,\nyear = 1983\n}"; - IdSuggestionsListViewItem::IdSuggestionsListViewItem( KListView *list, const QString& plainText, BibTeX::Entry *example ): KListViewItem( list ), m_original( plainText ), m_example( example ) + IdSuggestionsListViewItem::IdSuggestionsListViewItem( KListView *list, const TQString& plainText, BibTeX::Entry *example ): KListViewItem( list ), m_original( plainText ), m_example( example ) { KListViewItem::setText( 0, parse( plainText ) ); KListViewItem::setMultiLinesEnabled( TRUE ); } - IdSuggestionsListViewItem::IdSuggestionsListViewItem( KListView *list, KListViewItem *prev, const QString& plainText, BibTeX::Entry *example ): KListViewItem( list, prev ), m_original( plainText ), m_example( example ) + IdSuggestionsListViewItem::IdSuggestionsListViewItem( KListView *list, KListViewItem *prev, const TQString& plainText, BibTeX::Entry *example ): KListViewItem( list, prev ), m_original( plainText ), m_example( example ) { KListViewItem::setText( 0, parse( plainText ) ); KListViewItem::setMultiLinesEnabled( TRUE ); } - void IdSuggestionsListViewItem::setText( int col, const QString& text ) + void IdSuggestionsListViewItem::setText( int col, const TQString& text ) { if ( col == 0 ) KListViewItem::setText( 0, parse( text ) ); @@ -63,11 +63,11 @@ namespace KBibTeX KListViewItem::setText( col, text ); } - int IdSuggestionsListViewItem::width( const QFontMetrics & fm, const QListView *, int c ) const + int IdSuggestionsListViewItem::width( const TQFontMetrics & fm, const TQListView *, int c ) const { int max = 100; - QStringList lines = QStringList::split( '\n', text( c ) ); - for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) + TQStringList lines = TQStringList::split( '\n', text( c ) ); + for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) { int w = fm.width( *it ); if ( w > max ) max = w; @@ -76,26 +76,26 @@ namespace KBibTeX return max + 36; } - QString IdSuggestionsListViewItem::originalText() const + TQString IdSuggestionsListViewItem::originalText() const { return m_original; } - QString IdSuggestionsListViewItem::parse( const QString&plainText ) + TQString IdSuggestionsListViewItem::parse( const TQString&plainText ) { m_original = plainText; - QString result = IdSuggestions::formatStrToHuman( plainText ); + TQString result = IdSuggestions::formatStrToHuman( plainText ); if ( m_example != NULL ) { - result.append( QString( i18n( "\nExample: %1" ) ).arg( IdSuggestions::formatId( m_example, plainText ) ) ); + result.append( TQString( i18n( "\nExample: %1" ) ).arg( IdSuggestions::formatId( m_example, plainText ) ) ); } return result; } - SettingsIdSuggestions::SettingsIdSuggestions( QWidget *parent, const char *name ) - : QWidget( parent, name ) + SettingsIdSuggestions::SettingsIdSuggestions( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { - m_validator = new QRegExpValidator( QRegExp( "[^\\s]+" ), this ); + m_validator = new TQRegExpValidator( TQRegExp( "[^\\s]+" ), this ); setupGUI(); BibTeX::FileImporter *importer = new BibTeX::FileImporterBibTeX( false ); @@ -119,7 +119,7 @@ namespace KBibTeX settings->idSuggestions_default = -1; settings->idSuggestions_forceDefault = m_checkBoxForceDefault->isChecked(); int i = 0; - for ( QListViewItemIterator it( m_listIdSuggestions ); it.current(); ++i, ++it ) + for ( TQListViewItemIterator it( m_listIdSuggestions ); it.current(); ++i, ++it ) { IdSuggestionsListViewItem *item = dynamic_cast( *it ); settings->idSuggestions_formatStrList.append( item->originalText() ); @@ -127,7 +127,7 @@ namespace KBibTeX settings->idSuggestions_default = i; } settings->idSuggestions_smallWords.clear(); - for ( QListViewItemIterator it( m_listSmallWords ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listSmallWords ); it.current(); ++it ) settings->idSuggestions_smallWords << it.current()->text( 0 ); } @@ -141,7 +141,7 @@ namespace KBibTeX m_checkBoxForceDefault->setChecked( settings->idSuggestions_forceDefault ); m_checkBoxForceDefault->setEnabled( settings->idSuggestions_default >= 0 ); int i = 0; - for ( QStringList::ConstIterator it = settings->idSuggestions_formatStrList.begin(); it != settings->idSuggestions_formatStrList.end(); ++i, ++it ) + for ( TQStringList::ConstIterator it = settings->idSuggestions_formatStrList.begin(); it != settings->idSuggestions_formatStrList.end(); ++i, ++it ) { prev = new IdSuggestionsListViewItem( m_listIdSuggestions, prev, *it, m_example ); prev->setPixmap( 0, SmallIcon( "filter" ) ); @@ -153,7 +153,7 @@ namespace KBibTeX m_defaultSuggestionItem->setPixmap( 0, SmallIcon( "favorites" ) ); m_listSmallWords->clear(); - for ( QStringList::ConstIterator it = settings->idSuggestions_smallWords.begin(); it != settings->idSuggestions_smallWords.end(); ++it ) + for ( TQStringList::ConstIterator it = settings->idSuggestions_smallWords.begin(); it != settings->idSuggestions_smallWords.end(); ++it ) new KListViewItem( m_listSmallWords, *it ); m_lineEditSmallWords->setText( "" ); slotListSmallWordsChanged(); @@ -171,7 +171,7 @@ namespace KBibTeX IdSuggestionsListViewItem * item = new IdSuggestionsListViewItem( m_listIdSuggestions, "a|Y|T", m_example ); item->setPixmap( 0, SmallIcon( "filter" ) ); m_listIdSuggestions->setSelected( item, TRUE ); - QTimer::singleShot( 100, this, SLOT( slotEditIdSuggestion() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEditIdSuggestion() ) ); } void SettingsIdSuggestions::slotEditIdSuggestion() @@ -179,8 +179,8 @@ namespace KBibTeX IdSuggestionsListViewItem * item = static_cast( m_listIdSuggestions->selectedItem() ); if ( item != NULL ) { - QString formatStr = item->originalText(); - if ( IdSuggestionsWidget::execute( formatStr, this ) == QDialog::Accepted ) + TQString formatStr = item->originalText(); + if ( IdSuggestionsWidget::execute( formatStr, this ) == TQDialog::Accepted ) { item->setText( 0, formatStr ); emit configChanged(); @@ -210,7 +210,7 @@ namespace KBibTeX if ( item != NULL && item -> itemAbove() != NULL ) { IdSuggestionsListViewItem *itemAbove = dynamic_cast( item->itemAbove() ); - QString text = item->originalText(); + TQString text = item->originalText(); item->setText( 0, itemAbove->originalText( ) ); itemAbove->setText( 0, text ); m_listIdSuggestions->setCurrentItem( itemAbove ); @@ -237,7 +237,7 @@ namespace KBibTeX if ( item != NULL && item -> itemBelow() != NULL ) { IdSuggestionsListViewItem *itemBelow = dynamic_cast( item->itemBelow() ); - QString text = item->originalText(); + TQString text = item->originalText(); item->setText( 0, itemBelow->originalText( ) ); itemBelow->setText( 0, text ); m_listIdSuggestions->setCurrentItem( itemBelow ); @@ -263,7 +263,7 @@ namespace KBibTeX if ( m_defaultSuggestionItem != NULL ) m_defaultSuggestionItem->setPixmap( 0, SmallIcon( "filter" ) ); - QListViewItem *item = m_listIdSuggestions->selectedItem(); + TQListViewItem *item = m_listIdSuggestions->selectedItem(); if ( item == m_defaultSuggestionItem ) m_defaultSuggestionItem = NULL; else @@ -274,11 +274,11 @@ namespace KBibTeX m_checkBoxForceDefault->setEnabled( m_defaultSuggestionItem != NULL ); } - void SettingsIdSuggestions::slotEditSmallWordsChanged( const QString &newWord ) + void SettingsIdSuggestions::slotEditSmallWordsChanged( const TQString &newWord ) { bool result = !newWord.isEmpty(); - for ( QListViewItemIterator it( m_listSmallWords ); result && it.current(); ++it ) + for ( TQListViewItemIterator it( m_listSmallWords ); result && it.current(); ++it ) result &= it.current()->text( 0 ) != newWord; m_buttonAddSmallWord->setEnabled( result ); @@ -294,10 +294,10 @@ namespace KBibTeX void SettingsIdSuggestions::slotDeleteSmallWord() { bool changed = false; - QListViewItemIterator it( m_listSmallWords, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_listSmallWords, TQListViewItemIterator::Selected ); while ( it.current() ) { - QListViewItem *cur = it.current(); + TQListViewItem *cur = it.current(); ++it; delete cur; changed = true; @@ -309,13 +309,13 @@ namespace KBibTeX void SettingsIdSuggestions::slotListSmallWordsChanged() { - QListViewItemIterator it( m_listSmallWords, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_listSmallWords, TQListViewItemIterator::Selected ); m_buttonDeleteSmallWord->setEnabled( it.current() != NULL ); } void SettingsIdSuggestions::updateGUI() { - QListViewItem *item = m_listIdSuggestions->selectedItem(); + TQListViewItem *item = m_listIdSuggestions->selectedItem(); bool selected = item != NULL; m_buttonEditIdSuggestion->setEnabled( selected ); m_buttonDeleteIdSuggestion->setEnabled( selected ); @@ -326,7 +326,7 @@ namespace KBibTeX void SettingsIdSuggestions::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 13, 2, 0, KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 13, 2, 0, KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 6, 2 ); gridLayout->setRowSpacing( 8, KDialog::spacingHint() ); gridLayout->setRowStretch( 12, 1 ); @@ -339,46 +339,46 @@ namespace KBibTeX m_listIdSuggestions->setFullWidth( true ); gridLayout->addMultiCellWidget( m_listIdSuggestions, 0, 6, 0, 0 ); connect( m_listIdSuggestions, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listIdSuggestions, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listIdSuggestions, SIGNAL( doubleClicked( QListViewItem*, const QPoint &, int ) ), this, SLOT( slotEditIdSuggestion() ) ); + connect( m_listIdSuggestions, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listIdSuggestions, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint &, int ) ), this, SLOT( slotEditIdSuggestion() ) ); m_buttonNewIdSuggestion = new KPushButton( i18n( "id suggestion", "New" ), this ); - m_buttonNewIdSuggestion->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_buttonNewIdSuggestion->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); gridLayout->addWidget( m_buttonNewIdSuggestion, 0, 1 ); connect( m_buttonNewIdSuggestion, SIGNAL( clicked() ), this, SLOT( slotNewIdSuggestion() ) ); m_buttonEditIdSuggestion = new KPushButton( i18n( "id suggestion", "Edit" ), this ); - m_buttonEditIdSuggestion->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_buttonEditIdSuggestion->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); gridLayout->addWidget( m_buttonEditIdSuggestion, 1, 1 ); connect( m_buttonEditIdSuggestion, SIGNAL( clicked() ), this, SLOT( slotEditIdSuggestion() ) ); m_buttonDeleteIdSuggestion = new KPushButton( i18n( "id suggestion", "Delete" ), this ); - m_buttonDeleteIdSuggestion->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_buttonDeleteIdSuggestion->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); gridLayout->addWidget( m_buttonDeleteIdSuggestion, 2, 1 ); connect( m_buttonDeleteIdSuggestion, SIGNAL( clicked() ), this, SLOT( slotDeleteIdSuggestion() ) ); m_buttonMoveUpIdSuggestion = new KPushButton( i18n( "id suggestion", "Up" ), this ); - m_buttonMoveUpIdSuggestion->setIconSet( QIconSet( SmallIcon( "up" ) ) ); + m_buttonMoveUpIdSuggestion->setIconSet( TQIconSet( SmallIcon( "up" ) ) ); gridLayout->addWidget( m_buttonMoveUpIdSuggestion, 3, 1 ); connect( m_buttonMoveUpIdSuggestion, SIGNAL( clicked() ), this, SLOT( slotMoveUpIdSuggestion() ) ); m_buttonMoveDownIdSuggestion = new KPushButton( i18n( "id suggestion", "Down" ), this ); - m_buttonMoveDownIdSuggestion->setIconSet( QIconSet( SmallIcon( "down" ) ) ); + m_buttonMoveDownIdSuggestion->setIconSet( TQIconSet( SmallIcon( "down" ) ) ); gridLayout->addWidget( m_buttonMoveDownIdSuggestion, 4, 1 ); connect( m_buttonMoveDownIdSuggestion, SIGNAL( clicked() ), this, SLOT( slotMoveDownIdSuggestion() ) ); m_buttonToggleDefault = new KPushButton( i18n( "Toogle default" ), this ); - m_buttonToggleDefault->setIconSet( QIconSet( SmallIcon( "favorites" ) ) ); + m_buttonToggleDefault->setIconSet( TQIconSet( SmallIcon( "favorites" ) ) ); gridLayout->addWidget( m_buttonToggleDefault, 5, 1 ); connect( m_buttonToggleDefault, SIGNAL( clicked() ), this, SLOT( slotToggleDefault() ) ); - m_checkBoxForceDefault = new QCheckBox( i18n( "Use default id suggestion when editing new entries" ), this ); + m_checkBoxForceDefault = new TQCheckBox( i18n( "Use default id suggestion when editing new entries" ), this ); gridLayout->addMultiCellWidget( m_checkBoxForceDefault, 7, 7, 0, 1 ); - QLabel *label = new QLabel( i18n( "Small Words:" ), this ); + TQLabel *label = new TQLabel( i18n( "Small Words:" ), this ); gridLayout->addMultiCellWidget( label, 9, 9, 0, 1 ); m_lineEditSmallWords = new KLineEdit( this ); label->setBuddy( m_lineEditSmallWords ); gridLayout->addWidget( m_lineEditSmallWords, 10, 0 ); - connect( m_lineEditSmallWords, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotEditSmallWordsChanged( const QString & ) ) ); + connect( m_lineEditSmallWords, SIGNAL( textChanged( const TQString & ) ), this, SLOT( slotEditSmallWordsChanged( const TQString & ) ) ); m_buttonAddSmallWord = new KPushButton( i18n( "Add" ), this ); m_buttonAddSmallWord->setEnabled( false ); - m_buttonAddSmallWord->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_buttonAddSmallWord->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); gridLayout->addWidget( m_buttonAddSmallWord, 10, 1 ); connect( m_buttonAddSmallWord, SIGNAL( clicked() ), this, SLOT( slotAddSmallWord() ) ); @@ -387,11 +387,11 @@ namespace KBibTeX m_listSmallWords->header()->setClickEnabled( true ); m_listSmallWords->setFullWidth( true ); connect( m_listSmallWords, SIGNAL( selectionChanged() ), this, SLOT( slotListSmallWordsChanged() ) ); - connect( m_listSmallWords, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( slotListSmallWordsChanged() ) ); + connect( m_listSmallWords, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( slotListSmallWordsChanged() ) ); gridLayout->addMultiCellWidget( m_listSmallWords, 11, 12, 0, 0 ); m_buttonDeleteSmallWord = new KPushButton( i18n( "Delete" ), this ); m_buttonDeleteSmallWord->setEnabled( false ); - m_buttonDeleteSmallWord->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_buttonDeleteSmallWord->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); gridLayout->addWidget( m_buttonDeleteSmallWord, 11, 1 ); connect( m_buttonDeleteSmallWord, SIGNAL( clicked() ), this, SLOT( slotDeleteSmallWord() ) ); } diff --git a/src/settingsidsuggestions.h b/src/settingsidsuggestions.h index cbde362..4d364bc 100644 --- a/src/settingsidsuggestions.h +++ b/src/settingsidsuggestions.h @@ -20,14 +20,14 @@ #ifndef KBIBTEXSETTINGSIDSUGGESTIONS_H #define KBIBTEXSETTINGSIDSUGGESTIONS_H -#include +#include #include #include -class QRegExpValidator; -class QCheckBox; +class TQRegExpValidator; +class TQCheckBox; class KPushButton; class KLineEdit; @@ -38,26 +38,26 @@ namespace KBibTeX class IdSuggestionsListViewItem: public KListViewItem { public: - IdSuggestionsListViewItem( KListView *, const QString&, BibTeX::Entry *example ); - IdSuggestionsListViewItem( KListView *, KListViewItem *, const QString&, BibTeX::Entry *example ); - void setText( int, const QString& ); - QString originalText() const; - int width( const QFontMetrics &, const QListView *, int ) const; + IdSuggestionsListViewItem( KListView *, const TQString&, BibTeX::Entry *example ); + IdSuggestionsListViewItem( KListView *, KListViewItem *, const TQString&, BibTeX::Entry *example ); + void setText( int, const TQString& ); + TQString originalText() const; + int width( const TQFontMetrics &, const TQListView *, int ) const; private: - QString m_original; + TQString m_original; BibTeX::Entry *m_example; - QString parse( const QString& ); + TQString parse( const TQString& ); }; /** @author Thomas Fischer */ - class SettingsIdSuggestions : public QWidget + class SettingsIdSuggestions : public TQWidget { Q_OBJECT public: - SettingsIdSuggestions( QWidget *parent = 0, const char *name = 0 ); + SettingsIdSuggestions( TQWidget *parent = 0, const char *name = 0 ); ~SettingsIdSuggestions(); void applyData(); @@ -76,7 +76,7 @@ namespace KBibTeX void slotMoveUpIdSuggestion(); void slotMoveDownIdSuggestion(); void slotToggleDefault(); - void slotEditSmallWordsChanged( const QString & ); + void slotEditSmallWordsChanged( const TQString & ); void slotAddSmallWord(); void slotDeleteSmallWord(); void slotListSmallWordsChanged(); @@ -90,14 +90,14 @@ namespace KBibTeX KPushButton *m_buttonMoveUpIdSuggestion; KPushButton *m_buttonMoveDownIdSuggestion; KPushButton *m_buttonToggleDefault; - QCheckBox *m_checkBoxForceDefault; + TQCheckBox *m_checkBoxForceDefault; KListView *m_listSmallWords; KLineEdit *m_lineEditSmallWords; KPushButton *m_buttonAddSmallWord; KPushButton *m_buttonDeleteSmallWord; - QRegExpValidator *m_validator; - QListViewItem *m_defaultSuggestionItem; - static QString exampleBibTeXEntry; + TQRegExpValidator *m_validator; + TQListViewItem *m_defaultSuggestionItem; + static TQString exampleBibTeXEntry; BibTeX::Entry *m_example; void setupGUI(); diff --git a/src/settingskeyword.cpp b/src/settingskeyword.cpp index 6667e01..3e446d6 100644 --- a/src/settingskeyword.cpp +++ b/src/settingskeyword.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -39,7 +39,7 @@ namespace KBibTeX { - SettingsKeyword::SettingsKeyword( QWidget *parent, const char *name ) : QWidget( parent, name ), m_keywords( NULL ) + SettingsKeyword::SettingsKeyword( TQWidget *parent, const char *name ) : TQWidget( parent, name ), m_keywords( NULL ) { setupGUI(); } @@ -53,7 +53,7 @@ namespace KBibTeX { Settings * settings = Settings::self(); settings->keyword_GlobalList.clear(); - for ( QListViewItemIterator it = QListViewItemIterator( m_listKeywords ); it.current() != NULL; ++it ) + for ( TQListViewItemIterator it = TQListViewItemIterator( m_listKeywords ); it.current() != NULL; ++it ) settings->keyword_GlobalList.append( it.current() ->text( 0 ) ); settings->keyword_GlobalList.sort(); } @@ -62,7 +62,7 @@ namespace KBibTeX { Settings * settings = Settings::self(); m_listKeywords->clear(); - for ( QStringList::Iterator it = settings->keyword_GlobalList.begin(); it != settings->keyword_GlobalList.end(); ++it ) + for ( TQStringList::Iterator it = settings->keyword_GlobalList.begin(); it != settings->keyword_GlobalList.end(); ++it ) { KListViewItem *item = new KListViewItem( m_listKeywords, *it ); item->setPixmap( 0, SmallIcon( "package" ) ); @@ -84,7 +84,7 @@ namespace KBibTeX item->setPixmap( 0, SmallIcon( "package" ) ); m_listKeywords->setSelected( item, TRUE ); m_listKeywords->ensureItemVisible( item ); - QTimer::singleShot( 100, this, SLOT( slotEditKeyword() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEditKeyword() ) ); } void SettingsKeyword::slotEditKeyword() @@ -111,9 +111,9 @@ namespace KBibTeX void SettingsKeyword::slotImportKeywords() { int numImported = m_keywordsFromFile.size(); - for ( QListViewItemIterator it = QListViewItemIterator( m_listKeywords ); it.current() != NULL; ++it ) + for ( TQListViewItemIterator it = TQListViewItemIterator( m_listKeywords ); it.current() != NULL; ++it ) { - QString text = it.current() ->text( 0 ); + TQString text = it.current() ->text( 0 ); if ( !m_keywordsFromFile.contains( text ) ) m_keywordsFromFile.append( text ); else @@ -122,7 +122,7 @@ namespace KBibTeX m_keywordsFromFile.sort(); m_listKeywords->clear(); - for ( QStringList::Iterator it = m_keywordsFromFile.begin(); it != m_keywordsFromFile.end(); ++it ) + for ( TQStringList::Iterator it = m_keywordsFromFile.begin(); it != m_keywordsFromFile.end(); ++it ) { KListViewItem *item = new KListViewItem( m_listKeywords, *it ); item->setPixmap( 0, SmallIcon( "package" ) ); @@ -133,9 +133,9 @@ namespace KBibTeX m_buttonImportKeywords->setEnabled( FALSE ); } - void SettingsKeyword::slotItemRenamed( QListViewItem *item ) + void SettingsKeyword::slotItemRenamed( TQListViewItem *item ) { - QString newText = item->text( 0 ).stripWhiteSpace(); + TQString newText = item->text( 0 ).stripWhiteSpace(); if ( newText.isEmpty() ) item->setText( 0, m_oldText ); else @@ -155,7 +155,7 @@ namespace KBibTeX void SettingsKeyword::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 5, 2, 0, KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 5, 2, 0, KDialog::spacingHint(), "gridLayout" ); m_listKeywords = new KListView( this ); m_listKeywords->addColumn( i18n( "Keywords" ) ); @@ -163,19 +163,19 @@ namespace KBibTeX m_listKeywords->setFullWidth( true ); gridLayout->addMultiCellWidget( m_listKeywords, 0, 4, 0, 0 ); - m_buttonNewKeyword = new QPushButton( i18n( "keyword", "New" ), this ); - m_buttonNewKeyword->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_buttonNewKeyword = new TQPushButton( i18n( "keyword", "New" ), this ); + m_buttonNewKeyword->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); gridLayout->addWidget( m_buttonNewKeyword, 0, 1 ); - m_buttonEditKeyword = new QPushButton( i18n( "keyword", "Edit" ), this ); - m_buttonEditKeyword->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_buttonEditKeyword = new TQPushButton( i18n( "keyword", "Edit" ), this ); + m_buttonEditKeyword->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); gridLayout->addWidget( m_buttonEditKeyword, 1, 1 ); - m_buttonDeleteKeyword = new QPushButton( i18n( "keyword", "Delete" ), this ); - m_buttonDeleteKeyword->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_buttonDeleteKeyword = new TQPushButton( i18n( "keyword", "Delete" ), this ); + m_buttonDeleteKeyword->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); gridLayout->addWidget( m_buttonDeleteKeyword, 2, 1 ); - m_buttonImportKeywords = new QPushButton( i18n( "keyword", "Import" ), this ); - m_buttonImportKeywords->setIconSet( QIconSet( SmallIcon( "openfile" ) ) ); - QToolTip::add( m_buttonImportKeywords, "Import all keywords from the current BibTeX file" ); + m_buttonImportKeywords = new TQPushButton( i18n( "keyword", "Import" ), this ); + m_buttonImportKeywords->setIconSet( TQIconSet( SmallIcon( "openfile" ) ) ); + TQToolTip::add( m_buttonImportKeywords, "Import all keywords from the current BibTeX file" ); gridLayout->addWidget( m_buttonImportKeywords, 4, 1 ); connect( m_buttonImportKeywords, SIGNAL( clicked() ), this, SLOT( slotImportKeywords() ) ); @@ -183,9 +183,9 @@ namespace KBibTeX connect( m_buttonEditKeyword, SIGNAL( clicked() ), this, SLOT( slotEditKeyword() ) ); connect( m_buttonDeleteKeyword, SIGNAL( clicked() ), this, SLOT( slotDeleteKeyword() ) ); connect( m_listKeywords, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listKeywords, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listKeywords, SIGNAL( doubleClicked( QListViewItem*, const QPoint &, int ) ), this, SLOT( slotEditKeyword() ) ); - connect( m_listKeywords, SIGNAL( itemRenamed( QListViewItem* ) ), this, SLOT( slotItemRenamed( QListViewItem* ) ) ); + connect( m_listKeywords, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listKeywords, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint &, int ) ), this, SLOT( slotEditKeyword() ) ); + connect( m_listKeywords, SIGNAL( itemRenamed( TQListViewItem* ) ), this, SLOT( slotItemRenamed( TQListViewItem* ) ) ); updateGUI(); } diff --git a/src/settingskeyword.h b/src/settingskeyword.h index 516dfcb..49e3b7e 100644 --- a/src/settingskeyword.h +++ b/src/settingskeyword.h @@ -20,10 +20,10 @@ #ifndef KBIBTEXSETTINGSKEYWORD_H #define KBIBTEXSETTINGSKEYWORD_H -#include +#include class KListView; -class QPushButton; +class TQPushButton; namespace KBibTeX { @@ -31,11 +31,11 @@ namespace KBibTeX /** @author Thomas Fischer */ - class SettingsKeyword : public QWidget + class SettingsKeyword : public TQWidget { Q_OBJECT public: - SettingsKeyword( QWidget *parent = 0, const char *name = 0 ); + SettingsKeyword( TQWidget *parent = 0, const char *name = 0 ); ~SettingsKeyword(); void applyData(); @@ -49,18 +49,18 @@ namespace KBibTeX void slotEditKeyword(); void slotDeleteKeyword(); void slotImportKeywords(); - void slotItemRenamed( QListViewItem * ); + void slotItemRenamed( TQListViewItem * ); void updateGUI(); private: - QStringList *m_keywords; - QStringList m_keywordsFromFile; + TQStringList *m_keywords; + TQStringList m_keywordsFromFile; KListView *m_listKeywords; - QPushButton *m_buttonNewKeyword; - QPushButton *m_buttonEditKeyword; - QPushButton *m_buttonDeleteKeyword; - QPushButton *m_buttonImportKeywords; - QString m_oldText; + TQPushButton *m_buttonNewKeyword; + TQPushButton *m_buttonEditKeyword; + TQPushButton *m_buttonDeleteKeyword; + TQPushButton *m_buttonImportKeywords; + TQString m_oldText; void setupGUI(); }; diff --git a/src/settingssearchurl.cpp b/src/settingssearchurl.cpp index 3adfd6f..43bbfef 100644 --- a/src/settingssearchurl.cpp +++ b/src/settingssearchurl.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -36,8 +36,8 @@ namespace KBibTeX { - SettingsSearchURL::SettingsSearchURL( QWidget *parent, const char *name ) - : QWidget( parent, name ), m_counter( 1 ) + SettingsSearchURL::SettingsSearchURL( TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_counter( 1 ) { setupGUI(); } @@ -52,7 +52,7 @@ namespace KBibTeX { Settings * settings = Settings::self(); settings->searchURLs.clear(); - for ( QListViewItemIterator it( m_listviewSearchURLs ); it.current(); it++ ) + for ( TQListViewItemIterator it( m_listviewSearchURLs ); it.current(); it++ ) { Settings::SearchURL *searchURL = new Settings::SearchURL; searchURL->description = it.current() ->text( 0 ); @@ -67,7 +67,7 @@ namespace KBibTeX Settings * settings = Settings::self(); m_listviewSearchURLs->clear(); - for ( QValueList::ConstIterator it = settings->searchURLs.begin(); it != settings->searchURLs.end(); ++it ) + for ( TQValueList::ConstIterator it = settings->searchURLs.begin(); it != settings->searchURLs.end(); ++it ) { KListViewItem *item = new KListViewItem( m_listviewSearchURLs, ( *it ) ->description, ( *it ) ->includeAuthor ? i18n( "Yes" ) : i18n( "No" ), ( *it ) ->url ); item->setPixmap( 0, SmallIcon( "html" ) ); @@ -83,7 +83,7 @@ namespace KBibTeX void SettingsSearchURL::slotDelete() { - QListViewItem * item = m_listviewSearchURLs->selectedItem(); + TQListViewItem * item = m_listviewSearchURLs->selectedItem(); if ( item != NULL ) { m_listviewSearchURLs->removeItem( item ); @@ -94,7 +94,7 @@ namespace KBibTeX void SettingsSearchURL::slotEdit() { - QListViewItem * item = m_listviewSearchURLs->selectedItem(); + TQListViewItem * item = m_listviewSearchURLs->selectedItem(); if ( item != NULL ) { urlDialog( item ); @@ -123,7 +123,7 @@ namespace KBibTeX void SettingsSearchURL::setupGUI() { - QGridLayout * layout = new QGridLayout( this, 5, 2, 0, KDialog::spacingHint() ); + TQGridLayout * layout = new TQGridLayout( this, 5, 2, 0, KDialog::spacingHint() ); layout->setRowStretch( 3, 1 ); layout->setColStretch( 0, 1 ); @@ -138,53 +138,53 @@ namespace KBibTeX m_listviewSearchURLs->setMinimumWidth( 384 ); m_pushbuttonNew = new KPushButton( i18n( "search url", "New" ), this ); - m_pushbuttonNew->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_pushbuttonNew->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); layout->addWidget( m_pushbuttonNew, 0, 1 ); m_pushbuttonEdit = new KPushButton( i18n( "search url", "Edit" ), this ); - m_pushbuttonEdit->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_pushbuttonEdit->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); layout->addWidget( m_pushbuttonEdit, 1, 1 ); m_pushbuttonDelete = new KPushButton( i18n( "search url", "Delete" ), this ); - m_pushbuttonDelete->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_pushbuttonDelete->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); layout->addWidget( m_pushbuttonDelete, 2, 1 ); m_pushbuttonReset = new KPushButton( i18n( "search url", "Reset" ), this ); - m_pushbuttonReset->setIconSet( QIconSet( SmallIcon( "reload" ) ) ); + m_pushbuttonReset->setIconSet( TQIconSet( SmallIcon( "reload" ) ) ); layout->addWidget( m_pushbuttonReset, 4, 1 ); connect( m_pushbuttonNew, SIGNAL( clicked() ), this, SLOT( slotNew() ) ); connect( m_pushbuttonEdit, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); - connect( m_listviewSearchURLs, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), this, SLOT( slotEdit() ) ); + connect( m_listviewSearchURLs, SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), this, SLOT( slotEdit() ) ); connect( m_pushbuttonDelete, SIGNAL( clicked() ), this, SLOT( slotDelete() ) ); connect( m_pushbuttonReset, SIGNAL( clicked() ), this, SLOT( slotReset() ) ); - connect( m_listviewSearchURLs, SIGNAL( selectionChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listviewSearchURLs, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listviewSearchURLs, SIGNAL( onItem( QListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listviewSearchURLs, SIGNAL( selectionChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listviewSearchURLs, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listviewSearchURLs, SIGNAL( onItem( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); updateGUI(); } - void SettingsSearchURL::urlDialog( QListViewItem * item ) + void SettingsSearchURL::urlDialog( TQListViewItem * item ) { KDialogBase * dlg = new KDialogBase( this, "urldialog", TRUE, item == NULL ? i18n( "New URL" ) : i18n( "Edit URL" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, TRUE ); - QWidget *container = new QWidget( dlg, "container" ); - QGridLayout *layout = new QGridLayout( container, 3, 2, 0, KDialog::spacingHint() ); - QLabel *label = new QLabel( i18n( "Description:" ), container ); + TQWidget *container = new TQWidget( dlg, "container" ); + TQGridLayout *layout = new TQGridLayout( container, 3, 2, 0, KDialog::spacingHint() ); + TQLabel *label = new TQLabel( i18n( "Description:" ), container ); layout->addWidget( label, 0, 0 ); - QLineEdit *descr = new QLineEdit( container ); + TQLineEdit *descr = new TQLineEdit( container ); label->setBuddy( descr ); layout->addWidget( descr, 0, 1 ); - label = new QLabel( i18n( "URL:" ), container ); + label = new TQLabel( i18n( "URL:" ), container ); layout->addWidget( label, 1, 0 ); - QLineEdit *url = new QLineEdit( container ); + TQLineEdit *url = new TQLineEdit( container ); layout->addWidget( url, 1, 1 ); label->setBuddy( url ); url->setMinimumWidth( 384 ); - QToolTip::add( url, i18n( "Within the URL, '%1' will be replaced by the search term." ) ); - label = new QLabel( i18n( "Include Author:" ), container ); + TQToolTip::add( url, i18n( "Within the URL, '%1' will be replaced by the search term." ) ); + label = new TQLabel( i18n( "Include Author:" ), container ); layout->addWidget( label, 2, 0 ); - QComboBox *cbIncludeAuthor = new QComboBox( FALSE, container ); + TQComboBox *cbIncludeAuthor = new TQComboBox( FALSE, container ); layout->addWidget( cbIncludeAuthor, 2, 1 ); label->setBuddy( cbIncludeAuthor ); cbIncludeAuthor->insertItem( i18n( "Yes" ) ); @@ -199,7 +199,7 @@ namespace KBibTeX cbIncludeAuthor->setCurrentItem( item->text( 1 ) == i18n( "Yes" ) ? 0 : 1 ); } - if ( dlg->exec() == QDialog::Accepted ) + if ( dlg->exec() == TQDialog::Accepted ) { if ( item == NULL ) { diff --git a/src/settingssearchurl.h b/src/settingssearchurl.h index 7cc4f5a..da13cda 100644 --- a/src/settingssearchurl.h +++ b/src/settingssearchurl.h @@ -20,20 +20,20 @@ #ifndef SETTINGSSEARCHURL_H #define SETTINGSSEARCHURL_H -#include +#include -class QLineEdit; +class TQLineEdit; class KPushButton; class KListView; -class QListViewItem; +class TQListViewItem; namespace KBibTeX { - class SettingsSearchURL : public QWidget + class SettingsSearchURL : public TQWidget { Q_OBJECT public: - SettingsSearchURL( QWidget *parent = 0, const char *name = 0 ); + SettingsSearchURL( TQWidget *parent = 0, const char *name = 0 ); ~SettingsSearchURL(); void applyData(); @@ -60,7 +60,7 @@ namespace KBibTeX void setupGUI(); - void urlDialog( QListViewItem * item = NULL ); + void urlDialog( TQListViewItem * item = NULL ); }; } diff --git a/src/settingsuserdefinedinput.cpp b/src/settingsuserdefinedinput.cpp index dc903bc..3085814 100644 --- a/src/settingsuserdefinedinput.cpp +++ b/src/settingsuserdefinedinput.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -40,7 +40,7 @@ namespace KBibTeX { - SettingsUserDefinedInput::SettingsUserDefinedInput( QWidget *parent, const char *name ) : QWidget( parent, name ) + SettingsUserDefinedInput::SettingsUserDefinedInput( TQWidget *parent, const char *name ) : TQWidget( parent, name ) { setupGUI(); } @@ -54,7 +54,7 @@ namespace KBibTeX { Settings *settings = Settings::self( NULL ); settings->userDefinedInputFields.clear(); - for ( QListViewItemIterator it( m_listFields ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listFields ); it.current(); ++it ) { Settings::UserDefinedInputFields *udif = new Settings::UserDefinedInputFields(); udif->name = it.current()->text( 0 ); @@ -69,7 +69,7 @@ namespace KBibTeX m_listFields->clear(); Settings *settings = Settings::self( NULL ); KListViewItem *prev = NULL; - for ( QValueList::iterator it = settings->userDefinedInputFields.begin(); it != settings->userDefinedInputFields.end(); ++it ) + for ( TQValueList::iterator it = settings->userDefinedInputFields.begin(); it != settings->userDefinedInputFields.end(); ++it ) { prev = new KListViewItem( m_listFields, prev, ( *it )->name, ( *it )->label, ( *it )->inputType == FieldLineEdit::itMultiLine ? i18n( "Multiple lines" ) : i18n( "Single line" ) ); } @@ -84,7 +84,7 @@ namespace KBibTeX void SettingsUserDefinedInput::slotEditField() { - QListViewItem * item = m_listFields->selectedItem(); + TQListViewItem * item = m_listFields->selectedItem(); if ( item != NULL ) { fieldDialog( item ); @@ -95,7 +95,7 @@ namespace KBibTeX void SettingsUserDefinedInput::slotDeleteField() { - QListViewItem * item = m_listFields->selectedItem(); + TQListViewItem * item = m_listFields->selectedItem(); if ( item != NULL ) { m_listFields->removeItem( item ); @@ -106,13 +106,13 @@ namespace KBibTeX void SettingsUserDefinedInput::slotMoveUpField() { - QListViewItem *item = m_listFields->selectedItem(); + TQListViewItem *item = m_listFields->selectedItem(); if ( item != NULL && item -> itemAbove() != NULL ) { - QListViewItem *itemAbove = item->itemAbove(); + TQListViewItem *itemAbove = item->itemAbove(); for ( int i = 0; i < 3; ++i ) { - QString text = item->text( i ); + TQString text = item->text( i ); item->setText( i, itemAbove->text( i ) ); itemAbove->setText( i, text ); } @@ -124,13 +124,13 @@ namespace KBibTeX void SettingsUserDefinedInput::slotMoveDownField() { - QListViewItem *item = m_listFields->selectedItem(); + TQListViewItem *item = m_listFields->selectedItem(); if ( item != NULL && item -> itemBelow() != NULL ) { - QListViewItem *itemBelow = item->itemBelow(); + TQListViewItem *itemBelow = item->itemBelow(); for ( int i = 0; i < 3; ++i ) { - QString text = item->text( i ); + TQString text = item->text( i ); item->setText( i, itemBelow->text( i ) ); itemBelow->setText( i, text ); } @@ -142,7 +142,7 @@ namespace KBibTeX void SettingsUserDefinedInput::updateGUI() { - QListViewItem *item = m_listFields->selectedItem(); + TQListViewItem *item = m_listFields->selectedItem(); bool selected = item != NULL; m_buttonEditField->setEnabled( selected ); m_buttonDeleteField->setEnabled( selected ); @@ -159,7 +159,7 @@ namespace KBibTeX void SettingsUserDefinedInput::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 6, 2, 0, KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 5, 1 ); gridLayout->setColStretch( 0, 1 ); @@ -178,20 +178,20 @@ namespace KBibTeX gridLayout->addMultiCellWidget( m_listFields, 0, 5, 0, 0 ); m_buttonNewField = new KPushButton( i18n( "user-defined input", "New" ), this ); - m_buttonNewField->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_buttonNewField->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); gridLayout->addWidget( m_buttonNewField, 0, 1 ); m_buttonEditField = new KPushButton( i18n( "user-defined input", "Edit" ), this ); - m_buttonEditField->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_buttonEditField->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); gridLayout->addWidget( m_buttonEditField, 1, 1 ); m_buttonDeleteField = new KPushButton( i18n( "user-defined input", "Delete" ), this ); - m_buttonDeleteField->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_buttonDeleteField->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); gridLayout->addWidget( m_buttonDeleteField, 2, 1 ); m_buttonMoveUpField = new KPushButton( i18n( "user-defined input", "Up" ), this ); - m_buttonMoveUpField->setIconSet( QIconSet( SmallIcon( "up" ) ) ); + m_buttonMoveUpField->setIconSet( TQIconSet( SmallIcon( "up" ) ) ); gridLayout->addWidget( m_buttonMoveUpField, 3, 1 ); connect( m_buttonMoveUpField, SIGNAL( clicked() ), this, SLOT( slotMoveUpField() ) ); m_buttonMoveDownField = new KPushButton( i18n( "user-defined input", "Down" ), this ); - m_buttonMoveDownField->setIconSet( QIconSet( SmallIcon( "down" ) ) ); + m_buttonMoveDownField->setIconSet( TQIconSet( SmallIcon( "down" ) ) ); gridLayout->addWidget( m_buttonMoveDownField, 4, 1 ); connect( m_buttonMoveDownField, SIGNAL( clicked() ), this, SLOT( slotMoveDownField() ) ); @@ -199,29 +199,29 @@ namespace KBibTeX connect( m_buttonEditField, SIGNAL( clicked() ), this, SLOT( slotEditField() ) ); connect( m_buttonDeleteField, SIGNAL( clicked() ), this, SLOT( slotDeleteField() ) ); connect( m_listFields, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listFields, SIGNAL( doubleClicked( QListViewItem*, const QPoint &, int ) ), this, SLOT( slotEditField() ) ); - connect( m_listFields, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listFields, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint &, int ) ), this, SLOT( slotEditField() ) ); + connect( m_listFields, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); updateGUI(); } - void SettingsUserDefinedInput::fieldDialog( QListViewItem * item ) + void SettingsUserDefinedInput::fieldDialog( TQListViewItem * item ) { fieldDlg = new KDialogBase( this, "fieldDialog", TRUE, item == NULL ? i18n( "New Field" ) : i18n( "Edit Field" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, TRUE ); - QWidget *container = new QWidget( fieldDlg, "container" ); - QGridLayout *layout = new QGridLayout( container, 3, 2, 0, KDialog::spacingHint() ); - QLabel *label = new QLabel( i18n( "Name:" ), container ); + TQWidget *container = new TQWidget( fieldDlg, "container" ); + TQGridLayout *layout = new TQGridLayout( container, 3, 2, 0, KDialog::spacingHint() ); + TQLabel *label = new TQLabel( i18n( "Name:" ), container ); layout->addWidget( label, 0, 0 ); m_lineEditName = new KLineEdit( container ); label->setBuddy( m_lineEditName ); layout->addWidget( m_lineEditName, 0, 1 ); - label = new QLabel( i18n( "Label:" ), container ); + label = new TQLabel( i18n( "Label:" ), container ); layout->addWidget( label, 1, 0 ); m_lineEditLabel = new KLineEdit( container ); layout->addWidget( m_lineEditLabel, 1, 1 ); label->setBuddy( m_lineEditLabel ); m_lineEditLabel->setMinimumWidth( 384 ); - label = new QLabel( i18n( "Input Type:" ), container ); + label = new TQLabel( i18n( "Input Type:" ), container ); layout->addWidget( label, 2, 0 ); KComboBox *comboBoxInputType = new KComboBox( FALSE, container ); layout->addWidget( comboBoxInputType, 2, 1 ); @@ -241,9 +241,9 @@ namespace KBibTeX else fieldDlg->enableButton( KDialogBase::Ok, false ); - connect( m_lineEditName, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateDialogGUI() ) ); - connect( m_lineEditLabel, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateDialogGUI() ) ); - if ( fieldDlg->exec() == QDialog::Accepted ) + connect( m_lineEditName, SIGNAL( textChanged( const TQString & ) ), this, SLOT( updateDialogGUI() ) ); + connect( m_lineEditLabel, SIGNAL( textChanged( const TQString & ) ), this, SLOT( updateDialogGUI() ) ); + if ( fieldDlg->exec() == TQDialog::Accepted ) { if ( item == NULL ) { diff --git a/src/settingsuserdefinedinput.h b/src/settingsuserdefinedinput.h index a06d7b0..b0842fd 100644 --- a/src/settingsuserdefinedinput.h +++ b/src/settingsuserdefinedinput.h @@ -20,7 +20,7 @@ #ifndef KBIBTEXSETTINGSUSERDEFINEDINPUT_H #define KBIBTEXSETTINGSUSERDEFINEDINPUT_H -#include +#include class KListView; class KPushButton; @@ -32,11 +32,11 @@ namespace KBibTeX /** @author Thomas Fischer */ - class SettingsUserDefinedInput : public QWidget + class SettingsUserDefinedInput : public TQWidget { Q_OBJECT public: - SettingsUserDefinedInput( QWidget *parent = 0, const char *name = 0 ); + SettingsUserDefinedInput( TQWidget *parent = 0, const char *name = 0 ); ~SettingsUserDefinedInput(); void applyData(); @@ -66,7 +66,7 @@ namespace KBibTeX KLineEdit *m_lineEditName; void setupGUI(); - void fieldDialog( QListViewItem * item = NULL ); + void fieldDialog( TQListViewItem * item = NULL ); }; } diff --git a/src/settingsz3950.cpp b/src/settingsz3950.cpp index d2c3858..57784b9 100644 --- a/src/settingsz3950.cpp +++ b/src/settingsz3950.cpp @@ -23,12 +23,12 @@ #ifdef HAVE_YAZ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -44,13 +44,13 @@ namespace KBibTeX { - ServerListViewItem::ServerListViewItem( KListView *list, const QString &_id, Settings::Z3950Server& _server, bool _newItem ) + ServerListViewItem::ServerListViewItem( KListView *list, const TQString &_id, Settings::Z3950Server& _server, bool _newItem ) : KListViewItem( list, _server.name, _server.database ), server( _server ), id( _id ), newItem( _newItem ) { // nothing } - ServerListViewItem::ServerListViewItem( KListViewItem *item, const QString &_id, Settings::Z3950Server& _server, bool _newItem ) + ServerListViewItem::ServerListViewItem( KListViewItem *item, const TQString &_id, Settings::Z3950Server& _server, bool _newItem ) : KListViewItem( item, _server.name, _server.database ), server( _server ), id( _id ), newItem( _newItem ) { // nothing @@ -62,52 +62,52 @@ namespace KBibTeX setText( 1, server.database ); } - SettingsZ3950Edit::SettingsZ3950Edit( QString &id, Settings::Z3950Server& _server, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_id( id ), m_server( _server ), m_lineEditId( NULL ) + SettingsZ3950Edit::SettingsZ3950Edit( TQString &id, Settings::Z3950Server& _server, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_id( id ), m_server( _server ), m_lineEditId( NULL ) { - QGridLayout *layout = new QGridLayout( this, 10, 2 , 0, KDialog::spacingHint() ); - QLabel *label = NULL; + TQGridLayout *layout = new TQGridLayout( this, 10, 2 , 0, KDialog::spacingHint() ); + TQLabel *label = NULL; - label = new QLabel( i18n( "Name:" ), this ); + label = new TQLabel( i18n( "Name:" ), this ); layout->addWidget( label, 1, 0 ); m_lineEditName = new KLineEdit( m_server.name, this ); layout->addWidget( m_lineEditName, 1, 1 ); label->setBuddy( m_lineEditName ); - label = new QLabel( i18n( "Database:" ), this ); + label = new TQLabel( i18n( "Database:" ), this ); layout->addWidget( label, 2, 0 ); m_lineEditDatabase = new KLineEdit( m_server.database, this ); layout->addWidget( m_lineEditDatabase, 2, 1 ); label->setBuddy( m_lineEditDatabase ); - label = new QLabel( i18n( "Host:" ), this ); + label = new TQLabel( i18n( "Host:" ), this ); layout->addWidget( label, 3, 0 ); m_lineEditHost = new KLineEdit( m_server.host, this ); layout->addWidget( m_lineEditHost, 3, 1 ); label->setBuddy( m_lineEditHost ); - label = new QLabel( i18n( "Port:" ), this ); + label = new TQLabel( i18n( "Port:" ), this ); layout->addWidget( label, 4, 0 ); - m_spinBoxPort = new QSpinBox( this ); + m_spinBoxPort = new TQSpinBox( this ); m_spinBoxPort->setMinValue( 1 ); m_spinBoxPort->setMaxValue( 65535 ); m_spinBoxPort->setValue( m_server.port ); layout->addWidget( m_spinBoxPort, 4, 1 ); label->setBuddy( m_spinBoxPort ); - label = new QLabel( i18n( "User:" ), this ); + label = new TQLabel( i18n( "User:" ), this ); layout->addWidget( label, 5, 0 ); m_lineEditUser = new KLineEdit( m_server.user, this ); layout->addWidget( m_lineEditUser, 5, 1 ); label->setBuddy( m_lineEditUser ); - label = new QLabel( i18n( "Password:" ), this ); + label = new TQLabel( i18n( "Password:" ), this ); layout->addWidget( label, 6, 0 ); m_lineEditPassword = new KLineEdit( m_server.password, this ); layout->addWidget( m_lineEditPassword, 6, 1 ); label->setBuddy( m_lineEditPassword ); - label = new QLabel( i18n( "Syntax:" ), this ); + label = new TQLabel( i18n( "Syntax:" ), this ); layout->addWidget( label, 7, 0 ); m_comboBoxSyntax = new KComboBox( true, this ); layout->addWidget( m_comboBoxSyntax, 7, 1 ); @@ -119,14 +119,14 @@ namespace KBibTeX m_comboBoxSyntax->insertItem( "usmarc" ); m_comboBoxSyntax->setCurrentText( m_server.syntax ); - label = new QLabel( i18n( "Locale:" ), this ); + label = new TQLabel( i18n( "Locale:" ), this ); layout->addWidget( label, 8, 0 ); m_comboBoxLocale = new KComboBox( true, this ); m_comboBoxLocale->setCurrentText( m_server.locale ); layout->addWidget( m_comboBoxLocale, 8, 1 ); label->setBuddy( m_comboBoxLocale ); - label = new QLabel( i18n( "Charset:" ), this ); + label = new TQLabel( i18n( "Charset:" ), this ); layout->addWidget( label, 9, 0 ); m_comboBoxCharset = new KComboBox( true, this ); layout->addWidget( m_comboBoxCharset, 9, 1 ); @@ -144,7 +144,7 @@ namespace KBibTeX // nothing } - int SettingsZ3950Edit::execute( QWidget *parent, QString &id, Settings::Z3950Server &server ) + int SettingsZ3950Edit::execute( TQWidget *parent, TQString &id, Settings::Z3950Server &server ) { KDialogBase *dlg = new KDialogBase( parent, "SettingsZ3950Edit", true, i18n( "Edit Z39.50 Server" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, false ); SettingsZ3950Edit *edit = new SettingsZ3950Edit( id, server, dlg, "SettingsZ3950Edit" ); @@ -169,13 +169,13 @@ namespace KBibTeX if ( m_id.isEmpty() ) { - m_id = QString( m_server.name ).lower().replace( QRegExp( "[^a-z0-9]" ), "" ); - qDebug( "Setting id to %s", m_id.latin1() ); + m_id = TQString( m_server.name ).lower().replace( TQRegExp( "[^a-z0-9]" ), "" ); + tqDebug( "Setting id to %s", m_id.latin1() ); } } - SettingsZ3950::SettingsZ3950( QWidget *parent, const char *name ) - : QWidget( parent, name ) + SettingsZ3950::SettingsZ3950( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { setupGUI(); } @@ -190,7 +190,7 @@ namespace KBibTeX Settings *settings = Settings::self(); settings->z3950_ServerList.clear(); - for ( QListViewItemIterator it( m_listServers ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listServers ); it.current(); ++it ) { ServerListViewItem *item = dynamic_cast( *it ); settings->z3950_ServerList[item->id] = item->server; @@ -202,7 +202,7 @@ namespace KBibTeX Settings *settings = Settings::self(); m_listServers->clear(); - for ( QMap::Iterator it = settings->z3950_ServerList.begin(); it != settings-> z3950_ServerList.end(); ++it ) + for ( TQMap::Iterator it = settings->z3950_ServerList.begin(); it != settings-> z3950_ServerList.end(); ++it ) { ServerListViewItem *item = new ServerListViewItem( m_listServers, it.key(), it.data(), false ); item->setPixmap( 0, SmallIcon( "server" ) ); @@ -218,7 +218,7 @@ namespace KBibTeX ServerListViewItem * item = new ServerListViewItem( m_listServers, "", server, true ); item->setPixmap( 0, SmallIcon( "server" ) ); m_listServers->setSelected( item, TRUE ); - QTimer::singleShot( 100, this, SLOT( slotEditServer() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEditServer() ) ); } void SettingsZ3950::slotEditServer() @@ -226,7 +226,7 @@ namespace KBibTeX ServerListViewItem * item = static_cast( m_listServers->selectedItem() ); if ( item != NULL ) { - if ( SettingsZ3950Edit::execute( this, item->id, item->server ) == QDialog::Accepted ) + if ( SettingsZ3950Edit::execute( this, item->id, item->server ) == TQDialog::Accepted ) { item->refresh(); emit configChanged(); @@ -255,12 +255,12 @@ namespace KBibTeX Settings::Z3950Server server = item->server; item->server = itemAbove->server; itemAbove->server = server; - QString id = item->id; + TQString id = item->id; item->id = itemAbove->id; itemAbove->id = id; for ( int i = 0; i < 2; ++i ) { - QString swap = item->text( i ); + TQString swap = item->text( i ); item->setText( i, itemAbove->text( i ) ); itemAbove->setText( i, swap ); } @@ -278,12 +278,12 @@ namespace KBibTeX Settings::Z3950Server server = item->server; item->server = itemBelow->server; itemBelow->server = server; - QString id = item->id; + TQString id = item->id; item->id = itemBelow->id; itemBelow->id = id; for ( int i = 0; i < 2; ++i ) { - QString swap = item->text( i ); + TQString swap = item->text( i ); item->setText( i, itemBelow->text( i ) ); itemBelow->setText( i, swap ); } @@ -305,7 +305,7 @@ namespace KBibTeX void SettingsZ3950::updateGUI() { - QListViewItem *item = m_listServers->selectedItem(); + TQListViewItem *item = m_listServers->selectedItem(); bool selected = item != NULL; m_buttonEditServer->setEnabled( selected ); m_buttonDeleteServer->setEnabled( selected ); @@ -315,7 +315,7 @@ namespace KBibTeX void SettingsZ3950::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 7, 2, 0, KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 7, 2, 0, KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 5, 1 ); gridLayout->setColStretch( 0, 1 ); @@ -328,32 +328,32 @@ namespace KBibTeX m_listServers->setAllColumnsShowFocus( true ); gridLayout->addMultiCellWidget( m_listServers, 0, 7, 0, 0 ); connect( m_listServers, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listServers, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listServers, SIGNAL( doubleClicked( QListViewItem*, const QPoint &, int ) ), this, SLOT( slotEditServer() ) ); + connect( m_listServers, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listServers, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint &, int ) ), this, SLOT( slotEditServer() ) ); m_buttonNewServer = new KPushButton( i18n( "z3950 server", "New" ), this ); - m_buttonNewServer->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_buttonNewServer->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); gridLayout->addWidget( m_buttonNewServer, 0, 1 ); connect( m_buttonNewServer, SIGNAL( clicked() ), this, SLOT( slotNewServer() ) ); m_buttonEditServer = new KPushButton( i18n( "z3950 server", "Edit" ), this ); - m_buttonEditServer->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_buttonEditServer->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); gridLayout->addWidget( m_buttonEditServer, 1, 1 ); connect( m_buttonEditServer, SIGNAL( clicked() ), this, SLOT( slotEditServer() ) ); m_buttonDeleteServer = new KPushButton( i18n( "z3950 server", "Delete" ), this ); - m_buttonDeleteServer->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_buttonDeleteServer->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); gridLayout->addWidget( m_buttonDeleteServer, 2, 1 ); connect( m_buttonDeleteServer, SIGNAL( clicked() ), this, SLOT( slotDeleteServer() ) ); m_buttonMoveUpServer = new KPushButton( i18n( "z3950 server", "Up" ), this ); - m_buttonMoveUpServer->setIconSet( QIconSet( SmallIcon( "up" ) ) ); + m_buttonMoveUpServer->setIconSet( TQIconSet( SmallIcon( "up" ) ) ); gridLayout->addWidget( m_buttonMoveUpServer, 3, 1 ); connect( m_buttonMoveUpServer, SIGNAL( clicked() ), this, SLOT( slotMoveUpServer() ) ); m_buttonMoveDownServer = new KPushButton( i18n( "z3950 server", "Down" ), this ); - m_buttonMoveDownServer->setIconSet( QIconSet( SmallIcon( "down" ) ) ); + m_buttonMoveDownServer->setIconSet( TQIconSet( SmallIcon( "down" ) ) ); gridLayout->addWidget( m_buttonMoveDownServer, 4, 1 ); connect( m_buttonMoveDownServer, SIGNAL( clicked() ), this, SLOT( slotMoveDownServer() ) ); m_buttonResetToDefault = new KPushButton( i18n( "z3950 server", "Reset" ), this ); - m_buttonResetToDefault->setIconSet( QIconSet( SmallIcon( "reload" ) ) ); + m_buttonResetToDefault->setIconSet( TQIconSet( SmallIcon( "reload" ) ) ); gridLayout->addWidget( m_buttonResetToDefault, 6, 1 ); connect( m_buttonResetToDefault, SIGNAL( clicked() ), this, SLOT( slotResetToDefault() ) ); } diff --git a/src/settingsz3950.h b/src/settingsz3950.h index 1b694db..084444f 100644 --- a/src/settingsz3950.h +++ b/src/settingsz3950.h @@ -26,11 +26,11 @@ #ifndef KBIBTEXSETTINGSZ3950_H #define KBIBTEXSETTINGSZ3950_H -#include +#include #include -class QSpinBox; +class TQSpinBox; class KPushButton; class KListView; class KLineEdit; @@ -41,41 +41,41 @@ namespace KBibTeX class ServerListViewItem: public KListViewItem { public: - ServerListViewItem( KListView *, const QString &, Settings::Z3950Server& server, bool newItem ); - ServerListViewItem( KListViewItem *, const QString &, Settings::Z3950Server& server, bool newItem ); + ServerListViewItem( KListView *, const TQString &, Settings::Z3950Server& server, bool newItem ); + ServerListViewItem( KListViewItem *, const TQString &, Settings::Z3950Server& server, bool newItem ); void refresh(); public: Settings::Z3950Server server; - QString id; + TQString id; bool newItem; }; /** @author Thomas Fischer */ - class SettingsZ3950Edit : public QWidget + class SettingsZ3950Edit : public TQWidget { Q_OBJECT public: ~SettingsZ3950Edit(); - static int execute( QWidget *parent, QString &id, Settings::Z3950Server &server ); + static int execute( TQWidget *parent, TQString &id, Settings::Z3950Server &server ); protected slots: void slotApply(); protected: - SettingsZ3950Edit( QString &id, Settings::Z3950Server&, QWidget *parent = 0, const char *name = 0 ); + SettingsZ3950Edit( TQString &id, Settings::Z3950Server&, TQWidget *parent = 0, const char *name = 0 ); private: - QString& m_id; + TQString& m_id; Settings::Z3950Server& m_server; KLineEdit *m_lineEditId; KLineEdit *m_lineEditName; KLineEdit *m_lineEditHost; - QSpinBox *m_spinBoxPort; + TQSpinBox *m_spinBoxPort; KLineEdit *m_lineEditDatabase; KLineEdit *m_lineEditUser; KLineEdit *m_lineEditPassword; @@ -87,11 +87,11 @@ namespace KBibTeX /** @author Thomas Fischer */ - class SettingsZ3950 : public QWidget + class SettingsZ3950 : public TQWidget { Q_OBJECT public: - SettingsZ3950( QWidget *parent = 0, const char *name = 0 ); + SettingsZ3950( TQWidget *parent = 0, const char *name = 0 ); ~SettingsZ3950(); void applyData(); diff --git a/src/sidebar.cpp b/src/sidebar.cpp index 399cabf..e2202f0 100644 --- a/src/sidebar.cpp +++ b/src/sidebar.cpp @@ -17,13 +17,13 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -44,8 +44,8 @@ namespace KBibTeX BibTeX::EntryField::ftAuthor, BibTeX::EntryField::ftBookTitle, BibTeX::EntryField::ftJournal, BibTeX::EntryField::ftTitle, BibTeX::EntryField::ftYear, BibTeX::EntryField::ftKeywords }; - SideBar::SideBar( bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_bibtexFile( NULL ), m_isReadOnly( isReadOnly ), m_popupMenu( NULL ) + SideBar::SideBar( bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_bibtexFile( NULL ), m_isReadOnly( isReadOnly ), m_popupMenu( NULL ) { setupGUI(); } @@ -70,7 +70,7 @@ namespace KBibTeX if ( bibtexFile != NULL ) m_bibtexFile = bibtexFile; - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); setEnabled( FALSE ); BibTeX::EntryField::FieldType fieldType = m_buttonToggleShowAll->isOn() ? ( BibTeX::EntryField::FieldType )( m_listTypeList->currentItem() + ( int ) BibTeX::EntryField::ftAbstract ) : importantFields[ m_listTypeList->currentItem()]; @@ -78,50 +78,50 @@ namespace KBibTeX m_listAvailableItems->clear(); if ( m_bibtexFile != NULL ) { - QMap allValues = m_bibtexFile->getAllValuesAsStringListWithCount( fieldType ); - for ( QMap::ConstIterator it = allValues.constBegin(); it != allValues.constEnd();++it ) + TQMap allValues = m_bibtexFile->getAllValuesAsStringListWithCount( fieldType ); + for ( TQMap::ConstIterator it = allValues.constBegin(); it != allValues.constEnd();++it ) { - QString text = it.key(); + TQString text = it.key(); if ( !text.startsWith( "other" ) ) - new SideBarListViewItem( m_listAvailableItems, QString::number( it.data() ), text ); + new SideBarListViewItem( m_listAvailableItems, TQString::number( it.data() ), text ); } } setEnabled( TRUE ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } - void SideBar::resizeEvent( QResizeEvent *event ) + void SideBar::resizeEvent( TQResizeEvent *event ) { - QSize widgetSize = size(); + TQSize widgetSize = size(); setEnabled( widgetSize.width() > 3 && widgetSize.height() > 3 ); - QWidget::resizeEvent( event ); + TQWidget::resizeEvent( event ); } void SideBar::setupGUI() { - QGridLayout * layout = new QGridLayout( this, 2, 3, 0, KDialog::spacingHint() ); + TQGridLayout * layout = new TQGridLayout( this, 2, 3, 0, KDialog::spacingHint() ); layout->setColStretch( 0, 0 ); layout->setColStretch( 1, 10 ); layout->setColStretch( 2, 0 ); - m_buttonToggleShowAll = new QToolButton( this ); + m_buttonToggleShowAll = new TQToolButton( this ); layout->addWidget( m_buttonToggleShowAll, 0, 0 ); - QIconSet showAllPixmap = KGlobal::iconLoader() ->loadIconSet( "taskbar", KIcon::Small ); + TQIconSet showAllPixmap = KGlobal::iconLoader() ->loadIconSet( "taskbar", KIcon::Small ); m_buttonToggleShowAll->setIconSet( showAllPixmap ); m_buttonToggleShowAll->setToggleButton( TRUE ); - QToolTip::add( m_buttonToggleShowAll, i18n( "Toggle between showing all fields or only important fields" ) ); + TQToolTip::add( m_buttonToggleShowAll, i18n( "Toggle between showing all fields or only important fields" ) ); - m_listTypeList = new QComboBox( FALSE, this ); + m_listTypeList = new TQComboBox( FALSE, this ); layout->addWidget( m_listTypeList, 0, 1 ); - QToolTip::add( m_listTypeList, i18n( "Filter this sidebar for a given field" ) ); + TQToolTip::add( m_listTypeList, i18n( "Filter this sidebar for a given field" ) ); - m_buttonToggleMultiSelect = new QToolButton( this ); + m_buttonToggleMultiSelect = new TQToolButton( this ); layout->addWidget( m_buttonToggleMultiSelect, 0, 2 ); showAllPixmap = KGlobal::iconLoader() ->loadIconSet( "planner", KIcon::Small ); m_buttonToggleMultiSelect->setIconSet( showAllPixmap ); m_buttonToggleMultiSelect->setToggleButton( TRUE ); - QToolTip::add( m_buttonToggleMultiSelect, i18n( "Toggle between selecting only one item or multiple items (AND-connected in search)" ) ); + TQToolTip::add( m_buttonToggleMultiSelect, i18n( "Toggle between selecting only one item or multiple items (AND-connected in search)" ) ); m_listAvailableItems = new KListView( this ); m_listAvailableItems->addColumn( i18n( "#" ) ); @@ -138,8 +138,8 @@ namespace KBibTeX connect( m_listTypeList, SIGNAL( activated( int ) ), this, SLOT( refreshLists() ) ); connect( m_buttonToggleShowAll, SIGNAL( toggled( bool ) ), this, SLOT( toggleShowAll( bool ) ) ); connect( m_buttonToggleMultiSelect, SIGNAL( toggled( bool ) ), this, SLOT( toggleMultiSelect( bool ) ) ); - connect( m_listAvailableItems, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), this, SLOT( showContextMenu( QListViewItem*, const QPoint& ) ) ); - connect( m_listAvailableItems, SIGNAL( itemRenamed( QListViewItem*, int, const QString& ) ), this, SLOT( endRenaming( QListViewItem*, int, const QString& ) ) ); + connect( m_listAvailableItems, SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), this, SLOT( showContextMenu( TQListViewItem*, const TQPoint& ) ) ); + connect( m_listAvailableItems, SIGNAL( itemRenamed( TQListViewItem*, int, const TQString& ) ), this, SLOT( endRenaming( TQListViewItem*, int, const TQString& ) ) ); toggleShowAll( FALSE ); } @@ -154,9 +154,9 @@ namespace KBibTeX { BibTeX::EntryField::FieldType fieldType = m_buttonToggleShowAll->isOn() ? ( BibTeX::EntryField::FieldType )( m_listTypeList->currentItem() + ( int ) BibTeX::EntryField::ftAbstract ) : importantFields[ m_listTypeList->currentItem()]; - QString text = ""; + TQString text = ""; int countSelected = 0; - for ( QListViewItemIterator it( m_listAvailableItems, QListViewItemIterator::Selected ); it.current(); ++it, ++countSelected ) + for ( TQListViewItemIterator it( m_listAvailableItems, TQListViewItemIterator::Selected ); it.current(); ++it, ++countSelected ) { if ( !text.isEmpty() ) text += " "; text += it.current()->text( 1 ); @@ -190,12 +190,12 @@ namespace KBibTeX void SideBar::toggleMultiSelect( bool multiSelect ) { - m_listAvailableItems->setSelectionMode( multiSelect ? QListView::Extended : QListView::Single ); + m_listAvailableItems->setSelectionMode( multiSelect ? TQListView::Extended : TQListView::Single ); m_listAvailableItems->clearSelection(); prepareSearch(); } - void SideBar::showContextMenu( QListViewItem * item, const QPoint & pos ) + void SideBar::showContextMenu( TQListViewItem * item, const TQPoint & pos ) { if ( item != NULL && !m_isReadOnly && m_popupMenu != NULL ) m_popupMenu->exec( pos ); @@ -203,7 +203,7 @@ namespace KBibTeX void SideBar::startRenaming() { - QListViewItem * item = m_listAvailableItems->selectedItem(); + TQListViewItem * item = m_listAvailableItems->selectedItem(); if ( item == NULL ) item = m_listAvailableItems->currentItem(); @@ -215,7 +215,7 @@ namespace KBibTeX } } - void SideBar::endRenaming( QListViewItem * item, int , const QString & text ) + void SideBar::endRenaming( TQListViewItem * item, int , const TQString & text ) { item->setRenameEnabled( 1, FALSE ); BibTeX::EntryField::FieldType fieldType = m_buttonToggleShowAll->isOn() ? ( BibTeX::EntryField::FieldType )( m_listTypeList->currentItem() + ( int ) BibTeX::EntryField::ftAbstract ) : importantFields[ m_listTypeList->currentItem()]; @@ -228,12 +228,12 @@ namespace KBibTeX emit valueRenamed(); } - SideBarListViewItem::SideBarListViewItem( QListView *parent, QString label1, QString label2 ) : QListViewItem( parent, label1, label2 ) + SideBarListViewItem::SideBarListViewItem( TQListView *parent, TQString label1, TQString label2 ) : TQListViewItem( parent, label1, label2 ) { // nothing } - int SideBarListViewItem::compare( QListViewItem* item, int column, bool ascending ) const + int SideBarListViewItem::compare( TQListViewItem* item, int column, bool ascending ) const { if ( column == 0 ) { @@ -249,7 +249,7 @@ namespace KBibTeX } } - return QListViewItem::compare( item, column, ascending ); + return TQListViewItem::compare( item, column, ascending ); } } #include "sidebar.moc" diff --git a/src/sidebar.h b/src/sidebar.h index 250cd8c..b612544 100644 --- a/src/sidebar.h +++ b/src/sidebar.h @@ -20,50 +20,50 @@ #ifndef KBIBTEXSIDEBAR_H #define KBIBTEXSIDEBAR_H -#include -#include +#include +#include #include #include -class QComboBox; -class QToolButton; +class TQComboBox; +class TQToolButton; class KListView; -class QListViewItem; +class TQListViewItem; class KPopupMenu; namespace KBibTeX { - class SideBar : public QWidget + class SideBar : public TQWidget { Q_OBJECT public: - SideBar( bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + SideBar( bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~SideBar(); void restoreState(); void setReadOnly( bool isReadOnly ); signals: - void selected( const QString& text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType ); + void selected( const TQString& text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType ); void valueRenamed(); public slots: void refreshLists( BibTeX::File *bibtexFile = NULL ); protected: - void resizeEvent( QResizeEvent *event ); + void resizeEvent( TQResizeEvent *event ); private: BibTeX::File *m_bibtexFile; - QToolButton *m_buttonToggleShowAll; - QToolButton *m_buttonToggleMultiSelect; - QComboBox *m_listTypeList; + TQToolButton *m_buttonToggleShowAll; + TQToolButton *m_buttonToggleMultiSelect; + TQComboBox *m_listTypeList; KListView *m_listAvailableItems; static const BibTeX::EntryField::FieldType importantFields[ 6 ]; bool m_isReadOnly; KPopupMenu *m_popupMenu; - QString m_oldText; + TQString m_oldText; void setupGUI(); @@ -71,17 +71,17 @@ namespace KBibTeX void prepareSearch(); void toggleShowAll( bool showAll ); void toggleMultiSelect( bool showAll ); - void showContextMenu( QListViewItem * item, const QPoint & pos ); + void showContextMenu( TQListViewItem * item, const TQPoint & pos ); void startRenaming(); - void endRenaming( QListViewItem * item, int col, const QString & text ); + void endRenaming( TQListViewItem * item, int col, const TQString & text ); }; - class SideBarListViewItem: QListViewItem + class SideBarListViewItem: TQListViewItem { public: - SideBarListViewItem( QListView *parent, QString label1, QString label2 ); + SideBarListViewItem( TQListView *parent, TQString label1, TQString label2 ); - int compare( QListViewItem* item, int column, bool ascending ) const; + int compare( TQListViewItem* item, int column, bool ascending ) const; }; } diff --git a/src/value.cpp b/src/value.cpp index c31514e..b95e374 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "value.h" @@ -31,38 +31,38 @@ namespace BibTeX // nothing } - ValueTextInterface::ValueTextInterface( const QString& text ) : m_text( text ) + ValueTextInterface::ValueTextInterface( const TQString& text ) : m_text( text ) { // nothing } - void ValueTextInterface::setText( const QString& text ) + void ValueTextInterface::setText( const TQString& text ) { m_text = text; } - QString ValueTextInterface::text() const + TQString ValueTextInterface::text() const { return m_text; } - QString ValueTextInterface::simplifiedText() const + TQString ValueTextInterface::simplifiedText() const { - return text().replace( QRegExp( "\\\\[A-Za-z0-9]+" ), "" ).replace( '{', "" ).replace( '}', "" ); + return text().replace( TQRegExp( "\\\\[A-Za-z0-9]+" ), "" ).replace( '{', "" ).replace( '}', "" ); } - void ValueTextInterface::replace( const QString &before, const QString &after ) + void ValueTextInterface::replace( const TQString &before, const TQString &after ) { if ( before == text() || before == simplifiedText() ) setText( after ); } - bool ValueTextInterface::containsPattern( const QString &pattern, bool caseSensitive ) + bool ValueTextInterface::containsPattern( const TQString &pattern, bool caseSensitive ) { return text().contains( pattern, caseSensitive ) || simplifiedText().contains( pattern, caseSensitive ); } - ValueItem::ValueItem( const QString& text ) : ValueTextInterface( text ) + ValueItem::ValueItem( const TQString& text ) : ValueTextInterface( text ) { // nothing } @@ -72,7 +72,7 @@ namespace BibTeX // nothing } - Keyword::Keyword( const QString& text ) : ValueTextInterface( text ) + Keyword::Keyword( const TQString& text ) : ValueTextInterface( text ) { // nothing } @@ -87,18 +87,18 @@ namespace BibTeX // nothing } - KeywordContainer::KeywordContainer( const QString& text ) : ValueItem( text ) + KeywordContainer::KeywordContainer( const TQString& text ) : ValueItem( text ) { setText( text ); } - KeywordContainer::KeywordContainer( KeywordContainer *other ) : ValueItem( QString::null ) + KeywordContainer::KeywordContainer( KeywordContainer *other ) : ValueItem( TQString::null ) { - for ( QValueList::Iterator it = other->keywords.begin(); it != other->keywords.end(); ++it ) + for ( TQValueList::Iterator it = other->keywords.begin(); it != other->keywords.end(); ++it ) keywords.append(( *it )->clone() ); } - KeywordContainer::KeywordContainer( const QStringList& list ) : ValueItem( QString::null ) + KeywordContainer::KeywordContainer( const TQStringList& list ) : ValueItem( TQString::null ) { setList( list ); } @@ -108,56 +108,56 @@ namespace BibTeX return new KeywordContainer( this ); } - void KeywordContainer::setList( const QStringList& list ) + void KeywordContainer::setList( const TQStringList& list ) { keywords.clear(); - for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) keywords.append( new Keyword( *it ) ); } - void KeywordContainer::append( const QString& text ) + void KeywordContainer::append( const TQString& text ) { bool contains = FALSE; - for ( QValueList::ConstIterator it = keywords.begin(); !contains && it != keywords.end(); ++it ) - contains = QString::compare(( *it )->text(), text ) == 0; + for ( TQValueList::ConstIterator it = keywords.begin(); !contains && it != keywords.end(); ++it ) + contains = TQString::compare(( *it )->text(), text ) == 0; if ( contains == 0 ) keywords.append( new Keyword( text ) ); } - void KeywordContainer::remove( const QString& text ) + void KeywordContainer::remove( const TQString& text ) { bool contains = FALSE; - for ( QValueList::Iterator it = keywords.begin(); !contains && it != keywords.end(); ++it ) - if ( QString::compare(( *it )->text(), text ) == 0 ) + for ( TQValueList::Iterator it = keywords.begin(); !contains && it != keywords.end(); ++it ) + if ( TQString::compare(( *it )->text(), text ) == 0 ) { keywords.remove( it ); break; } } - void KeywordContainer::setText( const QString& text ) + void KeywordContainer::setText( const TQString& text ) { ValueItem::setText( text ); - QRegExp splitRegExp; + TQRegExp splitRegExp; if ( text.contains( ";" ) ) - splitRegExp = QRegExp( "\\s*;\\s*" ); + splitRegExp = TQRegExp( "\\s*;\\s*" ); else - splitRegExp = QRegExp( "\\s*,\\s*" ); + splitRegExp = TQRegExp( "\\s*,\\s*" ); keywords.clear(); - QStringList keywordList = QStringList::split( splitRegExp, text, FALSE ); - for ( QStringList::ConstIterator it = keywordList.begin(); it != keywordList.end(); ++it ) + TQStringList keywordList = TQStringList::split( splitRegExp, text, FALSE ); + for ( TQStringList::ConstIterator it = keywordList.begin(); it != keywordList.end(); ++it ) keywords.append( new Keyword( *it ) ); } - QString KeywordContainer::text() const + TQString KeywordContainer::text() const { - QString result; + TQString result; bool first = true; - for ( QValueList::ConstIterator it = keywords.begin(); it != keywords.end(); ++it ) + for ( TQValueList::ConstIterator it = keywords.begin(); it != keywords.end(); ++it ) { if ( !first ) result.append( "; " ); @@ -167,18 +167,18 @@ namespace BibTeX return result; } - void KeywordContainer::replace( const QString &before, const QString &after ) + void KeywordContainer::replace( const TQString &before, const TQString &after ) { - for ( QValueList::ConstIterator it = keywords.begin(); it != keywords.end(); ++it ) + for ( TQValueList::ConstIterator it = keywords.begin(); it != keywords.end(); ++it ) ( *it )->replace( before, after ); } - Person::Person( const QString& text, bool firstNameFirst ) : ValueTextInterface( text ), m_firstNameFirst( firstNameFirst ) + Person::Person( const TQString& text, bool firstNameFirst ) : ValueTextInterface( text ), m_firstNameFirst( firstNameFirst ) { setText( text ); } - Person::Person( const QString& firstName, const QString& lastName, bool firstNameFirst ) : ValueTextInterface( QString( firstName ).append( " " ).append( lastName ) ), m_firstName( firstName ), m_lastName( lastName ), m_firstNameFirst( firstNameFirst ) + Person::Person( const TQString& firstName, const TQString& lastName, bool firstNameFirst ) : ValueTextInterface( TQString( firstName ).append( " " ).append( lastName ) ), m_firstName( firstName ), m_lastName( lastName ), m_firstNameFirst( firstNameFirst ) { // nothing } @@ -188,11 +188,11 @@ namespace BibTeX return new Person( m_firstName, m_lastName, m_firstNameFirst ); } - void Person::setText( const QString& text ) + void Person::setText( const TQString& text ) { ValueTextInterface::setText( text ); - QStringList segments; + TQStringList segments; bool containsComma = splitName( text, segments ); m_firstName = ""; m_lastName = ""; @@ -242,7 +242,7 @@ namespace BibTeX { /** there are segments left for the first name */ m_firstName = *segments.begin(); - for ( QStringList::Iterator it = ++segments.begin(); from > 1; ++it, --from ) + for ( TQStringList::Iterator it = ++segments.begin(); from > 1; ++it, --from ) { m_firstName.append( " " ); m_firstName.append( *it ); @@ -271,12 +271,12 @@ namespace BibTeX } } - QString Person::text() const + TQString Person::text() const { return text( m_firstNameFirst ); } - QString Person::text( bool firstNameFirst ) const + TQString Person::text( bool firstNameFirst ) const { if ( m_firstName.isEmpty() ) @@ -285,21 +285,21 @@ namespace BibTeX return firstNameFirst ? m_firstName + " " + m_lastName : m_lastName + ", " + m_firstName; } - QString Person::firstName() + TQString Person::firstName() { return m_firstName; } - QString Person::lastName() + TQString Person::lastName() { return m_lastName; } /** Splits a name into single words. If the name's text was reversed (Last, First), the result will be true and the comma will be added to segments. Otherwise the functions result will be false. This function respects protecting {...}. */ - bool Person::splitName( const QString& text, QStringList& segments ) + bool Person::splitName( const TQString& text, TQStringList& segments ) { int bracketCounter = 0; bool result = FALSE; - QString buffer = ""; + TQString buffer = ""; for ( unsigned int pos = 0; pos < text.length(); ++pos ) { @@ -336,12 +336,12 @@ namespace BibTeX return result; } - PersonContainer::PersonContainer( bool firstNameFirst ) : ValueItem( QString::null ), m_firstNameFirst( firstNameFirst ) + PersonContainer::PersonContainer( bool firstNameFirst ) : ValueItem( TQString::null ), m_firstNameFirst( firstNameFirst ) { // nothing } - PersonContainer::PersonContainer( const QString& text, bool firstNameFirst ) : ValueItem( text ), m_firstNameFirst( firstNameFirst ) + PersonContainer::PersonContainer( const TQString& text, bool firstNameFirst ) : ValueItem( text ), m_firstNameFirst( firstNameFirst ) { persons.append( new Person( text, m_firstNameFirst ) ); } @@ -349,24 +349,24 @@ namespace BibTeX ValueItem *PersonContainer::clone() { PersonContainer *result = new PersonContainer( m_firstNameFirst ); - for ( QValueList::ConstIterator it = persons.begin(); it != persons.end(); ++it ) + for ( TQValueList::ConstIterator it = persons.begin(); it != persons.end(); ++it ) result->persons.append(( *it )->clone() ); return result; } - void PersonContainer::setText( const QString& text ) + void PersonContainer::setText( const TQString& text ) { ValueTextInterface::setText( text ); - qDebug( "You cannot set a text ('%s') to a Value object", text.latin1() ); + tqDebug( "You cannot set a text ('%s') to a Value object", text.latin1() ); } - QString PersonContainer::text() const + TQString PersonContainer::text() const { - QString result; + TQString result; bool first = TRUE; - for ( QValueList::ConstIterator it = persons.begin(); it != persons.end(); ++it ) + for ( TQValueList::ConstIterator it = persons.begin(); it != persons.end(); ++it ) { if ( !first ) result.append( " and " ); @@ -378,13 +378,13 @@ namespace BibTeX return result; } - void PersonContainer::replace( const QString &before, const QString &after ) + void PersonContainer::replace( const TQString &before, const TQString &after ) { - for ( QValueList::ConstIterator it = persons.begin(); it != persons.end(); ++it ) + for ( TQValueList::ConstIterator it = persons.begin(); it != persons.end(); ++it ) ( *it )->replace( before, after ); } - MacroKey::MacroKey( const QString& text ) : ValueItem( text ) + MacroKey::MacroKey( const TQString& text ) : ValueItem( text ) { m_isValid = isValidInternal(); } @@ -394,7 +394,7 @@ namespace BibTeX return new MacroKey( text() ); } - void MacroKey::setText( const QString& text ) + void MacroKey::setText( const TQString& text ) { ValueItem::setText( text ); m_isValid = isValidInternal(); @@ -407,10 +407,10 @@ namespace BibTeX bool MacroKey::isValidInternal() { - return !text().contains( QRegExp( "![-.:/+_a-zA-Z0-9]" ) ); + return !text().contains( TQRegExp( "![-.:/+_a-zA-Z0-9]" ) ); } - PlainText::PlainText( const QString& text ) : ValueItem( text ) + PlainText::PlainText( const TQString& text ) : ValueItem( text ) { // nothing } @@ -420,18 +420,18 @@ namespace BibTeX return new PlainText( text() ); } - Value::Value() : ValueTextInterface( QString::null ) + Value::Value() : ValueTextInterface( TQString::null ) { // nothing } Value::Value( const Value *other ) : ValueTextInterface( other ) { - for ( QValueList::ConstIterator it = other->items.begin(); it != other->items.end(); ++it ) + for ( TQValueList::ConstIterator it = other->items.begin(); it != other->items.end(); ++it ) items.append(( *it )->clone() ); } - Value::Value( const QString& text, bool isMacroKey ): ValueTextInterface( text ) + Value::Value( const TQString& text, bool isMacroKey ): ValueTextInterface( text ) { ValueItem *item = NULL; if ( isMacroKey ) @@ -441,25 +441,25 @@ namespace BibTeX items.append( item ); } - void Value::setText( const QString& text ) + void Value::setText( const TQString& text ) { ValueTextInterface::setText( text ); - qDebug( "You cannot set a text ('%s') to a Value object", text.latin1() ); + tqDebug( "You cannot set a text ('%s') to a Value object", text.latin1() ); } - QString Value::text() const + TQString Value::text() const { - QString result; + TQString result; - for ( QValueList::ConstIterator it = items.begin(); it != items.end(); ++it ) + for ( TQValueList::ConstIterator it = items.begin(); it != items.end(); ++it ) result.append(( *it )->text() ); return result; } - void Value::replace( const QString &before, const QString &after ) + void Value::replace( const TQString &before, const TQString &after ) { - for ( QValueList::ConstIterator it = items.begin(); it != items.end(); ++it ) + for ( TQValueList::ConstIterator it = items.begin(); it != items.end(); ++it ) ( *it )->replace( before, after ); } } diff --git a/src/value.h b/src/value.h index 3c7d876..8b1f711 100644 --- a/src/value.h +++ b/src/value.h @@ -20,9 +20,9 @@ #ifndef BIBTEXVALUE_H #define BIBTEXVALUE_H -#include +#include -class QStringList; +class TQStringList; namespace BibTeX { @@ -30,23 +30,23 @@ namespace BibTeX { public: ValueTextInterface( const ValueTextInterface* other ); - ValueTextInterface( const QString& text ); + ValueTextInterface( const TQString& text ); virtual ~ValueTextInterface() {}; - virtual void setText( const QString& text ); - virtual QString text() const; - QString simplifiedText() const; - virtual void replace( const QString &before, const QString &after ); - virtual bool containsPattern( const QString &pattern, bool caseSensitive ); + virtual void setText( const TQString& text ); + virtual TQString text() const; + TQString simplifiedText() const; + virtual void replace( const TQString &before, const TQString &after ); + virtual bool containsPattern( const TQString &pattern, bool caseSensitive ); private: - QString m_text; + TQString m_text; }; class ValueItem: public ValueTextInterface { public: - ValueItem( const QString& text ); + ValueItem( const TQString& text ); virtual ValueItem *clone() { @@ -58,7 +58,7 @@ namespace BibTeX { public: Keyword( Keyword *other ); - Keyword( const QString& text ); + Keyword( const TQString& text ); Keyword *clone(); }; @@ -67,55 +67,55 @@ namespace BibTeX { public: KeywordContainer(); - KeywordContainer( const QString& text ); + KeywordContainer( const TQString& text ); KeywordContainer( KeywordContainer *other ); - KeywordContainer( const QStringList& list ); + KeywordContainer( const TQStringList& list ); ValueItem *clone(); - void setList( const QStringList& list ); - void append( const QString& text ); - void remove( const QString& text ); - void setText( const QString& text ); - QString text() const; - void replace( const QString &before, const QString &after ); - - QValueList keywords; + void setList( const TQStringList& list ); + void append( const TQString& text ); + void remove( const TQString& text ); + void setText( const TQString& text ); + TQString text() const; + void replace( const TQString &before, const TQString &after ); + + TQValueList keywords; }; class Person: public ValueTextInterface { public: - Person( const QString& text, bool firstNameFirst = FALSE ); - Person( const QString& firstName, const QString& lastName, bool firstNameFirst = FALSE ); + Person( const TQString& text, bool firstNameFirst = FALSE ); + Person( const TQString& firstName, const TQString& lastName, bool firstNameFirst = FALSE ); Person *clone(); - void setText( const QString& text ); - QString text() const; - QString text( bool firstNameFirst ) const; + void setText( const TQString& text ); + TQString text() const; + TQString text( bool firstNameFirst ) const; - QString firstName(); - QString lastName(); + TQString firstName(); + TQString lastName(); protected: - QString m_firstName; - QString m_lastName; + TQString m_firstName; + TQString m_lastName; bool m_firstNameFirst; - bool splitName( const QString& text, QStringList& segments ); + bool splitName( const TQString& text, TQStringList& segments ); }; class PersonContainer: public ValueItem { public: PersonContainer( bool firstNameFirst = FALSE ); - PersonContainer( const QString& text, bool firstNameFirst = FALSE ); + PersonContainer( const TQString& text, bool firstNameFirst = FALSE ); ValueItem *clone(); - void setText( const QString& text ); - QString text() const; - void replace( const QString &before, const QString &after ); + void setText( const TQString& text ); + TQString text() const; + void replace( const TQString &before, const TQString &after ); - QValueList persons; + TQValueList persons; private: bool m_firstNameFirst; @@ -128,18 +128,18 @@ namespace BibTeX bool isValidInternal(); public: - MacroKey( const QString& text ); + MacroKey( const TQString& text ); ValueItem *clone(); - void setText( const QString& text ); + void setText( const TQString& text ); bool isValid(); }; class PlainText: public ValueItem { public: - PlainText( const QString& text ); + PlainText( const TQString& text ); ValueItem *clone(); }; @@ -149,13 +149,13 @@ namespace BibTeX public: Value(); Value( const Value *other ); - Value( const QString& text, bool isMacroKey = false ); + Value( const TQString& text, bool isMacroKey = false ); - void setText( const QString& text ); - QString text() const; - void replace( const QString &before, const QString &after ); + void setText( const TQString& text ); + TQString text() const; + void replace( const TQString &before, const TQString &after ); - QValueList items; + TQValueList items; }; } diff --git a/src/valuewidget.cpp b/src/valuewidget.cpp index 1455a9e..fdbba3a 100644 --- a/src/valuewidget.cpp +++ b/src/valuewidget.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -34,16 +34,16 @@ namespace KBibTeX { - QDialog::DialogCode ValueWidget::execute( const QString& title, BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, QWidget *parent, const char *name ) + TQDialog::DialogCode ValueWidget::execute( const TQString& title, BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, TQWidget *parent, const char *name ) { - KDialogBase * dlg = new KDialogBase( parent, name, TRUE, QString( i18n( "Edit field '%1'" ) ).arg( title ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, TRUE ); + KDialogBase * dlg = new KDialogBase( parent, name, TRUE, TQString( i18n( "Edit field '%1'" ) ).arg( title ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, TRUE ); ValueWidget* valueWidget = new ValueWidget( fieldType, value, isReadOnly, dlg, "kbibtexvaluewidget" ); dlg->setMainWidget( valueWidget ); connect( dlg, SIGNAL( okClicked() ), valueWidget, SLOT( apply() ) ); - QDialog::DialogCode result = ( QDialog::DialogCode )dlg->exec(); - if ( isReadOnly ) result = QDialog::Rejected; + TQDialog::DialogCode result = ( TQDialog::DialogCode )dlg->exec(); + if ( isReadOnly ) result = TQDialog::Rejected; delete( valueWidget ); delete( dlg ); @@ -51,8 +51,8 @@ namespace KBibTeX return result; } - ValueWidget::ValueWidget( BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_fieldType( fieldType ), m_value( value ), m_newValueCounter( 0 ), m_isReadOnly( isReadOnly ) + ValueWidget::ValueWidget( BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_fieldType( fieldType ), m_value( value ), m_newValueCounter( 0 ), m_isReadOnly( isReadOnly ) { setupGUI(); reset(); @@ -65,12 +65,12 @@ namespace KBibTeX // nothing } - void ValueWidget::applyList( QStringList& list ) + void ValueWidget::applyList( TQStringList& list ) { if ( m_fieldType == BibTeX::EntryField::ftKeywords ) { BibTeX::KeywordContainer *container = new BibTeX::KeywordContainer(); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) container->keywords.append( new BibTeX::Keyword( *it ) ); m_value->items.append( container ); } @@ -78,13 +78,13 @@ namespace KBibTeX { Settings * settings = Settings::self(); BibTeX::PersonContainer *container = new BibTeX::PersonContainer(); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) container->persons.append( new BibTeX::Person( *it, settings->editing_FirstNameFirst ) ); m_value->items.append( container ); } else { - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) m_value->items.append( new BibTeX::PlainText( *it ) ); } @@ -95,15 +95,15 @@ namespace KBibTeX { if ( m_isReadOnly ) return; - QStringList list; + TQStringList list; m_value->items.clear(); - QListViewItem *item = m_listViewValue->firstChild(); + TQListViewItem *item = m_listViewValue->firstChild(); while ( item != NULL ) { - QCheckListItem * checkItem = dynamic_cast( item ); - QString text = checkItem->text( 0 ); + TQCheckListItem * checkItem = dynamic_cast( item ); + TQString text = checkItem->text( 0 ); - if ( checkItem->state() == QCheckListItem::On ) + if ( checkItem->state() == TQCheckListItem::On ) { if ( !list.isEmpty() ) applyList( list ); m_value->items.append( new BibTeX::MacroKey( text ) ); @@ -121,21 +121,21 @@ namespace KBibTeX { m_listViewValue->clear(); - QCheckListItem *after = NULL; - for ( QValueList::ConstIterator it = m_value->items.begin(); it != m_value->items.end(); ++it ) + TQCheckListItem *after = NULL; + for ( TQValueList::ConstIterator it = m_value->items.begin(); it != m_value->items.end(); ++it ) { BibTeX::MacroKey *macroKey = dynamic_cast( *it ); - QCheckListItem *item = new QCheckListItem( m_listViewValue, after, ( *it )->text(), QCheckListItem::CheckBox ); + TQCheckListItem *item = new TQCheckListItem( m_listViewValue, after, ( *it )->text(), TQCheckListItem::CheckBox ); after = item; - item->setState( macroKey != NULL ? QCheckListItem::On : QCheckListItem::Off ); + item->setState( macroKey != NULL ? TQCheckListItem::On : TQCheckListItem::Off ); item->setRenameEnabled( 0, !m_isReadOnly ); } } void ValueWidget::slotAdd() { - QCheckListItem * item = new QCheckListItem( m_listViewValue, m_listViewValue->lastItem(), QString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewValue%1" ) ).arg( m_newValueCounter++ ), QCheckListItem::CheckBox ); - item->setState( QCheckListItem::Off ); + TQCheckListItem * item = new TQCheckListItem( m_listViewValue, m_listViewValue->lastItem(), TQString( i18n( "May only contain ASCII characters, in case of doubt keep English form", "NewValue%1" ) ).arg( m_newValueCounter++ ), TQCheckListItem::CheckBox ); + item->setState( TQCheckListItem::Off ); item->setRenameEnabled( 0, !m_isReadOnly ); m_listViewValue->setSelected( item, TRUE ); slotEdit(); @@ -143,17 +143,17 @@ namespace KBibTeX void ValueWidget::slotEdit() { - QListViewItem * item = m_listViewValue->selectedItem(); + TQListViewItem * item = m_listViewValue->selectedItem(); if ( item != NULL ) item->startRename( 0 ); } void ValueWidget::slotToggle() { - QListViewItem * item = m_listViewValue->selectedItem(); + TQListViewItem * item = m_listViewValue->selectedItem(); if ( item != NULL ) { - QCheckListItem * checkItem = dynamic_cast( item ); + TQCheckListItem * checkItem = dynamic_cast( item ); if ( checkItem != NULL ) checkItem->setOn( !checkItem->isOn() ); } @@ -161,7 +161,7 @@ namespace KBibTeX void ValueWidget::slotDelete() { - QListViewItem * item = m_listViewValue->selectedItem(); + TQListViewItem * item = m_listViewValue->selectedItem(); if ( item != NULL ) delete item; updateGUI(); @@ -169,7 +169,7 @@ namespace KBibTeX void ValueWidget::slotUp() { - QListViewItem * item = m_listViewValue->selectedItem(); + TQListViewItem * item = m_listViewValue->selectedItem(); if ( item != NULL && item -> itemAbove() != NULL ) { item->itemAbove() ->moveItem( item ); @@ -179,7 +179,7 @@ namespace KBibTeX void ValueWidget::slotDown() { - QListViewItem * item = m_listViewValue->selectedItem(); + TQListViewItem * item = m_listViewValue->selectedItem(); if ( item != NULL && item -> itemBelow() != NULL ) { item->moveItem( item->itemBelow() ); @@ -199,15 +199,15 @@ namespace KBibTeX void ValueWidget::setupGUI() { - QGridLayout * layout = new QGridLayout( this, 8, 2, 0, KDialog::spacingHint() ); + TQGridLayout * layout = new TQGridLayout( this, 8, 2, 0, KDialog::spacingHint() ); layout->setRowStretch( 7, 1 ); - QLabel *label = new QLabel( i18n( "Checked entries are string keys, unchecked entries are quoted text." ), this ); + TQLabel *label = new TQLabel( i18n( "Checked entries are string keys, unchecked entries are quoted text." ), this ); layout->addWidget( label, 0, 0 ); - m_listViewValue = new QListView( this ); + m_listViewValue = new TQListView( this ); layout->addMultiCellWidget( m_listViewValue, 1, 7, 0, 0 ); - m_listViewValue->setDefaultRenameAction( m_isReadOnly ? QListView::Reject : QListView::Accept ); + m_listViewValue->setDefaultRenameAction( m_isReadOnly ? TQListView::Reject : TQListView::Accept ); m_listViewValue->addColumn( i18n( "Text" ) ); m_listViewValue->setSorting( -1, TRUE ); m_listViewValue->setAllColumnsShowFocus( TRUE ); @@ -215,38 +215,38 @@ namespace KBibTeX m_listViewValue->header() ->setStretchEnabled( TRUE, 0 ); m_listViewValue->setEnabled( !m_isReadOnly ); connect( m_listViewValue, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listViewValue, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listViewValue, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listViewValue, SIGNAL( clicked( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listViewValue, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); - m_pushButtonAdd = new QPushButton( i18n( "Add" ), this ); + m_pushButtonAdd = new TQPushButton( i18n( "Add" ), this ); layout->addWidget( m_pushButtonAdd, 1, 1 ); - m_pushButtonAdd->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_pushButtonAdd->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); m_pushButtonAdd->setEnabled( !m_isReadOnly ); connect( m_pushButtonAdd, SIGNAL( clicked() ), this, SLOT( slotAdd() ) ); - m_pushButtonEdit = new QPushButton( i18n( "Edit" ), this ); + m_pushButtonEdit = new TQPushButton( i18n( "Edit" ), this ); layout->addWidget( m_pushButtonEdit, 2, 1 ); - m_pushButtonEdit->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_pushButtonEdit->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); connect( m_pushButtonEdit, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); - m_pushButtonToggle = new QPushButton( i18n( "Toggle" ), this ); + m_pushButtonToggle = new TQPushButton( i18n( "Toggle" ), this ); layout->addWidget( m_pushButtonToggle, 3, 1 ); - m_pushButtonToggle->setIconSet( QIconSet( SmallIcon( "flag" ) ) ); + m_pushButtonToggle->setIconSet( TQIconSet( SmallIcon( "flag" ) ) ); connect( m_pushButtonToggle, SIGNAL( clicked() ), this, SLOT( slotToggle() ) ); - m_pushButtonDelete = new QPushButton( i18n( "Delete" ), this ); + m_pushButtonDelete = new TQPushButton( i18n( "Delete" ), this ); layout->addWidget( m_pushButtonDelete, 4, 1 ); - m_pushButtonDelete->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_pushButtonDelete->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); connect( m_pushButtonDelete, SIGNAL( clicked() ), this, SLOT( slotDelete() ) ); - m_pushButtonUp = new QPushButton( i18n( "Up" ), this ); + m_pushButtonUp = new TQPushButton( i18n( "Up" ), this ); layout->addWidget( m_pushButtonUp, 5, 1 ); - m_pushButtonUp->setIconSet( QIconSet( SmallIcon( "up" ) ) ); + m_pushButtonUp->setIconSet( TQIconSet( SmallIcon( "up" ) ) ); connect( m_pushButtonUp, SIGNAL( clicked() ), this, SLOT( slotUp() ) ); - m_pushButtonDown = new QPushButton( i18n( "Down" ), this ); + m_pushButtonDown = new TQPushButton( i18n( "Down" ), this ); layout->addWidget( m_pushButtonDown, 6, 1 ); - m_pushButtonDown->setIconSet( QIconSet( SmallIcon( "down" ) ) ); + m_pushButtonDown->setIconSet( TQIconSet( SmallIcon( "down" ) ) ); connect( m_pushButtonDown, SIGNAL( clicked() ), this, SLOT( slotDown() ) ); } diff --git a/src/valuewidget.h b/src/valuewidget.h index 094bf1a..5a31fc4 100644 --- a/src/valuewidget.h +++ b/src/valuewidget.h @@ -20,14 +20,14 @@ #ifndef KBIBTEXVALUEWIDGET_H #define KBIBTEXVALUEWIDGET_H -#include -#include +#include +#include #include #include -class QListView; -class QPushButton; +class TQListView; +class TQPushButton; namespace KBibTeX { @@ -35,11 +35,11 @@ namespace KBibTeX /** @author Thomas Fischer */ - class ValueWidget : public QWidget + class ValueWidget : public TQWidget { Q_OBJECT public: - static QDialog::DialogCode execute( const QString& title, BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + static TQDialog::DialogCode execute( const TQString& title, BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); private slots: void apply( ); @@ -55,21 +55,21 @@ namespace KBibTeX private: BibTeX::EntryField::FieldType m_fieldType; BibTeX::Value *m_value; - QListView *m_listViewValue; - QPushButton *m_pushButtonAdd; - QPushButton *m_pushButtonEdit; - QPushButton *m_pushButtonToggle; - QPushButton *m_pushButtonDelete; - QPushButton *m_pushButtonUp; - QPushButton *m_pushButtonDown; + TQListView *m_listViewValue; + TQPushButton *m_pushButtonAdd; + TQPushButton *m_pushButtonEdit; + TQPushButton *m_pushButtonToggle; + TQPushButton *m_pushButtonDelete; + TQPushButton *m_pushButtonUp; + TQPushButton *m_pushButtonDown; int m_newValueCounter; bool m_isReadOnly; - ValueWidget( BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, QWidget *parent = 0, const char *name = 0 ); + ValueWidget( BibTeX::EntryField::FieldType fieldType, BibTeX::Value *value, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 ); ~ValueWidget(); void setupGUI(); - void applyList( QStringList& list ); + void applyList( TQStringList& list ); }; } diff --git a/src/webquery.cpp b/src/webquery.cpp index f1b44e3..dd15343 100644 --- a/src/webquery.cpp +++ b/src/webquery.cpp @@ -17,19 +17,19 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -70,8 +70,8 @@ namespace KBibTeX { - WebQueryWidget::WebQueryWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ), lineEditQuery( NULL ), spinBoxMaxHits( NULL ) + WebQueryWidget::WebQueryWidget( TQWidget *parent, const char *name ) + : TQWidget( parent, name ), lineEditQuery( NULL ), spinBoxMaxHits( NULL ) { // nothing } @@ -83,28 +83,28 @@ namespace KBibTeX void WebQueryWidget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearSearchText ); - QLabel *label = new QLabel( i18n( "Search &term:" ), this ); + TQLabel *label = new TQLabel( i18n( "Search &term:" ), this ); hLayout->addWidget( label ); lineEditQuery = new KLineEdit( this ); hLayout->addWidget( lineEditQuery ); label->setBuddy( lineEditQuery ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); hLayout->setStretchFactor( lineEditQuery, 4 ); KCompletion *completionQuery = lineEditQuery->completionObject(); - label = new QLabel( i18n( "&Number of results:" ), this ); + label = new TQLabel( i18n( "&Number of results:" ), this ); hLayout->addWidget( label ); - spinBoxMaxHits = new QSpinBox( 1, 250, 1, this ); + spinBoxMaxHits = new TQSpinBox( 1, 250, 1, this ); spinBoxMaxHits->setValue( 10 ); hLayout->addWidget( spinBoxMaxHits ); label->setBuddy( spinBoxMaxHits ); @@ -112,19 +112,19 @@ namespace KBibTeX vLayout->addStretch( 0 ); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); } - void WebQueryWidget::slotTextChanged( const QString& text ) + void WebQueryWidget::slotTextChanged( const TQString& text ) { slotTextChanged( text, false ); } - void WebQueryWidget::slotTextChanged( const QString& text, bool delayed ) + void WebQueryWidget::slotTextChanged( const TQString& text, bool delayed ) { bool doEnable = !text.stripWhiteSpace().replace( '$', "" ).isEmpty(); if ( delayed && doEnable ) - QTimer::singleShot( 100, this, SLOT( slotEnableSearchTrue() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEnableSearchTrue() ) ); else if ( !delayed ) emit enableSearch( doEnable ); } @@ -134,7 +134,7 @@ namespace KBibTeX emit enableSearch( true ); } - WebQuery::WebQuery( QWidget *parent ): QObject(), m_parent( parent ), m_progressDialog( NULL ), m_currentJob( NULL ) + WebQuery::WebQuery( TQWidget *parent ): TQObject(), m_parent( parent ), m_progressDialog( NULL ), m_currentJob( NULL ) { // nothing } @@ -150,7 +150,7 @@ namespace KBibTeX if ( m_progressDialog != NULL ) delete m_progressDialog; m_aborted = false; - m_progressDialog = new KProgressDialog( m_parent, "WebQuery_progressDialog", i18n( "Searching" ), QString( i18n( "Searching %1" ) ).arg( title() ) ); + m_progressDialog = new KProgressDialog( m_parent, "WebQuery_progressDialog", i18n( "Searching" ), TQString( i18n( "Searching %1" ) ).arg( title() ) ); m_progressDialog->progressBar()->setMinimumWidth( 256 ); m_progressDialog->setAutoClose( true ); m_progressDialog->setMinimumDuration( 10 ); @@ -190,54 +190,54 @@ namespace KBibTeX m_progressDialog->progressBar()->setProgress( m_currentStage * 100 ); } - QString WebQuery::download( const KURL& url ) + TQString WebQuery::download( const KURL& url ) { - QString data = downloadHTML( url ); - if ( data == QString::null ) - return QString::null; + TQString data = downloadHTML( url ); + if ( data == TQString::null ) + return TQString::null; /** post-processing */ - if ( data != QString::null ) + if ( data != TQString::null ) { - data.replace( QRegExp( "]*>" ), "\n" ); - data.replace( QRegExp( "]*>" ), "" ); + data.replace( TQRegExp( "]*>" ), "\n" ); + data.replace( TQRegExp( "]*>" ), "" ); data.replace( "@import", "" );/// JavaScript import? } return data; } - QString WebQuery::downloadHTML( const KURL& url ) + TQString WebQuery::downloadHTML( const KURL& url ) { - if ( m_currentJob != NULL ) return QString::null; + if ( m_currentJob != NULL ) return TQString::null; - qDebug( "WebQuery::download( %s )", url.prettyURL().latin1() ); + tqDebug( "WebQuery::download( %s )", url.prettyURL().latin1() ); m_incomingData = ""; m_currentJobTotalSize = -1; m_currentJob = KIO::get( url, false, false ); connect( m_currentJob, SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), this, SLOT( slotSetJobTotalSize( KIO::Job*, KIO::filesize_t ) ) ); connect( m_currentJob, SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), this, SLOT( slotSetJobProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( m_currentJob, SIGNAL( data( KIO::Job*, const QByteArray & ) ), this, SLOT( slotJobData( KIO::Job*, const QByteArray & ) ) ); + connect( m_currentJob, SIGNAL( data( KIO::Job*, const TQByteArray & ) ), this, SLOT( slotJobData( KIO::Job*, const TQByteArray & ) ) ); connect( m_currentJob, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotJobFinished( KIO::Job* ) ) ); - qApp->eventLoop()->enterLoop(); + tqApp->eventLoop()->enterLoop(); return m_incomingData; } - BibTeX::File *WebQuery::downloadBibTeXFile( const KURL& url, QTextStream::Encoding encoding ) + BibTeX::File *WebQuery::downloadBibTeXFile( const KURL& url, TQTextStream::Encoding encoding ) { - QString data = download( url ); - if ( data == QString::null ) + TQString data = download( url ); + if ( data == TQString::null ) return NULL; BibTeX::FileImporterBibTeX importer( FALSE ); importer.setIgnoreComments( TRUE ); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream ts( &buffer ); + TQTextStream ts( &buffer ); ts.setEncoding( encoding ); ts << data << endl; buffer.close(); @@ -262,10 +262,10 @@ namespace KBibTeX m_progressDialog->progressBar()->setProgress( m_currentStage * 100 + min( 100, size * 100 / m_currentJobTotalSize ) ); } - void WebQuery::slotJobData( KIO::Job *job, const QByteArray &data ) + void WebQuery::slotJobData( KIO::Job *job, const TQByteArray &data ) { if ( job != m_currentJob ) return; - QCString dataStr = QCString( data, data.size() + 1 ); + TQCString dataStr = TQCString( data, data.size() + 1 ); if ( data.size() > 0 ) m_incomingData.append( dataStr ); } @@ -277,13 +277,13 @@ namespace KBibTeX if ( job->error() ) { job->showErrorDialog(); - m_incomingData = QString::null; + m_incomingData = TQString::null; } enterNextStage(); - qApp->eventLoop()->exitLoop(); + tqApp->eventLoop()->exitLoop(); } - WebQueryWizard::WebQueryWizard( KDialogBase *dlg, const char* name ) : QWidget( dlg, name ), m_dlg( dlg ), m_pushButtonSearch( NULL ) + WebQueryWizard::WebQueryWizard( KDialogBase *dlg, const char* name ) : TQWidget( dlg, name ), m_dlg( dlg ), m_pushButtonSearch( NULL ) { setupGUI( ); @@ -301,14 +301,14 @@ namespace KBibTeX saveWindowSize( config ); } - void WebQueryWizard::showEvent( QShowEvent * ) + void WebQueryWizard::showEvent( TQShowEvent * ) { KConfig * config = kapp->config(); config->setGroup( "WebQueryWizard" ); restoreWindowSize( config ); } - int WebQueryWizard::execute( QWidget *parent, QValueList &results ) + int WebQueryWizard::execute( TQWidget *parent, TQValueList &results ) { KDialogBase *dlg = new KDialogBase( parent, "WebQueryWizard", true, i18n( "Import" ), KDialogBase::Ok | KDialogBase::Cancel, ( KDialogBase::ButtonCode )0, true ); WebQueryWizard *wiz = new WebQueryWizard( dlg, "WebQueryWizard" ); @@ -319,9 +319,9 @@ namespace KBibTeX results.clear(); int result = dlg->exec(); - if ( result == QDialog::Accepted ) + if ( result == TQDialog::Accepted ) { - QListViewItemIterator it = wiz->m_checkBoxImportAll->isChecked() ? QListViewItemIterator( wiz->m_listViewResults ) : QListViewItemIterator( wiz->m_listViewResults, QListViewItemIterator::Selected ); + TQListViewItemIterator it = wiz->m_checkBoxImportAll->isChecked() ? TQListViewItemIterator( wiz->m_listViewResults ) : TQListViewItemIterator( wiz->m_listViewResults, TQListViewItemIterator::Selected ); while ( it.current() ) { ResultsListViewItem *item = dynamic_cast( it.current() ); @@ -339,7 +339,7 @@ namespace KBibTeX return result; } - void WebQueryWizard::previewEntry( QListViewItem *item ) + void WebQueryWizard::previewEntry( TQListViewItem *item ) { ResultsListViewItem *rlvi = dynamic_cast( item ); if ( rlvi != NULL ) @@ -351,7 +351,7 @@ namespace KBibTeX void WebQueryWizard::importEnableChanging( ) { - QListViewItemIterator it( m_listViewResults, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_listViewResults, TQListViewItemIterator::Selected ); emit changeButtonOK(( m_checkBoxImportAll->isChecked() && m_listViewResults->childCount() > 0 ) || it.current() != NULL ); } @@ -360,11 +360,11 @@ namespace KBibTeX { if ( index < 0 || index >= ( int )m_webQueries.size() ) return; - m_pushButtonSearch->setCaption( QString( i18n( "Search %1" ) ).arg( m_webQueries[index]->title() ) ); + m_pushButtonSearch->setCaption( TQString( i18n( "Search %1" ) ).arg( m_webQueries[index]->title() ) ); m_disclaimerLabel->setText( m_webQueries[index]->disclaimer() ); m_disclaimerLabel->setURL( m_webQueries[index]->disclaimerURL() ); - QToolTip::remove( m_disclaimerLabel ); - QToolTip::add( m_disclaimerLabel, m_webQueries[index]->disclaimerURL() ); + TQToolTip::remove( m_disclaimerLabel ); + TQToolTip::add( m_disclaimerLabel, m_webQueries[index]->disclaimerURL() ); m_widgetStackQueries->raiseWidget( m_webQueries[index]->widget() ); m_pushButtonSearch->setEnabled( m_webQueries[index]->widget()->searchPossible() ); } @@ -381,7 +381,7 @@ namespace KBibTeX setEnabled( FALSE ); m_dlg->enableButtonCancel( FALSE ); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); m_listViewResults->clear(); connect( m_webQueries[index], SIGNAL( foundEntry( BibTeX::Entry*, bool ) ), this, SLOT( addHit( BibTeX::Entry*, bool ) ) ); connect( m_webQueries[index], SIGNAL( endSearch( WebQuery::Status ) ), this, SLOT( endSearch( WebQuery::Status ) ) ); @@ -397,7 +397,7 @@ namespace KBibTeX setEnabled( TRUE ); m_dlg->enableButtonCancel( TRUE ); importEnableChanging(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( status == WebQuery::statusInsufficientPermissions ) KMessageBox::sorry( this, i18n( "You do not have the necessary permissions to query data from this service." ) ); } @@ -415,7 +415,7 @@ namespace KBibTeX m_pushButtonSearch->setEnabled( enabled ); } - void WebQueryWizard::openURL( const QString& url ) + void WebQueryWizard::openURL( const TQString& url ) { Settings::openUrl( KURL( url ), this ); } @@ -424,24 +424,24 @@ namespace KBibTeX { Settings * settings = Settings::self(); setMinimumSize( 640, 384 ); - QGridLayout *layout = new QGridLayout( this, 5, 4, 0, KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( this, 5, 4, 0, KDialog::spacingHint() ); layout->setColStretch( 2, 1 ); layout->setRowStretch( 3, 1 ); - QLabel *label = new QLabel( i18n( "&Engine:" ), this ); + TQLabel *label = new TQLabel( i18n( "&Engine:" ), this ); layout->addWidget( label, 0, 0 ); m_comboBoxEngines = new KComboBox( FALSE, this ); label->setBuddy( m_comboBoxEngines ); layout->addWidget( m_comboBoxEngines, 0, 1 ); connect( m_comboBoxEngines, SIGNAL( activated( int ) ), this, SLOT( otherEngineSelected( int ) ) ); - m_widgetStackQueries = new QWidgetStack( this ); + m_widgetStackQueries = new TQWidgetStack( this ); layout->addMultiCellWidget( m_widgetStackQueries, 1, 2, 0, 2 ); setupQueries(); m_pushButtonSearch = new KPushButton( i18n( "&Search" ), this ); layout->addWidget( m_pushButtonSearch, 0, 3 ); - m_pushButtonSearch->setIconSet( QIconSet( SmallIcon( "find" ) ) ); + m_pushButtonSearch->setIconSet( TQIconSet( SmallIcon( "find" ) ) ); m_pushButtonSearch->setEnabled( FALSE ); m_listViewResults = new KListView( this ); @@ -455,23 +455,23 @@ namespace KBibTeX m_listViewResults->header() ->setFont( KGlobalSettings::generalFont() ); m_listViewResults->setAllColumnsShowFocus( TRUE ); m_listViewResults->setFullWidth( true ); - m_listViewResults->setSelectionMode( QListView::Extended ); + m_listViewResults->setSelectionMode( TQListView::Extended ); layout->addMultiCellWidget( m_listViewResults, 3, 3, 0, 3 ); - connect( m_listViewResults, SIGNAL( executed( QListViewItem* ) ), this, SLOT( previewEntry( QListViewItem* ) ) ); - connect( m_listViewResults, SIGNAL( returnPressed( QListViewItem* ) ), this, SLOT( previewEntry( QListViewItem* ) ) ); + connect( m_listViewResults, SIGNAL( executed( TQListViewItem* ) ), this, SLOT( previewEntry( TQListViewItem* ) ) ); + connect( m_listViewResults, SIGNAL( returnPressed( TQListViewItem* ) ), this, SLOT( previewEntry( TQListViewItem* ) ) ); - QHBoxLayout *horizontalLayout = new QHBoxLayout(); + TQHBoxLayout *horizontalLayout = new TQHBoxLayout(); layout->addMultiCellLayout( horizontalLayout, 4, 4, 0, 3 ); m_disclaimerLabel = new KURLLabel( this ); horizontalLayout->addWidget( m_disclaimerLabel ); horizontalLayout->setStretchFactor( m_disclaimerLabel, 4 ); - m_checkBoxImportAll = new QCheckBox( i18n( "Import all hits" ), this ); - m_checkBoxImportAll->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + m_checkBoxImportAll = new TQCheckBox( i18n( "Import all hits" ), this ); + m_checkBoxImportAll->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); horizontalLayout->addWidget( m_checkBoxImportAll ); - connect( m_disclaimerLabel, SIGNAL( leftClickedURL( const QString& ) ), this, SLOT( openURL( const QString& ) ) ); + connect( m_disclaimerLabel, SIGNAL( leftClickedURL( const TQString& ) ), this, SLOT( openURL( const TQString& ) ) ); connect( m_listViewResults, SIGNAL( selectionChanged( ) ), this, SLOT( importEnableChanging( ) ) ); - connect( m_listViewResults, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( importEnableChanging( ) ) ); + connect( m_listViewResults, SIGNAL( clicked( TQListViewItem* ) ), this, SLOT( importEnableChanging( ) ) ); connect( m_checkBoxImportAll, SIGNAL( toggled( bool ) ), this, SLOT( importEnableChanging( ) ) ); connect( m_pushButtonSearch, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); } @@ -511,7 +511,7 @@ namespace KBibTeX query = new WebQueryZMATH( this ); m_webQueries.append( query ); - for ( QValueList::Iterator it = m_webQueries.begin(); it != m_webQueries.end(); ++it ) + for ( TQValueList::Iterator it = m_webQueries.begin(); it != m_webQueries.end(); ++it ) { m_comboBoxEngines->insertItem(( *it )->title() ); m_widgetStackQueries->addWidget(( *it )->widget() ); @@ -523,8 +523,8 @@ namespace KBibTeX /* This function was taken form KMainWindow of KDE 3.5 and modified to fit KBibTeX */ void WebQueryWizard::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 @@ -539,10 +539,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 @@ -558,20 +558,20 @@ namespace KBibTeX void WebQueryWizard::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() ) @@ -587,7 +587,7 @@ namespace KBibTeX m_dlg->resize( size.width(), height() ); else m_dlg->resize( size ); - // QWidget::showMaximized() is both insufficient and broken + // TQWidget::showMaximized() is both insufficient and broken KWin::setState( m_dlg->winId(), state ); #else if ( size.width() > desk.width() || size.height() > desk.height() ) @@ -598,7 +598,7 @@ namespace KBibTeX } } - ResultsListViewItem::ResultsListViewItem( QListView * parent, BibTeX::Entry * entry ) : QListViewItem( parent ), m_entry( entry ) + ResultsListViewItem::ResultsListViewItem( TQListView * parent, BibTeX::Entry * entry ) : TQListViewItem( parent ), m_entry( entry ) { BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftTitle ); if ( field != NULL && field->value() != NULL ) @@ -609,9 +609,9 @@ namespace KBibTeX BibTeX::PersonContainer* personContainer = dynamic_cast( field->value()->items.first() ); if ( personContainer != NULL ) { - QStringList authors; - QValueList list = personContainer->persons; - for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + TQStringList authors; + TQValueList list = personContainer->persons; + for ( TQValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) authors.append(( *it ) ->text() ); setText( 1, authors.join( " and " ).replace( '{', "" ).replace( '}', "" ).replace( '~', ' ' ) ); } diff --git a/src/webquery.h b/src/webquery.h index f4b46b4..d0bcfdb 100644 --- a/src/webquery.h +++ b/src/webquery.h @@ -20,8 +20,8 @@ #ifndef KBIBTEXWEBQUERY_H #define KBIBTEXWEBQUERY_H -#include -#include +#include +#include #include #include @@ -31,10 +31,10 @@ #include "entry.h" -class QWidget; -class QFrame; -class QCheckBox; -class QSpinBox; +class TQWidget; +class TQFrame; +class TQCheckBox; +class TQSpinBox; class KComboBox; class KListView; class KPushButton; @@ -44,15 +44,15 @@ namespace KBibTeX /** @author Thomas Fischer */ - class WebQueryWidget : public QWidget + class WebQueryWidget : public TQWidget { Q_OBJECT public: - WebQueryWidget( QWidget *parent, const char *name = 0 ); + WebQueryWidget( TQWidget *parent, const char *name = 0 ); virtual bool searchPossible(); KLineEdit *lineEditQuery; - QSpinBox *spinBoxMaxHits; + TQSpinBox *spinBoxMaxHits; protected: virtual void init(); @@ -62,8 +62,8 @@ namespace KBibTeX void startSearch(); protected slots: - void slotTextChanged( const QString& ); - void slotTextChanged( const QString&, bool delayed ); + void slotTextChanged( const TQString& ); + void slotTextChanged( const TQString&, bool delayed ); private slots: void slotEnableSearchTrue(); @@ -72,20 +72,20 @@ namespace KBibTeX /** @author Thomas Fischer */ - class WebQuery : public QObject + class WebQuery : public TQObject { Q_OBJECT public: enum Status { statusSuccess, statusError, statusAborted, statusInvalidQuery, statusInsufficientPermissions }; - WebQuery( QWidget *parent ); + WebQuery( TQWidget *parent ); virtual ~WebQuery(); virtual void query(); - virtual QString title() { return "no_title"; }; - virtual QString disclaimer() = 0; - virtual QString disclaimerURL() = 0; + virtual TQString title() { return "no_title"; }; + virtual TQString disclaimer() = 0; + virtual TQString disclaimerURL() = 0; virtual WebQueryWidget *widget() = 0; @@ -95,7 +95,7 @@ namespace KBibTeX protected: bool m_aborted; - QWidget *m_parent; + TQWidget *m_parent; KProgressDialog *m_progressDialog; virtual void cancelQuery(); @@ -103,32 +103,32 @@ namespace KBibTeX void setEndSearch( WebQuery::Status ); void setNumStages( int numStages ); void enterNextStage(); - QString download( const KURL& url ); - QString downloadHTML( const KURL& url ); - BibTeX::File *downloadBibTeXFile( const KURL& url, QTextStream::Encoding = QTextStream::UnicodeUTF8 ); + TQString download( const KURL& url ); + TQString downloadHTML( const KURL& url ); + BibTeX::File *downloadBibTeXFile( const KURL& url, TQTextStream::Encoding = TQTextStream::UnicodeUTF8 ); private: int m_currentStage; int m_numStages; KIO::TransferJob *m_currentJob; int m_currentJobTotalSize; - QString m_incomingData; + TQString m_incomingData; private slots: void slotCancelQuery(); void slotSetJobTotalSize( KIO::Job *job, KIO::filesize_t size ); void slotSetJobProcessedSize( KIO::Job *job, KIO::filesize_t size ); - void slotJobData( KIO::Job *job, const QByteArray &data ); + void slotJobData( KIO::Job *job, const TQByteArray &data ); void slotJobFinished( KIO::Job *job ); }; - class WebQueryWizard: public QWidget + class WebQueryWizard: public TQWidget { Q_OBJECT public: ~WebQueryWizard(); - static int execute( QWidget *parent, QValueList &results ); + static int execute( TQWidget *parent, TQValueList &results ); signals: void changeButtonOK( bool state ); @@ -136,24 +136,24 @@ namespace KBibTeX protected: KListView *m_listViewResults; KComboBox *m_comboBoxEngines; - QWidgetStack *m_widgetStackQueries; + TQWidgetStack *m_widgetStackQueries; KURLLabel *m_disclaimerLabel; - QCheckBox *m_checkBoxImportAll; - QValueList m_webQueries; + TQCheckBox *m_checkBoxImportAll; + TQValueList m_webQueries; KDialogBase *m_dlg; WebQueryWizard( KDialogBase *dlg, const char* name = 0 ); - void showEvent( QShowEvent * ); + void showEvent( TQShowEvent * ); private slots: - void previewEntry( QListViewItem *item ); + void previewEntry( TQListViewItem *item ); void importEnableChanging( ); void otherEngineSelected( int index ); void startSearch(); void endSearch( WebQuery::Status ); void addHit( BibTeX::Entry*, bool keepId = false ); void enableSearch( bool ); - void openURL( const QString& ); + void openURL( const TQString& ); private: KPushButton *m_pushButtonSearch; @@ -164,10 +164,10 @@ namespace KBibTeX void saveWindowSize( KConfig *config ) const; }; - class ResultsListViewItem: public QListViewItem + class ResultsListViewItem: public TQListViewItem { public: - ResultsListViewItem( QListView * parent, BibTeX::Entry *entry ); + ResultsListViewItem( TQListView * parent, BibTeX::Entry *entry ); ~ResultsListViewItem(); BibTeX::Entry* entry(); diff --git a/src/webqueryamatex.cpp b/src/webqueryamatex.cpp index 8fcbb31..47b3bad 100644 --- a/src/webqueryamatex.cpp +++ b/src/webqueryamatex.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -34,13 +34,13 @@ namespace KBibTeX { - WebQueryAmatexWidget::WebQueryAmatexWidget( QWidget *parent, const char *name ) + WebQueryAmatexWidget::WebQueryAmatexWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); } - WebQueryAmatex::WebQueryAmatex( QWidget* parent ): WebQuery( parent ) + WebQueryAmatex::WebQueryAmatex( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQueryAmatexWidget( parent ); } @@ -50,19 +50,19 @@ namespace KBibTeX delete m_widget; } - QString WebQueryAmatex::title() + TQString WebQueryAmatex::title() { return i18n( "Amatex" ); } - QString WebQueryAmatex::disclaimer() + TQString WebQueryAmatex::disclaimer() { return i18n( "About Amatex" ); } - QString WebQueryAmatex::disclaimerURL() + TQString WebQueryAmatex::disclaimerURL() { - return QString( "http://www.2ndminute.org:8080/amatex/pages/about.jsp" ); + return TQString( "http://www.2ndminute.org:8080/amatex/pages/about.jsp" ); } WebQueryWidget *WebQueryAmatex::widget() @@ -76,16 +76,16 @@ namespace KBibTeX int numberOfResults = m_widget->spinBoxMaxHits->value(); setNumStages( 1 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ).replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ).replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - KURL url = KURL( QString( "http://www.2ndminute.org:8080/amatex/search.do?lang=US&querry=%1&suchart=kwd" ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + KURL url = KURL( TQString( "http://www.2ndminute.org:8080/amatex/search.do?lang=US&querry=%1&suchart=kwd" ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); - QString key = searchTerm.replace( QRegExp( "[^-_+A-Za-z0-9]" ), "" ); + TQString key = searchTerm.replace( TQRegExp( "[^-_+A-Za-z0-9]" ), "" ); int count = 0; BibTeX::File *tmpBibFile = downloadBibTeXFile( url ); if ( tmpBibFile != NULL && !m_aborted ) @@ -95,7 +95,7 @@ namespace KBibTeX BibTeX::Entry *entry = dynamic_cast( *it ); if ( entry != NULL ) { - entry->setId( QString( "Amatex_%1_%2" ).arg( key ).arg( ++count ) ); + entry->setId( TQString( "Amatex_%1_%2" ).arg( key ).arg( ++count ) ); emit foundEntry( entry, false ); } } @@ -105,10 +105,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } diff --git a/src/webqueryamatex.h b/src/webqueryamatex.h index d2486da..1f450de 100644 --- a/src/webqueryamatex.h +++ b/src/webqueryamatex.h @@ -31,7 +31,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryAmatexWidget( QWidget *parent, const char *name = 0 ); + WebQueryAmatexWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -41,14 +41,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryAmatex( QWidget* parent ); + WebQueryAmatex( TQWidget* parent ); virtual ~WebQueryAmatex(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/webqueryarxiv.cpp b/src/webqueryarxiv.cpp index f24fa44..93261ad 100644 --- a/src/webqueryarxiv.cpp +++ b/src/webqueryarxiv.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -33,19 +33,19 @@ namespace KBibTeX { - WebQueryArXivWidget::WebQueryArXivWidget( QWidget *parent, const char *name ) + WebQueryArXivWidget::WebQueryArXivWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "ArXiv" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "ArXiv" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryArXiv::WebQueryArXiv( QWidget* parent ) + WebQueryArXiv::WebQueryArXiv( TQWidget* parent ) : WebQuery( parent ), m_arXivServer( "www.arxiv.org" ), /** examples: @@ -117,17 +117,17 @@ namespace KBibTeX delete m_importer; } - QString WebQueryArXiv::title() + TQString WebQueryArXiv::title() { return i18n( "arXiv" ); } - QString WebQueryArXiv::disclaimer() + TQString WebQueryArXiv::disclaimer() { return i18n( "arXiv is an archive for preprints" ); } - QString WebQueryArXiv::disclaimerURL() + TQString WebQueryArXiv::disclaimerURL() { return "http://www.arxiv.org/"; } @@ -154,20 +154,20 @@ namespace KBibTeX m_numberOfResults = m_widget->spinBoxMaxHits->value(); setNumStages( m_numberOfResults + 1 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); - QStringList queryWords = QStringList::split( QRegExp( "\\s+" ), searchTerm ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQStringList queryWords = TQStringList::split( TQRegExp( "\\s+" ), searchTerm ); if ( searchTerm.isEmpty() || queryWords.size() == 0 ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - QString query; + TQString query; for ( unsigned int i = 0; i < queryWords.size() - 1; ++i ) query = query.append( "AND " ).append( queryWords[i] ).append( " " ); query.append( queryWords[queryWords.size()-1] ); - KURL url = KURL( QString( "http://www.arxiv.org/find/all/1/all:+%2/0/1/0/all/0/1?per_page=%1" ).arg( m_numberOfResults ).arg( query.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + KURL url = KURL( TQString( "http://www.arxiv.org/find/all/1/all:+%2/0/1/0/all/0/1?per_page=%1" ).arg( m_numberOfResults ).arg( query.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); m_currentJobMutex.lock(); KIO::Job *job = KIO::storedGet( url, FALSE, FALSE ); connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( unlockJob( KIO::Job * ) ) ); @@ -185,13 +185,13 @@ namespace KBibTeX { enterNextStage(); - QBuffer data; + TQBuffer data; data.open( IO_WriteOnly ); data.writeBlock( dynamic_cast( job )->data() ); data.close(); data.open( IO_ReadOnly ); - QTextStream ts( &data ); - QString result = ts.read(); + TQTextStream ts( &data ); + TQString result = ts.read(); data.close(); int p = -1; @@ -200,12 +200,12 @@ namespace KBibTeX while ( !m_aborted && ( int ) m_totalHits < m_numberOfResults && ( p = result.find( "arXiv:", p + 1 ) ) >= 0 ) { int p2 = result.find( "<", p + 2 ); - QString hit = result.mid( p + 6, p2 - p - 6 ); + TQString hit = result.mid( p + 6, p2 - p - 6 ); ++m_totalHits; p = p2 + 1; - KURL url = KURL( QString( "http://%2/abs/%1" ).arg( hit ).arg( m_arXivServer ) ); + KURL url = KURL( TQString( "http://%2/abs/%1" ).arg( hit ).arg( m_arXivServer ) ); m_urls.append( url ); } @@ -238,13 +238,13 @@ namespace KBibTeX ++m_receivedHits; enterNextStage(); - QBuffer data; + TQBuffer data; data.open( IO_WriteOnly ); data.writeBlock( dynamic_cast( job )->data() ); data.close(); data.open( IO_ReadOnly ); - QTextStream ts( &data ); - QString result = BibTeX::EncoderXML::currentEncoderXML()->decode( ts.read() ); + TQTextStream ts( &data ); + TQString result = BibTeX::EncoderXML::currentEncoderXML()->decode( ts.read() ); data.close(); /** find id */ @@ -252,24 +252,24 @@ namespace KBibTeX if ( p < 0 ) return; int p2 = result.find( "<", p + 2 ); if ( p2 < 0 ) return; - QString id = result.mid( p + 6, p2 - p - 6 ); + TQString id = result.mid( p + 6, p2 - p - 6 ); /** find cite_as */ - QString citeas = ""; + TQString citeas = ""; p = result.find( "Cite as", 0 ); p = result.find( ">arXiv:", p ); p2 = result.find( "= 0 && p2 >= 0 ) citeas = result.mid( p + 7, p2 - p - 7 ); - BibTeX::Entry * entry = new BibTeX::Entry( BibTeX::Entry::etMisc, citeas.isEmpty() ? ( id.isEmpty() ? QString( "arXiv" ).append( m_receivedHits ) : id ) : citeas ); + BibTeX::Entry * entry = new BibTeX::Entry( BibTeX::Entry::etMisc, citeas.isEmpty() ? ( id.isEmpty() ? TQString( "arXiv" ).append( m_receivedHits ) : id ) : citeas ); /** find abstract */ p = result.find( "Abstract:", 0 ); if ( p < 0 ) return; p2 = result.find( "]+>" ), "" ); + TQString abstract = result.mid( p + 16, p2 - p - 16 ).replace( TQRegExp( "\\s+" ), " " ).replace( TQRegExp( "^\\s+|\\s+$" ), "" ).replace( TQRegExp( "<[^>]+>" ), "" ); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftAbstract ); entry->addField( field ); field->setValue( new BibTeX::Value( abstract ) ); @@ -281,7 +281,7 @@ namespace KBibTeX { p = result.find( ">", p + 1 ); p2 = result.find( "<", p + 1 ); - QString author = result.mid( p + 1, p2 - p - 1 ); + TQString author = result.mid( p + 1, p2 - p - 1 ); personContainer->persons.append( new BibTeX::Person( author ) ); } if ( personContainer->persons.isEmpty() ) @@ -300,7 +300,7 @@ namespace KBibTeX p2 = result.find( "<", p + 10 ); if ( p >= 0 && p2 >= 0 ) { - QString title = result.mid( p + 13, p2 - p - 13 ).replace( QRegExp( "\\s+" ), " " ).replace( QRegExp( "^\\s+|\\s+$" ), "" ); + TQString title = result.mid( p + 13, p2 - p - 13 ).replace( TQRegExp( "\\s+" ), " " ).replace( TQRegExp( "^\\s+|\\s+$" ), "" ); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftTitle ); entry->addField( field ); field->setValue( new BibTeX::Value( title ) ); @@ -310,7 +310,7 @@ namespace KBibTeX p = result.find( "Submitted on", 0 ); while (( p2 = result.find( "last revised", p + 1 ) ) >= 0 ) p = p2; - p2 = result.find( QRegExp( "\\d\\d\\d\\d" ), p ); + p2 = result.find( TQRegExp( "\\d\\d\\d\\d" ), p ); bool ok = FALSE; int year = result.mid( p2, 4 ).toInt( &ok ); if ( !ok ) year = 0; @@ -318,12 +318,12 @@ namespace KBibTeX { BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftYear ); entry->addField( field ); - field->setValue( new BibTeX::Value( QString::number( year ) ) ); + field->setValue( new BibTeX::Value( TQString::number( year ) ) ); } - p2 = result.find( QRegExp( "\\b[A-Z][a-z]{2}\\b" ), p ); + p2 = result.find( TQRegExp( "\\b[A-Z][a-z]{2}\\b" ), p ); if ( p2 >= 0 ) { - QString month = result.mid( p2, 3 ).lower(); + TQString month = result.mid( p2, 3 ).lower(); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftMonth ); entry->addField( field ); BibTeX::Value *value = new BibTeX::Value(); @@ -336,7 +336,7 @@ namespace KBibTeX p2 = result.find( "\"", p + 1 ); if ( p >= 0 && p2 >= 0 ) { - QString doi = result.mid( p, p2 - p ); + TQString doi = result.mid( p, p2 - p ); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftDoi ); entry->addField( field ); field->setValue( new BibTeX::Value( doi ) ); @@ -347,7 +347,7 @@ namespace KBibTeX p2 = result.find( "", p + 1 ); if ( p >= 0 && p2 >= 0 ) { - QString keywords = result.mid( p + 31, p2 - p - 31 ).replace( QRegExp( "]*>" ), "" ); + TQString keywords = result.mid( p + 31, p2 - p - 31 ).replace( TQRegExp( "]*>" ), "" ); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftKeywords ); entry->addField( field ); BibTeX::Value *value = new BibTeX::Value(); @@ -360,7 +360,7 @@ namespace KBibTeX p2 = result.find( "", p + 1 ); if ( p >= 0 && p2 >= 0 ) { - QString acmclasses = result.mid( p + 34, p2 - p - 34 ); + TQString acmclasses = result.mid( p + 34, p2 - p - 34 ); BibTeX::EntryField * field = new BibTeX::EntryField( "acm-classes" ); entry->addField( field ); field->setValue( new BibTeX::Value( acmclasses ) ); @@ -369,7 +369,7 @@ namespace KBibTeX /** find versions */ for ( int v = 1; !m_aborted && v < 20; ++v ) { - p = result.find( QString( ">[v%1]<" ).arg( v ), 0 ); + p = result.find( TQString( ">[v%1]<" ).arg( v ), 0 ); if ( p < 0 ) break; int p3 = result.findRev( "href=\"", p ); @@ -378,18 +378,18 @@ namespace KBibTeX p2 = result.find( "\">", p3 ); if ( p2 >= 0 ) { - QString url = result.mid( p3 + 6, p2 - p3 - 6 ); - BibTeX::EntryField * field = new BibTeX::EntryField( QString( "v%1url" ).arg( v ) ); + TQString url = result.mid( p3 + 6, p2 - p3 - 6 ); + BibTeX::EntryField * field = new BibTeX::EntryField( TQString( "v%1url" ).arg( v ) ); entry->addField( field ); - field->setValue( new BibTeX::Value( QString( "http://www.arxiv.org" ).append( url ) ) ); + field->setValue( new BibTeX::Value( TQString( "http://www.arxiv.org" ).append( url ) ) ); } } p = result.find( "", p + 1 ); p2 = result.find( "= 0 && p2 >= 0 ) { - QString version = result.mid( p + 5, p2 - p - 5 ); - BibTeX::EntryField * field = new BibTeX::EntryField( QString( "v%1descr" ).arg( v ) ); + TQString version = result.mid( p + 5, p2 - p - 5 ); + BibTeX::EntryField * field = new BibTeX::EntryField( TQString( "v%1descr" ).arg( v ) ); entry->addField( field ); field->setValue( new BibTeX::Value( version ) ); } @@ -400,7 +400,7 @@ namespace KBibTeX p2 = result.find( "", p + 1 ); if ( p >= 0 && p2 >= 0 ) { - QString techRepNr = result.mid( p + 36, p2 - p - 36 ); + TQString techRepNr = result.mid( p + 36, p2 - p - 36 ); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftNumber ); entry->addField( field ); field->setValue( new BibTeX::Value( techRepNr ) ); @@ -412,15 +412,15 @@ namespace KBibTeX p2 = result.find( "", p + 1 ); if ( p >= 0 && p2 >= 0 ) { - QString jref = result.mid( p + 27, p2 - p - 27 ); + TQString jref = result.mid( p + 27, p2 - p - 27 ); jref.replace( "\n", " " ); - QString jTitle = ""; - QString jVol = ""; - QString jNo = ""; - QString jYear = ""; - QString jPage1 = ""; - QString jPage2 = ""; + TQString jTitle = ""; + TQString jVol = ""; + TQString jNo = ""; + TQString jYear = ""; + TQString jPage1 = ""; + TQString jPage2 = ""; // m_jourRef1( "^([a-zA-Z. ]+[a-zA-Z.])\\s*(\\d+)\\s+\\((\\d{4})\\)\\s+([0-9A-Z]+)(-([0-9A-Z]+))?$" ) if ( m_jourRef1.search( jref ) == 0 ) @@ -527,22 +527,22 @@ namespace KBibTeX entry->deleteField( BibTeX::EntryField::ftPages ); BibTeX::EntryField * field = new BibTeX::EntryField( BibTeX::EntryField::ftPages ); entry->addField( field ); - QString text = jPage1; + TQString text = jPage1; if ( !jPage2.isEmpty() ) text.append( "--" ).append( jPage2 ); field->setValue( new BibTeX::Value( text ) ); } } - if ( result.find( QRegExp( "Ph\\.?D\\.? Thesis", FALSE ), 0 ) >= 0 ) + if ( result.find( TQRegExp( "Ph\\.?D\\.? Thesis", FALSE ), 0 ) >= 0 ) entry->setEntryType( BibTeX::Entry::etPhDThesis ); field = new BibTeX::EntryField( BibTeX::EntryField::ftURL ); entry->addField( field ); - field->setValue( new BibTeX::Value( QString( "http://arxiv.org/abs/%1" ).arg( id ) ) ); + field->setValue( new BibTeX::Value( TQString( "http://arxiv.org/abs/%1" ).arg( id ) ) ); field = new BibTeX::EntryField( "pdf" ); entry->addField( field ); - field->setValue( new BibTeX::Value( QString( "http://arxiv.org/pdf/%1" ).arg( id ) ) ); + field->setValue( new BibTeX::Value( TQString( "http://arxiv.org/pdf/%1" ).arg( id ) ) ); emit foundEntry( entry, false ); diff --git a/src/webqueryarxiv.h b/src/webqueryarxiv.h index 6bebb9b..03eb89c 100644 --- a/src/webqueryarxiv.h +++ b/src/webqueryarxiv.h @@ -20,16 +20,16 @@ #ifndef KBIBTEXWEBQUERYARXIV_H #define KBIBTEXWEBQUERYARXIV_H -#include -#include -#include +#include +#include +#include #include #include #include -class QBuffer; +class TQBuffer; namespace KBibTeX { @@ -40,7 +40,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryArXivWidget( QWidget *parent, const char *name = 0 ); + WebQueryArXivWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -50,14 +50,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryArXiv( QWidget* parent ); + WebQueryArXiv( TQWidget* parent ); virtual ~WebQueryArXiv(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); @@ -72,15 +72,15 @@ namespace KBibTeX void arXivAbstractResult( KIO::Job *job ); private: - QString m_lastHit; + TQString m_lastHit; BibTeX::FileImporterBibTeX *m_importer; - QString m_arXivServer; + TQString m_arXivServer; int m_numberOfResults, m_totalHits, m_receivedHits; - QMutex m_currentJobMutex; - QValueList m_urls; + TQMutex m_currentJobMutex; + TQValueList m_urls; WebQueryArXivWidget *m_widget; - QRegExp m_jourRef1, m_jourRef2, m_jourRef3, m_jourRef4, m_jourRef5, m_jourRef6, m_reJour, m_reYear, m_rePages; + TQRegExp m_jourRef1, m_jourRef2, m_jourRef3, m_jourRef4, m_jourRef5, m_jourRef6, m_reJour, m_reYear, m_rePages; }; } diff --git a/src/webquerybibsonomy.cpp b/src/webquerybibsonomy.cpp index 135d72b..eec1d3f 100644 --- a/src/webquerybibsonomy.cpp +++ b/src/webquerybibsonomy.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -35,20 +35,20 @@ namespace KBibTeX { - WebQueryBibSonomyWidget::WebQueryBibSonomyWidget( QWidget *parent, const char *name ) + WebQueryBibSonomyWidget::WebQueryBibSonomyWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "BibSonomy" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "BibSonomy" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryBibSonomy::WebQueryBibSonomy( QWidget* parent ): WebQuery( parent ) + WebQueryBibSonomy::WebQueryBibSonomy( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQueryBibSonomyWidget( parent ); } @@ -58,17 +58,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryBibSonomy::title() + TQString WebQueryBibSonomy::title() { return i18n( "BibSonomy" ); } - QString WebQueryBibSonomy::disclaimer() + TQString WebQueryBibSonomy::disclaimer() { return i18n( "BibSonomy bookmark sharing system" ); } - QString WebQueryBibSonomy::disclaimerURL() + TQString WebQueryBibSonomy::disclaimerURL() { return "http://www.bibsonomy.org/help/about/"; } @@ -86,7 +86,7 @@ namespace KBibTeX setNumStages( 1 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); @@ -95,7 +95,7 @@ namespace KBibTeX int numberOfResults = m_widget->spinBoxMaxHits->value(); - KURL url = KURL( QString( "http://www.bibsonomy.org/bib/search/%2?items=%1" ).arg( numberOfResults ) .arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + KURL url = KURL( TQString( "http://www.bibsonomy.org/bib/search/%2?items=%1" ).arg( numberOfResults ) .arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); BibTeX::File *bibFile = downloadBibTeXFile( url ); if ( bibFile != NULL && !m_aborted ) @@ -110,10 +110,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } diff --git a/src/webquerybibsonomy.h b/src/webquerybibsonomy.h index 216771a..5d286c9 100644 --- a/src/webquerybibsonomy.h +++ b/src/webquerybibsonomy.h @@ -31,7 +31,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryBibSonomyWidget( QWidget *parent, const char *name = 0 ); + WebQueryBibSonomyWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -42,14 +42,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryBibSonomy( QWidget* parent ); + WebQueryBibSonomy( TQWidget* parent ); virtual ~WebQueryBibSonomy(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/webquerycitebase.cpp b/src/webquerycitebase.cpp index a12f400..8015df0 100644 --- a/src/webquerycitebase.cpp +++ b/src/webquerycitebase.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -34,20 +34,20 @@ namespace KBibTeX { - WebQueryCitebaseWidget::WebQueryCitebaseWidget( QWidget *parent, const char *name ) + WebQueryCitebaseWidget::WebQueryCitebaseWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "Citebase" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "Citebase" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryCitebase::WebQueryCitebase( QWidget* parent ): WebQuery( parent ) + WebQueryCitebase::WebQueryCitebase( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQueryCitebaseWidget( parent ); } @@ -57,17 +57,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryCitebase::title() + TQString WebQueryCitebase::title() { return i18n( "Citebase" ); } - QString WebQueryCitebase::disclaimer() + TQString WebQueryCitebase::disclaimer() { return i18n( "Citebase citation index" ); } - QString WebQueryCitebase::disclaimerURL() + TQString WebQueryCitebase::disclaimerURL() { return "http://www.citebase.org/"; } @@ -86,14 +86,14 @@ namespace KBibTeX setNumStages( 1 ); int numberOfResults = m_widget->spinBoxMaxHits->value(); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - KURL url = KURL( QString( "http://www.citebase.org/search?submitted=Search&author=&maxrows=%1&yearfrom=&format=BibTeX&order=DESC&type=metadata&title=%2&publication=&yearuntil=&rank=paperimpact" ).arg( numberOfResults ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + KURL url = KURL( TQString( "http://www.citebase.org/search?submitted=Search&author=&maxrows=%1&yearfrom=&format=BibTeX&order=DESC&type=metadata&title=%2&publication=&yearuntil=&rank=paperimpact" ).arg( numberOfResults ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); BibTeX::File *tmpBibFile = downloadBibTeXFile( url ); if ( tmpBibFile != NULL && !m_aborted ) { @@ -112,10 +112,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } diff --git a/src/webquerycitebase.h b/src/webquerycitebase.h index 346d1e4..5461063 100644 --- a/src/webquerycitebase.h +++ b/src/webquerycitebase.h @@ -31,7 +31,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryCitebaseWidget( QWidget *parent, const char *name = 0 ); + WebQueryCitebaseWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -41,14 +41,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryCitebase( QWidget* parent ); + WebQueryCitebase( TQWidget* parent ); virtual ~WebQueryCitebase(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/webqueryciteseerx.cpp b/src/webqueryciteseerx.cpp index d5d244e..6ac7da4 100644 --- a/src/webqueryciteseerx.cpp +++ b/src/webqueryciteseerx.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -43,14 +43,14 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // Construct widget - WebQueryCiteSeerXWidget::WebQueryCiteSeerXWidget( QWidget *parent, const char *name ) + WebQueryCiteSeerXWidget::WebQueryCiteSeerXWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "CiteSeerX" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "CiteSeerX" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } @@ -59,7 +59,7 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // Construct - WebQueryCiteSeerX::WebQueryCiteSeerX( QWidget* parent ) + WebQueryCiteSeerX::WebQueryCiteSeerX( TQWidget* parent ) : WebQuery( parent ), m_citeSeerXServer( "citeseerx.ist.psu.edu" ) { m_widget = new WebQueryCiteSeerXWidget( parent ); @@ -78,7 +78,7 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // GUI string - QString WebQueryCiteSeerX::title() + TQString WebQueryCiteSeerX::title() { return i18n( "CiteSeerX" ); } @@ -87,7 +87,7 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // GUI info - QString WebQueryCiteSeerX::disclaimer() + TQString WebQueryCiteSeerX::disclaimer() { return i18n( "About CiteSeerX" ); } @@ -96,7 +96,7 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // URL for disclaimer - QString WebQueryCiteSeerX::disclaimerURL() + TQString WebQueryCiteSeerX::disclaimerURL() { return "http://citeseerx.ist.psu.edu/about/site"; } @@ -137,8 +137,8 @@ namespace KBibTeX setNumStages( m_desiredHits + ( m_desiredHits / 10 + 1 ) ); // prepare search term - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); - QStringList queryWords = QStringList::split( QRegExp( "\\s+" ), searchTerm ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQStringList queryWords = TQStringList::split( TQRegExp( "\\s+" ), searchTerm ); if ( searchTerm.isEmpty() || queryWords.size() == 0 ) { @@ -147,7 +147,7 @@ namespace KBibTeX } // build query from search term - QString query; + TQString query; for ( uint i = 0; i < queryWords.size(); ++i ) { @@ -160,7 +160,7 @@ namespace KBibTeX // schedule jobs DataRequest dr; - dr.url = KURL( QString( "http://citeseerx.ist.psu.edu/search?q=" ).append( query ).append( "&submit=Search&sort=rel" ) ); + dr.url = KURL( TQString( "http://citeseerx.ist.psu.edu/search?q=" ).append( query ).append( "&submit=Search&sort=rel" ) ); dr.parser = &WebQueryCiteSeerX::parseSummaryPage; m_queryQueue.push_back( dr ); @@ -172,10 +172,10 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // process results from current job - void WebQueryCiteSeerX::parseSummaryPage( const QString& data ) + void WebQueryCiteSeerX::parseSummaryPage( const TQString& data ) { // regexp. for finding paper entries (example: href="/viewdoc/summary;jsessionid=12345ABCD?doi=10.1.1.108.9937") - QRegExp paperXpr( "href=\"(/viewdoc/summary[^?]*\\?doi=[^\"]+)\"" ); + TQRegExp paperXpr( "href=\"(/viewdoc/summary[^?]*\\?doi=[^\"]+)\"" ); // count paper results and schedule single paper URLs @@ -186,7 +186,7 @@ namespace KBibTeX DataRequest dr; - dr.url = KURL( QString( "http://" ) + m_citeSeerXServer + paperXpr.cap( 1 ) ); + dr.url = KURL( TQString( "http://" ) + m_citeSeerXServer + paperXpr.cap( 1 ) ); dr.parser = &WebQueryCiteSeerX::parsePaperPage; @@ -194,13 +194,13 @@ namespace KBibTeX } // if we haven't reached the desired number of hits, schedule the next summary page - QRegExp nextSummaryXpr( "Next 10" ); + TQRegExp nextSummaryXpr( "Next 10" ); if ( m_receivedHits < m_desiredHits ) if ( nextSummaryXpr.search( data ) >= 0 ) { DataRequest dr; - dr.url = KURL( QString( "http://" ) + m_citeSeerXServer + nextSummaryXpr.cap( 1 ).replace( "&", "&" ) ); + dr.url = KURL( TQString( "http://" ) + m_citeSeerXServer + nextSummaryXpr.cap( 1 ).replace( "&", "&" ) ); dr.parser = &WebQueryCiteSeerX::parseSummaryPage; m_queryQueue.push_back( dr ); } @@ -210,14 +210,14 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // process the result of one single paper link - void WebQueryCiteSeerX::parsePaperPage( const QString& data ) + void WebQueryCiteSeerX::parsePaperPage( const TQString& data ) { // find type and id: @XXX{ YYY - QRegExp typeIdXpr( "@(.*)\\{(.*)," ); + TQRegExp typeIdXpr( "@(.*)\\{(.*)," ); typeIdXpr.setMinimal( true ); typeIdXpr.search( data ); - QString typeStr = typeIdXpr.cap( 1 ); - QString id = typeIdXpr.cap( 2 ); + TQString typeStr = typeIdXpr.cap( 1 ); + TQString id = typeIdXpr.cap( 2 ); // create entry Entry *entry = new BibTeX::Entry( typeIdXpr.cap( 1 ), typeIdXpr.cap( 2 ) ); @@ -248,10 +248,10 @@ namespace KBibTeX //_______________________________________________________________________________________________________________ // find single bibtex field in html page and add to entry - void WebQueryCiteSeerX::parseForSingleExpression( QString description, const QString &data, Entry *entry, BibTeX::EntryField::FieldType type ) + void WebQueryCiteSeerX::parseForSingleExpression( TQString description, const TQString &data, Entry *entry, BibTeX::EntryField::FieldType type ) { // search, and add to entry if found - QRegExp xpr( description ); + TQRegExp xpr( description ); if ( xpr.search( data ) + 1 ) { @@ -274,13 +274,13 @@ namespace KBibTeX { // read data - QBuffer data; + TQBuffer data; data.open( IO_WriteOnly ); data.writeBlock( dynamic_cast( job )->data() ); data.close(); data.open( IO_ReadOnly ); - QTextStream ts( &data ); - QString result = ts.read(); + TQTextStream ts( &data ); + TQString result = ts.read(); data.close(); // hand the read data over to the parser diff --git a/src/webqueryciteseerx.h b/src/webqueryciteseerx.h index 458e188..10f6533 100644 --- a/src/webqueryciteseerx.h +++ b/src/webqueryciteseerx.h @@ -20,8 +20,8 @@ #ifndef KBIBTEXWEBQUERYCITESEERX_H #define KBIBTEXWEBQUERYCITESEERX_H -#include -#include +#include +#include #include @@ -30,7 +30,7 @@ #include -class QBuffer; +class TQBuffer; namespace KBibTeX { @@ -43,14 +43,14 @@ namespace KBibTeX Q_OBJECT public: - WebQueryCiteSeerXWidget( QWidget *parent, const char *name = 0 ); + WebQueryCiteSeerXWidget( TQWidget *parent, const char *name = 0 ); }; /// Convinience typedef for member pointer to parsing function class WebQueryCiteSeerX; - typedef void ( WebQueryCiteSeerX::* DataParser )( const QString & ); + typedef void ( WebQueryCiteSeerX::* DataParser )( const TQString & ); /// Query the citeseer database. /** This class is used for querying the citeseer data base. CiteSeerX is still beta, so this class has to be adapted as soon as the CiteSeer people change their web interface. After entering the search term, citeseer returns a page with 10 links (one for each paper), and one link for the next 10 hits. This class uses a queue to schedule each reading job, and two parsing functions, one for the summary page and one for each paper result. BibTeX fields abstract, title, author, year, journal, and pages are found. @@ -69,7 +69,7 @@ namespace KBibTeX }; /// Construct. - WebQueryCiteSeerX( QWidget* parent ); + WebQueryCiteSeerX( TQWidget* parent ); /// Destroy. virtual ~WebQueryCiteSeerX(); @@ -78,13 +78,13 @@ namespace KBibTeX void query(); /// Return title. - QString title(); + TQString title(); /// Return disclaimer. - QString disclaimer(); + TQString disclaimer(); /// Return disclaimer URL. - QString disclaimerURL(); + TQString disclaimerURL(); /// Return GUI element. WebQueryWidget *widget(); @@ -103,11 +103,11 @@ namespace KBibTeX /// Parses the main page and schedules single-paper reading jobs. /** Function parses the summary page, and schedules one job for each paper link, and one job for the "Next 10" summary page. */ - void parseSummaryPage( const QString &data ); + void parseSummaryPage( const TQString &data ); /// Parses single-paper pages. /** Function reads the "Abstract:" and the "@entrytype{" strings found in the html page. */ - void parsePaperPage( const QString &data ); + void parsePaperPage( const TQString &data ); /// Execute next waiting job. /** Takes the next query out of the queue, sets the appropriate parser, and schedules getData with the URL. */ @@ -115,13 +115,13 @@ namespace KBibTeX /// Find single bibtex field in html page and add to entry. /** Function uses the first collected text from the description (a regular expression), and adds it as type "type" to the "entry". */ - void parseForSingleExpression( QString description, const QString &data, BibTeX::Entry *entry, BibTeX::EntryField::FieldType type ); + void parseForSingleExpression( TQString description, const TQString &data, BibTeX::Entry *entry, BibTeX::EntryField::FieldType type ); /// The currently active parser. DataParser m_currentParser; /// The internet address of CiteSeerX. - QString m_citeSeerXServer; + TQString m_citeSeerXServer; /// Number of hits desired by user. int m_desiredHits; diff --git a/src/webquerycsb.cpp b/src/webquerycsb.cpp index 2a5ac54..e668499 100644 --- a/src/webquerycsb.cpp +++ b/src/webquerycsb.cpp @@ -17,16 +17,16 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,74 +41,74 @@ namespace KBibTeX { - WebQueryCSBWidget::WebQueryCSBWidget( QWidget *parent, const char *name ) + WebQueryCSBWidget::WebQueryCSBWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "CSB_query" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "CSB_query" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); value = settings->getWebQueryDefault( "CSB_field" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxField->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "CSB_yearCheck" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; checkBoxYear->setChecked( value == "1" ); value = settings->getWebQueryDefault( "CSB_yearType" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxYear->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "CSB_yearValue" ); - value = value == QString::null ? "2000" : value; + value = value == TQString::null ? "2000" : value; spinBoxYear->setValue( value.toInt() ); value = settings->getWebQueryDefault( "CSB_sortBy" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxSortBy->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "CSB_onlinePapersOnly" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; checkBoxOnlinePapersOnly->setChecked( value == "1" ); slotTextChanged( value, true ); } void WebQueryCSBWidget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearSearchText ); - QLabel *label = new QLabel( i18n( "Search &term:" ), this ); + TQLabel *label = new TQLabel( i18n( "Search &term:" ), this ); hLayout->addWidget( label ); lineEditQuery = new KLineEdit( this ); KCompletion *completionQuery = lineEditQuery->completionObject(); hLayout->addWidget( lineEditQuery ); label->setBuddy( lineEditQuery ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "Here, \"Field\" refers to a parameter for the CSB search (author, title, any)", "&Field:" ), this ); + label = new TQLabel( i18n( "Here, \"Field\" refers to a parameter for the CSB search (author, title, any)", "&Field:" ), this ); hLayout->addWidget( label ); comboBoxField = new KComboBox( false, this ); hLayout->addWidget( comboBoxField ); label->setBuddy( comboBoxField ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); hLayout->setStretchFactor( lineEditQuery, 5 ); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); - hLayout = new QHBoxLayout( ); + hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); - label = new QLabel( i18n( "&Number of results:" ), this ); + label = new TQLabel( i18n( "&Number of results:" ), this ); hLayout->addWidget( label ); - spinBoxMaxHits = new QSpinBox( 1, 500, 1, this ); + spinBoxMaxHits = new TQSpinBox( 1, 500, 1, this ); spinBoxMaxHits->setValue( 10 ); hLayout->setStretchFactor( spinBoxMaxHits, 3 ); hLayout->addWidget( spinBoxMaxHits ); label->setBuddy( spinBoxMaxHits ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); - checkBoxYear = new QCheckBox( i18n( "&Year:" ), this ); + checkBoxYear = new TQCheckBox( i18n( "&Year:" ), this ); hLayout->setStretchFactor( checkBoxYear, 1 ); checkBoxYear->setChecked( true ); hLayout->addWidget( checkBoxYear ); @@ -116,22 +116,22 @@ namespace KBibTeX comboBoxYear = new KComboBox( false, this ); hLayout->setStretchFactor( comboBoxYear, 3 ); hLayout->addWidget( comboBoxYear ); - spinBoxYear = new QSpinBox( 1800, 2100, 1, this ); - spinBoxYear->setValue( QDate::currentDate().year() ); + spinBoxYear = new TQSpinBox( 1800, 2100, 1, this ); + spinBoxYear->setValue( TQDate::currentDate().year() ); hLayout->setStretchFactor( spinBoxYear, 6 ); hLayout->addWidget( spinBoxYear ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "Sort &by:" ), this ); + label = new TQLabel( i18n( "Sort &by:" ), this ); hLayout->addWidget( label ); comboBoxSortBy = new KComboBox( false, this ); hLayout->setStretchFactor( comboBoxSortBy, 8 ); hLayout->addWidget( comboBoxSortBy ); label->setBuddy( comboBoxSortBy ); - hLayout = new QHBoxLayout( ); + hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); - checkBoxOnlinePapersOnly = new QCheckBox( i18n( "Online papers only" ), this ); + checkBoxOnlinePapersOnly = new TQCheckBox( i18n( "Online papers only" ), this ); hLayout->addWidget( checkBoxOnlinePapersOnly ); comboBoxField->insertItem( i18n( "any" ) ); @@ -153,7 +153,7 @@ namespace KBibTeX spinBoxYear->setEnabled( yearEnabled ); } - WebQueryCSB::WebQueryCSB( QWidget* parent ): WebQuery( parent ) + WebQueryCSB::WebQueryCSB( TQWidget* parent ): WebQuery( parent ) { m_importer = new BibTeX::FileImporterBibTeX( FALSE ); m_importer->setIgnoreComments( TRUE ); @@ -166,17 +166,17 @@ namespace KBibTeX delete m_importer; } - QString WebQueryCSB::title() + TQString WebQueryCSB::title() { return i18n( "Computer Science Bibliographies" ); } - QString WebQueryCSB::disclaimer() + TQString WebQueryCSB::disclaimer() { return i18n( "Copyright for the Bibliography Collection" ); } - QString WebQueryCSB::disclaimerURL() + TQString WebQueryCSB::disclaimerURL() { return "http://liinwww.ira.uka.de/bibliography/Copyright.html"; } @@ -192,30 +192,30 @@ namespace KBibTeX Settings *settings = Settings::self(); settings->setWebQueryDefault( "CSB_query", m_widget->lineEditQuery->text() ); - settings->setWebQueryDefault( "CSB_field", QString::number( m_widget->comboBoxField->currentItem() ) ); + settings->setWebQueryDefault( "CSB_field", TQString::number( m_widget->comboBoxField->currentItem() ) ); settings->setWebQueryDefault( "CSB_yearCheck", m_widget->checkBoxYear->isChecked() ? "1" : "0" ); - settings->setWebQueryDefault( "CSB_yearType", QString::number( m_widget->comboBoxYear->currentItem() ) ); - settings->setWebQueryDefault( "CSB_yearValue", QString::number( m_widget->spinBoxYear->value() ) ); - settings->setWebQueryDefault( "CSB_sortBy", QString::number( m_widget->comboBoxSortBy->currentItem() ) ); + settings->setWebQueryDefault( "CSB_yearType", TQString::number( m_widget->comboBoxYear->currentItem() ) ); + settings->setWebQueryDefault( "CSB_yearValue", TQString::number( m_widget->spinBoxYear->value() ) ); + settings->setWebQueryDefault( "CSB_sortBy", TQString::number( m_widget->comboBoxSortBy->currentItem() ) ); settings->setWebQueryDefault( "CSB_onlinePapersOnly", m_widget->checkBoxOnlinePapersOnly->isChecked() ? "1" : "0" ); setNumStages( 1 ); int numberOfResults = m_widget->spinBoxMaxHits->value(); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); - QString year; + TQString year; if ( m_widget->checkBoxYear->isChecked() ) { switch ( m_widget->comboBoxYear->currentItem() ) { - case 1: year = QString( "before=%1" ).arg( m_widget->spinBoxYear->value() ); break; - case 2: year = QString( "since=%1" ).arg( m_widget->spinBoxYear->value() ); break; - default: year = QString( "year=%1" ).arg( m_widget->spinBoxYear->value() ); break; + case 1: year = TQString( "before=%1" ).arg( m_widget->spinBoxYear->value() ); break; + case 2: year = TQString( "since=%1" ).arg( m_widget->spinBoxYear->value() ); break; + default: year = TQString( "year=%1" ).arg( m_widget->spinBoxYear->value() ); break; } } - QString field; + TQString field; switch ( m_widget->comboBoxField->currentItem() ) { case 1: field = "au"; break; @@ -223,7 +223,7 @@ namespace KBibTeX default: field = ""; break; } - QString sortBy; + TQString sortBy; switch ( m_widget->comboBoxSortBy->currentItem() ) { case 1: sortBy = "&sort=score"; break; @@ -231,23 +231,23 @@ namespace KBibTeX default: sortBy = ""; break; } - QString onlinePapersOnly = m_widget->checkBoxOnlinePapersOnly->isChecked() ? "&online=on" : ""; + TQString onlinePapersOnly = m_widget->checkBoxOnlinePapersOnly->isChecked() ? "&online=on" : ""; - KURL url = KURL( QString( "http://liinwww.ira.uka.de/csbib?query=%4&results=bibtex&maxnum=%1&%2&field=%3" ).arg( numberOfResults ).arg( year ).arg( field ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ).append( onlinePapersOnly ).append( sortBy ) ); + KURL url = KURL( TQString( "http://liinwww.ira.uka.de/csbib?query=%4&results=bibtex&maxnum=%1&%2&field=%3" ).arg( numberOfResults ).arg( year ).arg( field ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ).append( onlinePapersOnly ).append( sortBy ) ); - QString rawText = download( url ); + TQString rawText = download( url ); if ( rawText != NULL && !m_aborted ) { - QRegExp removeXML( "<[^>]+>" ); + TQRegExp removeXML( "<[^>]+>" ); rawText.replace( removeXML, "" ); BibTeX::FileImporterBibTeX importer( FALSE ); importer.setIgnoreComments( TRUE ); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << rawText << endl; buffer.close(); @@ -274,10 +274,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } diff --git a/src/webquerycsb.h b/src/webquerycsb.h index bedc3cc..14866cd 100644 --- a/src/webquerycsb.h +++ b/src/webquerycsb.h @@ -25,8 +25,8 @@ #include #include -class QSpinBox; -class QCheckBox; +class TQSpinBox; +class TQCheckBox; class KLineEdit; class KComboBox; @@ -40,14 +40,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryCSBWidget( QWidget *parent, const char *name = 0 ); + WebQueryCSBWidget( TQWidget *parent, const char *name = 0 ); KComboBox *comboBoxField; - QCheckBox *checkBoxYear; + TQCheckBox *checkBoxYear; KComboBox *comboBoxYear; - QSpinBox *spinBoxYear; + TQSpinBox *spinBoxYear; KComboBox *comboBoxSortBy; - QCheckBox *checkBoxOnlinePapersOnly; + TQCheckBox *checkBoxOnlinePapersOnly; protected: virtual void init(); @@ -64,14 +64,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryCSB( QWidget* parent ); + WebQueryCSB( TQWidget* parent ); virtual ~WebQueryCSB(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/webquerydblp.cpp b/src/webquerydblp.cpp index 38d6492..dceb074 100644 --- a/src/webquerydblp.cpp +++ b/src/webquerydblp.cpp @@ -17,13 +17,13 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -40,62 +40,62 @@ namespace KBibTeX { - WebQueryDBLPWidget::WebQueryDBLPWidget( QWidget *parent, const char *name ) + WebQueryDBLPWidget::WebQueryDBLPWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "DBLP_query" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "DBLP_query" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); value = settings->getWebQueryDefault( "DBLP_keepSeparate" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; checkBoxKeepEntriesSeparate->setChecked( value == "1" ); } void WebQueryDBLPWidget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearSearchText ); - QLabel *label = new QLabel( i18n( "Search &term:" ), this ); + TQLabel *label = new TQLabel( i18n( "Search &term:" ), this ); hLayout->addWidget( label ); lineEditQuery = new KLineEdit( this ); hLayout->addWidget( lineEditQuery ); label->setBuddy( lineEditQuery ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); hLayout->setStretchFactor( lineEditQuery, 4 ); KCompletion *completionQuery = lineEditQuery->completionObject(); - label = new QLabel( i18n( "&Number of results:" ), this ); + label = new TQLabel( i18n( "&Number of results:" ), this ); hLayout->addWidget( label ); - spinBoxMaxHits = new QSpinBox( 1, 250, 1, this ); + spinBoxMaxHits = new TQSpinBox( 1, 250, 1, this ); spinBoxMaxHits->setValue( 10 ); hLayout->addWidget( spinBoxMaxHits ); label->setBuddy( spinBoxMaxHits ); - hLayout = new QHBoxLayout( ); + hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); - checkBoxKeepEntriesSeparate = new QCheckBox( i18n( "Do not merge corresponding entries" ), this ); + checkBoxKeepEntriesSeparate = new TQCheckBox( i18n( "Do not merge corresponding entries" ), this ); hLayout->addWidget( checkBoxKeepEntriesSeparate ); vLayout->addStretch( 0 ); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); } - WebQueryDBLP::WebQueryDBLP( QWidget* parent ): WebQuery( parent ) + WebQueryDBLP::WebQueryDBLP( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQueryDBLPWidget( parent ); } @@ -105,17 +105,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryDBLP::title() + TQString WebQueryDBLP::title() { return i18n( "DBLP" ); } - QString WebQueryDBLP::disclaimer() + TQString WebQueryDBLP::disclaimer() { return i18n( "DBLP - Copyright" ); } - QString WebQueryDBLP::disclaimerURL() + TQString WebQueryDBLP::disclaimerURL() { return "http://www.informatik.uni-trier.de/~ley/db/copyright.html"; } @@ -135,19 +135,19 @@ namespace KBibTeX int numberOfResults = m_widget->spinBoxMaxHits->value(); setNumStages( numberOfResults + 1 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - KURL url = KURL( QString( "http://dblp.l3s.de/?newsearch=1&q=%1&search_opt=all&synt_query_exp=full" ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + KURL url = KURL( TQString( "http://dblp.l3s.de/?newsearch=1&q=%1&search_opt=all&synt_query_exp=full" ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); - QString completeText = download( url ); - if ( completeText != QString::null && !m_aborted ) + TQString completeText = download( url ); + if ( completeText != TQString::null && !m_aborted ) { - QRegExp findBibTeXurl( " -class QCheckBox; +class TQCheckBox; namespace KBibTeX { @@ -33,8 +33,8 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryDBLPWidget( QWidget *parent, const char *name = 0 ); - QCheckBox *checkBoxKeepEntriesSeparate; + WebQueryDBLPWidget( TQWidget *parent, const char *name = 0 ); + TQCheckBox *checkBoxKeepEntriesSeparate; protected: virtual void init(); @@ -47,14 +47,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryDBLP( QWidget* parent ); + WebQueryDBLP( TQWidget* parent ); virtual ~WebQueryDBLP(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/webquerygooglescholar.cpp b/src/webquerygooglescholar.cpp index a1c2d52..b8fdc04 100644 --- a/src/webquerygooglescholar.cpp +++ b/src/webquerygooglescholar.cpp @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -38,19 +38,19 @@ namespace KBibTeX { - WebQueryGoogleScholarWidget::WebQueryGoogleScholarWidget( QWidget *parent, const char *name ) + WebQueryGoogleScholarWidget::WebQueryGoogleScholarWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "GoogleScholar" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "GoogleScholar" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryGoogleScholar::WebQueryGoogleScholar( QWidget* parent ) + WebQueryGoogleScholar::WebQueryGoogleScholar( TQWidget* parent ) : WebQuery( parent ), m_transferJob( NULL ), m_transferJobBuffer( NULL ) { m_importer = new BibTeX::FileImporterBibTeX( FALSE ); @@ -64,17 +64,17 @@ namespace KBibTeX delete m_importer; } - QString WebQueryGoogleScholar::title() + TQString WebQueryGoogleScholar::title() { return i18n( "Google Scholar" ); } - QString WebQueryGoogleScholar::disclaimer() + TQString WebQueryGoogleScholar::disclaimer() { return i18n( "About Google Scholar" ); } - QString WebQueryGoogleScholar::disclaimerURL() + TQString WebQueryGoogleScholar::disclaimerURL() { return "http://scholar.google.com/intl/en/scholar/about.html"; } @@ -110,10 +110,10 @@ namespace KBibTeX readAndChangeConfig(); /** prepare HTTP request (buffer, signals, job) */ - m_transferJobBuffer = new QBuffer(); + m_transferJobBuffer = new TQBuffer(); m_transferJobBuffer->open( IO_WriteOnly ); KIO::TransferJob* m_transferJob = KIO::get( KURL( "http://scholar.google.com/scholar_ncr" ), false, false ); - connect( m_transferJob, SIGNAL( data( KIO::Job *, const QByteArray & ) ), this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( m_transferJob, SIGNAL( data( KIO::Job *, const TQByteArray & ) ), this, SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); connect( m_transferJob, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinishedStartpage( KIO::Job * ) ) ); } @@ -151,10 +151,10 @@ namespace KBibTeX enterNextStage(); /** prepare next HTTP request for preferences page (buffer, signals, job) */ - m_transferJobBuffer = new QBuffer(); + m_transferJobBuffer = new TQBuffer(); m_transferJobBuffer->open( IO_WriteOnly ); KIO::TransferJob* m_transferJob = KIO::get( KURL( "http://scholar.google.com/scholar_preferences?hl=en" ), false, false ); - connect( m_transferJob, SIGNAL( data( KIO::Job *, const QByteArray & ) ), this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( m_transferJob, SIGNAL( data( KIO::Job *, const TQByteArray & ) ), this, SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); connect( m_transferJob, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinishedLoadingSettings( KIO::Job * ) ) ); } @@ -163,7 +163,7 @@ namespace KBibTeX { /** close and delete buffer (content does not matter) */ m_transferJobBuffer->close(); - QString htmlCode = textFromBuffer( m_transferJobBuffer ); + TQString htmlCode = textFromBuffer( m_transferJobBuffer ); delete m_transferJobBuffer; /** if aborted in the mean time, clean up everything */ @@ -186,19 +186,19 @@ namespace KBibTeX enterNextStage(); /** parse html code to get form values */ - QMap keyValues = evalFormFields( htmlCode ); + TQMap keyValues = evalFormFields( htmlCode ); /** set form values for BibTeX search */ keyValues["scis"] = "yes"; keyValues["scisf"] = "4"; keyValues["submit"] = "Save+Preferences"; - keyValues["num"] = QString::number( m_numberOfResults ); + keyValues["num"] = TQString::number( m_numberOfResults ); /** prepare next HTTP request to submit preferences (buffer, signals, job) */ KURL nextUrl( formFieldsToUrl( "http://scholar.google.com/scholar_setprefs", keyValues ) ); - m_transferJobBuffer = new QBuffer(); + m_transferJobBuffer = new TQBuffer(); m_transferJobBuffer->open( IO_WriteOnly ); KIO::TransferJob* m_transferJob = KIO::get( nextUrl, false, false ); - connect( m_transferJob, SIGNAL( data( KIO::Job *, const QByteArray & ) ), this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( m_transferJob, SIGNAL( data( KIO::Job *, const TQByteArray & ) ), this, SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); connect( m_transferJob, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinishedSavingSettings( KIO::Job * ) ) ); } @@ -206,7 +206,7 @@ namespace KBibTeX { /** close and delete buffer (content does not matter) */ m_transferJobBuffer->close(); - QString htmlCode = textFromBuffer( m_transferJobBuffer ); + TQString htmlCode = textFromBuffer( m_transferJobBuffer ); delete m_transferJobBuffer; /** if aborted in the mean time, clean up everything */ @@ -229,17 +229,17 @@ namespace KBibTeX enterNextStage(); /** parse html code to get form values */ - QMap keyValues = evalFormFields( htmlCode ); + TQMap keyValues = evalFormFields( htmlCode ); /** set form values for search */ keyValues["q"] = m_searchTerm; - keyValues["num"] = QString::number( m_numberOfResults ); + keyValues["num"] = TQString::number( m_numberOfResults ); /** prepare next HTTP request for actual search (buffer, signals, job) */ KURL nextUrl( formFieldsToUrl( "http://scholar.google.com/scholar", keyValues ) ); - m_transferJobBuffer = new QBuffer(); + m_transferJobBuffer = new TQBuffer(); m_transferJobBuffer->open( IO_WriteOnly ); KIO::TransferJob* m_transferJob = KIO::get( nextUrl, false, false ); - connect( m_transferJob, SIGNAL( data( KIO::Job *, const QByteArray & ) ), this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( m_transferJob, SIGNAL( data( KIO::Job *, const TQByteArray & ) ), this, SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); connect( m_transferJob, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinishedReceivingResultOverview( KIO::Job * ) ) ); } @@ -247,7 +247,7 @@ namespace KBibTeX { /** close and delete buffer (content does not matter) */ m_transferJobBuffer->close(); - QString htmlCode = textFromBuffer( m_transferJobBuffer ); + TQString htmlCode = textFromBuffer( m_transferJobBuffer ); delete m_transferJobBuffer; /** if aborted in the mean time, clean up everything */ @@ -270,7 +270,7 @@ namespace KBibTeX enterNextStage(); /** find all links to BibTeX files in result page */ - QRegExp reBibUrl( "/scholar.bib[^ \">]+" ); + TQRegExp reBibUrl( "/scholar.bib[^ \">]+" ); int pos = 0; while ( !m_aborted && ( pos = htmlCode.find( reBibUrl, pos + 1 ) ) > 0 ) { @@ -311,12 +311,12 @@ namespace KBibTeX cfg.setGroup( "Cookie Policy" ); m_originalEnableCookies = cfg.readBoolEntry( "Cookies", true ); m_originalSessionCookies = cfg.readBoolEntry( "AcceptSessionCookies", true ); - QStringList cookieSettingsList = QStringList::split( ',', cfg.readEntry( "CookieDomainAdvice", "" ) ); + TQStringList cookieSettingsList = TQStringList::split( ',', cfg.readEntry( "CookieDomainAdvice", "" ) ); m_originalCookieGlobalAdvice = cfg.readEntry( "CookieGlobalAdvice", "Accept" ); - for ( QStringList::Iterator it = cookieSettingsList.begin(); it != cookieSettingsList.end(); ++it ) + for ( TQStringList::Iterator it = cookieSettingsList.begin(); it != cookieSettingsList.end(); ++it ) { - QStringList keyValue = QStringList::split( ':', *it ); + TQStringList keyValue = TQStringList::split( ':', *it ); if ( keyValue.size() == 2 ) { m_originalCookieMap[keyValue[0]] = keyValue[1]; @@ -327,9 +327,9 @@ namespace KBibTeX cfg.writeEntry( "CookieGlobalAdvice", "Accept" ); cfg.writeEntry( "AcceptSessionCookies", true ); cookieSettingsList.clear(); - for ( QMap::Iterator it = m_originalCookieMap.begin(); it != m_originalCookieMap.end(); ++it ) + for ( TQMap::Iterator it = m_originalCookieMap.begin(); it != m_originalCookieMap.end(); ++it ) { - QString value = it.key().contains( ".google." ) ? "Accept" : it.data(); + TQString value = it.key().contains( ".google." ) ? "Accept" : it.data(); cookieSettingsList << it.key() + ":" + value; } cfg.writeEntry( "CookieDomainAdvice", cookieSettingsList.join( "," ) ); @@ -345,8 +345,8 @@ namespace KBibTeX cfg.writeEntry( "CookieGlobalAdvice", m_originalCookieGlobalAdvice ); cfg.writeEntry( "Cookies", m_originalEnableCookies ); cfg.writeEntry( "AcceptSessionCookies", m_originalSessionCookies ); - QStringList cookieSettingsList; - for ( QMap::Iterator it = m_originalCookieMap.begin(); it != m_originalCookieMap.end(); ++it ) + TQStringList cookieSettingsList; + for ( TQMap::Iterator it = m_originalCookieMap.begin(); it != m_originalCookieMap.end(); ++it ) cookieSettingsList << it.key() + ":" + it.data(); cfg.writeEntry( "CookieDomainAdvice", cookieSettingsList.join( "," ) ); cfg.sync(); @@ -357,33 +357,33 @@ namespace KBibTeX ( void )DCOPRef( "kded", "kcookiejar" ).send( "reloadPolicy" ); } - QString WebQueryGoogleScholar::textFromBuffer( QBuffer *buffer ) + TQString WebQueryGoogleScholar::textFromBuffer( TQBuffer *buffer ) { - QString htmlCode = ""; + TQString htmlCode = ""; buffer->open( IO_ReadOnly ); - QTextStream ts( buffer ); + TQTextStream ts( buffer ); while ( !ts.atEnd() ) htmlCode.append( ts.readLine() ); buffer->close(); return htmlCode; } - QMap WebQueryGoogleScholar::evalFormFields( const QString &htmlCode ) + TQMap WebQueryGoogleScholar::evalFormFields( const TQString &htmlCode ) { - QMap keyValues; + TQMap keyValues; - QRegExp reInput( "]+>" ); - QRegExp reSplit( "[<>=\" ]+" ); + TQRegExp reInput( "]+>" ); + TQRegExp reSplit( "[<>=\" ]+" ); int pos = 0; while (( pos = htmlCode.find( reInput, pos + 1 ) ) > 5 ) { - QStringList elements = QStringList::split( reSplit, reInput.cap( 0 ) ); + TQStringList elements = TQStringList::split( reSplit, reInput.cap( 0 ) ); bool checked = false; bool isCheckable = false; bool isSubmit = false; - QString key = QString::null; - QString value = QString::null; - for ( QStringList::Iterator it = elements.begin(); it != elements.end(); ++it ) + TQString key = TQString::null; + TQString value = TQString::null; + for ( TQStringList::Iterator it = elements.begin(); it != elements.end(); ++it ) { if ( *it == "name" ) { @@ -406,27 +406,27 @@ namespace KBibTeX isSubmit = *it == "submit"; } } - if (( !isCheckable || checked ) && ( !isSubmit || value == "submit" ) && value != QString::null && key != QString::null ) + if (( !isCheckable || checked ) && ( !isSubmit || value == "submit" ) && value != TQString::null && key != TQString::null ) { keyValues[key] = value; } } - QRegExp reSelect( "" ); + TQRegExp reSelect( "" ); reSelect.setMinimal( true ); - QRegExp reOption( "]+>" ); + TQRegExp reOption( "]+>" ); int pos3 = 0; while (( pos3 = htmlCode.find( reSelect, pos3 + 1 ) ) > 5 ) { - QString key = reSelect.cap( 1 ); - QString sub = reSelect.cap( 0 ); + TQString key = reSelect.cap( 1 ); + TQString sub = reSelect.cap( 0 ); int pos2 = 0; while (( pos2 = sub.find( reOption, pos2 + 1 ) ) > 5 ) { - QStringList elements = QStringList::split( reSplit, reOption.cap( 0 ) ); + TQStringList elements = TQStringList::split( reSplit, reOption.cap( 0 ) ); bool selected = false; - QString value = QString::null; - for ( QStringList::Iterator it = elements.begin(); it != elements.end(); ++it ) + TQString value = TQString::null; + for ( TQStringList::Iterator it = elements.begin(); it != elements.end(); ++it ) { if ( *it == "value" ) { @@ -438,7 +438,7 @@ namespace KBibTeX if ( *it == "selected" ) selected = true; } - if ( selected && value != QString::null && key != QString::null ) + if ( selected && value != TQString::null && key != TQString::null ) { keyValues[key] = value; } @@ -448,11 +448,11 @@ namespace KBibTeX return keyValues; } - QString WebQueryGoogleScholar::formFieldsToUrl( const QString &prefix, const QMap &keyValues ) + TQString WebQueryGoogleScholar::formFieldsToUrl( const TQString &prefix, const TQMap &keyValues ) { bool first = true; - QString nextUrl = prefix; - for ( QMap::ConstIterator it = keyValues.begin(); it != keyValues.end(); ++it ) + TQString nextUrl = prefix; + for ( TQMap::ConstIterator it = keyValues.begin(); it != keyValues.end(); ++it ) { if ( first ) nextUrl.append( "?" ); diff --git a/src/webquerygooglescholar.h b/src/webquerygooglescholar.h index 6d9065a..20003fd 100644 --- a/src/webquerygooglescholar.h +++ b/src/webquerygooglescholar.h @@ -20,8 +20,8 @@ #ifndef KBIBTEXWEBQUERYGOOGLESCHOLAR_H #define KBIBTEXWEBQUERYGOOGLESCHOLAR_H -#include -#include +#include +#include #include @@ -37,7 +37,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryGoogleScholarWidget( QWidget *parent, const char *name = 0 ); + WebQueryGoogleScholarWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -47,14 +47,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryGoogleScholar( QWidget* parent ); + WebQueryGoogleScholar( TQWidget* parent ); virtual ~WebQueryGoogleScholar(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); @@ -62,7 +62,7 @@ namespace KBibTeX void cancelQuery(); private slots: - void slotData( KIO::Job *, const QByteArray &data ) + void slotData( KIO::Job *, const TQByteArray &data ) { m_transferJobBuffer->writeBlock( data.data(), data.size() ); }; @@ -80,30 +80,30 @@ namespace KBibTeX WebQueryGoogleScholarWidget *m_widget; bool m_abort; - QString m_searchTerm; + TQString m_searchTerm; int m_numberOfResults; BibTeX::FileImporterBibTeX *m_importer; bool m_originalEnableCookies; bool m_originalSessionCookies; - QMap m_originalCookieMap; - QString m_originalCookieGlobalAdvice; + TQMap m_originalCookieMap; + TQString m_originalCookieGlobalAdvice; KIO::TransferJob *m_transferJob; - QBuffer *m_transferJobBuffer; + TQBuffer *m_transferJobBuffer; /** load KDE's cookie configuration, store values, and reset with Google-friendly values */ void readAndChangeConfig(); /** restore previous configuration values by saving old cookie configuration */ void restoreConfig(); - /** extract text from a QBuffer object */ - QString textFromBuffer( QBuffer *buffer ); + /** extract text from a TQBuffer object */ + TQString textFromBuffer( TQBuffer *buffer ); /** parse HTML code and get all key-value pairs from and */ - QMap evalFormFields( const QString &htmlCode ); + TQMap evalFormFields( const TQString &htmlCode ); /** glue together URL from key-value pairs in form */ - QString formFieldsToUrl( const QString &prefix, const QMap &keyValues ); + TQString formFieldsToUrl( const TQString &prefix, const TQMap &keyValues ); }; } diff --git a/src/webqueryieeexplore.cpp b/src/webqueryieeexplore.cpp index 070f8ca..1ffbd9e 100644 --- a/src/webqueryieeexplore.cpp +++ b/src/webqueryieeexplore.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -38,19 +38,19 @@ namespace KBibTeX { - WebQueryIEEExploreWidget::WebQueryIEEExploreWidget( QWidget *parent, const char *name ) + WebQueryIEEExploreWidget::WebQueryIEEExploreWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "IEEE" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "IEEE" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryIEEExplore::WebQueryIEEExplore( QWidget* parent ): WebQuery( parent ), m_numberOfMatches( "Your search matched (\\d+) of" ), m_findArNumber( "srchabstract.jsp\\?arnumber=(\\d+)" ), m_date( "(?:([A-Z][a-z]{2,3})(?:(?:/|-\\d+\\s+)([A-Z][a-z]{2,3}))?)?\\.?\\s*(\\d{4})$" ), m_risURL( "http://ieeexplore.ieee.org/xpls/citationAct" ) + WebQueryIEEExplore::WebQueryIEEExplore( TQWidget* parent ): WebQuery( parent ), m_numberOfMatches( "Your search matched (\\d+) of" ), m_findArNumber( "srchabstract.jsp\\?arnumber=(\\d+)" ), m_date( "(?:([A-Z][a-z]{2,3})(?:(?:/|-\\d+\\s+)([A-Z][a-z]{2,3}))?)?\\.?\\s*(\\d{4})$" ), m_risURL( "http://ieeexplore.ieee.org/xpls/citationAct" ) { m_widget = new WebQueryIEEExploreWidget( parent ); m_bibtexImporter = new BibTeX::FileImporterBibTeX( false ); @@ -62,17 +62,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryIEEExplore::title() + TQString WebQueryIEEExplore::title() { return i18n( "IEEExplore" ); } - QString WebQueryIEEExplore::disclaimer() + TQString WebQueryIEEExplore::disclaimer() { return i18n( "What is IEEE Xplore?" ); } - QString WebQueryIEEExplore::disclaimerURL() + TQString WebQueryIEEExplore::disclaimerURL() { return "http://ieeexplore.ieee.org/guide/g_oview_faq.jsp"; } @@ -91,18 +91,18 @@ namespace KBibTeX m_arnumList.clear(); m_numMaxHits = min( 50, m_widget->spinBoxMaxHits->value() ); setNumStages( m_numMaxHits + 1 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - QString category = "metadata"; - KURL url = KURL( QString( "http://ieeexplore.ieee.org/search/freesearchresult.jsp?queryText=" ).append( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ).append( "+%3Cin%3E+" ).append( category ).append( "&ResultCount=" ).append( QString::number( m_numMaxHits ) ).append( "&ResultStart=0" ) ); + TQString category = "metadata"; + KURL url = KURL( TQString( "http://ieeexplore.ieee.org/search/freesearchresult.jsp?queryText=" ).append( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ).append( "+%3Cin%3E+" ).append( category ).append( "&ResultCount=" ).append( TQString::number( m_numMaxHits ) ).append( "&ResultStart=0" ) ); - QString completeText = downloadHTML( url ); - if ( completeText != QString::null && !m_aborted ) + TQString completeText = downloadHTML( url ); + if ( completeText != TQString::null && !m_aborted ) { if ( completeText.find( "You have entered an invalid search" ) > -1 ) { @@ -150,10 +150,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } @@ -171,23 +171,23 @@ namespace KBibTeX m_arnumList.remove( m_arnumList.begin() ); m_incomingData = ""; - QString data = "dlSelect=cite&fileFormate=BibTex&arnumber=%3Carnumber%3E" + QString::number( arnum ) + "%3C%2Farnumber%3E&Submit=Download"; + TQString data = "dlSelect=cite&fileFormate=BibTex&arnumber=%3Carnumber%3E" + TQString::number( arnum ) + "%3C%2Farnumber%3E&Submit=Download"; KIO::TransferJob *job = KIO::http_post( m_risURL, data.utf8(), false ); job->addMetaData( "content-type", "Content-Type: application/x-www-form-urlencoded" ); - connect( job, SIGNAL( data( KIO::Job *, const QByteArray & ) ), this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( job, SIGNAL( data( KIO::Job *, const TQByteArray & ) ), this, SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) ); } - void WebQueryIEEExplore::slotData( KIO::Job *, const QByteArray &data ) + void WebQueryIEEExplore::slotData( KIO::Job *, const TQByteArray &data ) { if ( data.size() > 0 ) - m_incomingData.append( QCString( data, data.size() + 1 ) ); + m_incomingData.append( TQCString( data, data.size() + 1 ) ); } void WebQueryIEEExplore::slotResult( KIO::Job *job ) { - QRegExp m_date( "^(((\\d{1,2}(-\\d{1,2}))\\s+)?(([A-Z][a-z]{2,3})(/([A-Z][a-z]{2,3}))?)\\.?\\s+)?(\\d{4})$" ); + TQRegExp m_date( "^(((\\d{1,2}(-\\d{1,2}))\\s+)?(([A-Z][a-z]{2,3})(/([A-Z][a-z]{2,3}))?)\\.?\\s+)?(\\d{4})$" ); if ( job->error() ) { job->showErrorDialog(); @@ -235,8 +235,8 @@ namespace KBibTeX field->setValue( new BibTeX::Value( m_date.cap( 3 ), true ) ); } - QString newMonth = QString::null; - if ( !m_date.cap( 1 ).isNull() && !m_date.cap( 1 ).isEmpty() && ( newMonth = parseMonth( m_date.cap( 1 ) ) ) != QString::null ) + TQString newMonth = TQString::null; + if ( !m_date.cap( 1 ).isNull() && !m_date.cap( 1 ).isEmpty() && ( newMonth = parseMonth( m_date.cap( 1 ) ) ) != TQString::null ) { BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftMonth ); if ( field == NULL ) @@ -247,8 +247,8 @@ namespace KBibTeX field->setValue( new BibTeX::Value( newMonth, true ) ); - newMonth = QString::null; - if ( !m_date.cap( 2 ).isNull() && !m_date.cap( 2 ).isEmpty() && ( newMonth = parseMonth( m_date.cap( 2 ) ) ) != QString::null ) + newMonth = TQString::null; + if ( !m_date.cap( 2 ).isNull() && !m_date.cap( 2 ).isEmpty() && ( newMonth = parseMonth( m_date.cap( 2 ) ) ) != TQString::null ) { field->value()->items.append( new BibTeX::PlainText( "/" ) ); field->value()->items.append( new BibTeX::MacroKey( newMonth ) ); @@ -256,11 +256,11 @@ namespace KBibTeX } } - QString WebQueryIEEExplore::parseMonth( const QString &month ) + TQString WebQueryIEEExplore::parseMonth( const TQString &month ) { for ( unsigned int i = 0; i < sizeof( BibTeX::MonthsTriple ) / sizeof( BibTeX::MonthsTriple[0] ); ++i ) if ( month.startsWith( BibTeX::MonthsTriple[i], false ) ) return BibTeX::MonthsTriple[i]; - return QString::null; + return TQString::null; } } diff --git a/src/webqueryieeexplore.h b/src/webqueryieeexplore.h index d07f504..3314d74 100644 --- a/src/webqueryieeexplore.h +++ b/src/webqueryieeexplore.h @@ -20,7 +20,7 @@ #ifndef KBIBTEXWEBQUERYIEEEXPLORE_H #define KBIBTEXWEBQUERYIEEEXPLORE_H -#include +#include #include #include @@ -34,7 +34,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryIEEExploreWidget( QWidget *parent, const char *name = 0 ); + WebQueryIEEExploreWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -45,14 +45,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryIEEExplore( QWidget* parent ); + WebQueryIEEExplore( TQWidget* parent ); virtual ~WebQueryIEEExplore(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); @@ -62,20 +62,20 @@ namespace KBibTeX private: BibTeX::FileImporter *m_bibtexImporter; WebQueryIEEExploreWidget *m_widget; - QRegExp m_numberOfMatches; - QRegExp m_findArNumber; - QRegExp m_date; + TQRegExp m_numberOfMatches; + TQRegExp m_findArNumber; + TQRegExp m_date; KURL m_risURL; - QValueList m_arnumList; - QString m_incomingData; + TQValueList m_arnumList; + TQString m_incomingData; int m_numMaxHits, m_numMatches, m_hitCounter; void fetchNext(); void fixDate( BibTeX::Entry *entry ); - QString parseMonth( const QString &month ); + TQString parseMonth( const TQString &month ); private slots: - void slotData( KIO::Job *job, const QByteArray &data ); + void slotData( KIO::Job *job, const TQByteArray &data ); void slotResult( KIO::Job *job ); }; } diff --git a/src/webquerymathscinet.cpp b/src/webquerymathscinet.cpp index ef6349a..33d78f1 100644 --- a/src/webquerymathscinet.cpp +++ b/src/webquerymathscinet.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include "webquerymathscinet.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -36,58 +36,58 @@ namespace KBibTeX { - WebQueryMathSciNetWidget::WebQueryMathSciNetWidget( QWidget *parent, const char *name ) + WebQueryMathSciNetWidget::WebQueryMathSciNetWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "MathSciNet" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "MathSciNet" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } void WebQueryMathSciNetWidget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearSearchText ); - QLabel *label = new QLabel( i18n( "Search &term:" ), this ); + TQLabel *label = new TQLabel( i18n( "Search &term:" ), this ); hLayout->addWidget( label ); lineEditQuery = new KLineEdit( this ); hLayout->addWidget( lineEditQuery ); label->setBuddy( lineEditQuery ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); hLayout->setStretchFactor( lineEditQuery, 4 ); KCompletion *completionQuery = lineEditQuery->completionObject(); /* - label = new QLabel( i18n( "&Number of results:" ), this ); + label = new TQLabel( i18n( "&Number of results:" ), this ); hLayout->addWidget( label ); - spinBoxMaxHits = new QSpinBox( 1, 250, 1, this ); + spinBoxMaxHits = new TQSpinBox( 1, 250, 1, this ); spinBoxMaxHits->setValue( 10 ); hLayout->addWidget( spinBoxMaxHits ); label->setBuddy( spinBoxMaxHits ); */ - label = new QLabel( i18n( "Use the same synatx as for BIBGET. For spaces within a search element, use \"+\".
Example: a=gilkey t=invariance book 1984
" ), this ); + label = new TQLabel( i18n( "Use the same synatx as for BIBGET. For spaces within a search element, use \"+\".
Example: a=gilkey t=invariance book 1984
" ), this ); vLayout->addWidget( label ); vLayout->addStretch( 0 ); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); } - WebQueryMathSciNet::WebQueryMathSciNet( QWidget* parent ): WebQuery( parent ) + WebQueryMathSciNet::WebQueryMathSciNet( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQueryMathSciNetWidget( parent ); } @@ -97,17 +97,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryMathSciNet::title() + TQString WebQueryMathSciNet::title() { return i18n( "MathSciNet" ); } - QString WebQueryMathSciNet::disclaimer() + TQString WebQueryMathSciNet::disclaimer() { return i18n( "American Mathematical Society" ); } - QString WebQueryMathSciNet::disclaimerURL() + TQString WebQueryMathSciNet::disclaimerURL() { return "http://www.ams.org/ams/copyright.html"; } @@ -125,34 +125,34 @@ namespace KBibTeX setNumStages( 1 ); - QStringList searchTerms = QStringList::split( QRegExp( "\\s+" ), m_widget->lineEditQuery->text().stripWhiteSpace() ); + TQStringList searchTerms = TQStringList::split( TQRegExp( "\\s+" ), m_widget->lineEditQuery->text().stripWhiteSpace() ); if ( searchTerms.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - QStringList queryTerms; + TQStringList queryTerms; int count = 1; - for ( QStringList::ConstIterator it = searchTerms.constBegin(); it != searchTerms.constEnd(); ++it ) + for ( TQStringList::ConstIterator it = searchTerms.constBegin(); it != searchTerms.constEnd(); ++it ) { - const QString term=*it; + const TQString term=*it; if ( term.startsWith( "a=" ) ) - queryTerms << QString( "pg%1=AUCN" ).arg( count ) << QString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); + queryTerms << TQString( "pg%1=AUCN" ).arg( count ) << TQString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); else if ( term.startsWith( "t=" ) ) - queryTerms << QString( "pg%1=TI" ).arg( count ) << QString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); + queryTerms << TQString( "pg%1=TI" ).arg( count ) << TQString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); else if ( term.startsWith( "k=" ) ) - queryTerms << QString( "pg%1=ALLF" ).arg( count ) << QString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); + queryTerms << TQString( "pg%1=ALLF" ).arg( count ) << TQString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); else if ( term.startsWith( "r=" ) ) - queryTerms << QString( "pg%1=MR" ).arg( count ) << QString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); + queryTerms << TQString( "pg%1=MR" ).arg( count ) << TQString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); else if ( term.startsWith( "j=" ) ) - queryTerms << QString( "pg%1=JOUR" ).arg( count ) << QString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); + queryTerms << TQString( "pg%1=JOUR" ).arg( count ) << TQString( "s%1=%2" ).arg( count ).arg( term.mid( 2 ) ); else - queryTerms << QString( "pg%1=ALLF" ).arg( count ) << QString( "s%1=%2" ).arg( count ).arg( term ); + queryTerms << TQString( "pg%1=ALLF" ).arg( count ) << TQString( "s%1=%2" ).arg( count ).arg( term ); ++count; } - KURL url( QString( "http://www.ams.org/msnmain?fn=130&fmt=bibtex&l=100&extend=1&" ).append( queryTerms.join( "&" ) ) ); + KURL url( TQString( "http://www.ams.org/msnmain?fn=130&fmt=bibtex&l=100&extend=1&" ).append( queryTerms.join( "&" ) ) ); kdDebug()<<"url="< -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -40,19 +40,19 @@ namespace KBibTeX { - WebQueryPubMedWidget::WebQueryPubMedWidget( QWidget *parent, const char *name ) + WebQueryPubMedWidget::WebQueryPubMedWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "PubMed" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "PubMed" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryPubMed::WebQueryPubMed( QWidget *parent ) : WebQuery( parent ) + WebQueryPubMed::WebQueryPubMed( TQWidget *parent ) : WebQuery( parent ) { m_widget = new WebQueryPubMedWidget( parent ); } @@ -62,17 +62,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryPubMed::title() + TQString WebQueryPubMed::title() { return i18n( "NCBI (PubMed)" ); } - QString WebQueryPubMed::disclaimer() + TQString WebQueryPubMed::disclaimer() { return i18n( "NCBI's Disclaimer and Copyright" ); } - QString WebQueryPubMed::disclaimerURL() + TQString WebQueryPubMed::disclaimerURL() { return "http://eutils.ncbi.nlm.nih.gov/About/disclaimer.html"; } @@ -91,7 +91,7 @@ namespace KBibTeX setNumStages( 2 ); int numberOfResults = m_widget->spinBoxMaxHits->value(); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); @@ -99,54 +99,54 @@ namespace KBibTeX } searchTerm = searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); - 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 ) ); + KURL url = KURL( TQString( "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 ) ); - QString data = downloadHTML( url ); - if ( data != QString::null && !m_aborted ) + TQString data = downloadHTML( url ); + if ( data != TQString::null && !m_aborted ) { - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << data << endl; buffer.close(); buffer.open( IO_ReadOnly ); - QValueList intList; - QXmlInputSource inputSource( &buffer ); - QXmlSimpleReader reader; + TQValueList intList; + TQXmlInputSource inputSource( &buffer ); + TQXmlSimpleReader reader; WebQueryPubMedStructureParserQuery handler( &intList ); reader.setContentHandler( &handler ); reader.parse( &inputSource ); buffer.close(); - QString ids; - QValueList::iterator it = intList.begin(); + TQString ids; + TQValueList::iterator it = intList.begin(); if ( it != intList.end() ) { - ids.append( QString::number( *it ) ); + ids.append( TQString::number( *it ) ); ++it; for ( ; it != intList.end(); ++it ) { ids.append( "," ); - ids.append( QString::number( *it ) ); + ids.append( TQString::number( *it ) ); } } - 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 ) ); + url = KURL( TQString( "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 ) ); data = downloadHTML( url ); - if ( data != QString::null && !m_aborted ) + if ( data != TQString::null && !m_aborted ) { buffer.open( IO_WriteOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << data << endl; buffer.close(); buffer.open( IO_ReadOnly ); - QDomDocument doc( "efetch'ed" ); + TQDomDocument doc( "efetch'ed" ); doc.setContent( &buffer ); - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); WebQueryPubMedResultParser resultParser; connect( &resultParser, SIGNAL( foundEntry( BibTeX::Entry*, bool ) ), this, SIGNAL( foundEntry( BibTeX::Entry*, bool ) ) ); resultParser.parse( docElem ); @@ -155,8 +155,8 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + TQString message = KIO::NetAccess::lastErrorString(); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } @@ -165,10 +165,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } @@ -176,7 +176,7 @@ namespace KBibTeX setEndSearch( WebQuery::statusAborted ); } - WebQueryPubMedStructureParserQuery::WebQueryPubMedStructureParserQuery( QValueList *intList ) : QXmlDefaultHandler(), m_intList( intList ) + WebQueryPubMedStructureParserQuery::WebQueryPubMedStructureParserQuery( TQValueList *intList ) : TQXmlDefaultHandler(), m_intList( intList ) { m_intList->clear(); } @@ -186,13 +186,13 @@ namespace KBibTeX // nothing } - bool WebQueryPubMedStructureParserQuery::startElement( const QString & /*namespaceURI*/, const QString & /*localName*/, const QString & /*qName*/, const QXmlAttributes & /*atts*/ ) + bool WebQueryPubMedStructureParserQuery::startElement( const TQString & /*namespaceURI*/, const TQString & /*localName*/, const TQString & /*qName*/, const TQXmlAttributes & /*atts*/ ) { - concatString = QString(); + concatString = TQString(); return TRUE; } - bool WebQueryPubMedStructureParserQuery::endElement( const QString & /*namespaceURI*/, const QString & /*localName*/, const QString & qName ) + bool WebQueryPubMedStructureParserQuery::endElement( const TQString & /*namespaceURI*/, const TQString & /*localName*/, const TQString & qName ) { if ( qName == "Id" ) { @@ -205,23 +205,23 @@ namespace KBibTeX return TRUE; } - bool WebQueryPubMedStructureParserQuery::characters( const QString & ch ) + bool WebQueryPubMedStructureParserQuery::characters( const TQString & ch ) { concatString.append( ch ); return TRUE; } - WebQueryPubMedResultParser::WebQueryPubMedResultParser( ) : QObject() + WebQueryPubMedResultParser::WebQueryPubMedResultParser( ) : TQObject() { // nothing } - void WebQueryPubMedResultParser::parse( const QDomElement& rootElement ) + void WebQueryPubMedResultParser::parse( const TQDomElement& rootElement ) { if ( rootElement.tagName() == "PubmedArticleSet" ) - for ( QDomNode n = rootElement.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = rootElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( !e.isNull() && e.tagName() == "PubmedArticle" ) { BibTeX::Entry * entry = new BibTeX::Entry( BibTeX::Entry::etMisc, "PubMed" ); @@ -236,26 +236,26 @@ namespace KBibTeX // nothing } - void WebQueryPubMedResultParser::parsePubmedArticle( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parsePubmedArticle( const TQDomElement& element, BibTeX::Entry *entry ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( !e.isNull() && e.tagName() == "MedlineCitation" ) parseMedlineCitation( e, entry ); } } - void WebQueryPubMedResultParser::parseMedlineCitation( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parseMedlineCitation( const TQDomElement& element, BibTeX::Entry *entry ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( !e.isNull() ) { if ( e.tagName() == "PMID" ) { - entry->setId( QString( "PubMed_%1" ).arg( e.text() ) ); + entry->setId( TQString( "PubMed_%1" ).arg( e.text() ) ); /** add url to pubmed website */ BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftURL ); @@ -264,15 +264,15 @@ namespace KBibTeX field = new BibTeX::EntryField( BibTeX::EntryField::ftURL ); entry->addField( field ); } - field->setValue( new BibTeX::Value( QString( "http://www.ncbi.nlm.nih.gov/pubmed/" ).append( e.text() ) ) ); + field->setValue( new BibTeX::Value( TQString( "http://www.ncbi.nlm.nih.gov/pubmed/" ).append( e.text() ) ) ); } else if ( e.tagName() == "Article" ) parseArticle( e, entry ); else if ( e.tagName() == "MedlineJournalInfo" ) { - for ( QDomNode n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) + for ( TQDomNode n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - QDomElement e2 = n2.toElement(); + TQDomElement e2 = n2.toElement(); if ( e2.tagName() == "MedlineTA" ) { BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftJournal ); @@ -290,11 +290,11 @@ namespace KBibTeX } - void WebQueryPubMedResultParser::parseArticle( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parseArticle( const TQDomElement& element, BibTeX::Entry *entry ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName() == "Journal" ) { @@ -313,7 +313,7 @@ namespace KBibTeX } else if ( e.tagName() == "Pagination" ) { - QDomElement medlinePgn = e.firstChild().toElement(); // may fail? + TQDomElement medlinePgn = e.firstChild().toElement(); // may fail? if ( !medlinePgn.text().isEmpty() ) { BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftPages ); @@ -327,7 +327,7 @@ namespace KBibTeX } else if ( e.tagName() == "Abstract" ) { - QDomElement abstractText = e.firstChild().toElement(); + TQDomElement abstractText = e.firstChild().toElement(); BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftAbstract ); if ( field == NULL ) { @@ -351,11 +351,11 @@ namespace KBibTeX } } - void WebQueryPubMedResultParser::parseJournal( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parseJournal( const TQDomElement& element, BibTeX::Entry *entry ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName() == "ISSN" ) { @@ -382,11 +382,11 @@ namespace KBibTeX } } - void WebQueryPubMedResultParser::parseJournalIssue( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parseJournalIssue( const TQDomElement& element, BibTeX::Entry *entry ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName() == "Volume" ) { @@ -413,11 +413,11 @@ namespace KBibTeX } } - void WebQueryPubMedResultParser::parsePubDate( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parsePubDate( const TQDomElement& element, BibTeX::Entry *entry ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName() == "Year" ) { @@ -431,7 +431,7 @@ namespace KBibTeX } else if ( e.tagName() == "Month" ) { - QString month = e.text().lower(); + TQString month = e.text().lower(); BibTeX::EntryField * field = entry->getField( BibTeX::EntryField::ftMonth ); if ( field == NULL ) { @@ -444,8 +444,8 @@ namespace KBibTeX } else if ( e.tagName() == "MedlineDate" ) { - QStringList frags = QStringList::split( QRegExp( "\\s+" ), e.text() ); - for ( QStringList::Iterator it = frags.begin(); it != frags.end(); ++it ) + TQStringList frags = TQStringList::split( TQRegExp( "\\s+" ), e.text() ); + for ( TQStringList::Iterator it = frags.begin(); it != frags.end(); ++it ) { bool ok; int num = ( *it ).toInt( &ok ); @@ -458,7 +458,7 @@ namespace KBibTeX entry->addField( field ); } BibTeX::Value *value = new BibTeX::Value(); - value->items.append( new BibTeX::MacroKey( QString::number( num ) ) ); + value->items.append( new BibTeX::MacroKey( TQString::number( num ) ) ); field->setValue( value ); } else if ( !ok && ( *it ).length() == 3 ) @@ -478,20 +478,20 @@ namespace KBibTeX } } - void WebQueryPubMedResultParser::parseAuthorList( const QDomElement& element, BibTeX::Entry *entry ) + void WebQueryPubMedResultParser::parseAuthorList( const TQDomElement& element, BibTeX::Entry *entry ) { if ( element.attribute( "CompleteYN", "Y" ) == "Y" ) { - QStringList authorList; - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + TQStringList authorList; + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName() == "Author" && e.attribute( "ValidYN", "Y" ) == "Y" ) { - QString lastName = QString::null, firstName = QString::null; - for ( QDomNode n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) + TQString lastName = TQString::null, firstName = TQString::null; + for ( TQDomNode n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - QDomElement e2 = n2.toElement(); + TQDomElement e2 = n2.toElement(); if ( e2.tagName() == "LastName" ) lastName = e2.text(); else if ( e2.tagName() == "CollectiveName" ) @@ -499,7 +499,7 @@ namespace KBibTeX else if ( e2.tagName() == "FirstName" || e2.tagName() == "ForeName" ) firstName = e2.text(); } - QString name = lastName; + TQString name = lastName; if ( !firstName.isNull() && !firstName.isEmpty() ) { if ( name.isNull() ) name = "UNSET"; @@ -520,11 +520,11 @@ namespace KBibTeX Settings *settings = Settings::self(); BibTeX::PersonContainer *personContainer = new BibTeX::PersonContainer( settings->editing_FirstNameFirst ); value->items.append( personContainer ); - for ( QStringList::Iterator sli = authorList.begin(); sli != authorList.end(); ++sli ) + for ( TQStringList::Iterator sli = authorList.begin(); sli != authorList.end(); ++sli ) { - QStringList nameParts = QStringList::split( '|', *sli ); - QString firstName = nameParts.count() > 1 ? nameParts[0] : ""; - QString lastName = nameParts[nameParts.count() - 1]; + TQStringList nameParts = TQStringList::split( '|', *sli ); + TQString firstName = nameParts.count() > 1 ? nameParts[0] : ""; + TQString lastName = nameParts[nameParts.count() - 1]; personContainer->persons.append( new BibTeX::Person( firstName, lastName, settings->editing_FirstNameFirst ) ); } field->setValue( value ); diff --git a/src/webquerypubmed.h b/src/webquerypubmed.h index 86d0326..a100da7 100644 --- a/src/webquerypubmed.h +++ b/src/webquerypubmed.h @@ -20,15 +20,15 @@ #ifndef KBIBTEXWEBQUERYPUBMED_H #define KBIBTEXWEBQUERYPUBMED_H -#include -#include -#include +#include +#include +#include #include -class QStringList; -class QDomElement; -class QDate; +class TQStringList; +class TQDomElement; +class TQDate; namespace KBibTeX { @@ -39,58 +39,58 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryPubMedWidget( QWidget *parent, const char *name = 0 ); + WebQueryPubMedWidget( TQWidget *parent, const char *name = 0 ); }; - class WebQueryPubMedStructureParserQuery : public QXmlDefaultHandler + class WebQueryPubMedStructureParserQuery : public TQXmlDefaultHandler { public: - WebQueryPubMedStructureParserQuery( QValueList *intList ); + WebQueryPubMedStructureParserQuery( TQValueList *intList ); ~WebQueryPubMedStructureParserQuery( ); - bool startElement( const QString&, const QString&, const QString&, const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString & ch ); + bool startElement( const TQString&, const TQString&, const TQString&, const TQXmlAttributes& ); + bool endElement( const TQString&, const TQString&, const TQString& ); + bool characters( const TQString & ch ); private: - QValueList *m_intList; - QString concatString; + TQValueList *m_intList; + TQString concatString; }; - class WebQueryPubMedResultParser: public QObject + class WebQueryPubMedResultParser: public TQObject { Q_OBJECT public: WebQueryPubMedResultParser(); ~WebQueryPubMedResultParser(); - void parse( const QDomElement& rootElement ); + void parse( const TQDomElement& rootElement ); signals: void foundEntry( BibTeX::Entry*, bool ); private: - void parsePubmedArticle( const QDomElement& element, BibTeX::Entry *entry ); - void parseMedlineCitation( const QDomElement& element, BibTeX::Entry *entry ); - void parseArticle( const QDomElement& element, BibTeX::Entry *entry ); - void parseJournal( const QDomElement& element, BibTeX::Entry *entry ); - void parseJournalIssue( const QDomElement& element, BibTeX::Entry *entry ); - void parsePubDate( const QDomElement& element, BibTeX::Entry *entry ); - void parseAuthorList( const QDomElement& element, BibTeX::Entry *entry ); + void parsePubmedArticle( const TQDomElement& element, BibTeX::Entry *entry ); + void parseMedlineCitation( const TQDomElement& element, BibTeX::Entry *entry ); + void parseArticle( const TQDomElement& element, BibTeX::Entry *entry ); + void parseJournal( const TQDomElement& element, BibTeX::Entry *entry ); + void parseJournalIssue( const TQDomElement& element, BibTeX::Entry *entry ); + void parsePubDate( const TQDomElement& element, BibTeX::Entry *entry ); + void parseAuthorList( const TQDomElement& element, BibTeX::Entry *entry ); }; class WebQueryPubMed : public WebQuery { Q_OBJECT public: - WebQueryPubMed( QWidget *parent ); + WebQueryPubMed( TQWidget *parent ); virtual ~WebQueryPubMed(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/webquerysciencedirect.cpp b/src/webquerysciencedirect.cpp index 152d05b..2b62da1 100644 --- a/src/webquerysciencedirect.cpp +++ b/src/webquerysciencedirect.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -37,35 +37,35 @@ namespace KBibTeX { - WebQueryScienceDirectWidget::WebQueryScienceDirectWidget( QWidget *parent, const char *name ) + WebQueryScienceDirectWidget::WebQueryScienceDirectWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); - QString allValues; + TQString allValues; Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "ScienceDirect_title" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "ScienceDirect_title" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); allValues += value; value = settings->getWebQueryDefault( "ScienceDirect_author" ); - value = value == QString::null ? "" : value; + value = value == TQString::null ? "" : value; lineEditAuthor->setText( value ); allValues += value; value = settings->getWebQueryDefault( "ScienceDirect_journal" ); - value = value == QString::null ? "" : value; + value = value == TQString::null ? "" : value; lineEditJournal->setText( value ); allValues += value; value = settings->getWebQueryDefault( "ScienceDirect_volume" ); - value = value == QString::null ? "" : value; + value = value == TQString::null ? "" : value; lineEditVolume->setText( value ); allValues += value; value = settings->getWebQueryDefault( "ScienceDirect_issue" ); - value = value == QString::null ? "" : value; + value = value == TQString::null ? "" : value; lineEditIssue->setText( value ); allValues += value; value = settings->getWebQueryDefault( "ScienceDirect_page" ); - value = value == QString::null ? "" : value; + value = value == TQString::null ? "" : value; lineEditPage->setText( value ); allValues += value; @@ -74,65 +74,65 @@ namespace KBibTeX void WebQueryScienceDirectWidget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearSearchText ); - QLabel *label = new QLabel( i18n( "Title, abstract, keywords:" ), this ); + TQLabel *label = new TQLabel( i18n( "Title, abstract, keywords:" ), this ); hLayout->addWidget( label ); lineEditQuery = new KLineEdit( this ); KCompletion *completionQuery = lineEditQuery->completionObject(); hLayout->addWidget( lineEditQuery ); label->setBuddy( lineEditQuery ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChangedSD( ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChangedSD( ) ) ); hLayout->setStretchFactor( lineEditQuery, 7 ); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); - hLayout = new QHBoxLayout( ); + hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearAuthor = new KPushButton( this ); - clearAuthor->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearAuthor->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearAuthor ); - label = new QLabel( i18n( "Author:" ), this ); + label = new TQLabel( i18n( "Author:" ), this ); hLayout->addWidget( label ); lineEditAuthor = new KLineEdit( this ); completionQuery = lineEditAuthor->completionObject(); hLayout->addWidget( lineEditAuthor ); label->setBuddy( lineEditAuthor ); connect( clearAuthor, SIGNAL( clicked() ), lineEditAuthor, SLOT( clear() ) ); - connect( lineEditAuthor, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChangedSD( ) ) ); + connect( lineEditAuthor, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChangedSD( ) ) ); hLayout->setStretchFactor( lineEditAuthor, 7 ); connect( lineEditAuthor, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditAuthor, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditAuthor, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); KPushButton *clearJournal = new KPushButton( this ); - clearJournal->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearJournal->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearJournal ); - label = new QLabel( i18n( "Journal/book title:" ), this ); + label = new TQLabel( i18n( "Journal/book title:" ), this ); hLayout->addWidget( label ); lineEditJournal = new KLineEdit( this ); completionQuery = lineEditJournal->completionObject(); hLayout->addWidget( lineEditJournal ); label->setBuddy( lineEditJournal ); connect( clearJournal, SIGNAL( clicked() ), lineEditJournal, SLOT( clear() ) ); - connect( lineEditJournal, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChangedSD( ) ) ); + connect( lineEditJournal, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChangedSD( ) ) ); hLayout->setStretchFactor( lineEditJournal, 4 ); connect( lineEditJournal, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditJournal, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditJournal, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); - hLayout = new QHBoxLayout( ); + hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); - label = new QLabel( i18n( "Volume:" ), this ); + label = new TQLabel( i18n( "Volume:" ), this ); hLayout->addWidget( label ); lineEditVolume = new KLineEdit( this ); hLayout->addWidget( lineEditVolume ); @@ -142,7 +142,7 @@ namespace KBibTeX hLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "Issue:" ), this ); + label = new TQLabel( i18n( "Issue:" ), this ); hLayout->addWidget( label ); lineEditIssue = new KLineEdit( this ); hLayout->addWidget( lineEditIssue ); @@ -152,7 +152,7 @@ namespace KBibTeX hLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "Page:" ), this ); + label = new TQLabel( i18n( "Page:" ), this ); hLayout->addWidget( label ); lineEditPage = new KLineEdit( this ); hLayout->addWidget( lineEditPage ); @@ -162,9 +162,9 @@ namespace KBibTeX hLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "&Number of results:" ), this ); + label = new TQLabel( i18n( "&Number of results:" ), this ); hLayout->addWidget( label ); - spinBoxMaxHits = new QSpinBox( 1, 100, 1, this ); + spinBoxMaxHits = new TQSpinBox( 1, 100, 1, this ); spinBoxMaxHits->setValue( 10 ); hLayout->addWidget( spinBoxMaxHits ); hLayout->setStretchFactor( spinBoxMaxHits, 1 ); @@ -174,11 +174,11 @@ namespace KBibTeX void WebQueryScienceDirectWidget::slotTextChangedSD() { - QString text = lineEditQuery->text().stripWhiteSpace().append( lineEditAuthor->text().stripWhiteSpace() ).append( lineEditJournal->text().stripWhiteSpace() ).replace( '$', "" ); + TQString text = lineEditQuery->text().stripWhiteSpace().append( lineEditAuthor->text().stripWhiteSpace() ).append( lineEditJournal->text().stripWhiteSpace() ).replace( '$', "" ); emit enableSearch( !text.isEmpty() ); } - WebQueryScienceDirect::WebQueryScienceDirect( QWidget* parent ): WebQuery( parent ) + WebQueryScienceDirect::WebQueryScienceDirect( TQWidget* parent ): WebQuery( parent ) { m_importer = new BibTeX::FileImporterBibTeX( FALSE ); m_importer->setIgnoreComments( TRUE ); @@ -191,17 +191,17 @@ namespace KBibTeX delete m_importer; } - QString WebQueryScienceDirect::title() + TQString WebQueryScienceDirect::title() { return i18n( "ScienceDirect" ); } - QString WebQueryScienceDirect::disclaimer() + TQString WebQueryScienceDirect::disclaimer() { return i18n( "About ScienceDirect" ); } - QString WebQueryScienceDirect::disclaimerURL() + TQString WebQueryScienceDirect::disclaimerURL() { return "http://info.sciencedirect.com/"; } @@ -222,12 +222,12 @@ namespace KBibTeX settings->setWebQueryDefault( "ScienceDirect_issue", m_widget->lineEditIssue->text() ); settings->setWebQueryDefault( "ScienceDirect_page", m_widget->lineEditPage->text() ); - QString tak = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); - QString author = m_widget->lineEditAuthor->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); - QString journal = m_widget->lineEditJournal->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); - QString volume = m_widget->lineEditVolume->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); - QString issue = m_widget->lineEditIssue->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); - QString page = m_widget->lineEditPage->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); + TQString tak = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); + TQString author = m_widget->lineEditAuthor->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); + TQString journal = m_widget->lineEditJournal->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); + TQString volume = m_widget->lineEditVolume->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); + TQString issue = m_widget->lineEditIssue->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); + TQString page = m_widget->lineEditPage->text().stripWhiteSpace().replace( '$', "" ).replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ); if ( tak.isEmpty() && author.isEmpty() && journal.isEmpty() ) { @@ -248,13 +248,13 @@ namespace KBibTeX bool WebQueryScienceDirect::getStartPage() { - QString startPage = downloadHTML( KURL( "http://www.sciencedirect.com/" ) ); + TQString startPage = downloadHTML( KURL( "http://www.sciencedirect.com/" ) ); if ( m_aborted ) { setEndSearch( WebQuery::statusAborted ); return false; } - else if ( startPage == QString::null ) + else if ( startPage == TQString::null ) { setEndSearch( WebQuery::statusError ); return false; @@ -278,16 +278,16 @@ namespace KBibTeX return true; } - bool WebQueryScienceDirect::getResultPage( const QString &tak, const QString &author, const QString &journal, const QString &volume, const QString &issue, const QString &page ) + bool WebQueryScienceDirect::getResultPage( const TQString &tak, const TQString &author, const TQString &journal, const TQString &volume, const TQString &issue, const TQString &page ) { - KURL url = KURL( QString( "http://www.sciencedirect.com/science?_ob=QuickSearchURL&_method=submitForm&qs_tak=" ).append( tak ).append( "&qs_author=" ).append( author ).append( "&qs_title=" ).append( journal ).append( "&qs_vol=" ).append( volume ).append( "&qs_issue=" ).append( issue ).append( "&qs_pages=" ).append( page ).append( "&_acct=" ).append( m_account ).append( "&md5=" ).append( m_md5 ).append( "&x=0&y=0&=Submit" ) ); - QString resultPage = downloadHTML( url ); + KURL url = KURL( TQString( "http://www.sciencedirect.com/science?_ob=QuickSearchURL&_method=submitForm&qs_tak=" ).append( tak ).append( "&qs_author=" ).append( author ).append( "&qs_title=" ).append( journal ).append( "&qs_vol=" ).append( volume ).append( "&qs_issue=" ).append( issue ).append( "&qs_pages=" ).append( page ).append( "&_acct=" ).append( m_account ).append( "&md5=" ).append( m_md5 ).append( "&x=0&y=0&=Submit" ) ); + TQString resultPage = downloadHTML( url ); if ( m_aborted ) { setEndSearch( WebQuery::statusAborted ); return false; } - else if ( resultPage == QString::null ) + else if ( resultPage == TQString::null ) { setEndSearch( WebQuery::statusError ); return false; @@ -321,21 +321,21 @@ namespace KBibTeX bool WebQueryScienceDirect::getArticleListPage() { - KURL url = KURL( QString( "http://www.sciencedirect.com/science?_ob=ArticleListURL&_method=tag&refSource=search&_st=13&_chunk=0&NEXT_LIST=1&view=c&md5=%1&_ArticleListID=%2&sisr_search=&sisrterm=&export=Export+Citations&count=%3" ).arg( m_md5 ).arg( m_articleListID ).arg( m_widget->spinBoxMaxHits->value() ) ); - QString articleListPage = downloadHTML( url ); + KURL url = KURL( TQString( "http://www.sciencedirect.com/science?_ob=ArticleListURL&_method=tag&refSource=search&_st=13&_chunk=0&NEXT_LIST=1&view=c&md5=%1&_ArticleListID=%2&sisr_search=&sisrterm=&export=Export+Citations&count=%3" ).arg( m_md5 ).arg( m_articleListID ).arg( m_widget->spinBoxMaxHits->value() ) ); + TQString articleListPage = downloadHTML( url ); if ( m_aborted ) { setEndSearch( WebQuery::statusAborted ); return false; } - else if ( articleListPage == QString::null ) + else if ( articleListPage == TQString::null ) { setEndSearch( WebQuery::statusError ); return false; } else if ( articleListPage.find( "subscription does not entitle" ) >= 0 ) { - qWarning( "Your subscription does not entitle you to access the download feature of ScienceDirect" ); + tqWarning( "Your subscription does not entitle you to access the download feature of ScienceDirect" ); setEndSearch( WebQuery::statusInsufficientPermissions ); return false; } @@ -361,20 +361,20 @@ namespace KBibTeX bool WebQueryScienceDirect::getRISFile() { m_incomingData = ""; - QString data = QString( "_ob=DownloadURL&_method=finish&_acct=%1&_userid=%2&_ArticleListID=%3&count=10&md5=%4&JAVASCRIPT_ON=&format=cite&citation-type=RIS&RETURN_URL=http://www.sciencedirect.com/science/home" ).arg( m_account ).arg( m_userid ).arg( m_articleListID ).arg( m_md5 ); + TQString data = TQString( "_ob=DownloadURL&_method=finish&_acct=%1&_userid=%2&_ArticleListID=%3&count=10&md5=%4&JAVASCRIPT_ON=&format=cite&citation-type=RIS&RETURN_URL=http://www.sciencedirect.com/science/home" ).arg( m_account ).arg( m_userid ).arg( m_articleListID ).arg( m_md5 ); KURL url = KURL( "http://www.sciencedirect.com/science" ); KIO::TransferJob *job = KIO::http_post( url, data.utf8(), false ); job->addMetaData( "content-type", "Content-Type: application/x-www-form-urlencoded" ); - connect( job, SIGNAL( data( KIO::Job *, const QByteArray & ) ), this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( job, SIGNAL( data( KIO::Job *, const TQByteArray & ) ), this, SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) ); return true; } - void WebQueryScienceDirect::slotData( KIO::Job *, const QByteArray &data ) + void WebQueryScienceDirect::slotData( KIO::Job *, const TQByteArray &data ) { if ( data.size() > 0 ) - m_incomingData.append( QCString( data, data.size() + 1 ) ); + m_incomingData.append( TQCString( data, data.size() + 1 ) ); } void WebQueryScienceDirect::slotResult( KIO::Job *job ) @@ -386,11 +386,11 @@ namespace KBibTeX } BibTeX::FileImporterRIS importer; - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream ts( &buffer ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &buffer ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << m_incomingData << endl; buffer.close(); diff --git a/src/webquerysciencedirect.h b/src/webquerysciencedirect.h index b43a221..b3dab3a 100644 --- a/src/webquerysciencedirect.h +++ b/src/webquerysciencedirect.h @@ -32,7 +32,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryScienceDirectWidget( QWidget *parent, const char *name = 0 ); + WebQueryScienceDirectWidget( TQWidget *parent, const char *name = 0 ); KLineEdit *lineEditAuthor; KLineEdit *lineEditJournal; @@ -55,14 +55,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryScienceDirect( QWidget* parent ); + WebQueryScienceDirect( TQWidget* parent ); virtual ~WebQueryScienceDirect(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); @@ -72,16 +72,16 @@ namespace KBibTeX private: BibTeX::FileImporterBibTeX *m_importer; WebQueryScienceDirectWidget *m_widget; - QString m_incomingData; - QString m_md5, m_userid, m_articleListID, m_account; + TQString m_incomingData; + TQString m_md5, m_userid, m_articleListID, m_account; bool getStartPage(); - bool getResultPage( const QString &tak, const QString &author, const QString &journal, const QString &volume, const QString &issue, const QString &page ); + bool getResultPage( const TQString &tak, const TQString &author, const TQString &journal, const TQString &volume, const TQString &issue, const TQString &page ); bool getArticleListPage(); bool getRISFile(); private slots: - void slotData( KIO::Job *job, const QByteArray &data ); + void slotData( KIO::Job *job, const TQByteArray &data ); void slotResult( KIO::Job *job ); }; diff --git a/src/webqueryspireshep.cpp b/src/webqueryspireshep.cpp index 61d9c48..51745b5 100644 --- a/src/webqueryspireshep.cpp +++ b/src/webqueryspireshep.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -39,32 +39,32 @@ namespace KBibTeX { - const QString WebQuerySpiresHep::mirrorNames[] = {i18n( "DESY (Germany)" ), i18n( "FNAL (U.S.A.)" ), i18n( "IHEP (Russia)" ), i18n( "Durham U (U.K.)" ), i18n( "SLAC (U.S.A.)" ), i18n( "YITP (Japan)" ), i18n( "LIPI (Indonesia)" )}; - const QString WebQuerySpiresHep::mirrorURLs[] = {"http://www-library.desy.de/cgi-bin/spiface", "http://www-spires.fnal.gov/spires", "http://usparc.ihep.su/spires", "http://www-spires.dur.ac.uk/spires", "http://www.slac.stanford.edu/spires", "http://www.yukawa.kyoto-u.ac.jp/spires", "http://www.spires.lipi.go.id/spires"}; + const TQString WebQuerySpiresHep::mirrorNames[] = {i18n( "DESY (Germany)" ), i18n( "FNAL (U.S.A.)" ), i18n( "IHEP (Russia)" ), i18n( "Durham U (U.K.)" ), i18n( "SLAC (U.S.A.)" ), i18n( "YITP (Japan)" ), i18n( "LIPI (Indonesia)" )}; + const TQString WebQuerySpiresHep::mirrorURLs[] = {"http://www-library.desy.de/cgi-bin/spiface", "http://www-spires.fnal.gov/spires", "http://usparc.ihep.su/spires", "http://www-spires.dur.ac.uk/spires", "http://www.slac.stanford.edu/spires", "http://www.yukawa.kyoto-u.ac.jp/spires", "http://www.spires.lipi.go.id/spires"}; - WebQuerySpiresHepWidget::WebQuerySpiresHepWidget( QWidget *parent, const char *name ) + WebQuerySpiresHepWidget::WebQuerySpiresHepWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "SpiresHep_query" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "SpiresHep_query" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); value = settings->getWebQueryDefault( "SpiresHep_mirror" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxMirror->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "SpiresHep_type" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxType->setCurrentItem( value.toInt() ); } void WebQuerySpiresHepWidget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); comboBoxMirror = new KComboBox( false, this ); @@ -75,7 +75,7 @@ namespace KBibTeX comboBoxMirror->insertItem( WebQuerySpiresHep::mirrorNames[i] ); comboBoxMirror->setCurrentItem( 0 ); - QLabel *label = new QLabel( i18n( "Type:" ), this ); + TQLabel *label = new TQLabel( i18n( "Type:" ), this ); hLayout->addWidget( label ); hLayout->setStretchFactor( label, 1 ); comboBoxType = new KComboBox( false, this ); @@ -91,31 +91,31 @@ namespace KBibTeX comboBoxType->insertItem( i18n( "keywords" ) ); comboBoxType->setCurrentItem( 0 ); - hLayout = new QHBoxLayout( ); + hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); hLayout->addWidget( clearSearchText ); - label = new QLabel( i18n( "Search &term:" ), this ); + label = new TQLabel( i18n( "Search &term:" ), this ); hLayout->addWidget( label ); lineEditQuery = new KLineEdit( this ); hLayout->addWidget( lineEditQuery ); label->setBuddy( lineEditQuery ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); hLayout->setStretchFactor( lineEditQuery, 4 ); KCompletion *completionQuery = lineEditQuery->completionObject(); - m_checkBoxFetchAbstracts = new QCheckBox( i18n( "Include abstracts from arxiv.org if available" ), this ); + m_checkBoxFetchAbstracts = new TQCheckBox( i18n( "Include abstracts from arxiv.org if available" ), this ); vLayout->addWidget( m_checkBoxFetchAbstracts ); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); vLayout->addStretch( 1 ); } - WebQuerySpiresHep::WebQuerySpiresHep( QWidget* parent ): WebQuery( parent ) + WebQuerySpiresHep::WebQuerySpiresHep( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQuerySpiresHepWidget( parent ); } @@ -125,17 +125,17 @@ namespace KBibTeX delete m_widget; } - QString WebQuerySpiresHep::title() + TQString WebQuerySpiresHep::title() { return i18n( "SPIRES-HEP" ); } - QString WebQuerySpiresHep::disclaimer() + TQString WebQuerySpiresHep::disclaimer() { return i18n( "SPIRES-HEP Search" ); } - QString WebQuerySpiresHep::disclaimerURL() + TQString WebQuerySpiresHep::disclaimerURL() { return "http://www.slac.stanford.edu/spires/"; } @@ -154,12 +154,12 @@ namespace KBibTeX WebQuery::query(); Settings *settings = Settings::self(); settings->setWebQueryDefault( "SpiresHep_query", m_widget->lineEditQuery->text() ); - settings->setWebQueryDefault( "SpiresHep_mirror", QString::number( m_widget->comboBoxMirror->currentItem() ) ); - settings->setWebQueryDefault( "SpiresHep_type", QString::number( m_widget->comboBoxType->currentItem() ) ); + settings->setWebQueryDefault( "SpiresHep_mirror", TQString::number( m_widget->comboBoxMirror->currentItem() ) ); + settings->setWebQueryDefault( "SpiresHep_type", TQString::number( m_widget->comboBoxType->currentItem() ) ); setNumStages( 1 + doFetchAbstracts ? maxEntries : 0 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); @@ -177,8 +177,8 @@ namespace KBibTeX default: ;// nothing } - KURL url = KURL( QString( "%1/find/hep/www?rawcmd=%2&FORMAT=WWWBRIEFBIBTEX&SEQUENCE=" ).arg( mirrorURLs[mirrorIdx] ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); - qDebug( "url=%s", url.prettyURL().latin1() ); + KURL url = KURL( TQString( "%1/find/hep/www?rawcmd=%2&FORMAT=WWWBRIEFBIBTEX&SEQUENCE=" ).arg( mirrorURLs[mirrorIdx] ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + tqDebug( "url=%s", url.prettyURL().latin1() ); BibTeX::File *tmpBibFile = downloadBibTeXFile( url ); if ( tmpBibFile != NULL && !m_aborted ) @@ -200,10 +200,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } @@ -218,13 +218,13 @@ namespace KBibTeX { BibTeX::EntryField *field = NULL; BibTeX::Value *value = NULL; - QString eprint = (( field = entry->getField( "eprint" ) ) ) && (( value = field->value() ) ) ? value->text() : QString::null; - QString archivePrefix = (( field = entry->getField( "archivePrefix" ) ) ) && (( value = field->value() ) ) ? value->text() : QString::null; + TQString eprint = (( field = entry->getField( "eprint" ) ) ) && (( value = field->value() ) ) ? value->text() : TQString::null; + TQString archivePrefix = (( field = entry->getField( "archivePrefix" ) ) ) && (( value = field->value() ) ) ? value->text() : TQString::null; if ( archivePrefix == "arXiv" && !eprint.isNull() ) { - KURL absURL( QString( "http://arxiv.org/abs/" ).append( eprint ) ); - QString abstract = download( absURL ); + KURL absURL( TQString( "http://arxiv.org/abs/" ).append( eprint ) ); + TQString abstract = download( absURL ); int p = abstract.find( "Abstract:" ); if ( p > -1 ) { @@ -236,11 +236,11 @@ namespace KBibTeX field = new BibTeX::EntryField( "pdf" ); entry->addField( field ); - field->setValue( new BibTeX::Value( QString( "http://arxiv.org/pdf/" ).append( eprint ) ) ); + field->setValue( new BibTeX::Value( TQString( "http://arxiv.org/pdf/" ).append( eprint ) ) ); field = new BibTeX::EntryField( BibTeX::EntryField::ftURL ); entry->addField( field ); - field->setValue( new BibTeX::Value( QString( "http://arxiv.org/abs/" ).append( eprint ) ) ); + field->setValue( new BibTeX::Value( TQString( "http://arxiv.org/abs/" ).append( eprint ) ) ); } } } diff --git a/src/webqueryspireshep.h b/src/webqueryspireshep.h index 968a20e..190ac3f 100644 --- a/src/webqueryspireshep.h +++ b/src/webqueryspireshep.h @@ -31,11 +31,11 @@ namespace KBibTeX { Q_OBJECT public: - WebQuerySpiresHepWidget( QWidget *parent, const char *name = 0 ); + WebQuerySpiresHepWidget( TQWidget *parent, const char *name = 0 ); KComboBox *comboBoxMirror; KComboBox *comboBoxType; - QCheckBox *m_checkBoxFetchAbstracts; + TQCheckBox *m_checkBoxFetchAbstracts; protected: virtual void init(); @@ -48,19 +48,19 @@ namespace KBibTeX { Q_OBJECT public: - WebQuerySpiresHep( QWidget* parent ); + WebQuerySpiresHep( TQWidget* parent ); virtual ~WebQuerySpiresHep(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); - static const QString mirrorNames[]; - static const QString mirrorURLs[]; + static const TQString mirrorNames[]; + static const TQString mirrorURLs[]; protected: void cancelQuery() { /* nothing */ }; diff --git a/src/webqueryz3950.cpp b/src/webqueryz3950.cpp index 1b62129..f001b4d 100644 --- a/src/webqueryz3950.cpp +++ b/src/webqueryz3950.cpp @@ -32,11 +32,11 @@ #include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -56,42 +56,42 @@ namespace KBibTeX { - const QString WebQueryZ3950Widget::attributesI18N[] = { i18n( "any" ), i18n( "title" ), i18n( "author" ), i18n( "publisher" )}; + const TQString WebQueryZ3950Widget::attributesI18N[] = { i18n( "any" ), i18n( "title" ), i18n( "author" ), i18n( "publisher" )}; - WebQueryZ3950Widget::WebQueryZ3950Widget( QWidget *parent, const char *name ) + WebQueryZ3950Widget::WebQueryZ3950Widget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ), lineEditQuery2( NULL ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "Z3950_server" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + TQString value = settings->getWebQueryDefault( "Z3950_server" ); + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxServers->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "Z3950_query1" ); - value = value == QString::null ? "" : value; + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); value = settings->getWebQueryDefault( "Z3950_attr1" ); - value = value == QString::null ? "1" : value; + value = value == TQString::null ? "1" : value; comboBoxInAttribute->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "Z3950_query2" ); - lineEditQuery2->setText( value == QString::null ? "" : value ); + lineEditQuery2->setText( value == TQString::null ? "" : value ); value = settings->getWebQueryDefault( "Z3950_attr2" ); - value = value == QString::null ? "1" : value; + value = value == TQString::null ? "1" : value; comboBoxInAttribute2->setCurrentItem( value.toInt() ); value = settings->getWebQueryDefault( "Z3950_booleanOp" ); - value = value == QString::null || value.isEmpty() ? "0" : value; + value = value == TQString::null || value.isEmpty() ? "0" : value; comboBoxBooleanOp->setCurrentItem( value.toInt() ); } void WebQueryZ3950Widget::init() { - QVBoxLayout *vLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *vLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QHBoxLayout *hLayout = new QHBoxLayout( ); + TQHBoxLayout *hLayout = new TQHBoxLayout( ); vLayout->addLayout( hLayout ); - QLabel *label = new QLabel( i18n( "Server:" ), this ); + TQLabel *label = new TQLabel( i18n( "Server:" ), this ); hLayout->setStretchFactor( label, 1 ); hLayout->addWidget( label ); comboBoxServers = new KComboBox( false, this ); @@ -99,31 +99,31 @@ namespace KBibTeX hLayout->setStretchFactor( comboBoxServers, 7 ); label->setBuddy( comboBoxServers ); hLayout->addSpacing( KDialog::spacingHint() * 2 ); - label = new QLabel( i18n( "&Number of results:" ), this ); + label = new TQLabel( i18n( "&Number of results:" ), this ); hLayout->addWidget( label ); hLayout->setStretchFactor( label, 1 ); - spinBoxMaxHits = new QSpinBox( 1, 50, 1, this ); + spinBoxMaxHits = new TQSpinBox( 1, 50, 1, this ); spinBoxMaxHits->setValue( 10 ); hLayout->addWidget( spinBoxMaxHits ); hLayout->setStretchFactor( spinBoxMaxHits, 3 ); label->setBuddy( spinBoxMaxHits ); - QGridLayout *layout = new QGridLayout( vLayout, 2, 6, KDialog::spacingHint() ); + TQGridLayout *layout = new TQGridLayout( vLayout, 2, 6, KDialog::spacingHint() ); KPushButton *clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); layout->addWidget( clearSearchText, 0, 1 ); - label = new QLabel( i18n( "Search term 1:" ), this ); + label = new TQLabel( i18n( "Search term 1:" ), this ); layout->addWidget( label, 0, 2 ); lineEditQuery = new KLineEdit( this ); layout->addWidget( lineEditQuery, 0, 3 ); label->setBuddy( lineEditQuery ); connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery, SLOT( clear() ) ); - connect( lineEditQuery, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotTextChanged( const QString& ) ) ); + connect( lineEditQuery, SIGNAL( textChanged( const TQString& ) ), this, SLOT( slotTextChanged( const TQString& ) ) ); KCompletion *completionQuery = lineEditQuery->completionObject(); connect( lineEditQuery, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); - label = new QLabel( i18n( "Search in:" ), this ); + connect( lineEditQuery, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); + label = new TQLabel( i18n( "Search in:" ), this ); layout->addWidget( label, 0, 4 ); comboBoxInAttribute = new KComboBox( false, this ); layout->addWidget( comboBoxInAttribute, 0, 5 ); @@ -133,9 +133,9 @@ namespace KBibTeX layout->addWidget( comboBoxBooleanOp, 1, 0 ); clearSearchText = new KPushButton( this ); - clearSearchText->setIconSet( QIconSet( SmallIcon( "locationbar_erase" ) ) ); + clearSearchText->setIconSet( TQIconSet( SmallIcon( "locationbar_erase" ) ) ); layout->addWidget( clearSearchText, 1, 1 ); - label = new QLabel( i18n( "Search term 2:" ), this ); + label = new TQLabel( i18n( "Search term 2:" ), this ); layout->addWidget( label, 1, 2 ); lineEditQuery2 = new KLineEdit( this ); layout->addWidget( lineEditQuery2, 1, 3 ); @@ -143,8 +143,8 @@ namespace KBibTeX connect( clearSearchText, SIGNAL( clicked() ), lineEditQuery2, SLOT( clear() ) ); completionQuery = lineEditQuery->completionObject(); connect( lineEditQuery2, SIGNAL( returnPressed() ), this, SIGNAL( startSearch() ) ); - connect( lineEditQuery2, SIGNAL( returnPressed( const QString& ) ), completionQuery, SLOT( addItem( const QString& ) ) ); - label = new QLabel( i18n( "Search in:" ), this ); + connect( lineEditQuery2, SIGNAL( returnPressed( const TQString& ) ), completionQuery, SLOT( addItem( const TQString& ) ) ); + label = new TQLabel( i18n( "Search in:" ), this ); layout->addWidget( label, 1, 4 ); comboBoxInAttribute2 = new KComboBox( false, this ); layout->addWidget( comboBoxInAttribute2, 1, 5 ); @@ -152,7 +152,7 @@ namespace KBibTeX #ifdef HAVE_YAZ Settings *settings = Settings::self(); - for ( QMap::Iterator it = settings->z3950_ServerList.begin(); it != settings->z3950_ServerList.end(); ++it ) + for ( TQMap::Iterator it = settings->z3950_ServerList.begin(); it != settings->z3950_ServerList.end(); ++it ) comboBoxServers->insertItem( it.data().name ); #endif // HAVE_YAZ for ( unsigned int i = 0; i < sizeof( attributesI18N ) / sizeof( attributesI18N[0] ); ++i ) @@ -164,7 +164,7 @@ namespace KBibTeX comboBoxBooleanOp->insertItem( i18n( "or" ) ); } - WebQueryZ3950::WebQueryZ3950( QWidget* parent ) : WebQuery( parent ) + WebQueryZ3950::WebQueryZ3950( TQWidget* parent ) : WebQuery( parent ) #ifdef HAVE_YAZ , m_marc21transformer( NULL ), m_unimarctransformer( NULL ), m_modsImporter( NULL ), m_conn( NULL ) #endif // HAVE_YAZ @@ -183,17 +183,17 @@ namespace KBibTeX // delete m_widget; FIXME Why does delete fail here? } - QString WebQueryZ3950::title() + TQString WebQueryZ3950::title() { return i18n( "Z39.50" ); } - QString WebQueryZ3950::disclaimer() + TQString WebQueryZ3950::disclaimer() { return i18n( "Z39.50" ); } - QString WebQueryZ3950::disclaimerURL() + TQString WebQueryZ3950::disclaimerURL() { return "http://[127.0.0.1]/"; } @@ -208,16 +208,16 @@ namespace KBibTeX WebQuery::query(); Settings *settings = Settings::self(); - settings->setWebQueryDefault( "Z3950_server", QString::number( m_widget->comboBoxServers->currentItem() ) ); + settings->setWebQueryDefault( "Z3950_server", TQString::number( m_widget->comboBoxServers->currentItem() ) ); settings->setWebQueryDefault( "Z3950_query1", m_widget->lineEditQuery->text() ); - settings->setWebQueryDefault( "Z3950_attr1", QString::number( m_widget->comboBoxInAttribute->currentItem() ) ); + settings->setWebQueryDefault( "Z3950_attr1", TQString::number( m_widget->comboBoxInAttribute->currentItem() ) ); settings->setWebQueryDefault( "Z3950_query2", m_widget->lineEditQuery2->text() ); - settings->setWebQueryDefault( "Z3950_attr2", QString::number( m_widget->comboBoxInAttribute2->currentItem() ) ); - settings->setWebQueryDefault( "Z3950_booleanOp", QString::number( m_widget->comboBoxBooleanOp->currentItem() ) ); + settings->setWebQueryDefault( "Z3950_attr2", TQString::number( m_widget->comboBoxInAttribute2->currentItem() ) ); + settings->setWebQueryDefault( "Z3950_booleanOp", TQString::number( m_widget->comboBoxBooleanOp->currentItem() ) ); #ifdef HAVE_YAZ - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace(); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace(); if ( searchTerm.isEmpty() ) { setNumStages( 1 ); @@ -225,7 +225,7 @@ namespace KBibTeX return; } - QString query = queryClause( searchTerm, m_widget->comboBoxInAttribute->currentItem() ); + TQString query = queryClause( searchTerm, m_widget->comboBoxInAttribute->currentItem() ); searchTerm = m_widget->lineEditQuery2->text().stripWhiteSpace(); if ( !searchTerm.isEmpty() ) @@ -241,7 +241,7 @@ namespace KBibTeX m_conn = NULL; settings = Settings::self(); - for ( QMap::Iterator it = settings->z3950_ServerList.begin(); m_conn == NULL && it != settings->z3950_ServerList.end(); ++it ) + for ( TQMap::Iterator it = settings->z3950_ServerList.begin(); m_conn == NULL && it != settings->z3950_ServerList.end(); ++it ) { if ( it.data().name.compare( m_widget->comboBoxServers->currentText() ) == 0 ) { @@ -286,9 +286,9 @@ namespace KBibTeX } #ifdef HAVE_YAZ - QString WebQueryZ3950::queryClause( const QString& text, int field ) + TQString WebQueryZ3950::queryClause( const TQString& text, int field ) { - QString result = "@attr 1="; + TQString result = "@attr 1="; switch ( field ) { case 1: result.append( "4" ); break; @@ -303,7 +303,7 @@ namespace KBibTeX } #endif // HAVE_YAZ - void WebQueryZ3950::customEvent( QCustomEvent* event ) + void WebQueryZ3950::customEvent( TQCustomEvent* event ) { kdDebug() << "WebQueryZ3950::customEvent of type " << event->type() << endl; @@ -327,7 +327,7 @@ namespace KBibTeX KBibTeX::Z3950ConnectionDone* e = static_cast( event ); kdDebug() << "Z3950ConnectionDone: " << e->message() << " (" << e->messageType() << ")" << endl; if ( e->messageType() > -1 ) - KMessageBox::error( m_widget, QString( i18n( "The server returned the following message:\n\n%1" ) ).arg( e->message() ), i18n( "Error querying Z39.50 server" ) ); + KMessageBox::error( m_widget, TQString( i18n( "The server returned the following message:\n\n%1" ) ).arg( e->message() ), i18n( "Error querying Z39.50 server" ) ); m_started = false; if ( m_conn != NULL ) @@ -340,15 +340,15 @@ namespace KBibTeX } } - qApp->processEvents(); + tqApp->processEvents(); #endif // HAVE_YAZ } #ifdef HAVE_YAZ - void WebQueryZ3950::storeResult( const QString& resultText, const QString& syntax ) + void WebQueryZ3950::storeResult( const TQString& resultText, const TQString& syntax ) { if ( resultText.isEmpty() ) return; - QString convertedResultText = QString::null; + TQString convertedResultText = TQString::null; if ( syntax == "mods" ) convertedResultText = resultText; @@ -371,7 +371,7 @@ namespace KBibTeX if ( m_modsImporter == NULL ) m_modsImporter = new BibTeX::FileImporterBibUtils( BibTeX::File::formatMODS ); - for ( QStringList::Iterator it = m_modsList.begin(); it != m_modsList.end();++it ) + for ( TQStringList::Iterator it = m_modsList.begin(); it != m_modsList.end();++it ) { BibTeX::File *bibtexFile = m_modsImporter->load( *it ); if ( bibtexFile != NULL ) diff --git a/src/webqueryz3950.h b/src/webqueryz3950.h index 93d8999..5f926f7 100644 --- a/src/webqueryz3950.h +++ b/src/webqueryz3950.h @@ -34,9 +34,9 @@ #ifndef KBIBTEXWEBQUERYZ3950_H #define KBIBTEXWEBQUERYZ3950_H -#include -#include -#include +#include +#include +#include #include @@ -57,7 +57,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryZ3950Widget( QWidget *parent, const char *name = 0 ); + WebQueryZ3950Widget( TQWidget *parent, const char *name = 0 ); KComboBox *comboBoxServers; KComboBox *comboBoxInAttribute; @@ -69,7 +69,7 @@ namespace KBibTeX virtual void init(); private: - static const QString attributesI18N[]; + static const TQString attributesI18N[]; }; @@ -80,14 +80,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryZ3950( QWidget* parent ); + WebQueryZ3950( TQWidget* parent ); virtual ~WebQueryZ3950(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); @@ -98,7 +98,7 @@ namespace KBibTeX void cancelQuery(); protected: - virtual void customEvent( QCustomEvent* event ); + virtual void customEvent( TQCustomEvent* event ); #ifdef HAVE_YAZ private: @@ -108,13 +108,13 @@ namespace KBibTeX KBibTeX::Z3950Connection *m_conn; bool m_started; bool m_waitingRetrieveRange; - QString m_syntax; - QStringList m_modsList; + TQString m_syntax; + TQStringList m_modsList; int m_hitCounter; - void storeResult( const QString& resultText, const QString& syntax ); + void storeResult( const TQString& resultText, const TQString& syntax ); void evalStoredResults(); - QString queryClause( const QString& text, int field ); + TQString queryClause( const TQString& text, int field ); #endif // HAVE_YAZ }; } diff --git a/src/webqueryzmath.cpp b/src/webqueryzmath.cpp index 9e8a78e..b805829 100644 --- a/src/webqueryzmath.cpp +++ b/src/webqueryzmath.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -34,19 +34,19 @@ namespace KBibTeX { - WebQueryZMATHWidget::WebQueryZMATHWidget( QWidget *parent, const char *name ) + WebQueryZMATHWidget::WebQueryZMATHWidget( TQWidget *parent, const char *name ) : WebQueryWidget( parent, name ) { init(); Settings *settings = Settings::self(); - QString value = settings->getWebQueryDefault( "ZMATH" ); - value = value == QString::null ? "" : value; + TQString value = settings->getWebQueryDefault( "ZMATH" ); + value = value == TQString::null ? "" : value; lineEditQuery->setText( value ); slotTextChanged( value, true ); } - WebQueryZMATH::WebQueryZMATH( QWidget* parent ): WebQuery( parent ) + WebQueryZMATH::WebQueryZMATH( TQWidget* parent ): WebQuery( parent ) { m_widget = new WebQueryZMATHWidget( parent ); } @@ -56,17 +56,17 @@ namespace KBibTeX delete m_widget; } - QString WebQueryZMATH::title() + TQString WebQueryZMATH::title() { return i18n( "Zentralblatt MATH" ); } - QString WebQueryZMATH::disclaimer() + TQString WebQueryZMATH::disclaimer() { return i18n( "About Zentralblatt MATH" ); } - QString WebQueryZMATH::disclaimerURL() + TQString WebQueryZMATH::disclaimerURL() { return "http://www.zentralblatt-math.org/zmath/en/"; } @@ -85,14 +85,14 @@ namespace KBibTeX int numberOfResults = m_widget->spinBoxMaxHits->value(); setNumStages( 1 ); - QString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); + TQString searchTerm = m_widget->lineEditQuery->text().stripWhiteSpace().replace( '$', "" ); if ( searchTerm.isEmpty() ) { setEndSearch( WebQuery::statusInvalidQuery ); return; } - KURL url = KURL( QString( "http://www.zentralblatt-math.org/zmath/en/search/?q=%2&count=%1&type=bibtex&format=short&display=all" ).arg( numberOfResults ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); + KURL url = KURL( TQString( "http://www.zentralblatt-math.org/zmath/en/search/?q=%2&count=%1&type=bibtex&format=short&display=all" ).arg( numberOfResults ).arg( searchTerm.replace( "%", "%25" ).replace( "+", "%2B" ).replace( " ", "%20" ).replace( "#", "%23" ).replace( "&", "%26" ).replace( "?", "%3F" ) ) ); BibTeX::File *bibtexFile = downloadBibTeXFile( url ); if ( bibtexFile != NULL && !m_aborted ) { @@ -107,10 +107,10 @@ namespace KBibTeX } else if ( !m_aborted ) { - QString message = KIO::NetAccess::lastErrorString(); + TQString message = KIO::NetAccess::lastErrorString(); if ( message.isEmpty() ) message.prepend( '\n' ); - message.prepend( QString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); + message.prepend( TQString( i18n( "Querying database '%1' failed." ) ).arg( title() ) ); KMessageBox::error( m_parent, message ); setEndSearch( WebQuery::statusError ); } diff --git a/src/webqueryzmath.h b/src/webqueryzmath.h index e6e7625..101ce7f 100644 --- a/src/webqueryzmath.h +++ b/src/webqueryzmath.h @@ -31,7 +31,7 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryZMATHWidget( QWidget *parent, const char *name = 0 ); + WebQueryZMATHWidget( TQWidget *parent, const char *name = 0 ); }; /** @@ -41,14 +41,14 @@ namespace KBibTeX { Q_OBJECT public: - WebQueryZMATH( QWidget* parent ); + WebQueryZMATH( TQWidget* parent ); virtual ~WebQueryZMATH(); void query(); - QString title(); - QString disclaimer(); - QString disclaimerURL(); + TQString title(); + TQString disclaimer(); + TQString disclaimerURL(); WebQueryWidget *widget(); diff --git a/src/xsltransform.cpp b/src/xsltransform.cpp index fbb4fce..bae027b 100644 --- a/src/xsltransform.cpp +++ b/src/xsltransform.cpp @@ -23,19 +23,19 @@ #include #include -#include -#include +#include +#include #include "xsltransform.h" namespace BibTeX { - XSLTransform::XSLTransform( const QString& xsltFilename ) + XSLTransform::XSLTransform( const TQString& xsltFilename ) { m_xlstStylesheet = xsltParseStylesheetFile(( const xmlChar* ) xsltFilename.latin1() ); if ( m_xlstStylesheet == NULL ) - qDebug( "Could not load XSLT file '%s'.", xsltFilename.latin1() ); + tqDebug( "Could not load XSLT file '%s'.", xsltFilename.latin1() ); } XSLTransform::~XSLTransform() @@ -43,10 +43,10 @@ namespace BibTeX xsltFreeStylesheet( m_xlstStylesheet ); } - QString XSLTransform::transform( const QString& xmlText ) + TQString XSLTransform::transform( const TQString& xmlText ) { - QString result = QString::null; - QCString xmlCText = xmlText.utf8(); + TQString result = TQString::null; + TQCString xmlCText = xmlText.utf8(); xmlDocPtr document = xmlParseMemory( xmlCText, xmlCText.length() ); if ( document ) { @@ -55,25 +55,25 @@ namespace BibTeX xmlDocPtr resultDocument = xsltApplyStylesheet( m_xlstStylesheet, document, NULL ); if ( resultDocument ) { - // Save the result into the QString + // Save the result into the TQString xmlChar * mem; int size; xmlDocDumpMemoryEnc( resultDocument, &mem, &size, "UTF-8" ); - result = QString::fromUtf8( QCString(( char * )( mem ), size + 1 ) ); + result = TQString::fromUtf8( TQCString(( char * )( mem ), size + 1 ) ); xmlFree( mem ); xmlFreeDoc( resultDocument ); } else - qDebug( "Applying XSLT stylesheet to XML document failed" ); + tqDebug( "Applying XSLT stylesheet to XML document failed" ); } else - qDebug( "XSLT stylesheet is not available or not valid" ); + tqDebug( "XSLT stylesheet is not available or not valid" ); xmlFreeDoc( document ); } else - qDebug( "XML document is not available or not valid" ); + tqDebug( "XML document is not available or not valid" ); return result; } diff --git a/src/xsltransform.h b/src/xsltransform.h index 73dd4ec..e400a3b 100644 --- a/src/xsltransform.h +++ b/src/xsltransform.h @@ -22,7 +22,7 @@ #include -class QString; +class TQString; namespace BibTeX { @@ -31,10 +31,10 @@ namespace BibTeX { public: - XSLTransform( const QString& xsltFilename ); + XSLTransform( const TQString& xsltFilename ); ~XSLTransform(); - QString transform( const QString& xmlText ); + TQString transform( const TQString& xmlText ); private: xsltStylesheetPtr m_xlstStylesheet; diff --git a/src/z3950connection.cpp b/src/z3950connection.cpp index ada2a1d..567253e 100644 --- a/src/z3950connection.cpp +++ b/src/z3950connection.cpp @@ -28,7 +28,7 @@ #include "iso5426converter.h" #include "iso6937converter.h" -#include +#include #include @@ -43,7 +43,7 @@ extern "C" #include -#include +#include namespace { @@ -53,8 +53,8 @@ namespace using KBibTeX::Z3950ResultFound; using KBibTeX::Z3950Connection; -Z3950ResultFound::Z3950ResultFound( const QString& s ) : QCustomEvent( uid() ) - , m_result( QDeepCopy( s ) ) +Z3950ResultFound::Z3950ResultFound( const TQString& s ) : TQCustomEvent( uid() ) + , m_result( TQDeepCopy( s ) ) { ++Z3950Connection::resultsLeft; } @@ -85,24 +85,24 @@ int Z3950Connection::resultsLeft = 0; // since the character set goes into a yaz api call // I'm paranoid about user insertions, so just grab 64 // characters at most -Z3950Connection::Z3950Connection( QObject* fetcher, - const QString& host, +Z3950Connection::Z3950Connection( TQObject* fetcher, + const TQString& host, uint port, - const QString& dbname, - const QString& sourceCharSet, - const QString& syntax, - const QString& esn ) - : QThread() + const TQString& dbname, + const TQString& sourceCharSet, + const TQString& syntax, + const TQString& esn ) + : TQThread() , d( new Private() ) , m_connected( false ) , m_aborted( false ) , m_fetcher( fetcher ) - , m_host( QDeepCopy( host ) ) + , m_host( TQDeepCopy( host ) ) , m_port( port ) - , m_dbname( QDeepCopy( dbname ) ) - , m_sourceCharSet( QDeepCopy( sourceCharSet.left( 64 ) ) ) - , m_syntax( QDeepCopy( syntax ) ) - , m_esn( QDeepCopy( esn ) ) + , m_dbname( TQDeepCopy( dbname ) ) + , m_sourceCharSet( TQDeepCopy( sourceCharSet.left( 64 ) ) ) + , m_syntax( TQDeepCopy( syntax ) ) + , m_esn( TQDeepCopy( esn ) ) , m_start( 0 ) , m_limit( Z3950_DEFAULT_MAX_RECORDS ) , m_hasMore( false ) @@ -122,16 +122,16 @@ void Z3950Connection::reset() m_limit = Z3950_DEFAULT_MAX_RECORDS; } -void Z3950Connection::setQuery( const QString& query_, unsigned int numHits ) +void Z3950Connection::setQuery( const TQString& query_, unsigned int numHits ) { - m_pqn = QDeepCopy( query_ ); + m_pqn = TQDeepCopy( query_ ); m_limit = Z3950_DEFAULT_MAX_RECORDS < numHits ? Z3950_DEFAULT_MAX_RECORDS : numHits; } -void Z3950Connection::setUserPassword( const QString& user_, const QString& pword_ ) +void Z3950Connection::setUserPassword( const TQString& user_, const TQString& pword_ ) { - m_user = QDeepCopy( user_ ); - m_password = QDeepCopy( pword_ ); + m_user = TQDeepCopy( user_ ); + m_password = TQDeepCopy( pword_ ); } void Z3950Connection::run() @@ -155,7 +155,7 @@ void Z3950Connection::run() { kdDebug() << "Z3950Connection::run() - query error: " << m_pqn << endl; ZOOM_query_destroy( query ); - QString s = i18n( "Query error!" ); + TQString s = i18n( "Query error!" ); s += ' ' + m_pqn; done( s, MessageHandler::Error ); return; @@ -174,10 +174,10 @@ void Z3950Connection::run() // to get MODS data, that seems a bit odd... // esn only makes sense for marc and grs-1 // if syntax is mods, set esn to mods too - QCString type = "raw"; + TQCString type = "raw"; if ( m_syntax == Latin1Literal( "mods" ) ) { - m_syntax = QString::fromLatin1( "xml" ); + m_syntax = TQString::fromLatin1( "xml" ); ZOOM_resultset_option_set( resultSet, "elementSetName", "mods" ); type = "xml"; } @@ -185,8 +185,8 @@ void Z3950Connection::run() { ZOOM_resultset_option_set( resultSet, "elementSetName", m_esn.latin1() ); } - ZOOM_resultset_option_set( resultSet, "start", QCString().setNum( m_start ) ); - ZOOM_resultset_option_set( resultSet, "count", QCString().setNum( m_limit - m_start ) ); + ZOOM_resultset_option_set( resultSet, "start", TQCString().setNum( m_start ) ); + ZOOM_resultset_option_set( resultSet, "count", TQCString().setNum( m_limit - m_start ) ); // search in default syntax, unless syntax is already set if ( !m_syntax.isEmpty() ) { @@ -202,8 +202,8 @@ void Z3950Connection::run() ZOOM_query_destroy( query ); m_connected = false; - QString s = i18n( "Connection search error %1: %2" ).arg( errcode ).arg( toString( errmsg ) ); - if ( !QCString( addinfo ).isEmpty() ) + TQString s = i18n( "Connection search error %1: %2" ).arg( errcode ).arg( toString( errmsg ) ); + if ( !TQCString( addinfo ).isEmpty() ) { s += " (" + toString( addinfo ) + ")"; } @@ -214,7 +214,7 @@ void Z3950Connection::run() const size_t numResults = ZOOM_resultset_size( resultSet ); - QString newSyntax = m_syntax; + TQString newSyntax = m_syntax; if ( numResults > 0 ) { kdDebug() << "Z3950Connection::run() - current syntax is " << m_syntax << " (" << numResults << " results)" << endl; @@ -225,11 +225,11 @@ void Z3950Connection::run() ZOOM_record_get( rec, type, &len ); if ( len > 0 && m_syntax.isEmpty() ) { - newSyntax = QString::fromLatin1( ZOOM_record_get( rec, "syntax", &len ) ).lower(); + newSyntax = TQString::fromLatin1( ZOOM_record_get( rec, "syntax", &len ) ).lower(); kdDebug() << "Z3950Connection::run() - syntax guess is " << newSyntax << endl; if ( newSyntax == Latin1Literal( "mods" ) || newSyntax == Latin1Literal( "xml" ) ) { - m_syntax = QString::fromLatin1( "xml" ); + m_syntax = TQString::fromLatin1( "xml" ); ZOOM_resultset_option_set( resultSet, "elementSetName", "mods" ); } else if ( newSyntax == Latin1Literal( "grs-1" ) ) @@ -247,7 +247,7 @@ void Z3950Connection::run() newSyntax != Latin1Literal( "grs-1" ) ) { kdDebug() << "Z3950Connection::run() - changing z39.50 syntax to MODS" << endl; - newSyntax = QString::fromLatin1( "xml" ); + newSyntax = TQString::fromLatin1( "xml" ); ZOOM_resultset_option_set( resultSet, "elementSetName", "mods" ); ZOOM_resultset_option_set( resultSet, "preferredRecordSyntax", newSyntax.latin1() ); rec = ZOOM_resultset_record( resultSet, 0 ); @@ -256,7 +256,7 @@ void Z3950Connection::run() { // change set name back ZOOM_resultset_option_set( resultSet, "elementSetName", m_esn.latin1() ); - newSyntax = QString::fromLatin1( "usmarc" ); // try usmarc + newSyntax = TQString::fromLatin1( "usmarc" ); // try usmarc kdDebug() << "Z3950Connection::run() - changing z39.50 syntax to USMARC" << endl; ZOOM_resultset_option_set( resultSet, "preferredRecordSyntax", newSyntax.latin1() ); rec = ZOOM_resultset_record( resultSet, 0 ); @@ -264,7 +264,7 @@ void Z3950Connection::run() } if ( len == 0 ) { - newSyntax = QString::fromLatin1( "marc21" ); // try marc21 + newSyntax = TQString::fromLatin1( "marc21" ); // try marc21 kdDebug() << "Z3950Connection::run() - changing z39.50 syntax to MARC21" << endl; ZOOM_resultset_option_set( resultSet, "preferredRecordSyntax", newSyntax.latin1() ); rec = ZOOM_resultset_record( resultSet, 0 ); @@ -272,7 +272,7 @@ void Z3950Connection::run() } if ( len == 0 ) { - newSyntax = QString::fromLatin1( "unimarc" ); // try unimarc + newSyntax = TQString::fromLatin1( "unimarc" ); // try unimarc kdDebug() << "Z3950Connection::run() - changing z39.50 syntax to UNIMARC" << endl; ZOOM_resultset_option_set( resultSet, "preferredRecordSyntax", newSyntax.latin1() ); rec = ZOOM_resultset_record( resultSet, 0 ); @@ -280,7 +280,7 @@ void Z3950Connection::run() } if ( len == 0 ) { - newSyntax = QString::fromLatin1( "grs-1" ); // try grs-1 + newSyntax = TQString::fromLatin1( "grs-1" ); // try grs-1 kdDebug() << "Z3950Connection::run() - changing z39.50 syntax to GRS-1" << endl; ZOOM_resultset_option_set( resultSet, "preferredRecordSyntax", newSyntax.latin1() ); rec = ZOOM_resultset_record( resultSet, 0 ); @@ -301,25 +301,25 @@ void Z3950Connection::run() // go back to fooling ourselves and calling it mods if ( m_syntax == Latin1Literal( "xml" ) ) { - m_syntax = QString::fromLatin1( "mods" ); + m_syntax = TQString::fromLatin1( "mods" ); } if ( newSyntax == Latin1Literal( "xml" ) ) { - newSyntax = QString::fromLatin1( "mods" ); + newSyntax = TQString::fromLatin1( "mods" ); } // save syntax change for next time if ( m_syntax != newSyntax ) { - qApp->postEvent( m_fetcher, new Z3950SyntaxChange( newSyntax ) ); + tqApp->postEvent( m_fetcher, new Z3950SyntaxChange( newSyntax ) ); m_syntax = newSyntax; } if ( m_sourceCharSet.isEmpty() ) { - m_sourceCharSet = QString::fromLatin1( "marc-8" ); + m_sourceCharSet = TQString::fromLatin1( "marc-8" ); } - const size_t realLimit = QMIN( numResults, m_limit ); + const size_t realLimit = TQMIN( numResults, m_limit ); for ( size_t i = m_start; i < realLimit && !m_aborted; ++i ) { @@ -331,7 +331,7 @@ void Z3950Connection::run() continue; } int len; - QString data; + TQString data; if ( m_syntax == Latin1Literal( "mods" ) ) { data = toString( ZOOM_record_get( rec, "xml", &len ) ); @@ -346,10 +346,10 @@ void Z3950Connection::run() #if 0 kdWarning() << "Remove debug from z3950connection.cpp" << endl; { - QFile f1( QString::fromLatin1( "/tmp/z3950.raw" ) ); + TQFile f1( TQString::fromLatin1( "/tmp/z3950.raw" ) ); if ( f1.open( IO_WriteOnly ) ) { - QDataStream t( &f1 ); + TQDataStream t( &f1 ); t << ZOOM_record_get( rec, "raw", &len ); } f1.close(); @@ -358,7 +358,7 @@ void Z3950Connection::run() data = toXML( ZOOM_record_get( rec, "raw", &len ), m_sourceCharSet ); } Z3950ResultFound* ev = new Z3950ResultFound( data ); - QApplication::postEvent( m_fetcher, ev ); + TQApplication::postEvent( m_fetcher, ev ); } ZOOM_resultset_destroy( resultSet ); @@ -402,8 +402,8 @@ bool Z3950Connection::makeConnection() ZOOM_connection_destroy( d->conn ); m_connected = false; - QString s = i18n( "Connection error %1: %2" ).arg( errcode ).arg( toString( errmsg ) ); - if ( !QCString( addinfo ).isEmpty() ) + TQString s = i18n( "Connection error %1: %2" ).arg( errcode ).arg( toString( errmsg ) ); + if ( !TQCString( addinfo ).isEmpty() ) { s += " (" + toString( addinfo ) + ")"; } @@ -419,19 +419,19 @@ bool Z3950Connection::makeConnection() void Z3950Connection::done() { checkPendingEvents(); - qApp->postEvent( m_fetcher, new Z3950ConnectionDone( m_hasMore ) ); + tqApp->postEvent( m_fetcher, new Z3950ConnectionDone( m_hasMore ) ); } -void Z3950Connection::done( const QString& msg_, int type_ ) +void Z3950Connection::done( const TQString& msg_, int type_ ) { checkPendingEvents(); if ( m_aborted ) { - qApp->postEvent( m_fetcher, new Z3950ConnectionDone( m_hasMore ) ); + tqApp->postEvent( m_fetcher, new Z3950ConnectionDone( m_hasMore ) ); } else { - qApp->postEvent( m_fetcher, new Z3950ConnectionDone( m_hasMore, msg_, type_ ) ); + tqApp->postEvent( m_fetcher, new Z3950ConnectionDone( m_hasMore, msg_, type_ ) ); } } @@ -445,19 +445,19 @@ void Z3950Connection::checkPendingEvents() } inline -QCString Z3950Connection::toCString( const QString& text_ ) +TQCString Z3950Connection::toCString( const TQString& text_ ) { - return iconvRun( text_.utf8(), QString::fromLatin1( "utf-8" ), m_sourceCharSet ); + return iconvRun( text_.utf8(), TQString::fromLatin1( "utf-8" ), m_sourceCharSet ); } inline -QString Z3950Connection::toString( const QCString& text_ ) +TQString Z3950Connection::toString( const TQCString& text_ ) { - return QString::fromUtf8( iconvRun( text_, m_sourceCharSet, QString::fromLatin1( "utf-8" ) ) ); + return TQString::fromUtf8( iconvRun( text_, m_sourceCharSet, TQString::fromLatin1( "utf-8" ) ) ); } // static -QCString Z3950Connection::iconvRun( const QCString& text_, const QString& fromCharSet_, const QString& toCharSet_ ) +TQCString Z3950Connection::iconvRun( const TQCString& text_, const TQString& fromCharSet_, const TQString& toCharSet_ ) { #ifdef HAVE_YAZ if ( text_.isEmpty() ) @@ -474,15 +474,15 @@ QCString Z3950Connection::iconvRun( const QCString& text_, const QString& fromCh if ( !cd ) { // maybe it's iso 5426, which we sorta support - QString charSetLower = fromCharSet_.lower(); + TQString charSetLower = fromCharSet_.lower(); charSetLower.remove( '-' ).remove( ' ' ); if ( charSetLower == Latin1Literal( "iso5426" ) ) { - return iconvRun( Iso5426Converter::toUtf8( text_ ).utf8(), QString::fromLatin1( "utf-8" ), toCharSet_ ); + return iconvRun( Iso5426Converter::toUtf8( text_ ).utf8(), TQString::fromLatin1( "utf-8" ), toCharSet_ ); } else if ( charSetLower == Latin1Literal( "iso6937" ) ) { - return iconvRun( Iso6937Converter::toUtf8( text_ ).utf8(), QString::fromLatin1( "utf-8" ), toCharSet_ ); + return iconvRun( Iso6937Converter::toUtf8( text_ ).utf8(), TQString::fromLatin1( "utf-8" ), toCharSet_ ); } kdWarning() << "Z3950Connection::iconvRun() - conversion from " << fromCharSet_ << " to " << toCharSet_ << " is unsupported" << endl; @@ -493,7 +493,7 @@ QCString Z3950Connection::iconvRun( const QCString& text_, const QString& fromCh size_t inlen = text_.length(); size_t outlen = 2 * inlen; // this is enough, right? - QMemArray result0( outlen ); + TQMemArray result0( outlen ); char* result = result0.data(); int r = yaz_iconv( cd, const_cast( &input ), &inlen, &result, &outlen ); @@ -508,7 +508,7 @@ QCString Z3950Connection::iconvRun( const QCString& text_, const QString& fromCh // length is pointer difference size_t len = result - result0; - QCString output = QCString( result0, len + 1 ); + TQCString output = TQCString( result0, len + 1 ); // kdDebug() << "-------------------------------------------" << endl; // kdDebug() << output << endl; // kdDebug() << "-------------------------------------------" << endl; @@ -518,31 +518,31 @@ QCString Z3950Connection::iconvRun( const QCString& text_, const QString& fromCh return text_; } -QString Z3950Connection::toXML( const QCString& marc_, const QString& charSet_ ) +TQString Z3950Connection::toXML( const TQCString& marc_, const TQString& charSet_ ) { #ifdef HAVE_YAZ if ( marc_.isEmpty() ) { kdDebug() << "Z3950Connection::toXML() - empty string" << endl; - return QString::null; + return TQString::null; } yaz_iconv_t cd = yaz_iconv_open( "utf-8", charSet_.latin1() ); if ( !cd ) { // maybe it's iso 5426, which we sorta support - QString charSetLower = charSet_.lower(); + TQString charSetLower = charSet_.lower(); charSetLower.remove( '-' ).remove( ' ' ); if ( charSetLower == Latin1Literal( "iso5426" ) ) { - return toXML( Iso5426Converter::toUtf8( marc_ ).utf8(), QString::fromLatin1( "utf-8" ) ); + return toXML( Iso5426Converter::toUtf8( marc_ ).utf8(), TQString::fromLatin1( "utf-8" ) ); } else if ( charSetLower == Latin1Literal( "iso6937" ) ) { - return toXML( Iso6937Converter::toUtf8( marc_ ).utf8(), QString::fromLatin1( "utf-8" ) ); + return toXML( Iso6937Converter::toUtf8( marc_ ).utf8(), TQString::fromLatin1( "utf-8" ) ); } kdWarning() << "Z3950Connection::toXML() - conversion from " << charSet_ << " is unsupported" << endl; - return QString::null; + return TQString::null; } yaz_marc_t mt = yaz_marc_create(); @@ -559,7 +559,7 @@ QString Z3950Connection::toXML( const QCString& marc_, const QString& charSet_ ) if ( ok && ( len < 25 || len > 100000 ) ) { kdDebug() << "Z3950Connection::toXML() - bad length: " << ( ok ? len : -1 ) << endl; - return QString::null; + return TQString::null; } #if YAZ_VERSIONL < 0x030000 @@ -571,12 +571,12 @@ QString Z3950Connection::toXML( const QCString& marc_, const QString& charSet_ ) if ( r <= 0 ) { kdDebug() << "Z3950Connection::toXML() - can't decode buffer" << endl; - return QString::null; + return TQString::null; } - QString output = QString::fromLatin1( "\n" ); - output += QString::fromUtf8( QCString( result, len + 1 ), len + 1 ); -// kdDebug() << QCString(result) << endl; + TQString output = TQString::fromLatin1( "\n" ); + output += TQString::fromUtf8( TQCString( result, len + 1 ), len + 1 ); +// kdDebug() << TQCString(result) << endl; // kdDebug() << "-------------------------------------------" << endl; // kdDebug() << output << endl; yaz_iconv_close( cd ); @@ -584,6 +584,6 @@ QString Z3950Connection::toXML( const QCString& marc_, const QString& charSet_ ) return output; #else // no yaz - return QString::null; + return TQString::null; #endif } diff --git a/src/z3950connection.h b/src/z3950connection.h index 8019f40..aedb645 100644 --- a/src/z3950connection.h +++ b/src/z3950connection.h @@ -23,83 +23,83 @@ #ifndef KBIBTEX_Z3950CONNECTION_H #define KBIBTEX_Z3950CONNECTION_H -#include -#include -#include +#include +#include +#include #include namespace KBibTeX { -class Z3950ResultFound : public QCustomEvent { +class Z3950ResultFound : public TQCustomEvent { public: - Z3950ResultFound(const QString& s); + Z3950ResultFound(const TQString& s); ~Z3950ResultFound(); - const QString& result() const { return m_result; } + const TQString& result() const { return m_result; } static int uid() { return User + 11111; } private: - QString m_result; + TQString m_result; }; -class Z3950ConnectionDone : public QCustomEvent { +class Z3950ConnectionDone : public TQCustomEvent { public: - Z3950ConnectionDone(bool more) : QCustomEvent(uid()), m_type(-1), m_hasMore(more) {} - Z3950ConnectionDone(bool more, const QString& s, int t) : QCustomEvent(uid()), m_msg(QDeepCopy(s)), m_type(t), m_hasMore(more) {} + Z3950ConnectionDone(bool more) : TQCustomEvent(uid()), m_type(-1), m_hasMore(more) {} + Z3950ConnectionDone(bool more, const TQString& s, int t) : TQCustomEvent(uid()), m_msg(TQDeepCopy(s)), m_type(t), m_hasMore(more) {} - const QString& message() const { return m_msg; } + const TQString& message() const { return m_msg; } int messageType() const { return m_type; } bool hasMoreResults() const { return m_hasMore; } static int uid() { return User + 22222; } private: - QString m_msg; + TQString m_msg; int m_type; bool m_hasMore; }; -class Z3950SyntaxChange : public QCustomEvent { +class Z3950SyntaxChange : public TQCustomEvent { public: - Z3950SyntaxChange(const QString& s) : QCustomEvent(uid()), m_syntax(QDeepCopy(s)) {} - const QString& syntax() const { return m_syntax; } + Z3950SyntaxChange(const TQString& s) : TQCustomEvent(uid()), m_syntax(TQDeepCopy(s)) {} + const TQString& syntax() const { return m_syntax; } static int uid() { return User + 33333; } private: - QString m_syntax; + TQString m_syntax; }; /** * @author Robby Stephenson */ -class Z3950Connection : public QThread { +class Z3950Connection : public TQThread { public: - Z3950Connection(QObject* fetcher, - const QString& host, + Z3950Connection(TQObject* fetcher, + const TQString& host, uint port, - const QString& dbname, - const QString& sourceCharSet, - const QString& syntax, - const QString& esn); + const TQString& dbname, + const TQString& sourceCharSet, + const TQString& syntax, + const TQString& esn); ~Z3950Connection(); void reset(); - void setQuery(const QString& query, unsigned int numHits); - void setUserPassword(const QString& user, const QString& pword); + void setQuery(const TQString& query, unsigned int numHits); + void setUserPassword(const TQString& user, const TQString& pword); void run(); void abort() { m_aborted = true; } private: - static QCString iconvRun(const QCString& text, const QString& fromCharSet, const QString& toCharSet); - static QString toXML(const QCString& marc, const QString& fromCharSet); + static TQCString iconvRun(const TQCString& text, const TQString& fromCharSet, const TQString& toCharSet); + static TQString toXML(const TQCString& marc, const TQString& fromCharSet); bool makeConnection(); void done(); - void done(const QString& message, int type); - QCString toCString(const QString& text); - QString toString(const QCString& text); + void done(const TQString& message, int type); + TQCString toCString(const TQString& text); + TQString toString(const TQCString& text); void checkPendingEvents(); class Private; @@ -108,16 +108,16 @@ private: bool m_connected; bool m_aborted; - QObject* m_fetcher; - QString m_host; + TQObject* m_fetcher; + TQString m_host; uint m_port; - QString m_dbname; - QString m_user; - QString m_password; - QString m_sourceCharSet; - QString m_syntax; - QString m_pqn; - QString m_esn; + TQString m_dbname; + TQString m_user; + TQString m_password; + TQString m_sourceCharSet; + TQString m_syntax; + TQString m_pqn; + TQString m_esn; size_t m_start; size_t m_limit; bool m_hasMore; -- cgit v1.2.1