diff options
Diffstat (limited to 'src/electronics/subcircuits.cpp')
-rw-r--r-- | src/electronics/subcircuits.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/electronics/subcircuits.cpp b/src/electronics/subcircuits.cpp index 65ae8e3..18ff615 100644 --- a/src/electronics/subcircuits.cpp +++ b/src/electronics/subcircuits.cpp @@ -20,13 +20,13 @@ #include <kdebug.h> #include <kiconloader.h> #include <kstandarddirs.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> Subcircuits::Subcircuits() - : QObject() + : TQObject() { - connect( ComponentSelector::self(), SIGNAL(itemRemoved(const QString& )), this, SLOT(slotItemRemoved(const QString& )) ); + connect( ComponentSelector::self(), TQT_SIGNAL(itemRemoved(const TQString& )), this, TQT_SLOT(slotItemRemoved(const TQString& )) ); } @@ -37,8 +37,8 @@ Subcircuits::~Subcircuits() void Subcircuits::initECSubcircuit( int subcircuitId, ECSubcircuit *ecSubcircuit ) { - const QString fileName = genFileName(subcircuitId); - if ( !QFile::exists(fileName) ) + const TQString fileName = genFileName(subcircuitId); + if ( !TQFile::exists(fileName) ) { kdDebug() << "Subcircuits::createSubcircuit: Subcircuit \""<<fileName<<"\" was not found."<<endl; return; @@ -68,11 +68,11 @@ void Subcircuits::loadSubcircuits() KConfig *config = kapp->config(); config->setGroup("Subcircuits"); - QValueList<int> idList = config->readIntListEntry("Ids"); - const QValueList<int>::iterator idListEnd = idList.end(); - for ( QValueList<int>::iterator it = idList.begin(); it != idListEnd; ++it ) + TQValueList<int> idList = config->readIntListEntry("Ids"); + const TQValueList<int>::iterator idListEnd = idList.end(); + for ( TQValueList<int>::iterator it = idList.begin(); it != idListEnd; ++it ) { - QFile file( genFileName(*it) ); + TQFile file( genFileName(*it) ); if ( file.open(IO_ReadOnly) == false ) { // File has mysteriously disappeared.... @@ -80,7 +80,7 @@ void Subcircuits::loadSubcircuits() } else { - config->setGroup("Subcircuit_"+QString::number(*it)); + config->setGroup("Subcircuit_"+TQString::number(*it)); updateComponentSelector( *it, config->readEntry("Name") ); } file.close(); @@ -93,36 +93,36 @@ void Subcircuits::loadSubcircuits() } -QString Subcircuits::genFileName( const int nextId ) +TQString Subcircuits::genFileName( const int nextId ) { - return locateLocal( "appdata", "subcircuit_"+QString::number(nextId)+".circuit" ); + return locateLocal( "appdata", "subcircuit_"+TQString::number(nextId)+".circuit" ); } -void Subcircuits::updateComponentSelector( int id, const QString &name ) +void Subcircuits::updateComponentSelector( int id, const TQString &name ) { if ( name.isEmpty() ) return; - ComponentSelector::self()->addItem( name, "sc/"+QString::number(id), "Subcircuits", KGlobal::iconLoader()->loadIcon( "ktechlab_circuit", KIcon::Small ), true ); + ComponentSelector::self()->addItem( name, "sc/"+TQString::number(id), "Subcircuits", KGlobal::iconLoader()->loadIcon( "ktechlab_circuit", KIcon::Small ), true ); } -void Subcircuits::addSubcircuit( const QString &name, const QString &subcircuitXml ) +void Subcircuits::addSubcircuit( const TQString &name, const TQString &subcircuitXml ) { KConfig *config = kapp->config(); config->setGroup("Subcircuits"); int nextId = config->readNumEntry( "NextId", 0 ); - while ( QFile::exists( genFileName(nextId) ) ) { + while ( TQFile::exists( genFileName(nextId) ) ) { nextId++; } const int id = nextId; - const QString fileName = genFileName(id); - QFile file(fileName); + const TQString fileName = genFileName(id); + TQFile file(fileName); if ( file.open(IO_WriteOnly) == false ) { @@ -130,16 +130,16 @@ void Subcircuits::addSubcircuit( const QString &name, const QString &subcircuitX return; } - QTextStream stream(&file); + TQTextStream stream(&file); stream << subcircuitXml; file.close(); - QValueList<int> idList = config->readIntListEntry("Ids"); + TQValueList<int> idList = config->readIntListEntry("Ids"); idList += id; config->writeEntry( "Ids", idList ); config->writeEntry( "NextId", ++nextId ); - config->setGroup("Subcircuit_"+QString::number(id)); + config->setGroup("Subcircuit_"+TQString::number(id)); config->writeEntry( "Name", name ); // It's important that we write the configuration *now*, lest the subcircuits be lost @@ -149,22 +149,22 @@ void Subcircuits::addSubcircuit( const QString &name, const QString &subcircuitX } -void Subcircuits::slotItemRemoved( const QString &id ) +void Subcircuits::slotItemRemoved( const TQString &id ) { if ( !id.startsWith("sc/") ) { return; } - QString temp = id; + TQString temp = id; temp.remove("sc/"); const int id_num = temp.toInt(); - const QString fileName = genFileName(id_num); - QFile file(fileName); + const TQString fileName = genFileName(id_num); + TQFile file(fileName); file.remove(); KConfig *config = kapp->config(); config->setGroup("Subcircuits"); - QValueList<int> idList = config->readIntListEntry("Ids"); + TQValueList<int> idList = config->readIntListEntry("Ids"); idList.remove(id_num); config->writeEntry( "Ids", idList ); } |