~neon/kolf/master

« back to all changes in this revision

Viewing changes to slope.cpp

  • Committer: Paul Broadbent
  • Date: 2007-02-21 16:56:45 UTC
  • Revision ID: git-v1:efe052a813b637d1d76e2e8f554980812626e167
KConfig ports

svn path=/trunk/KDE/kdegames/kolf/; revision=636003

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        setZValue(((double)1 / (area == 0? 1 : area)) + newZ);
212
212
}
213
213
 
214
 
void Slope::load(KConfig *cfg)
 
214
void Slope::load(KConfigGroup *cfgGroup)
215
215
{
216
 
        stuckOnGround = cfg->readEntry("stuckOnGround", stuckOnGround);
217
 
        grade = cfg->readEntry("grade", grade);
218
 
        reversed = cfg->readEntry("reversed", reversed);
 
216
        stuckOnGround = cfgGroup->readEntry("stuckOnGround", stuckOnGround);
 
217
        grade = cfgGroup->readEntry("grade", grade);
 
218
        reversed = cfgGroup->readEntry("reversed", reversed);
219
219
 
220
220
        // bypass updatePixmap which newSize normally does
221
 
        QGraphicsRectItem::setRect(rect().x(), rect().y(), cfg->readEntry("width", width()), cfg->readEntry("height", height()));
 
221
        QGraphicsRectItem::setRect(rect().x(), rect().y(), cfgGroup->readEntry("width", width()), cfgGroup->readEntry("height", height()));
222
222
        baseWidth = rect().width();
223
223
        baseHeight = rect().height();
224
224
        updateZ();
225
225
 
226
 
        QString gradientType = cfg->readEntry("gradient", "Vertical");
 
226
        QString gradientType = cfgGroup->readEntry("gradient", "Vertical");
227
227
        setGradient(gradientType);
228
228
}
229
229
 
230
 
void Slope::save(KConfig *cfg)
 
230
void Slope::save(KConfigGroup *cfgGroup)
231
231
{
232
 
        cfg->writeEntry("reversed", reversed);
233
 
        cfg->writeEntry("width", width());
234
 
        cfg->writeEntry("height", height());
235
 
        cfg->writeEntry("gradient", type);;
236
 
        cfg->writeEntry("grade", grade);
237
 
        cfg->writeEntry("stuckOnGround", stuckOnGround);
 
232
        cfgGroup->writeEntry("reversed", reversed);
 
233
        cfgGroup->writeEntry("width", width());
 
234
        cfgGroup->writeEntry("height", height());
 
235
        cfgGroup->writeEntry("gradient", type);;
 
236
        cfgGroup->writeEntry("grade", grade);
 
237
        cfgGroup->writeEntry("stuckOnGround", stuckOnGround);
238
238
}
239
239
 
240
240
void Slope::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/ )