diff options
author | Slávek Banko <[email protected]> | 2013-06-29 12:56:53 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2013-07-04 03:11:35 +0200 |
commit | 5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch) | |
tree | c8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/webqueryciteseerx.cpp | |
parent | 251c9a439759c830d34c70683d0fc9454d703010 (diff) | |
download | kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip |
Initial TQt conversion
Diffstat (limited to 'src/webqueryciteseerx.cpp')
-rw-r--r-- | src/webqueryciteseerx.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
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 <qfile.h> -#include <qregexp.h> -#include <qbuffer.h> -#include <qspinbox.h> +#include <ntqfile.h> +#include <ntqregexp.h> +#include <ntqbuffer.h> +#include <ntqspinbox.h> #include <klocale.h> #include <klineedit.h> @@ -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( "<a href=\"([^\"]+)\">Next 10" ); + TQRegExp nextSummaryXpr( "<a href=\"([^\"]+)\">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<KIO::StoredTransferJob*>( 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 |