[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/libkdepim
From:       Volker Krause <vkrause () kde ! org>
Date:       2010-10-25 13:14:59
Message-ID: 20101025131459.60722AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1189637 by vkrause:

Don't crash if the combo box is not editable.


 M  +6 -1      ktimeedit.cpp  


--- trunk/KDE/kdepim/libkdepim/ktimeedit.cpp #1189636:1189637
@@ -172,17 +172,22 @@
 
   // Set the text but without emitting signals, nor losing the cursor position
   QLineEdit *line = q->lineEdit();
+  int pos = 0;
+  if ( line ) {
   line->blockSignals( true );
-  const int pos = line->cursorPosition();
+    pos = line->cursorPosition();
+  }
 
   // select item with nearest time, must be done while line edit is blocked
   // as setCurrentItem() calls setText() with triggers KTimeEdit::changedText()
   q->setCurrentIndex( ( mTime.hour() * 4 ) + ( ( mTime.minute() + 7 ) / 15 ) );
 
+  if ( line ) {
   line->setText( text );
   line->setCursorPosition( pos );
   line->blockSignals( false );
 }
+}
 
 void KTimeEdit::Private::slotActivated( int index )
 {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic