diff options
Diffstat (limited to 'kivio/kiviopart/kiviosdk/kivio_stencil_spawner_set.cpp')
-rw-r--r-- | kivio/kiviopart/kiviosdk/kivio_stencil_spawner_set.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/kivio/kiviopart/kiviosdk/kivio_stencil_spawner_set.cpp b/kivio/kiviopart/kiviosdk/kivio_stencil_spawner_set.cpp index 66339a0e..64d5a7c9 100644 --- a/kivio/kiviopart/kiviosdk/kivio_stencil_spawner_set.cpp +++ b/kivio/kiviopart/kiviosdk/kivio_stencil_spawner_set.cpp @@ -24,22 +24,22 @@ #include "kivio_stencil_spawner.h" #include "kivio_stencil_spawner_set.h" -#include <qdir.h> -#include <qfile.h> -#include <qstring.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqstring.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> -KivioStencilSpawnerSet::KivioStencilSpawnerSet(const QString& name) +KivioStencilSpawnerSet::KivioStencilSpawnerSet(const TQString& name) : m_pSpawners(NULL), m_pSelected(NULL) { m_hidden = false; m_dir = ""; - m_name = name.isEmpty() ? QString("Untitled") : name; + m_name = name.isEmpty() ? TQString("Untitled") : name; - m_pSpawners = new QPtrList<KivioStencilSpawner>; + m_pSpawners = new TQPtrList<KivioStencilSpawner>; m_pSpawners->setAutoDelete(true); } @@ -54,31 +54,31 @@ KivioStencilSpawnerSet::~KivioStencilSpawnerSet() /** * Loads a stencil spawners from data defined in an XML file * - * @param e The @ref QDomElement to load from + * @param e The @ref TQDomElement to load from * * This is a function that needs to be implemented by all descendant * classes. It should search the known stencil-paths for the spawner * specified, and load it. */ -bool KivioStencilSpawnerSet::loadXML( const QDomElement & ) +bool KivioStencilSpawnerSet::loadXML( const TQDomElement & ) { return false; } /** - * Saves a spawner to a @ref QDomElement + * Saves a spawner to a @ref TQDomElement * * @param doc The document to save to * * All descendant classes should implement this function. It should - * save the necessary data to a @ref QDomElement such that when + * save the necessary data to a @ref TQDomElement such that when * it is loaded again, it can find the spawner and load it from * the local filesystem. */ -QDomElement KivioStencilSpawnerSet::saveXML( QDomDocument &doc ) +TQDomElement KivioStencilSpawnerSet::saveXML( TQDomDocument &doc ) { - QDomElement spawnE = doc.createElement("KivioStencilSpawnerSet"); + TQDomElement spawnE = doc.createElement("KivioStencilSpawnerSet"); XmlWriteString( spawnE, "id", m_id ); XmlWriteString(spawnE, "hidden", (m_hidden ? "true" : "false")); @@ -95,22 +95,22 @@ QDomElement KivioStencilSpawnerSet::saveXML( QDomDocument &doc ) return spawnE; } -bool KivioStencilSpawnerSet::loadDir( const QString &dirName ) +bool KivioStencilSpawnerSet::loadDir( const TQString &dirName ) { - QDir d(dirName); - QString fileName; + TQDir d(dirName); + TQString fileName; m_dir = dirName; m_name = readTitle( dirName ); m_id = readId( dirName ); - d.setNameFilter("*.so *.sml *.ksp *.spy *.shape"); + d.setNameFilter("*.so *.sml *.ksp *.spy *.tqshape"); m_files = d.entryList(); return true; } -KivioStencilSpawner* KivioStencilSpawnerSet::loadFile( const QString &fileName ) +KivioStencilSpawner* KivioStencilSpawnerSet::loadFile( const TQString &fileName ) { for (KivioStencilSpawner* ss = m_pSpawners->first(); ss; ss = m_pSpawners->next() ) if (ss->fileName() == fileName) @@ -118,23 +118,23 @@ KivioStencilSpawner* KivioStencilSpawnerSet::loadFile( const QString &fileName ) KivioStencilSpawner *pSpawner; - if( fileName.contains( ".sml", false ) ) + if( fileName.tqcontains( ".sml", false ) ) { pSpawner = new KivioSMLStencilSpawner(this); } - else if( fileName.contains( ".ksp", false ) ) + else if( fileName.tqcontains( ".ksp", false ) ) { pSpawner = new KivioPluginStencilSpawner(this); } - else if( fileName.contains( ".so", false ) ) + else if( fileName.tqcontains( ".so", false ) ) { pSpawner = new KivioPluginStencilSpawner(this); } - else if( fileName.contains( ".spy", false ) ) + else if( fileName.tqcontains( ".spy", false ) ) { pSpawner = new KivioPyStencilSpawner(this); } - else if( fileName.contains( ".shape", false ) ) + else if( fileName.tqcontains( ".tqshape", false ) ) { pSpawner = new KivioDiaStencilSpawner(this); } @@ -154,20 +154,20 @@ KivioStencilSpawner* KivioStencilSpawnerSet::loadFile( const QString &fileName ) return pSpawner; } -QString KivioStencilSpawnerSet::readTitle( const QString &dir ) +TQString KivioStencilSpawnerSet::readTitle( const TQString &dir ) { - QDomDocument d("StencilSPawnerSet"); - QDomElement root, nodeElement; - QDomNode node; - QString nodeName; - QString title, origTitle; - QFile f(dir+"/desc"); + TQDomDocument d("StencilSPawnerSet"); + TQDomElement root, nodeElement; + TQDomNode node; + TQString nodeName; + TQString title, origTitle; + TQFile f(dir+"/desc"); if( f.open( IO_ReadOnly )==false ) { kdDebug(43000) << "KivioStencilSpawnerSet::readTitle() - Error opening stencil set title: " << dir << "/desc" << endl; - return dir.right(dir.length() - dir.findRev('/')-1); + return dir.right(dir.length() - dir.tqfindRev('/')-1); } d.setContent(&f); @@ -201,14 +201,14 @@ QString KivioStencilSpawnerSet::readTitle( const QString &dir ) return title; } -QString KivioStencilSpawnerSet::readId( const QString &dir ) +TQString KivioStencilSpawnerSet::readId( const TQString &dir ) { - QDomDocument d("StencilSPawnerSet"); - QDomElement root; - QDomNode node; - QString nodeName; - QString theid; - QFile f(dir+"/desc"); + TQDomDocument d("StencilSPawnerSet"); + TQDomElement root; + TQDomNode node; + TQString nodeName; + TQString theid; + TQFile f(dir+"/desc"); if( f.open( IO_ReadOnly )==false ) { @@ -241,13 +241,13 @@ QString KivioStencilSpawnerSet::readId( const QString &dir ) return ""; } -QString KivioStencilSpawnerSet::readDescription(const QString& dir) +TQString KivioStencilSpawnerSet::readDescription(const TQString& dir) { - QDomDocument d("StencilSPawnerSet"); - QDomElement root, nodeElement; - QDomNode node; - QString nodeName; - QFile f(dir + "/desc"); + TQDomDocument d("StencilSPawnerSet"); + TQDomElement root, nodeElement; + TQDomNode node; + TQString nodeName; + TQFile f(dir + "/desc"); if( f.open( IO_ReadOnly )==false ) { @@ -260,7 +260,7 @@ QString KivioStencilSpawnerSet::readDescription(const QString& dir) root = d.documentElement(); node = root.firstChild(); - QString description, origDesc; + TQString description, origDesc; while( !node.isNull() ) { @@ -289,7 +289,7 @@ QString KivioStencilSpawnerSet::readDescription(const QString& dir) } -KivioStencilSpawner* KivioStencilSpawnerSet::find( const QString& id) +KivioStencilSpawner* KivioStencilSpawnerSet::tqfind( const TQString& id) { if(!m_pSpawners || m_pSpawners->isEmpty()) { return 0; |