diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-06-24 12:48:06 -0400 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-06-24 12:48:06 -0400 |
commit | edad4063970e74ac826c5a01c09e9c3917eca40f (patch) | |
tree | 0a088cb744f1d20a67d536a61a4677b35e9ca268 /libqmenumodel/src | |
parent | f59e06eaf20e69ee5ab3c7b5cc2734463b37dae4 (diff) | |
download | qmenumodel-edad4063970e74ac826c5a01c09e9c3917eca40f.tar.gz qmenumodel-edad4063970e74ac826c5a01c09e9c3917eca40f.tar.bz2 qmenumodel-edad4063970e74ac826c5a01c09e9c3917eca40f.zip |
unitymenumodel: remove forSubMenu
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r-- | libqmenumodel/src/unitymenumodel.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index f370832..4507c29 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -37,9 +37,6 @@ class UnityMenuModelPrivate { public: UnityMenuModelPrivate(UnityMenuModel *model); - - static UnityMenuModelPrivate * forSubMenu(UnityMenuModel *model, GtkMenuTrackerItem *item); - ~UnityMenuModelPrivate(); void clearItems(bool resetModel=true); @@ -86,6 +83,7 @@ UnityMenuModelPrivate::UnityMenuModelPrivate(UnityMenuModel *model) { this->model = model; this->menutracker = NULL; + this->connection = NULL; this->nameWatchId = 0; this->muxer = gtk_action_muxer_new (); @@ -94,15 +92,6 @@ UnityMenuModelPrivate::UnityMenuModelPrivate(UnityMenuModel *model) this->items = g_sequence_new (NULL); } -UnityMenuModelPrivate * UnityMenuModelPrivate::forSubMenu(UnityMenuModel *model, GtkMenuTrackerItem *item) -{ - UnityMenuModelPrivate *priv = new UnityMenuModelPrivate(model); - - priv->menutracker = gtk_menu_tracker_new_for_item_submenu (item, menuItemInserted, menuItemRemoved, priv); - - return priv; -} - UnityMenuModelPrivate::~UnityMenuModelPrivate() { this->clearItems(false); @@ -370,7 +359,11 @@ QObject * UnityMenuModel::submenu(int position) model = (UnityMenuModel *) g_object_get_qdata (G_OBJECT (item), unity_submenu_model_quark ()); if (model == NULL) { model = new UnityMenuModel(this); - model->priv = UnityMenuModelPrivate::forSubMenu(model, item); + model->priv = new UnityMenuModelPrivate(model); + model->priv->menutracker = gtk_menu_tracker_new_for_item_submenu (item, + UnityMenuModelPrivate::menuItemInserted, + UnityMenuModelPrivate::menuItemRemoved, + model->priv); g_object_set_qdata (G_OBJECT (item), unity_submenu_model_quark (), model); } |