summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic/embed.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 16:20:48 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 16:20:48 -0600
commite63beeb5bdb82987b1e00bc35178667786fbad48 (patch)
treeab77b6ac830b7944d5d1eb9ce8f81feb8fdab948 /qtruby/rubylib/designer/rbuic/embed.cpp
parent67557a2b56c0678c22ab1b00c4fd0224c5e9ed99 (diff)
downloadtdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.tar.gz
tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.zip
Fix incorrect conversion
Diffstat (limited to 'qtruby/rubylib/designer/rbuic/embed.cpp')
-rw-r--r--qtruby/rubylib/designer/rbuic/embed.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/qtruby/rubylib/designer/rbuic/embed.cpp b/qtruby/rubylib/designer/rbuic/embed.cpp
index 365eaf7d..3377a1b0 100644
--- a/qtruby/rubylib/designer/rbuic/embed.cpp
+++ b/qtruby/rubylib/designer/rbuic/embed.cpp
@@ -52,14 +52,14 @@ struct EmbedImage
int width, height, depth;
int numColors;
TQRgb* colorTable;
- TTQString name;
- TTQString cname;
+ TQString name;
+ TQString cname;
bool alpha;
};
-static TTQString convertToCIdentifier( const char *s )
+static TQString convertToCIdentifier( const char *s )
{
- TTQString r = s;
+ TQString r = s;
int len = r.length();
if ( len > 0 && !isalpha( (char)r[0].latin1() ) )
r[0] = '_';
@@ -71,16 +71,16 @@ static TTQString convertToCIdentifier( const char *s )
}
-static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes )
+static ulong embedData( TQTextStream& out, const uchar* input, int nbytes )
{
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
- TTQByteArray bazip( qCompress( input, nbytes ) );
+ TQByteArray bazip( qCompress( input, nbytes ) );
ulong len = bazip.size();
#else
ulong len = nbytes;
#endif
static const char hexdigits[] = "0123456789abcdef";
- TTQString s;
+ TQString s;
for ( int i=0; i<(int)len; i++ ) {
if ( (i%14) == 0 ) {
s += "\n ";
@@ -105,7 +105,7 @@ static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes )
return len;
}
-static void embedData( TTQTextStream& out, const TQRgb* input, int n )
+static void embedData( TQTextStream& out, const TQRgb* input, int n )
{
out << hex;
const TQRgb *v = input;
@@ -120,19 +120,19 @@ static void embedData( TTQTextStream& out, const TQRgb* input, int n )
out << dec; // back to decimal mode
}
-void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& images )
+void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images )
{
- TTQString cProject = convertToCIdentifier( project );
+ TQString cProject = convertToCIdentifier( project );
- TTQStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
out << "# Image collection for project '" << project << "'." << endl;
out << "#" << endl;
out << "# Generated from reading image files: " << endl;
for ( it = images.begin(); it != images.end(); ++it )
out << "# " << *it << endl;
out << "#" << endl;
- out << "# Created: " << TTQDateTime::currentDateTime().toString() << endl;
+ out << "# Created: " << TQDateTime::currentDateTime().toString() << endl;
out << "# by: The QtRuby User Interface Compiler (rbuic)" << endl;
out << "#" << endl;
out << "# WARNING! All changes made in this file will be lost!" << endl;
@@ -147,10 +147,10 @@ void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& i
out << indent << "class MimeSourceFactory_" << cProject << " < TQt::MimeSourceFactory" << endl;
out << endl;
- TTQPtrList<EmbedImage> list_image;
+ TQPtrList<EmbedImage> list_image;
int image_count = 0;
for ( it = images.begin(); it != images.end(); ++it ) {
- TTQImage img;
+ TQImage img;
if ( !img.load( *it ) ) {
fprintf( stderr, "rbuic: cannot load image file %s\n", (*it).latin1() );
continue;
@@ -163,16 +163,16 @@ void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& i
e->colorTable = new TQRgb[e->numColors];
e->alpha = img.hasAlphaBuffer();
memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb));
- TTQFileInfo fi( *it );
+ TQFileInfo fi( *it );
e->name = fi.fileName();
- e->cname = TTQString("@@image_%1").arg( image_count++);
+ e->cname = TQString("@@image_%1").arg( image_count++);
list_image.append( e );
out << "# " << *it << endl;
- TTQString imgname = (const char *)e->cname;
+ TQString imgname = (const char *)e->cname;
- TTQString s;
+ TQString s;
if ( e->depth == 1 )
- img = img.convertBitOrder(TTQImage::BigEndian);
+ img = img.convertBitOrder(TQImage::BigEndian);
out << indent << imgname << "_data = [";
embedData( out, img.bits(), img.numBytes() );
out << "]\n\n";
@@ -192,7 +192,7 @@ void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& i
{
out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, "
<< e->width << ", " << e->height << ", " << e->depth << ", "
- << (e->numColors ? e->cname + "_ctable" : TTQString::fromLatin1( "[]" ) ) << ", "
+ << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1( "[]" ) ) << ", "
<< (e->alpha ? "true" : "false") << "]," << endl;
e = list_image.next();
}