mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
generic: stop using obsolete code paths
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
bbb50c2c43
commit
7f4caa8dda
9 changed files with 25 additions and 25 deletions
|
@ -360,7 +360,7 @@ void ThumbnailProtocol::get(const KUrl &url)
|
|||
}
|
||||
// Keep in sync with kdelibs/kio/kio/previewjob.cpp
|
||||
stream << img.width() << img.height() << quint8(img.format());
|
||||
memcpy(shmaddr, img.bits(), img.numBytes());
|
||||
memcpy(shmaddr, img.bits(), img.byteCount());
|
||||
shmdt((char*)shmaddr);
|
||||
mimeType("application/octet-stream");
|
||||
data(imgData);
|
||||
|
|
|
@ -223,7 +223,7 @@ bool Fountain::loadParticle()
|
|||
if (buf.load( KStandardDirs::locate("data", QLatin1String( "kscreensaver/particle.png" )) ) )
|
||||
{
|
||||
tex = convertToGLFormat(buf); // flipped 32bit RGBA
|
||||
kDebug() << "Texture loaded: " << tex.numBytes ();
|
||||
kDebug() << "Texture loaded: " << tex.byteCount ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -226,7 +226,7 @@ bool Gravity::loadParticle()
|
|||
|
||||
{
|
||||
tex = convertToGLFormat(buf); // flipped 32bit RGBA
|
||||
kDebug() << "Texture loaded: " << tex.numBytes ();
|
||||
kDebug() << "Texture loaded: " << tex.byteCount ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -315,7 +315,7 @@ bool Wave::LoadGLTextures()
|
|||
|
||||
{
|
||||
tex = convertToGLFormat(buf); // flipped 32bit RGBA
|
||||
kDebug() << "Texture loaded: " << tex.numBytes ();
|
||||
kDebug() << "Texture loaded: " << tex.byteCount ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -332,7 +332,7 @@ PixmapData PP::convertFromImage( const QImage &img, int conversion_flags )
|
|||
Visual *visual = (Visual *)x11Visual();
|
||||
XImage *xi = 0;
|
||||
bool trucol = (visual->c_class == TrueColor);
|
||||
int nbytes = image.numBytes();
|
||||
int nbytes = image.byteCount();
|
||||
uchar *newbits= 0;
|
||||
int newbits_size = 0;
|
||||
#ifdef QT_MITSHM_CONVERSIONS
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
QImage supports a variety of methods for getting information about
|
||||
the image, for example, colorTable(), allGray(), isGrayscale(),
|
||||
bitOrder(), bytesPerLine(), depth(), dotsPerMeterX() and
|
||||
dotsPerMeterY(), hasAlphaBuffer(), numBytes(), numColors(), and
|
||||
dotsPerMeterY(), hasAlphaBuffer(), byteCount(), numColors(), and
|
||||
width() and height().
|
||||
|
||||
Pixel colors are retrieved with pixel() and set with setPixel().
|
||||
|
@ -672,12 +672,12 @@ QImage QImage::copy() const
|
|||
#ifdef Q_WS_QWS
|
||||
// Qt/Embedded can create images with non-default bpl
|
||||
// make sure we don't crash.
|
||||
if ( image.numBytes() != numBytes() )
|
||||
if ( image.byteCount() != byteCount() )
|
||||
for ( int i = 0; i < height(); i++ )
|
||||
memcpy( image.scanLine(i), scanLine(i), image.bytesPerLine() );
|
||||
else
|
||||
#endif
|
||||
memcpy( image.bits(), bits(), numBytes() );
|
||||
memcpy( image.bits(), bits(), byteCount() );
|
||||
memcpy( image.colorTable(), colorTable(), numColors() * sizeof(QRgb) );
|
||||
image.setAlphaBuffer( hasAlphaBuffer() );
|
||||
image.data->dpmx = dotsPerMeterX();
|
||||
|
@ -869,7 +869,7 @@ QImage QImage::copy(int x, int y, int w, int h, int conversion_flags) const
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn int QImage::numBytes() const
|
||||
\fn int QImage::byteCount() const
|
||||
|
||||
Returns the number of bytes occupied by the image data.
|
||||
|
||||
|
@ -880,9 +880,9 @@ QImage QImage::copy(int x, int y, int w, int h, int conversion_flags) const
|
|||
\fn int QImage::bytesPerLine() const
|
||||
|
||||
Returns the number of bytes per image scanline. This is equivalent
|
||||
to numBytes()/height().
|
||||
to byteCount()/height().
|
||||
|
||||
\sa numBytes() scanLine()
|
||||
\sa byteCount() scanLine()
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -939,7 +939,7 @@ QImage QImage::copy(int x, int y, int w, int h, int conversion_flags) const
|
|||
Returns a pointer to the first pixel data. This is equivalent to
|
||||
scanLine(0).
|
||||
|
||||
\sa numBytes() scanLine() jumpTable()
|
||||
\sa byteCount() scanLine() jumpTable()
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ void QImage::fill( uint pixel )
|
|||
|
||||
void QImage::invertPixels( bool invertAlpha )
|
||||
{
|
||||
quint32 n = numBytes();
|
||||
quint32 n = byteCount();
|
||||
if ( n % 4 ) {
|
||||
Q_UINT8 *p = (Q_UINT8*)bits();
|
||||
Q_UINT8 *end = p + n;
|
||||
|
@ -1233,7 +1233,7 @@ void QImage::setAlphaBuffer( bool enable )
|
|||
and the image data (bits()).
|
||||
|
||||
\sa fill() width() height() depth() numColors() bitOrder()
|
||||
jumpTable() scanLine() bits() bytesPerLine() numBytes()
|
||||
jumpTable() scanLine() bits() bytesPerLine() byteCount()
|
||||
*/
|
||||
|
||||
bool QImage::create( int width, int height, int depth, int numColors,
|
||||
|
@ -3004,23 +3004,23 @@ QImage QImage::xForm( const QWMatrix &matrix ) const
|
|||
switch ( bpp ) {
|
||||
// initizialize the data
|
||||
case 1:
|
||||
memset( dImage.bits(), 0, dImage.numBytes() );
|
||||
memset( dImage.bits(), 0, dImage.byteCount() );
|
||||
break;
|
||||
case 8:
|
||||
if ( dImage.data->ncols < 256 ) {
|
||||
// colors are left in the color table, so pick that one as transparent
|
||||
dImage.setNumColors( dImage.data->ncols+1 );
|
||||
dImage.setColor( dImage.data->ncols-1, 0x00 );
|
||||
memset( dImage.bits(), dImage.data->ncols-1, dImage.numBytes() );
|
||||
memset( dImage.bits(), dImage.data->ncols-1, dImage.byteCount() );
|
||||
} else {
|
||||
memset( dImage.bits(), 0, dImage.numBytes() );
|
||||
memset( dImage.bits(), 0, dImage.byteCount() );
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
memset( dImage.bits(), 0xff, dImage.numBytes() );
|
||||
memset( dImage.bits(), 0xff, dImage.byteCount() );
|
||||
break;
|
||||
case 32:
|
||||
memset( dImage.bits(), 0x00, dImage.numBytes() );
|
||||
memset( dImage.bits(), 0x00, dImage.byteCount() );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3688,7 +3688,7 @@ static void swapPixel01( QImage *image ) // 1-bpp: swap 0 and 1 pixels
|
|||
int i;
|
||||
if ( image->depth() == 1 && image->numColors() == 2 ) {
|
||||
register uint *p = (uint *)image->bits();
|
||||
int nbytes = image->numBytes();
|
||||
int nbytes = image->byteCount();
|
||||
for ( i=0; i<nbytes/4; i++ ) {
|
||||
*p = ~*p;
|
||||
p++;
|
||||
|
@ -5605,7 +5605,7 @@ static void write_xbm_image( QImageIO *iio )
|
|||
register char *p = buf;
|
||||
uchar *b = image.scanLine(0);
|
||||
int x=0, y=0;
|
||||
int nbytes = image.numBytes();
|
||||
int nbytes = image.byteCount();
|
||||
w = (w+7)/8;
|
||||
while ( nbytes-- ) { // write all bytes
|
||||
*p++ = '0'; *p++ = 'x';
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
uchar *scanLine( int ) const;
|
||||
uchar **jumpTable() const;
|
||||
QRgb *colorTable() const;
|
||||
int numBytes() const;
|
||||
int byteCount() const;
|
||||
int bytesPerLine() const;
|
||||
|
||||
#ifdef Q_WS_QWS
|
||||
|
@ -368,7 +368,7 @@ inline QRgb *QImage::colorTable() const
|
|||
return data->ctbl;
|
||||
}
|
||||
|
||||
inline int QImage::numBytes() const
|
||||
inline int QImage::byteCount() const
|
||||
{
|
||||
return data->nbytes;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ void MultiMeter::answerReceived(int id, const QList<QByteArray>& answerlist)
|
|||
digits += 1;
|
||||
}
|
||||
|
||||
mLcd->setNumDigits(qMin(15,digits));
|
||||
mLcd->setDigitCount(qMin(15,digits));
|
||||
|
||||
mLcd->display(val);
|
||||
if (mLowerLimitActive && val < mLowerLimit)
|
||||
|
|
|
@ -376,7 +376,7 @@ QPixmap StatusNotifierItemSource::KDbusImageStructToPixmap(const KDbusImageStruc
|
|||
}
|
||||
}
|
||||
QImage iconImage(image.width, image.height, QImage::Format_ARGB32 );
|
||||
memcpy(iconImage.bits(), (uchar*)image.data.data(), iconImage.numBytes());
|
||||
memcpy(iconImage.bits(), (uchar*)image.data.data(), iconImage.byteCount());
|
||||
|
||||
return QPixmap::fromImage(iconImage);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue