Less warnings please.

svn path=/trunk/KDE/kdebase/workspace/; revision=1031438
This commit is contained in:
Lucas Murray 2009-10-05 06:59:10 +00:00
parent ca9df8caae
commit 8cbce93613
13 changed files with 71 additions and 80 deletions

View file

@ -1028,8 +1028,8 @@ static void redraw_pixmaps()
QColor color = is_act ? activeColor : inactiveColor;
drawB2Rect(&thinBox, color, is_down);
pix->fill(Qt::black);
bitBlt(pix, 0, 0, &thinBox,
0, 0, thinBox.width(), thinBox.height());
QPainter p(pix);
p.drawPixmap(0, 0, thinBox);
}
// normalize + iconify
@ -1044,12 +1044,12 @@ static void redraw_pixmaps()
drawB2Rect(&smallBox, color, is_down);
drawB2Rect(&largeBox, color, is_down);
pix->fill(options()->color(KDecoration::ColorTitleBar, is_act));
bitBlt(pix, pix->width() - 12, pix->width() - 12, &largeBox,
0, 0, 12, 12);
bitBlt(pix, 0, 0, &smallBox, 0, 0, 10, 10);
QPainter p(pix);
p.drawPixmap(pix->width() - 12, pix->width() - 12, largeBox, 0, 0, 12, 12);
p.drawPixmap(0, 0, smallBox, 0, 0, 10, 10);
bitBlt(pixmap[P_ICONIFY + i], 0, 0,
&smallBox, 0, 0, 10, 10);
QPainter p2(pixmap[P_ICONIFY + i]);
p2.drawPixmap(0, 0, smallBox, 0, 0, 10, 10);
}
// resize
@ -1059,7 +1059,8 @@ static void redraw_pixmaps()
*pixmap[P_RESIZE + i] = *pixmap[P_MAX + i];
pixmap[P_RESIZE + i]->detach();
drawB2Rect(&smallBox, is_act ? activeColor : inactiveColor, is_down);
bitBlt(pixmap[P_RESIZE + i], 0, 0, &smallBox, 0, 0, 10, 10);
QPainter p(pixmap[P_RESIZE + i]);
p.drawPixmap(0, 0, smallBox, 0, 0, 10, 10);
}
QPainter p;
@ -1241,13 +1242,15 @@ void B2Client::positionButtons()
}
// Transparent bound stuff.
static QRect *visible_bound;
//static QRect *visible_bound;
static QPolygon bound_shape;
bool B2Client::drawbound(const QRect& geom, bool clear)
{
// Let kwin draw the bounds, for now.
Q_UNUSED(geom);
Q_UNUSED(clear);
return false;
#if 0
if (clear) {
@ -1512,10 +1515,10 @@ void B2Titlebar::resizeEvent(QResizeEvent *)
void B2Titlebar::paintEvent(QPaintEvent *)
{
if (client->isActive())
bitBlt(this, 0, 0, &titleBuffer, 0, 0, titleBuffer.width(),
titleBuffer.height());
else {
if (client->isActive()) {
QPainter p(this);
p.drawPixmap(0, 0, titleBuffer);
} else {
QPainter p(this);
drawTitlebar(p, false);
}

View file

@ -47,6 +47,7 @@ extern "C"
KDE2Config::KDE2Config( KConfig* conf, QWidget* parent )
: QObject( parent )
{
Q_UNUSED( conf );
KGlobal::locale()->insertCatalog("kwin_clients");
c = new KConfig("kwinKDE2rc");
highcolor = QPixmap::defaultDepth() > 8;

View file

@ -52,6 +52,7 @@ extern "C"
KeramikConfig::KeramikConfig( KConfig* conf, QWidget* parent )
: QObject( parent )
{
Q_UNUSED( conf );
KGlobal::locale()->insertCatalog("kwin_clients");
c = new KConfig( "kwinkeramikrc" );
KConfigGroup cg(c, "General");

View file

@ -254,6 +254,7 @@ static void delete_pixmaps()
LaptopButton::LaptopButton(ButtonType type, LaptopClient *parent, const char *name)
: KCommonDecorationButton(type, parent)
{
Q_UNUSED( name );
setAttribute(Qt::WA_NoSystemBackground, true);
}

View file

@ -103,10 +103,10 @@ static QPixmap *iButtonPixDown=0;
static QColor *buttonFg;
static bool pixmaps_created = false;
static QBitmap *lcDark1;
static QBitmap *lcDark2;
static QBitmap *lcDark3;
static QBitmap *lcLight1;
static QBitmap lcDark1;
static QBitmap lcDark2;
static QBitmap lcDark3;
static QBitmap lcLight1;
static QImage *btnSource;
static bool show_handle;
@ -129,12 +129,13 @@ static void make_button_fx(const QPalette &g, QPixmap *pix, bool light=false)
int i, destH, destS, destV, srcH, srcS, srcV;
QColor btnColor = g.background().color();
// TODO: This seems to have been broken from the port to Qt4
if(btnSource->depth() < 32)
*btnSource = btnSource->convertDepth(32);
*btnSource = btnSource->convertToFormat(QImage::Format_RGB32);
if(light)
btnColor = btnColor.light(120);
btnColor.getHsv(&destH, &destS, &destV);
QImage btnDest(14, 15, 32);
QImage btnDest(14, 15, QImage::Format_RGB32);
unsigned int *srcData = (unsigned int *)btnSource->bits();
unsigned int *destData = (unsigned int *)btnDest.bits();
@ -149,19 +150,19 @@ static void make_button_fx(const QPalette &g, QPixmap *pix, bool light=false)
}
else{
if(!lcDark1->mask()){
lcDark1->setMask(*lcDark1);
lcDark2->setMask(*lcDark2);
lcDark3->setMask(*lcDark3);
lcLight1->setMask(*lcLight1);
if(!lcDark1.mask()){
lcDark1.setMask(lcDark1);
lcDark2.setMask(lcDark2);
lcDark3.setMask(lcDark3);
lcLight1.setMask(lcLight1);
}
p.setPen(g.dark().color());
p.drawPixmap(0, 0, *lcDark2);
p.drawPixmap(0, 0, *lcDark1);
p.drawPixmap(0, 0, lcDark2);
p.drawPixmap(0, 0, lcDark1);
p.setPen(g.mid().color());
p.drawPixmap(0, 0, *lcDark3);
p.drawPixmap(0, 0, lcDark3);
p.setPen(g.light().color());
p.drawPixmap(0, 0, *lcLight1);
p.drawPixmap(0, 0, lcLight1);
}
}
@ -181,10 +182,10 @@ static void create_pixmaps()
return;
pixmaps_created = true;
lcDark1 = new QBitmap(14, 15, lowcolor_6a696a_bits, true);
lcDark2 = new QBitmap(14, 15, lowcolor_949194_bits, true);
lcDark3 = new QBitmap(14, 15, lowcolor_b4b6b4_bits, true);
lcLight1 = new QBitmap(14, 15, lowcolor_e6e6e6_bits, true);
lcDark1 = QBitmap::fromData(QSize(14, 15), lowcolor_6a696a_bits, QImage::Format_Mono);
lcDark2 = QBitmap::fromData(QSize(14, 15), lowcolor_949194_bits, QImage::Format_Mono);
lcDark3 = QBitmap::fromData(QSize(14, 15), lowcolor_b4b6b4_bits, QImage::Format_Mono);
lcLight1 = QBitmap::fromData(QSize(14, 15), lowcolor_e6e6e6_bits, QImage::Format_Mono);
btnSource = new QImage(btnhighcolor_xpm);
if(QPixmap::defaultDepth() > 8){
@ -218,10 +219,6 @@ static void create_pixmaps()
else
buttonFg = new QColor(Qt::black);
delete lcDark1;
delete lcDark2;
delete lcDark3;
delete lcLight1;
delete btnSource;
}
@ -649,7 +646,7 @@ void ModernSys::paintEvent( QPaintEvent* )
QPalette pt = options()->palette(ColorFrame, isActive());
pt.setCurrentColorGroup( QPalette::Active );
QBrush fillBrush(widget()->palette().brush(QPalette::Background).pixmap() ?
QBrush fillBrush(!widget()->palette().brush(QPalette::Background).texture().isNull() ?
widget()->palette().brush(QPalette::Background) :
pt.brush(QPalette::Button));

View file

@ -36,6 +36,7 @@
PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent)
: QObject(parent), m_config(0), m_dialog(0)
{
Q_UNUSED( config );
// create the configuration object
m_config = new KConfig("kwinplastikrc");
KConfigGroup cg(m_config, "General");

View file

@ -50,6 +50,7 @@ namespace KWin
RulesWidget::RulesWidget( QWidget* parent )
: detect_dlg( NULL )
{
Q_UNUSED( parent );
setupUi(this);
QString enableDesc =
@ -476,16 +477,16 @@ Rules* RulesWidget::rules() const
rules->types = NET::AllTypesMask;
else
{
rules->types |= types->item(0)->isSelected() ? NET::NormalMask : 0;
rules->types |= types->item(1)->isSelected() ? NET::DialogMask : 0;
rules->types |= types->item(2)->isSelected() ? NET::UtilityMask : 0;
rules->types |= types->item(3)->isSelected() ? NET::DockMask : 0;
rules->types |= types->item(4)->isSelected() ? NET::ToolbarMask : 0;
rules->types |= types->item(5)->isSelected() ? NET::MenuMask : 0;
rules->types |= types->item(6)->isSelected() ? NET::SplashMask : 0;
rules->types |= types->item(7)->isSelected() ? NET::DesktopMask : 0;
rules->types |= types->item(8)->isSelected() ? NET::OverrideMask : 0;
rules->types |= types->item(9)->isSelected() ? NET::TopMenuMask : 0;
rules->types |= types->item(0)->isSelected() ? NET::NormalMask : 0U;
rules->types |= types->item(1)->isSelected() ? NET::DialogMask : 0U;
rules->types |= types->item(2)->isSelected() ? NET::UtilityMask : 0U;
rules->types |= types->item(3)->isSelected() ? NET::DockMask : 0U;
rules->types |= types->item(4)->isSelected() ? NET::ToolbarMask : 0U;
rules->types |= types->item(5)->isSelected() ? NET::MenuMask : 0U;
rules->types |= types->item(6)->isSelected() ? NET::SplashMask : 0U;
rules->types |= types->item(7)->isSelected() ? NET::DesktopMask : 0U;
rules->types |= types->item(8)->isSelected() ? NET::OverrideMask : 0U;
rules->types |= types->item(9)->isSelected() ? NET::TopMenuMask : 0U;
}
rules->title = title->text();
rules->titlematch = static_cast< Rules::StringMatch >( title_match->currentIndex());

View file

@ -435,14 +435,11 @@ QPalette KDecorationOptions::palette(ColorType type, bool active) const
int idx = type + (active ? 0 : NUM_COLORS);
if(d->pal[idx])
return(*d->pal[idx]);
#ifdef __GNUC__
#warning KDE4 : why construct the palette this way?
#endif
// TODO: Is this worth 'porting' to Qt4?
// d->pal[idx] = new QPalette(Qt::black, d->colors[idx], d->colors[idx].light(150),
// d->colors[idx].dark(), d->colors[idx].dark(120),
// Qt::black, QApplication::palette().active().
// base());
// TODO: Why construct the palette this way? Is it worth porting to Qt4?
//d->pal[idx] = new QPalette(Qt::black, d->colors[idx], d->colors[idx].light(150),
// d->colors[idx].dark(), d->colors[idx].dark(120),
// Qt::black, QApplication::palette().active().
// base());
d->pal[idx] = new QPalette(d->colors[idx]);
return(*d->pal[idx]);
}

View file

@ -147,10 +147,8 @@ unsigned long KDecorationOptionsPrivate::updateSettings( KConfig* config )
inactiveFont = wmConfig.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 );
// TODO: Is it useful ? (Temporary hack)
//activeFontSmall.setPointSize(activeFont.pointSize() - 2 > 0 ? activeFont.pointSize() - 2 : activeFont.pointSize()+1 );
activeFontSmall = wmConfig.readEntry("activeFontSmall", activeFontSmall);
inactiveFontSmall = wmConfig.readEntry("inactiveFontSmall", activeFontSmall);

View file

@ -168,6 +168,7 @@ static QByteArray errorMessage( const XErrorEvent& event, Display* dpy )
static int x11ErrorHandler( Display* d, XErrorEvent* e )
{
Q_UNUSED( d );
bool ignore_badwindow = true; // Might be temporary
if( initting && ( e->request_code == X_ChangeWindowAttributes || e->request_code == X_GrabKey ) &&
@ -252,9 +253,7 @@ Application::Application()
KSharedConfig::Ptr config = KGlobal::config();
if( !config->isImmutable() && args->isSet( "lock" ))
{
#ifdef __GNUC__
#warning this shouldn not be necessary
#endif
// TODO: This shouldn't be necessary
//config->setReadOnly( true );
config->reparseConfiguration();
}

View file

@ -85,7 +85,7 @@ QVariant ClientModel::data( const QModelIndex& index, int role ) const
int ClientModel::columnCount( const QModelIndex& parent ) const
{
Q_UNUSED( parent )
int count;
int count = 1;
switch( tabBox->config().layout() )
{
case TabBoxConfig::HorizontalLayout:
@ -106,7 +106,7 @@ int ClientModel::columnCount( const QModelIndex& parent ) const
int ClientModel::rowCount( const QModelIndex& parent ) const
{
Q_UNUSED( parent )
int count;
int count = 1;
switch( tabBox->config().layout() )
{
case TabBoxConfig::HorizontalLayout:

View file

@ -156,10 +156,8 @@ NET::WindowType Toplevel::windowType( bool direct, int supported_types ) const
if( direct )
return wt;
const Client* cl = dynamic_cast< const Client* >( this );
#ifdef __GNUC__
#warning TODO
#endif
// NET::WindowType wt2 = rules()->checkType( wt );
// TODO
//NET::WindowType wt2 = rules()->checkType( wt );
NET::WindowType wt2 = wt;
if( wt != wt2 )
{

View file

@ -327,9 +327,7 @@ void Workspace::initShortcuts()
// a separate KActionCollection is needed for the shortcut for disabling global shortcuts,
// otherwise it would also disable itself
disable_shortcuts_keys = new KActionCollection( this );
#ifdef __GNUC__
#warning TODO PORT ME (KGlobalAccel related)
#endif
// TODO: PORT ME (KGlobalAccel related)
// FIXME KAccel port... needed?
//disable_shortcuts_keys->disableBlocking( true );
#define IN_KWIN
@ -339,9 +337,7 @@ void Workspace::initShortcuts()
void Workspace::readShortcuts()
{
#ifdef __GNUC__
#warning TODO PORT ME (KGlobalAccel related)
#endif
// TODO: PORT ME (KGlobalAccel related)
//KGlobalAccel::self()->readSettings();
KAction *kaction = qobject_cast<KAction*>( keys->action("Walk Through Desktops") );
@ -406,12 +402,10 @@ void Workspace::readShortcuts()
void Workspace::setupWindowShortcut( Client* c )
{
assert( client_keys_dialog == NULL );
#ifdef __GNUC__
#warning TODO PORT ME (KGlobalAccel related)
#endif
// keys->setEnabled( false );
// disable_shortcuts_keys->setEnabled( false );
// client_keys->setEnabled( false );
// TODO: PORT ME (KGlobalAccel related)
//keys->setEnabled( false );
//disable_shortcuts_keys->setEnabled( false );
//client_keys->setEnabled( false );
client_keys_dialog = new ShortcutDialog( c->shortcut().primary());
client_keys_client = c;
connect( client_keys_dialog, SIGNAL( dialogDone( bool )), SLOT( setupWindowShortcutDone( bool )));