diff --git a/clients/b2/b2client.cpp b/clients/b2/b2client.cpp index d39a99223f..499a8ba7a7 100644 --- a/clients/b2/b2client.cpp +++ b/clients/b2/b2client.cpp @@ -9,7 +9,7 @@ * Thin frame in fixed size windows, titlebar gradient support, accessibility * improvements, customizable menu double click action and button hover * effects are - * Copyright (c) 2003, 2004, 2006 Luciano Montanaro + * Copyright (c) 2003,2004 Luciano Montanaro */ #include "b2client.h" @@ -118,8 +118,8 @@ static void read_config(B2ClientFactory *f) KConfig conf("kwinb2rc"); conf.setGroup("General"); - colored_frame = conf.readEntry("UseTitleBarBorderColors", QVariant(false)).toBool(); - do_draw_handle = conf.readEntry("DrawGrabHandle", QVariant(true)).toBool(); + colored_frame = conf.readEntry("UseTitleBarBorderColors", false); + do_draw_handle = conf.readEntry("DrawGrabHandle", true); drawSmallBorders = !options()->moveResizeMaximizedWindows(); QString opString = conf.readEntry("MenuButtonDoubleClickOperation", "NoOp"); @@ -144,10 +144,10 @@ static void read_config(B2ClientFactory *f) thickness = 8; break; case KDecoration::BorderHuge: - case KDecoration::BorderVeryHuge: - case KDecoration::BorderOversized: thickness = 12; break; + case KDecoration::BorderVeryHuge: + case KDecoration::BorderOversized: case KDecoration::BorderNormal: default: thickness = 4; @@ -199,37 +199,37 @@ static void create_pixmaps() for (i = 0; i < NUM_PIXMAPS; i++) { switch (i / NumStates) { - case P_MAX: // will be initialized by copying P_CLOSE - case P_RESIZE: - pixmap[i] = new QPixmap(); - break; - case P_ICONIFY: - pixmap[i] = new QPixmap(10, 10); - break; - case P_SHADE: - case P_CLOSE: - pixmap[i] = new QPixmap(bsize, bsize); - break; - default: - pixmap[i] = new QPixmap(16, 16); - break; + case P_MAX: // will be initialized by copying P_CLOSE + case P_RESIZE: + pixmap[i] = new QPixmap(); + break; + case P_ICONIFY: + pixmap[i] = new QPixmap(10, 10); + break; + case P_SHADE: + case P_CLOSE: + pixmap[i] = new QPixmap(bsize, bsize); + break; + default: + pixmap[i] = new QPixmap(16, 16); + break; } } // there seems to be no way to load X bitmaps from data properly, so // we need to create new ones for each mask :P - QBitmap pinupMask = QBitmap::fromData(QSize(16, 16), pinup_mask_bits); + QBitmap pinupMask = QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits); PIXMAP_A(P_PINUP)->setMask(pinupMask); PIXMAP_I(P_PINUP)->setMask(pinupMask); - QBitmap pindownMask = QBitmap::fromData(QSize(16, 16), pindown_mask_bits); + QBitmap pindownMask = QBitmap::fromData(QSize( 16, 16 ), pindown_mask_bits); PIXMAP_AD(P_PINUP)->setMask(pindownMask); PIXMAP_ID(P_PINUP)->setMask(pindownMask); - QBitmap menuMask = QBitmap::fromData(QSize(16, 16), menu_mask_bits); + QBitmap menuMask = QBitmap::fromData(QSize( 16, 16 ), menu_mask_bits); for (i = 0; i < NumStates; i++) pixmap[P_MENU * NumStates + i]->setMask(menuMask); - QBitmap helpMask = QBitmap::fromData(QSize(16, 16), help_mask_bits); + QBitmap helpMask = QBitmap::fromData(QSize( 16, 16 ), help_mask_bits); for (i = 0; i < NumStates; i++) pixmap[P_HELP * NumStates + i]->setMask(helpMask); @@ -309,9 +309,10 @@ bool B2ClientFactory::reset(unsigned long changed) return needsReset; } -bool B2ClientFactory::supports(Ability ability) +bool B2ClientFactory::supports( Ability ability ) { - switch (ability) { + switch( ability ) + { case AbilityAnnounceButtons: case AbilityButtonMenu: case AbilityButtonOnAllDesktops: @@ -415,7 +416,7 @@ void B2Client::init() } // titlebar - g->addItem( new QSpacerItem(0, buttonSize + 4), 0, 0 ); + g->addItem( new QSpacerItem( 0, buttonSize + 4 ), 0, 0 ); titlebar = new B2Titlebar(this); titlebar->setMinimumWidth(buttonSize + 4); @@ -649,7 +650,7 @@ void B2Client::paintEvent(QPaintEvent* e) qDrawShadePanel(&p, 1, t.bottom() - thickness + 2, width() - 2, fHeight - 2 - bb + thickness, fillColor, false); if (thickness == 4) { - p.setPen(fillColor.color(QPalette::Background)); + p.setPen(fillColor.color( QPalette::Background ) ); p.drawRect(thickness - 2, t.bottom() - 1, width() - 2 * (thickness - 2), fHeight + 4 - bDepth); } else if (thickness > 4) { @@ -685,12 +686,12 @@ void B2Client::paintEvent(QPaintEvent* e) p.fillRect(hx + 1, height() - thickness - 3, hw - 2, thickness + 2, fillBrush); - p.setPen(fillColor.color(QPalette::Dark)); + p.setPen(fillColor.color( QPalette::Dark )); p.drawLine(width() - 2, height() - thickness - 4, width() - 2, height() - 2); p.drawLine(hx + 1, height() - 2, width() - 2, height() - 2); - p.setPen(fillColor.color(QPalette::Light)); + p.setPen(fillColor.color( QPalette::Light )); p.drawLine(hx + 1, height() - thickness - 2, hx + 1, height() - 3); p.drawLine(hx + 1, height() - thickness - 3, @@ -728,7 +729,7 @@ void B2Client::doShape() } if (t.right() < width() - 1) { mask -= QRect(width() - 1, - t.height() - thickness, 1, 1); // top right point + t.height() - thickness, 1, 1); //top right point mask -= QRect(t.right() + 1, 0, width() - t.right() - 1, t.height() - thickness); } @@ -855,7 +856,7 @@ void B2Client::activeChange() titlebar->repaint(); QColor c = options()->palette( - KDecoration::ColorTitleBar, isActive()).color(QPalette::Active, QPalette::Button); + KDecoration::ColorTitleBar, isActive()).color(QPalette::Active, QPalette::Button); for (int i = 0; i < BtnCount; i++) if (button[i]) { @@ -871,7 +872,7 @@ void B2Client::shadeChange() g->activate(); doShape(); if (B2Button *b = button[BtnShade]) { - b->setToolTip(isSetShade() ? i18n("Unshade") : i18n("Shade")); + b->setToolTip( isSetShade() ? i18n("Unshade") : i18n("Shade")); } } @@ -939,7 +940,7 @@ void B2Client::unobscureTitlebar() return; } in_unobs = 1; - QRegion reg(QRect(0, 0, width(), buttonSize + 4)); + QRegion reg(QRect(0,0,width(), buttonSize + 4)); reg = unobscuredRegion(reg); if (!reg.isEmpty()) { // there is at least _one_ pixel from our title area, which is not @@ -954,8 +955,8 @@ void B2Client::unobscureTitlebar() static void redraw_pixmaps() { int i; - QPalette aGrp = options()->palette(KDecoration::ColorButtonBg, true); - QPalette iGrp = options()->palette(KDecoration::ColorButtonBg, false); + QPalette aGrp = options()->palette(KDecoration::ColorButtonBg, true); + QPalette iGrp = options()->palette(KDecoration::ColorButtonBg, false); // close drawB2Rect(PIXMAP_A(P_CLOSE), aGrp.color( QPalette::Button ), false); @@ -1136,10 +1137,10 @@ bool B2Client::drawbound(const QRect& geom, bool clear) if (barRight > geom.right()) barRight = geom.right(); // line width is 5 pixels, so compensate for the 2 outer pixels (#88657) QRect g = geom; - g.setLeft(g.left() + 2); - g.setTop(g.top() + 2); - g.setRight(g.right() - 2); - g.setBottom(g.bottom() - 2); + g.setLeft( g.left() + 2 ); + g.setTop( g.top() + 2 ); + g.setRight( g.right() - 2 ); + g.setBottom( g.bottom() - 2 ); frameTop += 2; barLeft += 2; barRight -= 2; @@ -1208,7 +1209,7 @@ B2Button::B2Button(B2Client *_client, QWidget *parent, client = _client; useMiniIcon = false; setFixedSize(buttonSize, buttonSize); - this->setToolTip(tip); + this->setToolTip( tip); } @@ -1231,8 +1232,7 @@ void B2Button::drawButton(QPainter *p) p->fillRect(rect(), bg); } if (useMiniIcon) { - QPixmap miniIcon = client->icon().pixmap( - style()->pixelMetric(QStyle::PM_SmallIconSize), + QPixmap miniIcon = client->icon().pixmap(style()->pixelMetric( QStyle::PM_SmallIconSize ), client->isActive() ? QIcon::Normal : QIcon::Disabled); p->drawPixmap((width() - miniIcon.width()) / 2, (height() - miniIcon.height()) / 2, miniIcon); @@ -1386,7 +1386,7 @@ void B2Titlebar::resizeEvent(QResizeEvent *) void B2Titlebar::paintEvent(QPaintEvent *) { - if (client->isActive()) + if(client->isActive()) bitBlt(this, 0, 0, &titleBuffer, 0, 0, titleBuffer.width(), titleBuffer.height()); else { @@ -1436,6 +1436,6 @@ void B2Titlebar::mouseMoveEvent(QMouseEvent * e) #include "b2client.moc" -// vim: sw=4 ts=8 +// vim: sw=4 #endif // CLIENTS/B2/B2CLIENT.CPP diff --git a/clients/b2/config/config.cpp b/clients/b2/config/config.cpp index 182ae0169d..3e1bd8fd25 100644 --- a/clients/b2/config/config.cpp +++ b/clients/b2/config/config.cpp @@ -104,10 +104,10 @@ void B2Config::load(KConfig * /*conf*/) { b2Config->setGroup("General"); - bool override = b2Config->readEntry("UseTitleBarBorderColors", QVariant(false)).toBool(); + bool override = b2Config->readEntry("UseTitleBarBorderColors", false); cbColorBorder->setChecked(override); - override = b2Config->readEntry( "DrawGrabHandle", QVariant(true )).toBool(); + override = b2Config->readEntry( "DrawGrabHandle", true); showGrabHandleCb->setChecked(override); QString returnString = b2Config->readEntry( diff --git a/clients/default/config/config.cpp b/clients/default/config/config.cpp index de3ecdcc2a..9e5bbf24d4 100644 --- a/clients/default/config/config.cpp +++ b/clients/default/config/config.cpp @@ -91,14 +91,14 @@ void KDEDefaultConfig::slotSelectionChanged() void KDEDefaultConfig::load( KConfig* conf ) { conf->setGroup("KDEDefault"); - bool override = conf->readEntry( "ShowTitleBarStipple", QVariant(true )).toBool(); + bool override = conf->readEntry( "ShowTitleBarStipple", true); cbShowStipple->setChecked( override ); - override = conf->readEntry( "ShowGrabBar", QVariant(true )).toBool(); + override = conf->readEntry( "ShowGrabBar", true); cbShowGrabBar->setChecked( override ); if (highcolor) { - override = conf->readEntry( "UseGradients", QVariant(true )).toBool(); + override = conf->readEntry( "UseGradients", true); cbUseGradients->setChecked( override ); } } diff --git a/clients/default/kdedefault.cpp b/clients/default/kdedefault.cpp index da79b8bb73..1eea51ba91 100644 --- a/clients/default/kdedefault.cpp +++ b/clients/default/kdedefault.cpp @@ -198,9 +198,9 @@ unsigned long KDEDefaultHandler::readConfig( bool update ) KSharedConfig::Ptr conf = KGlobal::config(); conf->setGroup("KDEDefault"); - bool new_showGrabBar = conf->readEntry("ShowGrabBar", QVariant(true)).toBool(); - bool new_showTitleBarStipple = conf->readEntry("ShowTitleBarStipple", QVariant(true)).toBool(); - bool new_useGradients = conf->readEntry("UseGradients", QVariant(true)).toBool(); + bool new_showGrabBar = conf->readEntry("ShowGrabBar", true); + bool new_showTitleBarStipple = conf->readEntry("ShowTitleBarStipple", true); + bool new_useGradients = conf->readEntry("UseGradients", true); int new_titleHeight = QFontMetrics(options()->font(true)).height(); int new_toolTitleHeight = QFontMetrics(options()->font(true, true)).height()-2; diff --git a/clients/keramik/config/config.cpp b/clients/keramik/config/config.cpp index f70adad70c..9c9fcd1a78 100644 --- a/clients/keramik/config/config.cpp +++ b/clients/keramik/config/config.cpp @@ -77,10 +77,10 @@ KeramikConfig::~KeramikConfig() void KeramikConfig::load( KConfig* ) { c->setGroup("General"); - ui->showAppIcons->setChecked( c->readEntry("ShowAppIcons", QVariant(true)).toBool() ); - ui->smallCaptions->setChecked( c->readEntry("SmallCaptionBubbles", QVariant(false)).toBool() ); - ui->largeGrabBars->setChecked( c->readEntry("LargeGrabBars", QVariant(true)).toBool() ); - ui->useShadowedText->setChecked( c->readEntry("UseShadowedText", QVariant(true)).toBool() ); + ui->showAppIcons->setChecked( c->readEntry("ShowAppIcons", true) ); + ui->smallCaptions->setChecked( c->readEntry("SmallCaptionBubbles", false) ); + ui->largeGrabBars->setChecked( c->readEntry("LargeGrabBars", true) ); + ui->useShadowedText->setChecked( c->readEntry("UseShadowedText", true) ); } diff --git a/clients/keramik/keramik.cpp b/clients/keramik/keramik.cpp index fda8389858..ee018ad056 100644 --- a/clients/keramik/keramik.cpp +++ b/clients/keramik/keramik.cpp @@ -563,10 +563,10 @@ void KeramikHandler::readConfig() KConfig *c = new KConfig( "kwinkeramikrc" ); c->setGroup( "General" ); - showIcons = c->readEntry( "ShowAppIcons", QVariant(true )).toBool(); - shadowedText = c->readEntry( "UseShadowedText", QVariant(true )).toBool(); - smallCaptionBubbles = c->readEntry( "SmallCaptionBubbles", QVariant(false )).toBool(); - largeGrabBars = c->readEntry( "LargeGrabBars", QVariant(true )).toBool(); + showIcons = c->readEntry( "ShowAppIcons", true); + shadowedText = c->readEntry( "UseShadowedText", true); + smallCaptionBubbles = c->readEntry( "SmallCaptionBubbles", false); + largeGrabBars = c->readEntry( "LargeGrabBars", true); if ( ! settings_cache ) { settings_cache = new SettingsCache; diff --git a/clients/modernsystem/config/config.cpp b/clients/modernsystem/config/config.cpp index ed95ba27bb..f47813bdc2 100644 --- a/clients/modernsystem/config/config.cpp +++ b/clients/modernsystem/config/config.cpp @@ -108,7 +108,7 @@ void ModernSysConfig::slotSelectionChanged() void ModernSysConfig::load(KConfig* /*conf*/) { clientrc->setGroup("General"); - bool i = clientrc->readEntry("ShowHandle", QVariant(true )).toBool(); + bool i = clientrc->readEntry("ShowHandle", true); cbShowHandle->setChecked(i); hbox->setEnabled(i); handleSizeSlider->setEnabled(i); diff --git a/clients/plastik/config/config.cpp b/clients/plastik/config/config.cpp index 5e4e580786..2bbed37b92 100644 --- a/clients/plastik/config/config.cpp +++ b/clients/plastik/config/config.cpp @@ -32,6 +32,7 @@ #include #include "config.h" +#include "configdialog.h" PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent) : QObject(parent), m_config(0), m_dialog(0) @@ -62,8 +63,8 @@ PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent) PlastikConfig::~PlastikConfig() { - delete m_dialog; - delete m_config; + if (m_dialog) delete m_dialog; + if (m_config) delete m_config; } void PlastikConfig::load(KConfig*) @@ -74,13 +75,13 @@ void PlastikConfig::load(KConfig*) QString value = m_config->readEntry("TitleAlignment", "AlignLeft"); QRadioButton *button = m_dialog->titleAlign->findChild(value.toLatin1()); if (button) button->setChecked(true); - bool animateButtons = m_config->readEntry("AnimateButtons", QVariant(true)).toBool(); + bool animateButtons = m_config->readEntry("AnimateButtons", true); m_dialog->animateButtons->setChecked(animateButtons); - bool menuClose = m_config->readEntry("CloseOnMenuDoubleClick", QVariant(true)).toBool(); + bool menuClose = m_config->readEntry("CloseOnMenuDoubleClick", true); m_dialog->menuClose->setChecked(menuClose); - bool titleShadow = m_config->readEntry("TitleShadow", QVariant(true)).toBool(); + bool titleShadow = m_config->readEntry("TitleShadow", true); m_dialog->titleShadow->setChecked(titleShadow); - bool coloredBorder = m_config->readEntry("ColoredBorder", QVariant(true)).toBool(); + bool coloredBorder = m_config->readEntry("ColoredBorder", true); m_dialog->coloredBorder->setChecked(coloredBorder); } diff --git a/clients/plastik/plastik.cpp b/clients/plastik/plastik.cpp index 1a5b4b5507..2a282ffab4 100644 --- a/clients/plastik/plastik.cpp +++ b/clients/plastik/plastik.cpp @@ -167,7 +167,7 @@ void PlastikHandler::readConfig() config.setGroup("General"); // grab settings - m_titleShadow = config.readEntry("TitleShadow", QVariant(true)).toBool(); + m_titleShadow = config.readEntry("TitleShadow", true); QFontMetrics fm(m_titleFont); // active font = inactive font int titleHeightMin = config.readEntry("MinTitleHeight", 16); @@ -190,9 +190,9 @@ void PlastikHandler::readConfig() else if (value == "AlignHCenter") m_titleAlign = Qt::AlignHCenter; else if (value == "AlignRight") m_titleAlign = Qt::AlignRight; - m_coloredBorder = config.readEntry("ColoredBorder", QVariant(true)).toBool(); - m_animateButtons = config.readEntry("AnimateButtons", QVariant(true)).toBool(); - m_menuClose = config.readEntry("CloseOnMenuDoubleClick", QVariant(true)).toBool(); + m_coloredBorder = config.readEntry("ColoredBorder", true); + m_animateButtons = config.readEntry("AnimateButtons", true); + m_menuClose = config.readEntry("CloseOnMenuDoubleClick", true); } QColor PlastikHandler::getColor(KWinPlastik::ColorType type, const bool active) diff --git a/clients/quartz/config/config.cpp b/clients/quartz/config/config.cpp index 736efeb0c4..34e99ae3c0 100644 --- a/clients/quartz/config/config.cpp +++ b/clients/quartz/config/config.cpp @@ -76,9 +76,9 @@ void QuartzConfig::slotSelectionChanged() void QuartzConfig::load( KConfig* /*conf*/ ) { quartzConfig->setGroup("General"); - bool override = quartzConfig->readEntry( "UseTitleBarBorderColors", QVariant(true )).toBool(); + bool override = quartzConfig->readEntry( "UseTitleBarBorderColors", true); cbColorBorder->setChecked( override ); - override = quartzConfig->readEntry( "UseQuartzExtraSlim", QVariant(false )).toBool(); + override = quartzConfig->readEntry( "UseQuartzExtraSlim", false); cbExtraSmall->setChecked( override ); } diff --git a/clients/quartz/quartz.cpp b/clients/quartz/quartz.cpp index c90fa82727..5166d218da 100644 --- a/clients/quartz/quartz.cpp +++ b/clients/quartz/quartz.cpp @@ -207,8 +207,8 @@ void QuartzHandler::readConfig() { KConfig conf("kwinquartzrc"); conf.setGroup("General"); - coloredFrame = conf.readEntry( "UseTitleBarBorderColors", QVariant(true )).toBool(); - extraSlim = conf.readEntry( "UseQuartzExtraSlim", QVariant(false )).toBool(); + coloredFrame = conf.readEntry( "UseTitleBarBorderColors", true); + extraSlim = conf.readEntry( "UseQuartzExtraSlim", false); // A small hack to make the on all desktops button look nicer onAllDesktopsButtonOnLeft = KDecoration::options()->titleButtonsLeft().contains( 'S' ); diff --git a/clients/web/Web.cpp b/clients/web/Web.cpp index 0e68ae7992..777e87db8a 100644 --- a/clients/web/Web.cpp +++ b/clients/web/Web.cpp @@ -187,7 +187,7 @@ WebClient::init() KConfig c("kwinwebrc"); c.setGroup("General"); - shape_ = c.readEntry("Shape", QVariant(true)).toBool(); + shape_ = c.readEntry("Shape", true); KCommonDecoration::init(); } diff --git a/effects/showfps.cpp b/effects/showfps.cpp index 35b3b58b55..1e3bf68e13 100644 --- a/effects/showfps.cpp +++ b/effects/showfps.cpp @@ -51,8 +51,9 @@ ShowFpsEffect::ShowFpsEffect() void ShowFpsEffect::prePaintScreen( int* mask, QRegion* region, int time ) { - if( time == 0 ) - ; // TODO optimized away + if( time == 0 ) { + // TODO optimized away + } t.start(); frames[ frames_pos ] = t.minute() * 60000 + t.second() * 1000 + t.msec(); if( ++frames_pos == MAX_FPS ) diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 35a9b2c98a..20ea1100d9 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -435,7 +435,7 @@ void KWinDecorationModule::readConfig( KConfig* conf ) { // General tab // ============ - cbShowToolTips->setChecked( conf->readEntry("ShowToolTips", QVariant(true )).toBool()); + cbShowToolTips->setChecked( conf->readEntry("ShowToolTips", true)); // cbUseMiniWindows->setChecked( conf->readEntry("MiniWindowBorders", QVariant(false)).toBool()); // Find the corresponding decoration name to that of @@ -462,7 +462,7 @@ void KWinDecorationModule::readConfig( KConfig* conf ) // Buttons tab // ============ - bool customPositions = conf->readEntry("CustomButtonPositions", QVariant(false)).toBool(); + bool customPositions = conf->readEntry("CustomButtonPositions", false); cbUseCustomButtonPositions->setChecked( customPositions ); buttonPositionWidget->setEnabled( customPositions ); // Menu and onAllDesktops buttons are default on LHS diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index 40c9b64df3..0c791aa1c6 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -427,13 +427,13 @@ void KFocusConfig::load( void ) key = config->readEntry(KWIN_ALTTABMODE, "KDE"); setAltTabMode(key == "KDE"); - setRollOverDesktops( config->readEntry(KWIN_ROLL_OVER_DESKTOPS, QVariant(true )).toBool()); + setRollOverDesktops( config->readEntry(KWIN_ROLL_OVER_DESKTOPS, true)); config->setGroup( "PopupInfo" ); - setShowPopupinfo( config->readEntry(KWIN_SHOW_POPUP, QVariant(false )).toBool()); + setShowPopupinfo( config->readEntry(KWIN_SHOW_POPUP, false)); config->setGroup( "TabBox" ); - setTraverseAll( config->readEntry(KWIN_TRAVERSE_ALL, QVariant(false )).toBool()); + setTraverseAll( config->readEntry(KWIN_TRAVERSE_ALL, false)); config->setGroup("Desktops"); emit KCModule::changed(false); @@ -684,8 +684,8 @@ void KAdvancedConfig::load( void ) { config->setGroup( "Windows" ); - setAnimateShade(config->readEntry(KWIN_ANIMSHADE, QVariant(true)).toBool()); - setShadeHover(config->readEntry(KWIN_SHADEHOVER, QVariant(false)).toBool()); + setAnimateShade(config->readEntry(KWIN_ANIMSHADE, true)); + setShadeHover(config->readEntry(KWIN_SHADEHOVER, false)); setShadeHoverInterval(config->readEntry(KWIN_SHADEHOVER_INTERVAL, 250)); setElectricBorders(config->readEntry(KWM_ELECTRIC_BORDER, false)); @@ -694,7 +694,7 @@ void KAdvancedConfig::load( void ) // setFocusStealing( config->readEntry(KWIN_FOCUS_STEALING, 2 )); // TODO default to low for now setFocusStealing( config->readEntry(KWIN_FOCUS_STEALING, 1 )); - setHideUtilityWindowsForInactive( config->readEntry( KWIN_HIDE_UTILITY, QVariant(true )).toBool()); + setHideUtilityWindowsForInactive( config->readEntry( KWIN_HIDE_UTILITY, true)); emit KCModule::changed(false); } @@ -1061,7 +1061,7 @@ void KMovingConfig::load( void ) setMove(OPAQUE); //CT 17Jun1998 - variable animation speed from 0 (none!!) to 10 (max) - bool anim = config->readEntry(KWIN_MINIMIZE_ANIM, QVariant(true )).toBool(); + bool anim = config->readEntry(KWIN_MINIMIZE_ANIM, true); int animSpeed = config->readEntry(KWIN_MINIMIZE_ANIM_SPEED, 5); if( animSpeed < 1 ) animSpeed = 0; if( animSpeed > 10 ) animSpeed = 10; @@ -1076,7 +1076,7 @@ void KMovingConfig::load( void ) setResizeOpaque(RESIZE_TRANSPARENT); //KS 10Jan2003 - Geometry Tip during window move/resize - bool showGeomTip = config->readEntry(KWIN_GEOMETRY, QVariant(false)).toBool(); + bool showGeomTip = config->readEntry(KWIN_GEOMETRY, false); setGeometryTip( showGeomTip ); // placement policy --- CT 19jan98 --- @@ -1114,7 +1114,7 @@ void KMovingConfig::load( void ) setPlacement(SMART_PLACEMENT); // } - setMoveResizeMaximized(config->readEntry(KWIN_MOVE_RESIZE_MAXIMIZED, QVariant(false)).toBool()); + setMoveResizeMaximized(config->readEntry(KWIN_MOVE_RESIZE_MAXIMIZED, false)); int v; @@ -1128,7 +1128,7 @@ void KMovingConfig::load( void ) else if (v < 0) setWindowSnapZone (0); else setWindowSnapZone(v); - OverlapSnap->setChecked(config->readEntry("SnapOnlyWhenOverlapping", QVariant(false)).toBool()); + OverlapSnap->setChecked(config->readEntry("SnapOnlyWhenOverlapping", false)); emit KCModule::changed(false); } @@ -1475,15 +1475,15 @@ void KTranslucencyConfig::load( void ) if (!kompmgrAvailable_) return; config->setGroup( "Translucency" ); - useTranslucency->setChecked(config->readEntry("UseTranslucency", QVariant(false)).toBool()); - activeWindowTransparency->setChecked(config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool()); - inactiveWindowTransparency->setChecked(config->readEntry("TranslucentInactiveWindows", QVariant(true)).toBool()); - movingWindowTransparency->setChecked(config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool()); - removeShadowsOnMove->setChecked(config->readEntry("RemoveShadowsOnMove", QVariant(false)).toBool()); - removeShadowsOnResize->setChecked(config->readEntry("RemoveShadowsOnResize", QVariant(false)).toBool()); - dockWindowTransparency->setChecked(config->readEntry("TranslucentDocks", QVariant(true)).toBool()); - keepAboveAsActive->setChecked(config->readEntry("TreatKeepAboveAsActive", QVariant(true)).toBool()); - onlyDecoTranslucent->setChecked(config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool()); + useTranslucency->setChecked(config->readEntry("UseTranslucency", false)); + activeWindowTransparency->setChecked(config->readEntry("TranslucentActiveWindows", false)); + inactiveWindowTransparency->setChecked(config->readEntry("TranslucentInactiveWindows", true)); + movingWindowTransparency->setChecked(config->readEntry("TranslucentMovingWindows", false)); + removeShadowsOnMove->setChecked(config->readEntry("RemoveShadowsOnMove", false)); + removeShadowsOnResize->setChecked(config->readEntry("RemoveShadowsOnResize", false)); + dockWindowTransparency->setChecked(config->readEntry("TranslucentDocks", true)); + keepAboveAsActive->setChecked(config->readEntry("TreatKeepAboveAsActive", true)); + onlyDecoTranslucent->setChecked(config->readEntry("OnlyDecoTranslucent", false)); activeWindowOpacity->setValue(config->readEntry("ActiveWindowOpacity",100)); inactiveWindowOpacity->setValue(config->readEntry("InactiveWindowOpacity",75)); @@ -1503,7 +1503,7 @@ void KTranslucencyConfig::load( void ) KConfig conf_(QDir::homePath() + "/.xcompmgrrc"); conf_.setGroup("xcompmgr"); - disableARGB->setChecked(conf_.readEntry("DisableARGB", QVariant(false)).toBool()); + disableARGB->setChecked(conf_.readEntry("DisableARGB", false)); useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0); shadowTopOffset->setValue(-1*(conf_.readEntry("ShadowOffsetY",-80))); @@ -1523,8 +1523,8 @@ void KTranslucencyConfig::load( void ) else shadowColor->setColor(QColor(r,g,b)); - fadeInWindows->setChecked(conf_.readEntry("FadeWindows", QVariant(true)).toBool()); - fadeOnOpacityChange->setChecked(conf_.readEntry("FadeTrans", QVariant(false)).toBool()); + fadeInWindows->setChecked(conf_.readEntry("FadeWindows", true)); + fadeOnOpacityChange->setChecked(conf_.readEntry("FadeTrans", false)); fadeInSpeed->setValue((int)(conf_.readEntry("FadeInStep",0.020)*1000.0)); fadeOutSpeed->setValue((int)(conf_.readEntry("FadeOutStep",0.070)*1000.0)); diff --git a/lib/kdecoration_p.cpp b/lib/kdecoration_p.cpp index d07d83d389..e4c621a34c 100644 --- a/lib/kdecoration_p.cpp +++ b/lib/kdecoration_p.cpp @@ -145,15 +145,15 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config ) QFont old_activeFontSmall = activeFontSmall; QFont old_inactiveFontSmall = inactiveFontSmall; - QFont activeFontGuess = KGlobalSettings::windowTitleFont(); + QFont activeFontGuess = KGlobalSettings::generalFont(); + activeFontGuess.setBold(true); + activeFontGuess.setPixelSize(12); activeFont = config->readEntry("activeFont", activeFontGuess); inactiveFont = config->readEntry("inactiveFont", activeFont); activeFontSmall = activeFont; -#ifdef __GNUC__ #warning KDE4 : is it useful ? ( temporary hack ) -#endif // activeFontSmall.setPointSize(activeFont.pointSize() - 2 > 0 ? activeFont.pointSize() - 2 : activeFont.pointSize()+1 ); activeFontSmall = config->readEntry("activeFontSmall", activeFontSmall); inactiveFontSmall = config->readEntry("inactiveFontSmall", activeFontSmall); @@ -169,7 +169,7 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config ) QString old_title_buttons_left = title_buttons_left; QString old_title_buttons_right = title_buttons_right; bool old_custom_button_positions = custom_button_positions; - custom_button_positions = config->readEntry("CustomButtonPositions", QVariant(false)).toBool(); + custom_button_positions = config->readEntry("CustomButtonPositions", false); if (custom_button_positions) { title_buttons_left = config->readEntry("ButtonsOnLeft", "MS"); @@ -188,7 +188,7 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config ) // SettingTooltips bool old_show_tooltips = show_tooltips; - show_tooltips = config->readEntry("ShowToolTips", QVariant(true)).toBool(); + show_tooltips = config->readEntry("ShowToolTips", true); if( old_show_tooltips != show_tooltips ) changed |= SettingTooltips; @@ -206,7 +206,7 @@ unsigned long KDecorationOptionsPrivate::updateKWinSettings( KConfig* config ) config->setGroup( "Windows" ); bool old_move_resize_maximized_windows = move_resize_maximized_windows; - move_resize_maximized_windows = config->readEntry( "MoveResizeMaximizedWindows", QVariant(false )).toBool(); + move_resize_maximized_windows = config->readEntry( "MoveResizeMaximizedWindows", false); if( old_move_resize_maximized_windows != move_resize_maximized_windows ) changed |= SettingBorder; diff --git a/options.cpp b/options.cpp index 84eb0f0911..d9ea164156 100644 --- a/options.cpp +++ b/options.cpp @@ -54,7 +54,7 @@ unsigned long Options::updateSettings() config->setGroup( "Windows" ); moveMode = stringToMoveResizeMode( config->readEntry("MoveMode", "Opaque" )); resizeMode = stringToMoveResizeMode( config->readEntry("ResizeMode", "Opaque" )); - show_geometry_tip = config->readEntry("GeometryTip", QVariant(false)).toBool(); + show_geometry_tip = config->readEntry("GeometryTip", false); QString val; @@ -72,7 +72,7 @@ unsigned long Options::updateSettings() if ( val == "CDE" ) altTabStyle = CDE; - rollOverDesktops = config->readEntry("RollOverDesktops", QVariant(true)).toBool(); + rollOverDesktops = config->readEntry("RollOverDesktops", true); // focusStealingPreventionLevel = config->readEntry( "FocusStealingPreventionLevel", 2 ); // TODO use low level for now @@ -84,14 +84,14 @@ unsigned long Options::updateSettings() KConfig *gc = new KConfig("kdeglobals", false, false); bool isVirtual = KApplication::desktop()->isVirtualDesktop(); gc->setGroup("Windows"); - xineramaEnabled = gc->readEntry ("XineramaEnabled", QVariant(isVirtual )).toBool() && + xineramaEnabled = gc->readEntry ("XineramaEnabled", isVirtual) && isVirtual; if (xineramaEnabled) { - xineramaPlacementEnabled = gc->readEntry ("XineramaPlacementEnabled", QVariant(true)).toBool(); - xineramaMovementEnabled = gc->readEntry ("XineramaMovementEnabled", QVariant(true)).toBool(); - xineramaMaximizeEnabled = gc->readEntry ("XineramaMaximizeEnabled", QVariant(true)).toBool(); - xineramaFullscreenEnabled = gc->readEntry ("XineramaFullscreenEnabled", QVariant(true)).toBool(); + xineramaPlacementEnabled = gc->readEntry ("XineramaPlacementEnabled", true); + xineramaMovementEnabled = gc->readEntry ("XineramaMovementEnabled", true); + xineramaMaximizeEnabled = gc->readEntry ("XineramaMaximizeEnabled", true); + xineramaFullscreenEnabled = gc->readEntry ("XineramaFullscreenEnabled", true); } else { @@ -101,9 +101,9 @@ unsigned long Options::updateSettings() placement = Placement::policyFromString( config->readEntry("Placement"), true ); - animateShade = config->readEntry("AnimateShade", QVariant(true)).toBool(); + animateShade = config->readEntry("AnimateShade", true); - animateMinimize = config->readEntry("AnimateMinimize", QVariant(true)).toBool(); + animateMinimize = config->readEntry("AnimateMinimize", true); animateMinimizeSpeed = config->readEntry("AnimateMinimizeSpeed", 5 ); if( focusPolicy == ClickToFocus ) @@ -115,21 +115,21 @@ unsigned long Options::updateSettings() } else { - autoRaise = config->readEntry("AutoRaise", QVariant(false)).toBool(); + autoRaise = config->readEntry("AutoRaise", false); autoRaiseInterval = config->readEntry("AutoRaiseInterval", 0 ); - delayFocus = config->readEntry("DelayFocus", QVariant(false)).toBool(); + delayFocus = config->readEntry("DelayFocus", false); delayFocusInterval = config->readEntry("DelayFocusInterval", 0 ); } - shadeHover = config->readEntry("ShadeHover", QVariant(false)).toBool(); + shadeHover = config->readEntry("ShadeHover", false); shadeHoverInterval = config->readEntry("ShadeHoverInterval", 250 ); // important: autoRaise implies ClickRaise - clickRaise = autoRaise || config->readEntry("ClickRaise", QVariant(true)).toBool(); + clickRaise = autoRaise || config->readEntry("ClickRaise", true); borderSnapZone = config->readEntry("BorderSnapZone", 10); windowSnapZone = config->readEntry("WindowSnapZone", 10); - snapOnlyWhenOverlapping=config->readEntry("SnapOnlyWhenOverlapping", QVariant(false)).toBool(); + snapOnlyWhenOverlapping=config->readEntry("SnapOnlyWhenOverlapping", false); electric_borders = config->readEntry("ElectricBorders", 0); electric_border_delay = config->readEntry("ElectricBorderDelay", 150); @@ -152,7 +152,7 @@ unsigned long Options::updateSettings() (*it) = (*it).toLower(); killPingTimeout = config->readEntry( "KillPingTimeout", 5000 ); - hideUtilityWindowsForInactive = config->readEntry( "HideUtilityWindowsForInactive", QVariant( true)).toBool(); + hideUtilityWindowsForInactive = config->readEntry( "HideUtilityWindowsForInactive", true); showDesktopIsMinimizeAll = config->readEntry( "ShowDesktopIsMinimizeAll", false ); // Mouse bindings @@ -175,24 +175,24 @@ unsigned long Options::updateSettings() //translucency settings - TODO config->setGroup( "Translucency"); - useTranslucency = config->readEntry("UseTranslucency", QVariant(true)).toBool(); - translucentActiveWindows = config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool(); + useTranslucency = config->readEntry("UseTranslucency", true); + translucentActiveWindows = config->readEntry("TranslucentActiveWindows", false); activeWindowOpacity = uint((config->readEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF); - translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", QVariant(false)).toBool(); + translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", false); inactiveWindowOpacity = uint((config->readEntry("InactiveWindowOpacity", 75)/100.0)*0xFFFFFFFF); - translucentMovingWindows = config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool(); + translucentMovingWindows = config->readEntry("TranslucentMovingWindows", false); movingWindowOpacity = uint((config->readEntry("MovingWindowOpacity", 50)/100.0)*0xFFFFFFFF); - translucentDocks = config->readEntry("TranslucentDocks", QVariant(false)).toBool(); + translucentDocks = config->readEntry("TranslucentDocks", false); dockOpacity = uint((config->readEntry("DockOpacity", 80)/100.0)*0xFFFFFFFF); - keepAboveAsActive = config->readEntry("TreatKeepAboveAsActive", QVariant(true)).toBool(); + keepAboveAsActive = config->readEntry("TreatKeepAboveAsActive", true); //TODO: remove this variable useTitleMenuSlider = true; activeWindowShadowSize = config->readEntry("ActiveWindowShadowSize", 200); inactiveWindowShadowSize = config->readEntry("InactiveWindowShadowSize", 100); dockShadowSize = config->readEntry("DockShadowSize", 80); - removeShadowsOnMove = config->readEntry("RemoveShadowsOnMove", QVariant(true)).toBool(); - removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", QVariant(true)).toBool(); - onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool(); + removeShadowsOnMove = config->readEntry("RemoveShadowsOnMove", true); + removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", true); + onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", false); refreshRate = config->readEntry( "RefreshRate", 0 ); smoothScale = qBound( -1, config->readEntry( "SmoothScale", -1 ), 2 ); @@ -221,11 +221,11 @@ unsigned long Options::updateSettings() // "EffectNoTooltip" setting from kdeglobals. KConfig globalConfig("kdeglobals"); globalConfig.setGroup("KDE"); - topmenus = globalConfig.readEntry( "macStyle", QVariant(false)).toBool(); + topmenus = globalConfig.readEntry( "macStyle", false); KConfig kdesktopcfg( "kdesktoprc", true ); kdesktopcfg.setGroup( "Menubar" ); - desktop_topmenu = kdesktopcfg.readEntry( "ShowMenubar", QVariant(false)).toBool(); + desktop_topmenu = kdesktopcfg.readEntry( "ShowMenubar", false); if( desktop_topmenu ) topmenus = true; diff --git a/rules.cpp b/rules.cpp index 04b878fd1f..fc9e05e10f 100644 --- a/rules.cpp +++ b/rules.cpp @@ -116,7 +116,7 @@ void Rules::readFromCfg( KConfig& cfg ) { description = cfg.readEntry( "description" ); READ_MATCH_STRING( wmclass, .toLower().toLatin1() ); - wmclasscomplete = cfg.readEntry( "wmclasscomplete" , QVariant(false)).toBool(); + wmclasscomplete = cfg.readEntry( "wmclasscomplete" , false); READ_MATCH_STRING( windowrole, .toLower().toLatin1() ); READ_MATCH_STRING( title, ); READ_MATCH_STRING( extrarole, .toLower().toLatin1() ); diff --git a/tabbox.cpp b/tabbox.cpp index 8f0a6cc71d..4885a81192 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -111,8 +111,6 @@ void TabBox::createClientList(ClientList &list, int desktop /*-1 = all*/, Client list += c; else if( !list.contains( modal )) list += modal; - else - ; // nothing } }