From 0d04f6a458589be9214402cbf7167807cf461b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 14 Jul 2004 14:27:47 +0000 Subject: [PATCH] Some warnings, and changed automatic filling of description. svn path=/trunk/kdebase/kwin/; revision=329159 --- kcmkwin/kwinrules/ruleswidget.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index f89a303b20..d342471fe2 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -325,10 +325,7 @@ void RulesWidget::setRules( Rules* rules ) { Rules tmp; if( rules == NULL ) - { - tmp.description = i18n( "New Entry" ); rules = &tmp; // empty - } description->setText( rules->description ); wmclass->setText( rules->wmclass ); whole_wmclass->setChecked( rules->wmclasscomplete ); @@ -415,7 +412,7 @@ Rules* RulesWidget::rules() const rules->windowrolematch = static_cast< Rules::StringMatch >( role_match->currentItem()); rules->types = 0; bool all_types = true; - for( int i = 0; + for( unsigned int i = 0; i < types->count(); ++i ) if( !types->isSelected( i )) @@ -516,8 +513,15 @@ void RulesWidget::detected( bool ok ) bool RulesWidget::finalCheck() { + if( description->text().isEmpty()) + { + if( !wmclass->text().isEmpty()) + description->setText( i18n( "Settings for %1" ).arg( wmclass->text())); + else + description->setText( i18n( "Unnamed entry" )); + } bool all_types = true; - for( int i = 0; + for( unsigned int i = 0; i < types->count(); ++i ) if( !types->isSelected( i ))