[gnote] Make EmbeddableWidget re-embeddable
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Make EmbeddableWidget re-embeddable
- Date: Mon, 11 Feb 2013 21:03:54 +0000 (UTC)
commit 9ec86c600eb0ac7776d22890cfc636f12d33d233
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Mon Feb 11 23:01:50 2013 +0200
Make EmbeddableWidget re-embeddable
Move relevant code from NoteWindow.
src/notewindow.cpp | 9 ---------
src/notewindow.hpp | 1 -
src/utils.hpp | 4 ++++
3 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 4a66ac6..64882e7 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -160,15 +160,6 @@ namespace gnote {
signal_name_changed(m_name);
}
- void NoteWindow::embed(utils::EmbeddableWidgetHost *h)
- {
- //remove from previous host, if any
- if(host()) {
- host()->unembed_widget(*this);
- }
- utils::EmbeddableWidget::embed(h);
- }
-
void NoteWindow::foreground()
{
//addins may add accelarators, so accel group must be there
diff --git a/src/notewindow.hpp b/src/notewindow.hpp
index 941ea62..941d00c 100644
--- a/src/notewindow.hpp
+++ b/src/notewindow.hpp
@@ -108,7 +108,6 @@ public:
virtual std::string get_name() const;
void set_name(const std::string & name);
- virtual void embed(utils::EmbeddableWidgetHost *h);
virtual void foreground();
virtual void background();
diff --git a/src/utils.hpp b/src/utils.hpp
index 4c6c316..089e1a9 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -261,6 +261,10 @@ namespace gnote {
virtual std::string get_name() const = 0;
virtual void embed(EmbeddableWidgetHost *h)
{
+ //remove from previous host, if any
+ if(m_host) {
+ m_host->unembed_widget(*this);
+ }
m_host = h;
signal_embedded();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]