ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CkbSettingsWriter Class Reference

#include <src/ckb/ckbsettingswriter.h>

+ Inheritance diagram for CkbSettingsWriter:
+ Collaboration diagram for CkbSettingsWriter:

Public Member Functions

 CkbSettingsWriter (QSettings *backing, const QStringList &removals, const QMap< QString, QVariant > &updates)
 
 ~CkbSettingsWriter ()
 
Q_SLOT void run ()
 

Private Attributes

QSettings * _backing
 
QStringList _removals
 
QMap< QString, QVariant > _updates
 

Detailed Description

Definition at line 12 of file ckbsettingswriter.h.

Constructor & Destructor Documentation

CkbSettingsWriter::CkbSettingsWriter ( QSettings *  backing,
const QStringList &  removals,
const QMap< QString, QVariant > &  updates 
)

Definition at line 12 of file ckbsettingswriter.cpp.

References cacheWritesInProgress.

12  :
13  _backing(backing), _removals(removals), _updates(updates) {
15 }
QMap< QString, QVariant > _updates
QAtomicInt cacheWritesInProgress
CkbSettingsWriter::~CkbSettingsWriter ( )

Definition at line 17 of file ckbsettingswriter.cpp.

References cacheWritesInProgress.

17  {
18  cacheWritesInProgress.deref();
19 }
QAtomicInt cacheWritesInProgress

Member Function Documentation

void CkbSettingsWriter::run ( )

Definition at line 21 of file ckbsettingswriter.cpp.

References _backing, _removals, _updates, and lockMutexStatic.

21  {
23  // Process key removals
24  foreach(const QString& rm, _removals){
25  _backing->remove(rm);
26  }
27  // Process writes
28  QMapIterator<QString, QVariant> i(_updates);
29  while(i.hasNext()){
30  i.next();
31  _backing->setValue(i.key(), i.value());
32  // Updating the global cache was done above
33  }
34  _backing->sync();
35  deleteLater();
36 }
#define lockMutexStatic
QMap< QString, QVariant > _updates

Field Documentation

QSettings* CkbSettingsWriter::_backing
private

Definition at line 21 of file ckbsettingswriter.h.

Referenced by run().

QStringList CkbSettingsWriter::_removals
private

Definition at line 22 of file ckbsettingswriter.h.

Referenced by run().

QMap<QString, QVariant> CkbSettingsWriter::_updates
private

Definition at line 23 of file ckbsettingswriter.h.

Referenced by run().


The documentation for this class was generated from the following files: