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

List:       kde-commits
Subject:    KDE/kdepim/kaddressbook
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-05-16 9:35:18
Message-ID: 20100516093518.09364AC8B5 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1127310 by tokoe:

Use the right indexes which have been checked before (prevents possible crashes)


 M  +2 -2      standardcontactactionmanager.cpp  


--- trunk/KDE/kdepim/kaddressbook/standardcontactactionmanager.cpp #1127309:1127310
@@ -80,7 +80,7 @@
       if ( mItemSelectionModel ) {
         itemCount = mItemSelectionModel->selectedRows().count();
         if ( itemCount == 1 ) {
-          const QModelIndex index = mItemSelectionModel->selectedIndexes().first();
+          const QModelIndex index = mItemSelectionModel->selectedRows().first();
           if ( index.isValid() ) {
             const QString mimeType = index.data( EntityTreeModel::MimeTypeRole \
).toString();  if ( mimeType == KABC::Addressee::mimeType() ) {
@@ -108,7 +108,7 @@
 
       if ( mCollectionSelectionModel ) {
         if ( mCollectionSelectionModel->selectedRows().count() == 1 ) {
-          const QModelIndex index = \
mCollectionSelectionModel->selectedIndexes().first(); +          const QModelIndex \
index = mCollectionSelectionModel->selectedRows().first();  if ( index.isValid() ) {
             const Collection collection = index.data( \
EntityTreeModel::CollectionRole ).value<Collection>();  if ( collection.isValid() ) {


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

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