summaryrefslogtreecommitdiffstats
path: root/arts/modules/common/env_item_impl.cc
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /arts/modules/common/env_item_impl.cc
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'arts/modules/common/env_item_impl.cc')
-rw-r--r--arts/modules/common/env_item_impl.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/arts/modules/common/env_item_impl.cc b/arts/modules/common/env_item_impl.cc
new file mode 100644
index 00000000..6bc960d8
--- /dev/null
+++ b/arts/modules/common/env_item_impl.cc
@@ -0,0 +1,48 @@
+#include "artsmodulescommon.h"
+#include "debug.h"
+#include "env_item_impl.h"
+
+using namespace Arts;
+using namespace std;
+
+Environment::Item_impl::Item_impl()
+ : _active(false)
+{
+}
+
+Environment::Item_impl::~Item_impl()
+{
+ // Items can't be deleted while they are still inside a Container
+ arts_assert(_active == false);
+}
+
+Environment::Container Environment::Item_impl::parent()
+{
+ Container p = _parent;
+ return p;
+}
+
+void Environment::Item_impl::setContainer(Environment::Container container)
+{
+ if(container.isNull()) // remove from container
+ {
+ arts_return_if_fail(_active == true);
+
+ _parent = container;
+ _active = false;
+ }
+ else // add to container
+ {
+ Container p = _parent;
+ arts_return_if_fail(p.isNull() && _active == false);
+
+ _parent = container;
+ _active = true;
+ }
+ active_changed(_active);
+}
+
+bool Environment::Item_impl::active()
+{
+ return _active;
+}