summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e6d8ac)
raw | patch | inline | side by side (parent: 5e6d8ac)
author | mental <mental@users.sourceforge.net> | |
Sat, 29 Jul 2006 21:25:37 +0000 (21:25 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sat, 29 Jul 2006 21:25:37 +0000 (21:25 +0000) |
ChangeLog | patch | blob | history | |
src/sp-switch.cpp | patch | blob | history | |
src/sp-switch.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index af5c3eb0b2c653b3e85e007ba7aafacf97173442..056d54fc4836ed39490d9caa13a03a8a5546f18f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
* src/desktop.cpp, src/desktop.h, src/sp-gradient.cpp,
src/sp-gradient.h, src/sp-pattern.cpp, src/sp-pattern.h,
- src/widgets/desktop-widget.cpp, src/widgets/desktop-widget.h,
- src/widgets/gradient-image.cpp, src/widgets/gradient-image.h,
- src/widgets/gradient-toolbar.cpp, src/widgets/gradient-toolbar.cpp:
+ src/sp-switch.cpp, src/sp-switch.h, src/widgets/desktop-widget.cpp,
+ src/widgets/desktop-widget.h, src/widgets/gradient-image.cpp,
+ src/widgets/gradient-image.h, src/widgets/gradient-toolbar.cpp,
+ src/widgets/gradient-toolbar.cpp:
switch to sigc++ SPObject signals
diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp
index 65ecc5442ffbe0a3824b444d33c8672a0fba8086..bafb9de18241b8cac4bab43a7ee1873b855ab452 100644 (file)
--- a/src/sp-switch.cpp
+++ b/src/sp-switch.cpp
*
* Authors:
* Andrius R. <knutux@gmail.com>
+ * MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2006 authors
*
#include "display/nr-arena-group.h"
#include "conditions.h"
+#include <sigc++/functors/ptr_fun.h>
+#include <sigc++/adaptors/bind.h>
+
static void sp_switch_class_init (SPSwitchClass *klass);
static void sp_switch_init (SPSwitch *group);
group->group = new CSwitch(group);
}
-CSwitch::CSwitch(SPGroup *group) : CGroup(group), _cached_item(NULL), _release_handler_id(0) {
+CSwitch::CSwitch(SPGroup *group) : CGroup(group), _cached_item(NULL) {
}
CSwitch::~CSwitch() {
}
_cached_item = evaluated_child;
- _release_handler_id = g_signal_connect(
- G_OBJECT(evaluated_child), "release",
- G_CALLBACK(&CSwitch::_releaseItem),
- this);
+ _release_connection = evaluated_child->connectRelease(sigc::bind(sigc::ptr_fun(&CSwitch::_releaseItem), this));
_group->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
}
if (NULL == _cached_item || _cached_item != obj)
return;
- g_signal_handler_disconnect(G_OBJECT(_cached_item), _release_handler_id);
- _release_handler_id = 0;
+ _release_connection.disconnect();
_cached_item = NULL;
}
diff --git a/src/sp-switch.h b/src/sp-switch.h
index 421d562ab0e772c88b5d280b05111202a97e8008..91fdcae46f23c09ef3ce2c888efcf3fe3c57ef51 100644 (file)
--- a/src/sp-switch.h
+++ b/src/sp-switch.h
#include "sp-item-group.h"
+#include <sigc++/connection.h>
+
#define SP_TYPE_SWITCH (CSwitch::getType())
#define SP_SWITCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_SWITCH, SPSwitch))
#define SP_SWITCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_SWITCH, SPSwitchClass))
private:
SPObject *_cached_item;
- gulong _release_handler_id;
+ sigc::connection _release_connection;
};
struct SPSwitch : public SPGroup {