diff options
Diffstat (limited to 'src/webqueryspireshep.cpp')
-rw-r--r-- | src/webqueryspireshep.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
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 <qfile.h> -#include <qapplication.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> +#include <ntqfile.h> +#include <ntqapplication.h> +#include <ntqlayout.h> +#include <ntqlabel.h> +#include <ntqcheckbox.h> #include <kiconloader.h> #include <kcombobox.h> @@ -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:</span>" ); 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 ) ) ); } } } |