summaryrefslogtreecommitdiffstats
path: root/src/webqueryz3950.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-06-29 12:56:53 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-07-04 03:11:35 +0200
commit5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch)
treec8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/webqueryz3950.cpp
parent251c9a439759c830d34c70683d0fc9454d703010 (diff)
downloadkbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz
kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip
Initial TQt conversion
Diffstat (limited to 'src/webqueryz3950.cpp')
-rw-r--r--src/webqueryz3950.cpp98
1 files changed, 49 insertions, 49 deletions
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 <config.h>
#endif
-#include <qfile.h>
-#include <qapplication.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <ntqfile.h>
+#include <ntqapplication.h>
+#include <ntqspinbox.h>
+#include <ntqlayout.h>
+#include <ntqlabel.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -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<QString, Settings::Z3950Server>::Iterator it = settings->z3950_ServerList.begin(); it != settings->z3950_ServerList.end(); ++it )
+ for ( TQMap<TQString, Settings::Z3950Server>::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<QString, Settings::Z3950Server>::Iterator it = settings->z3950_ServerList.begin(); m_conn == NULL && it != settings->z3950_ServerList.end(); ++it )
+ for ( TQMap<TQString, Settings::Z3950Server>::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<KBibTeX::Z3950ConnectionDone*>( 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 )