[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdeui/icons
From: Jonathan Michael Thomas <echidnaman () kubuntu ! org>
Date: 2010-08-29 16:57:38
Message-ID: 20100829165738.66F54AC857 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1169549 by jmthomas:
Krazy2 fixes:
- Use prefix operators for incrementing the variables in the third argument of our foreach variables
- Use QString::clear() rather than assigning a null QString
M +2 -2 kiconcache.cpp
M +17 -17 kiconeffect.cpp
M +2 -2 kiconloader.cpp
M +1 -1 kicontheme.cpp
--- trunk/KDE/kdelibs/kdeui/icons/kiconcache.cpp #1169548:1169549
@@ -239,13 +239,13 @@
void KIconCache::setThemeInfo(const QList<KIconTheme*>& themes)
{
if (themes.isEmpty()) {
- for (KIconLoader::Group i = KIconLoader::FirstGroup; i < KIconLoader::LastGroup; i++) {
+ for (KIconLoader::Group i = KIconLoader::FirstGroup; i < KIconLoader::LastGroup; ++i) {
d->mDefaultIconSize[i] = 0;
}
return;
}
// This as to be done always, even if the cache itself is disabled
- for (KIconLoader::Group i = KIconLoader::FirstGroup; i < KIconLoader::LastGroup; i++) {
+ for (KIconLoader::Group i = KIconLoader::FirstGroup; i < KIconLoader::LastGroup; ++i) {
d->mDefaultIconSize[i] = themes.first()->defaultSize(i);
}
--- trunk/KDE/kdelibs/kdeui/icons/kiconeffect.cpp #1169548:1169549
@@ -524,19 +524,19 @@
if(painterSupportsAntialiasing()){
unsigned char *line;
- for(y=0; y<height; y++){
+ for(y=0; y<height; ++y){
if(QSysInfo::ByteOrder == QSysInfo::BigEndian)
line = img.scanLine(y);
else
line = img.scanLine(y) + 3;
- for(x=0; x<width; x++){
+ for(x=0; x<width; ++x){
*line >>= 1;
line += 4;
}
}
}
else{
- for(y=0; y<height; y++){
+ for(y=0; y<height; ++y){
QRgb* line = (QRgb*)img.scanLine(y);
for(x=(y%2); x<width; x+=2)
line[x] &= 0x00ffffff;
@@ -559,7 +559,7 @@
int transColor = -1;
// search for a color that is already transparent
- for(x=0; x<img.numColors(); x++){
+ for(x=0; x<img.numColors(); ++x){
// try to find already transparent pixel
if(qAlpha(img.color(x)) < 127){
transColor = x;
@@ -574,7 +574,7 @@
img.setColor(transColor, 0);
unsigned char *line;
if(img.depth() == 8){
- for(y=0; y<img.height(); y++){
+ for(y=0; y<img.height(); ++y){
line = img.scanLine(y);
for(x=(y%2); x<img.width(); x+=2)
line[x] = transColor;
@@ -583,7 +583,7 @@
else{
bool setOn = (transColor != 0);
if(img.format() == QImage::Format_MonoLSB){
- for(y=0; y<img.height(); y++){
+ for(y=0; y<img.height(); ++y){
line = img.scanLine(y);
for(x=(y%2); x<img.width(); x+=2){
if(!setOn)
@@ -594,7 +594,7 @@
}
}
else{
- for(y=0; y<img.height(); y++){
+ for(y=0; y<img.height(); ++y){
line = img.scanLine(y);
for(x=(y%2); x<img.width(); x+=2){
if(!setOn)
@@ -655,11 +655,11 @@
if (src.depth() == 32)
{
QRgb* l1, *l2;
- for (y=0; y<h; y++)
+ for (y=0; y<h; ++y)
{
l1 = (QRgb*)src.scanLine(y);
l2 = (QRgb*)dst.scanLine(y*2);
- for (x=0; x<w; x++)
+ for (x=0; x<w; ++x)
{
l2[x*2] = l2[x*2+1] = l1[x];
}
@@ -667,16 +667,16 @@
}
} else
{
- for (x=0; x<src.numColors(); x++)
+ for (x=0; x<src.numColors(); ++x)
dst.setColor(x, src.color(x));
const unsigned char *l1;
unsigned char *l2;
- for (y=0; y<h; y++)
+ for (y=0; y<h; ++y)
{
l1 = src.scanLine(y);
l2 = dst.scanLine(y*2);
- for (x=0; x<w; x++)
+ for (x=0; x<w; ++x)
{
l2[x*2] = l1[x];
l2[x*2+1] = l1[x];
@@ -749,18 +749,18 @@
// Merge color tables
int nc = src.numColors();
src.setNumColors(nc + overlay.numColors());
- for (i=0; i<overlay.numColors(); i++)
+ for (i=0; i<overlay.numColors(); ++i)
{
src.setColor(nc+i, overlay.color(i));
}
// Overwrite nontransparent pixels.
unsigned char *oline, *sline;
- for (i=0; i<src.height(); i++)
+ for (i=0; i<src.height(); ++i)
{
oline = overlay.scanLine(i);
sline = src.scanLine(i);
- for (j=0; j<src.width(); j++)
+ for (j=0; j<src.width(); ++j)
{
if (oline[j] != trans)
sline[j] = oline[j]+nc;
@@ -776,12 +776,12 @@
int r1, g1, b1, a1;
int r2, g2, b2, a2;
- for (i=0; i<src.height(); i++)
+ for (i=0; i<src.height(); ++i)
{
oline = (QRgb*)overlay.scanLine(i);
sline = (QRgb*)src.scanLine(i);
- for (j=0; j<src.width(); j++)
+ for (j=0; j<src.width(); ++j)
{
r1 = qRed(oline[j]);
g1 = qGreen(oline[j]);
--- trunk/KDE/kdelibs/kdeui/icons/kiconloader.cpp #1169548:1169549
@@ -493,7 +493,7 @@
// loading config and default sizes
mpGroups = new KIconGroup[(int) KIconLoader::LastGroup];
- for (KIconLoader::Group i=KIconLoader::FirstGroup; i<KIconLoader::LastGroup; i++)
+ for (KIconLoader::Group i=KIconLoader::FirstGroup; i<KIconLoader::LastGroup; ++i)
{
if (groups[i] == 0L)
break;
@@ -1304,7 +1304,7 @@
// Don't add the path to our unknown icon to the cache, only cache the
// actual image.
if (iconWasUnknown) {
- icon.path = QString();
+ icon.path.clear();
}
d->insertCachedPixmapWithPath(key, pix, icon.path);
--- trunk/KDE/kdelibs/kdeui/icons/kicontheme.cpp #1169548:1169549
@@ -230,7 +230,7 @@
}
if ((dir->type() == KIconLoader::Scalable) && !scIcons.contains(dir->size())) {
QList<int> lst;
- for (i=dir->minSize(); i<=dir->maxSize(); i++) {
+ for (i=dir->minSize(); i<=dir->maxSize(); ++i) {
lst += i;
}
scIcons[dir->size()] = lst;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic