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

List:       kde-commits
Subject:    KDE/kdepim/kleopatra/dialogs
From:       Marc Mutz <mutz () kde ! org>
Date:       2008-05-07 12:22:07
Message-ID: 1210162927.595824.3446.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 805037 by mutz:

Allow to pass vectors of tests

 M  +16 -6     selftestdialog.cpp  
 M  +4 -0      selftestdialog.h  


--- trunk/KDE/kdepim/kleopatra/dialogs/selftestdialog.cpp #805036:805037
@@ -123,11 +123,11 @@
             endRemoveRows();
         }
 
-        void append( const shared_ptr<SelfTest> & test ) {
-            if ( !test )
+        void append( const std::vector< shared_ptr<SelfTest> > & tests ) {
+            if ( tests.empty() )
                 return;
-            beginInsertRows( QModelIndex(), m_tests.size(), m_tests.size() );
-            m_tests.push_back( test );
+            beginInsertRows( QModelIndex(), m_tests.size(), m_tests.size() + \
tests.size() ); +            m_tests.insert( m_tests.end(), tests.begin(), \
tests.end() );  endInsertRows();
         }
 
@@ -169,7 +169,7 @@
         } else {
             ui.proposedCorrectiveActionGB->setEnabled( true );
             ui.proposedCorrectiveActionLB->setText( model.at(row)->proposedFix() );
-            ui.doItPB->setEnabled( model.at(row)->canFixAutomatically() );
+            ui.doItPB->setEnabled( !model.at(row)->passed() && \
model.at(row)->canFixAutomatically() );  }
     }
     void slotDoItClicked() {
@@ -208,12 +208,22 @@
 
 }
 
+SelfTestDialog::SelfTestDialog( const std::vector< shared_ptr<SelfTest> > & tests, \
QWidget * p, Qt::WindowFlags f ) +    : QDialog( p, f ), d( new Private( this ) )
+{
+    addSelfTests( tests );
+}
+
 SelfTestDialog::~SelfTestDialog() {}
 
 void SelfTestDialog::addSelfTest( const shared_ptr<SelfTest> & test ) {
-    d->model.append( test );
+    d->model.append( std::vector< shared_ptr<SelfTest> >( 1, test ) );
 }
 
+void SelfTestDialog::addSelfTests( const std::vector< shared_ptr<SelfTest> > & tests \
) { +    d->model.append( tests );
+}
 
+
 #include "selftestdialog.moc"
 #include "moc_selftestdialog.cpp"
--- trunk/KDE/kdepim/kleopatra/dialogs/selftestdialog.h #805036:805037
@@ -37,6 +37,8 @@
 
 #include <utils/pimpl_ptr.h>
 
+#include <vector>
+
 namespace boost {
     template <typename T> class shared_ptr;
 }
@@ -51,9 +53,11 @@
         Q_OBJECT
     public:
         explicit SelfTestDialog( QWidget * parent=0, Qt::WindowFlags f=0 );
+        explicit SelfTestDialog( const std::vector< boost::shared_ptr<SelfTest> > & \
tests, QWidget * parent=0, Qt::WindowFlags f=0 );  ~SelfTestDialog();
 
         void addSelfTest( const boost::shared_ptr<SelfTest> & test );
+        void addSelfTests( const std::vector< boost::shared_ptr<SelfTest> > & tests \
);  
     private:
         class Private;


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

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