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

List:       kde-commits
Subject:    KDE/kdepim
From:       Stephen Kelly <steveire () gmail ! com>
Date:       2010-09-23 14:11:24
Message-ID: 20100923141124.AA29AAC888 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1178683 by skelly:

Use a KConfigGroup instead of a KSharedConfigPtr in this API.

 M  +6 -7      akonadi_next/kviewstatemaintainer.cpp  
 M  +5 -5      akonadi_next/kviewstatemaintainer.h  
 M  +1 -1      akonadiconsole/browserwidget.cpp  
 M  +1 -1      kontact/plugins/kmail/kcmkmailsummary.cpp  
 M  +1 -1      kontact/plugins/kmail/summarywidget.cpp  
 M  +1 -1      mobile/lib/kdeclarativemainview.cpp  


--- trunk/KDE/kdepim/akonadi_next/kviewstatemaintainer.cpp #1178682:1178683
@@ -28,8 +28,8 @@
 
 class KViewStateMaintainerBasePrivate
 {
-  KViewStateMaintainerBasePrivate(KSharedConfigPtr configPtr, const QString &name, \
                KViewStateMaintainerBase *qq)
-    : q_ptr(qq), m_configPtr(configPtr), m_name(name)
+  KViewStateMaintainerBasePrivate(KConfigGroup configGroup, KViewStateMaintainerBase \
*qq) +    : q_ptr(qq), m_configGroup(configGroup)
   {
 
   }
@@ -43,8 +43,7 @@
   QWeakPointer<QAbstractItemView> m_view;
   QWeakPointer<QItemSelectionModel> m_selectionModel;
 
-  const KSharedConfigPtr m_configPtr;
-  const QString m_name;
+  const KConfigGroup m_configGroup;
 };
 
 }
@@ -63,8 +62,8 @@
   q->restoreState();
 }
 
-KViewStateMaintainerBase::KViewStateMaintainerBase(KSharedConfigPtr configPtr, const \
                QString &name, QObject* parent)
-  : QObject(parent), d_ptr(new KViewStateMaintainerBasePrivate(configPtr, name, \
this)) +KViewStateMaintainerBase::KViewStateMaintainerBase(KConfigGroup configPtr, \
QObject* parent) +  : QObject(parent), d_ptr(new \
KViewStateMaintainerBasePrivate(configPtr, this))  {
 
 }
@@ -77,7 +76,7 @@
 KConfigGroup KViewStateMaintainerBase::configGroup() const
 {
   Q_D(const KViewStateMaintainerBase);
-  return KConfigGroup(d->m_configPtr, d->m_name);
+  return d->m_configGroup;
 }
 
 QItemSelectionModel* KViewStateMaintainerBase::selectionModel() const
--- trunk/KDE/kdepim/akonadi_next/kviewstatemaintainer.h #1178682:1178683
@@ -40,7 +40,7 @@
 {
   Q_OBJECT
 public:
-  KViewStateMaintainerBase(KSharedConfigPtr configPtr, const QString &name, QObject* \
parent = 0); +  KViewStateMaintainerBase(KConfigGroup configGroup, QObject* parent = \
0);  ~KViewStateMaintainerBase();
 
   void setSelectionModel(QItemSelectionModel *selectionModel);
@@ -67,10 +67,10 @@
  * @brief Encapsulates the maintenance of state between resets of QAbstractItemModel
  *
  * @code
- *   m_collectionViewStateMaintainer = new \
KViewStateMaintainer<Akonadi::ETMViewStateSaver>(KGlobal::config(), \
"collectionView"); + *   m_collectionViewStateMaintainer = new \
KViewStateMaintainer<Akonadi::ETMViewStateSaver>(KGlobal::config()->group("collectionView"));
                
  *   m_collectionViewStateMaintainer->setView(m_collectionView);
  *
- *   m_collectionCheckStateMaintainer = new \
KViewStateMaintainer<Akonadi::ETMViewStateSaver>(KGlobal::config(), \
"collectionCheckState"); + *   m_collectionCheckStateMaintainer = new \
KViewStateMaintainer<Akonadi::ETMViewStateSaver>(KGlobal::config()->group("collectionCheckState"));
                
  *   m_collectionCheckStateMaintainer->setSelectionModel(m_checkableProxy->selectionModel());
                
  * @endcode
  *
@@ -81,8 +81,8 @@
 {
   typedef StateSaver StateRestorer;
 public:
-  KViewStateMaintainer(KSharedConfigPtr configPtr, const QString &name, QObject* \
                parent = 0)
-    : KViewStateMaintainerBase(configPtr, name, parent)
+  KViewStateMaintainer(KConfigGroup configGroup, QObject* parent = 0)
+    : KViewStateMaintainerBase(configGroup, parent)
   {
 
   }
--- trunk/KDE/kdepim/akonadiconsole/browserwidget.cpp #1178682:1178683
@@ -198,7 +198,7 @@
 
   Nepomuk::ResourceManager::instance()->init();
 
-  m_stateMaintainer = new Future::KViewStateMaintainer<ETMViewStateSaver>( \
KGlobal::config(), "CollectionViewState", this ); +  m_stateMaintainer = new \
Future::KViewStateMaintainer<ETMViewStateSaver>( \
KGlobal::config()->group("CollectionViewState"), this );  m_stateMaintainer->setView( \
mCollectionView );  
   m_stateMaintainer->restoreState();
--- trunk/KDE/kdepim/kontact/plugins/kmail/kcmkmailsummary.cpp #1178682:1178683
@@ -121,7 +121,7 @@
 
   KSharedConfigPtr _config = KSharedConfig::openConfig("kcmkmailsummaryrc");
 
-  mModelState = new Future::KViewStateMaintainer<Akonadi::ETMViewStateSaver>( \
_config, "CheckState", this ); +  mModelState = new \
Future::KViewStateMaintainer<Akonadi::ETMViewStateSaver>( _config->group( \
"CheckState" ), this );  mModelState->setSelectionModel( mSelectionModel );
 }
 
--- trunk/KDE/kdepim/kontact/plugins/kmail/summarywidget.cpp #1178682:1178683
@@ -85,7 +85,7 @@
 
   KSharedConfigPtr _config = KSharedConfig::openConfig("kcmkmailsummaryrc");
 
-  mModelState = new Future::KViewStateMaintainer<Akonadi::ETMViewStateSaver>( \
_config, "CheckState", this ); +  mModelState = new \
Future::KViewStateMaintainer<Akonadi::ETMViewStateSaver>( _config->group( \
"CheckState" ), this );  mModelState->setSelectionModel( mSelectionModel );
 
   connect( mChangeRecorder, SIGNAL( collectionChanged( const Akonadi::Collection & ) \
                ), SLOT( slotCollectionChanged( const Akonadi::Collection& ) ) );
--- trunk/KDE/kdepim/mobile/lib/kdeclarativemainview.cpp #1178682:1178683
@@ -188,7 +188,7 @@
   }
   d->mItemNavigationSelectionModel = new KLinkItemSelectionModel( d->mListProxy, \
itemSelectionModel, this);  
-  d->mItemViewStateMaintainer = new Future::KViewStateMaintainer<ETMViewStateSaver>( \
KGlobal::config(), QLatin1String( "ItemSelectionState" ), this); +  \
d->mItemViewStateMaintainer = new Future::KViewStateMaintainer<ETMViewStateSaver>( \
KGlobal::config()->group( QLatin1String( "ItemSelectionState" ) ), this);  \
d->mItemViewStateMaintainer->setSelectionModel( d->mItemNavigationSelectionModel );  
   d->mItemActionSelectionModel = new KLinkItemSelectionModel( d->mListProxy, \
itemActionCheckModel, this);


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

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