summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/pixmapcollection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/pixmapcollection.cpp')
-rw-r--r--kdevdesigner/designer/pixmapcollection.cpp60
1 files changed, 30 insertions, 30 deletions
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 <qmime.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
-#include <qimage.h>
+#include <tqmime.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
+#include <tqimage.h>
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<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ for ( TQValueList<Pixmap>::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<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ for ( TQValueList<Pixmap>::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::Pixmap> PixmapCollection::pixmaps() const
+TQValueList<PixmapCollection::Pixmap> 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<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ for ( TQValueList<Pixmap>::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<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ for ( TQValueList<Pixmap>::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 );