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/settings.cpp | 344 +++++++++++++++++++++++++++---------------------------- 1 file changed, 172 insertions(+), 172 deletions(-) (limited to 'src/settings.cpp') 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 ) ) -- cgit v1.2.1