From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdevdesigner/designer/pixmapcollection.cpp | 60 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'kdevdesigner/designer/pixmapcollection.cpp') diff --git a/kdevdesigner/designer/pixmapcollection.cpp b/kdevdesigner/designer/pixmapcollection.cpp index c8b14ffa..d0692de1 100644 --- a/kdevdesigner/designer/pixmapcollection.cpp +++ b/kdevdesigner/designer/pixmapcollection.cpp @@ -27,17 +27,17 @@ #include "pixmapcollection.h" #include "project.h" #include "mainwindow.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include PixmapCollection::PixmapCollection( Project *pro ) : project( pro ) { iface = new DesignerPixmapCollectionImpl( this ); - mimeSourceFactory = new QMimeSourceFactory(); + mimeSourceFactory = new TQMimeSourceFactory(); } PixmapCollection::~PixmapCollection() @@ -52,7 +52,7 @@ bool PixmapCollection::addPixmap( const Pixmap &pix, bool force ) savePixmap( pixmap ); if ( !force ) { - for ( QValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { + for ( TQValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { if ( (*it).name == pixmap.name ) return FALSE; } @@ -64,9 +64,9 @@ bool PixmapCollection::addPixmap( const Pixmap &pix, bool force ) return TRUE; } -void PixmapCollection::removePixmap( const QString &name ) +void PixmapCollection::removePixmap( const TQString &name ) { - for ( QValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { + for ( TQValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { if ( (*it).name == name ) { pixList.remove( it ); break; @@ -75,24 +75,24 @@ void PixmapCollection::removePixmap( const QString &name ) project->setModified( TRUE ); } -QValueList PixmapCollection::pixmaps() const +TQValueList PixmapCollection::pixmaps() const { return pixList; } -QString PixmapCollection::unifyName( const QString &n ) +TQString PixmapCollection::unifyName( const TQString &n ) { - QString name = n; + TQString name = n; bool restart = FALSE; int added = 1; - for ( QValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { + for ( TQValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { if ( restart ) it = pixList.begin(); restart = FALSE; if ( name == (*it).name ) { name = n; - name += "_" + QString::number( added ); + name += "_" + TQString::number( added ); ++added; restart = TRUE; } @@ -104,28 +104,28 @@ QString PixmapCollection::unifyName( const QString &n ) void PixmapCollection::setActive( bool b ) { if ( b ) - QMimeSourceFactory::defaultFactory()->addFactory( mimeSourceFactory ); + TQMimeSourceFactory::defaultFactory()->addFactory( mimeSourceFactory ); else - QMimeSourceFactory::defaultFactory()->removeFactory( mimeSourceFactory ); + TQMimeSourceFactory::defaultFactory()->removeFactory( mimeSourceFactory ); } -QPixmap PixmapCollection::pixmap( const QString &name ) +TQPixmap PixmapCollection::pixmap( const TQString &name ) { - for ( QValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { + for ( TQValueList::Iterator it = pixList.begin(); it != pixList.end(); ++it ) { if ( (*it).name == name ) return (*it).pix; } - return QPixmap(); + return TQPixmap(); } void PixmapCollection::savePixmap( Pixmap &pix ) { if ( pix.absname == imageDir() + "/" + pix.name ) return; // no need to save, it is already there - QString rel = project->makeRelative( pix.absname ); + TQString rel = project->makeRelative( pix.absname ); if ( rel[0] == '/' || ( rel[1] == ':' && rel[2] == '/' ) ) { // only save if file is outside the project mkdir(); - pix.name = unifyName( QFileInfo( pix.absname ).baseName() ) + ".png"; + pix.name = unifyName( TQFileInfo( pix.absname ).baseName() ) + ".png"; pix.absname = imageDir() + "/" + pix.name; pix.pix.save( pix.absname, "PNG" ); } else if ( rel.isEmpty() ) { @@ -136,34 +136,34 @@ void PixmapCollection::savePixmap( Pixmap &pix ) } } -QString PixmapCollection::imageDir() const +TQString PixmapCollection::imageDir() const { - return QFileInfo( project->fileName() ).dirPath( TRUE ) + "/images"; + return TQFileInfo( project->fileName() ).dirPath( TRUE ) + "/images"; } void PixmapCollection::mkdir() { - QString f = project->fileName(); - QDir d( QFileInfo( f ).dirPath( TRUE ) ); + TQString f = project->fileName(); + TQDir d( TQFileInfo( f ).dirPath( TRUE ) ); d.mkdir( "images" ); } -void PixmapCollection::load( const QString& filename ) +void PixmapCollection::load( const TQString& filename ) { if ( filename.isEmpty() ) return; - QString absfile; + TQString absfile; if ( filename[0] == '/' ) absfile = filename; else - absfile = QFileInfo( project->fileName() ).dirPath( TRUE ) + "/" + filename; + absfile = TQFileInfo( project->fileName() ).dirPath( TRUE ) + "/" + filename; - QPixmap pm( absfile ); + TQPixmap pm( absfile ); if ( pm.isNull() ) return; Pixmap pix; - pix.name = QFileInfo( absfile ).fileName(); + pix.name = TQFileInfo( absfile ).fileName(); pix.absname = absfile; pix.pix = pm; addPixmap( pix, TRUE ); -- cgit v1.2.1