I guess Laurent is right about this - don't show non-existent virtual

desktops.

svn path=/trunk/kdebase/kwin/; revision=353961
icc-effect-5.14.5
Luboš Luňák 2004-10-12 15:08:31 +00:00
parent 1161bd5713
commit be90fd3f6a
2 changed files with 8 additions and 10 deletions

View File

@ -99,10 +99,6 @@ RulesWidget::RulesWidget( QWidget* parent, const char* name )
i <= module.numberOfDesktops();
++i )
desktop->insertItem( QString::number( i ).rightJustify( 2 ) + ":" + module.desktopName( i ));
for(;
i <= 16;
++i )
desktop->insertItem( QString::number( i ).rightJustify( 2 ));
desktop->insertItem( i18n( "All Desktops" ));
}
@ -204,16 +200,16 @@ static QSize strToSize( const QString& str )
}
static int desktopToCombo( int desktop )
int RulesWidget::desktopToCombo( int d ) const
{
if( desktop >= 1 && desktop <= 16 )
return desktop - 1;
return 16; // on all desktops
if( d >= 1 && d < desktop->count())
return d - 1;
return desktop->count() - 1; // on all desktops
}
static int comboToDesktop( int val )
int RulesWidget::comboToDesktop( int val ) const
{
if( val == 16 )
if( val == desktop->count() - 1 )
return NET::OnAllDesktops;
return val + 1;
}

View File

@ -78,6 +78,8 @@ class RulesWidget
// internal
void detected( bool );
private:
int desktopToCombo( int d ) const;
int comboToDesktop( int val ) const;
DetectDialog* detect_dlg;
bool detect_dlg_ok;
};