summaryrefslogtreecommitdiffstats
path: root/src/documentwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/documentwidget.cpp')
-rw-r--r--src/documentwidget.cpp354
1 files changed, 177 insertions, 177 deletions
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 <cmath>
-#include <qlayout.h>
-#include <qfile.h>
-#include <qdragobject.h>
-#include <qregexp.h>
-#include <qsplitter.h>
-#include <qurl.h>
-#include <qtextedit.h>
-#include <qprogressdialog.h>
-#include <qbuffer.h>
-#include <qtooltip.h>
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qfileinfo.h>
+#include <ntqlayout.h>
+#include <ntqfile.h>
+#include <ntqdragobject.h>
+#include <ntqregexp.h>
+#include <ntqsplitter.h>
+#include <ntqurl.h>
+#include <ntqtextedit.h>
+#include <ntqprogressdialog.h>
+#include <ntqbuffer.h>
+#include <ntqtooltip.h>
+#include <ntqapplication.h>
+#include <ntqpushbutton.h>
+#include <ntqfileinfo.h>
#include <kdebug.h>
#include <klocale.h>
@@ -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( "<qt>Loading file <b>%1</b></qt>" ) ).arg( fileName ), importer );
+ result = open( &file, mergeOnly, TQString( i18n( "<qt>Loading file <b>%1</b></qt>" ) ).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<BibTeX::Element*>::ConstIterator eit = newFile->constBegin(); eit != newFile->constEnd(); ++eit )
+ for ( TQValueList<BibTeX::Element*>::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( "<qt>Writing file <b>%1</b></qt>" ) ).arg( fileName ), errorLog );
+ result = save( &file, format, TQString( i18n( "<qt>Writing file <b>%1</b></qt>" ) ).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<DocumentListViewItem*>( 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<BibTeX::Entry*> entryList;
- for ( QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); it.current(); ++it )
+ TQValueList<BibTeX::Entry*> entryList;
+ for ( TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); it.current(); ++it )
{
BibTeX::Element * currentElement = NULL;
DocumentListViewItem * dlvi = dynamic_cast<DocumentListViewItem*>( it.current() );
@@ -721,17 +721,17 @@ namespace KBibTeX
}
}
- for ( QValueList<BibTeX::Entry*>::Iterator it = entryList.begin(); it != entryList.end(); ++it )
+ for ( TQValueList<BibTeX::Entry*>::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<BibTeX::ValueItem*>::ConstIterator it = valueKeywords->items.begin();it != valueKeywords->items.end();++it )
+ for ( TQValueList<BibTeX::ValueItem*>::ConstIterator it = valueKeywords->items.begin();it != valueKeywords->items.end();++it )
{
BibTeX::KeywordContainer *container = dynamic_cast<BibTeX::KeywordContainer*>( *it );
if ( container != NULL )
- for ( QValueList<BibTeX::Keyword*>::ConstIterator kit = container->keywords.begin();kit != container->keywords.end();++kit )
+ for ( TQValueList<BibTeX::Keyword*>::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<BibTeX::Element*>::ConstIterator eit = m_bibtexfile->constBegin(); eit != m_bibtexfile->constEnd(); ++eit )
+ for ( TQValueList<BibTeX::Element*>::ConstIterator eit = m_bibtexfile->constBegin(); eit != m_bibtexfile->constEnd(); ++eit )
{
BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( *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<BibTeX::ValueItem*>::ConstIterator vit = value->items.constBegin(); vit != value->items.constEnd();++vit )
+ for ( TQValueList<BibTeX::ValueItem*>::ConstIterator vit = value->items.constBegin(); vit != value->items.constEnd();++vit )
{
BibTeX::KeywordContainer *container = dynamic_cast<BibTeX::KeywordContainer *>( *vit );
- for ( QValueList<BibTeX::Keyword*>::ConstIterator kit = container->keywords.constBegin(); kit != container->keywords.constEnd();++kit )
+ for ( TQValueList<BibTeX::Keyword*>::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<Settings::SearchURL*>::ConstIterator it = settings->searchURLs.begin(); it != settings->searchURLs.end(); ++it )
+ for ( TQValueList<Settings::SearchURL*>::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<DocumentListViewItem*>( 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<BibTeX::Entry*>( 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<BibTeX::Element*> 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<BibTeX::Element*> 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<BibTeX::Element*>::Iterator it = elements.begin(); it != elements.end(); ++it )
+ TQStringList refsToSend;
+ for ( TQValueList<BibTeX::Element*>::Iterator it = elements.begin(); it != elements.end(); ++it )
{
BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( *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<DocumentListViewItem*>( 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<BibTeX::Entry*>( element );
if ( entry != NULL )
@@ -1183,8 +1183,8 @@ namespace KBibTeX
BibTeX::PersonContainer *personContainer = dynamic_cast<BibTeX::PersonContainer*>( field->value()->items.first() );
if ( personContainer != NULL )
{
- QValueList<BibTeX::Person*> list = personContainer->persons;
- for ( QValueList<BibTeX::Person*>::ConstIterator it = list.begin(); it != list.end(); ++it )
+ TQValueList<BibTeX::Person*> list = personContainer->persons;
+ for ( TQValueList<BibTeX::Person*>::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<BibTeX::Entry*> list;
- if ( WebQueryWizard::execute( this, list ) == QDialog::Accepted )
+ TQValueList<BibTeX::Entry*> list;
+ if ( WebQueryWizard::execute( this, list ) == TQDialog::Accepted )
{
Settings * settings = Settings::self( m_bibtexfile );
- for ( QValueList<BibTeX::Entry*>::Iterator it = list.begin(); it != list.end(); ++it )
+ for ( TQValueList<BibTeX::Entry*>::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( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ).append( "</qt>" ).prepend( "<qt>" ).replace( QRegExp( "\\\\emph\\{([^}]+)\\}" ), "<em>\\1</em>" ).replace( QRegExp( "\\\\[A-Za-z0-9]+" ), "" ).replace( '{', "" ).replace( '}', "" );
+ TQString text = htmlText.remove( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ).append( "</qt>" ).prepend( "<qt>" ).replace( TQRegExp( "\\\\emph\\{([^}]+)\\}" ), "<em>\\1</em>" ).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<BibTeX::Entry*> entryList;
+ TQValueList<BibTeX::Entry*> 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<DocumentListViewItem*>( it.current() );
@@ -1601,7 +1601,7 @@ namespace KBibTeX
}
}
- for ( QValueList<BibTeX::Entry*>::Iterator it = entryList.begin(); it != entryList.end(); ++it )
+ for ( TQValueList<BibTeX::Entry*>::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<BibTeX::Entry*> entryList;
- for ( QListViewItemIterator it( m_listViewElements, QListViewItemIterator::Selected ); it.current(); ++it )
+ TQValueList<BibTeX::Entry*> entryList;
+ for ( TQListViewItemIterator it( m_listViewElements, TQListViewItemIterator::Selected ); it.current(); ++it )
{
BibTeX::Element * currentElement = NULL;
DocumentListViewItem * dlvi = dynamic_cast<DocumentListViewItem*>( it.current() );
@@ -1645,7 +1645,7 @@ namespace KBibTeX
}
}
- for ( QValueList<BibTeX::Entry*>::Iterator it = entryList.begin(); it != entryList.end(); ++it )
+ for ( TQValueList<BibTeX::Entry*>::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<BibTeX::Entry*, QString> entryToNewId;
- QMap<BibTeX::Entry*, DocumentListViewItem*> entryToItem;
- QStringList msgList;
+ TQMap<BibTeX::Entry*, TQString> entryToNewId;
+ TQMap<BibTeX::Entry*, DocumentListViewItem*> 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<DocumentListViewItem*>( it.current() );
@@ -1701,7 +1701,7 @@ namespace KBibTeX
BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( 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<BibTeX::Entry*, DocumentListViewItem*>::Iterator itItem = entryToItem.begin();
- for ( QMap<BibTeX::Entry*, QString>::Iterator it = entryToNewId.begin(); it != entryToNewId.end(); ++it, ++itItem )
+ TQApplication::setOverrideCursor( TQt::waitCursor );
+ TQMap<BibTeX::Entry*, DocumentListViewItem*>::Iterator itItem = entryToItem.begin();
+ for ( TQMap<BibTeX::Entry*, TQString>::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();
}
}