gconfmm 2.28.3
Gnome::Conf::ChangeSet Class Reference

A ChangeSet is a set of changes to the GConf database that can be commited and reversed easily. More...

#include <gconfmm/changeset.h>

Inheritance diagram for Gnome::Conf::ChangeSet:
Collaboration diagram for Gnome::Conf::ChangeSet:

Public Types

typedef sigc::slot< void, const Glib::ustring&, const Value& > ForeachSlot
 

Public Member Functions

 ChangeSet ()
 
 ChangeSet (GConfChangeSet* castitem, bool make_a_copy=false)
 
 ChangeSet (const ChangeSet& src)
 
ChangeSetoperator= (const ChangeSet& src)
 
virtual ~ChangeSet ()
 
GConfChangeSet* gobj ()
 
const GConfChangeSet* gobj () const
 
GConfChangeSet* gobj_copy () const
 
void clear ()
 Clear all entries.
 
unsigned int size () const
 Returns the number of keys in the changeset.
 
void remove (const Glib::ustring& key)
 Remove the specified key from the changeset.
 
Valueexists (const Glib::ustring& key) const
 Check whether the given key will be modified by a commit operation.
 
void unset (const Glib::ustring& key)
 Unset the given key.
 
virtual void set (const Glib::ustring& key, const Value& value)
 
virtual void set (const Glib::ustring& key, bool what)
 
virtual void set (const Glib::ustring& key, int what)
 
virtual void set (const Glib::ustring& key, double what)
 
virtual void set (const Glib::ustring& key, const Glib::ustring& what)
 
virtual void set (const Glib::ustring& key, const Schema& what)
 
void for_each (const ForeachSlot& slot)
 Iterate over the keys marked in this ChangeSet.
 
- Public Member Functions inherited from Gnome::Conf::SetInterface
void set (const Glib::ustring& key, const ValuePair&pair)
 
void set_int_list (const Glib::ustring& key, const SListHandle_ValueInt& list)
 
void set_bool_list (const Glib::ustring& key, const SListHandle_ValueBool& list)
 
void set_float_list (const Glib::ustring& key, const SListHandle_ValueFloat& list)
 
void set_string_list (const Glib::ustring& key, const SListHandle_ValueString& list)
 
void set_schema_list (const Glib::ustring& key, const SListHandle_ValueSchema& list)
 

Protected Attributes

GConfChangeSet* gobject_
 

Detailed Description

A ChangeSet is a set of changes to the GConf database that can be commited and reversed easily.

The changes can be both set and unset operations. Currently the ChangeSet operations are not atomic, and not specially optimized for. However, it is suitable for use, for instance, preferences dialogs.

The set*() methods do not throw errors, they simply store the keys and the values.

See also
Client::change_set_from_current(), Client::change_set_commit(), Client::change_set_reverse().

Member Typedef Documentation

◆ ForeachSlot

typedef sigc::slot<void, const Glib::ustring&, const Value&> Gnome::Conf::ChangeSet::ForeachSlot

Constructor & Destructor Documentation

◆ ChangeSet() [1/3]

Gnome::Conf::ChangeSet::ChangeSet ( )

◆ ChangeSet() [2/3]

Gnome::Conf::ChangeSet::ChangeSet ( GConfChangeSet * castitem,
bool make_a_copy = false )
explicit

◆ ChangeSet() [3/3]

Gnome::Conf::ChangeSet::ChangeSet ( const ChangeSet& src)

◆ ~ChangeSet()

virtual Gnome::Conf::ChangeSet::~ChangeSet ( )
virtual

Member Function Documentation

◆ clear()

void Gnome::Conf::ChangeSet::clear ( )

Clear all entries.

After this method, commiting the changeset is a no-op.

◆ exists()

Value* Gnome::Conf::ChangeSet::exists ( const Glib::ustring & key) const

Check whether the given key will be modified by a commit operation.

Returns
0 if the key will not be modified, else the modified value. Remember to delete the Value.

◆ for_each()

void Gnome::Conf::ChangeSet::for_each ( const ForeachSlot& slot)

Iterate over the keys marked in this ChangeSet.

Calls slot for each key-value pair that is marked in the ChangeSet. Keys marked unset will have a Value with type VALUE_INVALID.

◆ gobj() [1/2]

GConfChangeSet * Gnome::Conf::ChangeSet::gobj ( )
inline

◆ gobj() [2/2]

const GConfChangeSet * Gnome::Conf::ChangeSet::gobj ( ) const
inline

◆ gobj_copy()

GConfChangeSet * Gnome::Conf::ChangeSet::gobj_copy ( ) const

◆ operator=()

ChangeSet& Gnome::Conf::ChangeSet::operator= ( const ChangeSet& src)

◆ remove()

void Gnome::Conf::ChangeSet::remove ( const Glib::ustring & key)

Remove the specified key from the changeset.

This means that the given key will not be modified by a commit.

◆ set() [1/6]

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring & key,
bool what )
virtual

◆ set() [2/6]

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring & key,
const Glib::ustring & what )
virtual

◆ set() [3/6]

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring & key,
const Schema& what )
virtual

◆ set() [4/6]

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring & key,
const Value& value )
virtual

◆ set() [5/6]

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring & key,
double what )
virtual

◆ set() [6/6]

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring & key,
int what )
virtual

◆ size()

unsigned int Gnome::Conf::ChangeSet::size ( ) const

Returns the number of keys in the changeset.

◆ unset()

void Gnome::Conf::ChangeSet::unset ( const Glib::ustring & key)

Unset the given key.

Mark the key, so that it will be removed from the configuration database during a commit.

Member Data Documentation

◆ gobject_

GConfChangeSet* Gnome::Conf::ChangeSet::gobject_
protected

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