Merge lp:~gordallott/unity/unity-31-03-11-places-fixes into lp:unity

Proposed by Gord Allott
Status: Merged
Merged at revision: 1078
Proposed branch: lp:~gordallott/unity/unity-31-03-11-places-fixes
Merge into: lp:unity
Diff against target: 214 lines (+72/-9)
5 files modified
src/BamfLauncherIcon.cpp (+36/-3)
src/BamfLauncherIcon.h (+5/-0)
src/PlacesController.cpp (+5/-3)
src/PlacesView.cpp (+22/-1)
src/PlacesView.h (+4/-2)
To merge this branch: bzr merge lp:~gordallott/unity/unity-31-03-11-places-fixes
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+55765@code.launchpad.net

Description of the change

small fixes, bugs attached

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

Reverts out recent changes to trunk???

review: Needs Fixing
Revision history for this message
Gord Allott (gordallott) wrote :

> Reverts out recent changes to trunk???
Trunk would not build at the time, needed to build trunk - obviously would of handled that when merging back into trunk. shouldn't of been marked as needs fixing and has now missed release.

Revision history for this message
Jason Smith (jassmith) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/BamfLauncherIcon.cpp'
--- src/BamfLauncherIcon.cpp 2011-04-02 08:36:07 +0000
+++ src/BamfLauncherIcon.cpp 2011-04-05 09:30:54 +0000
@@ -104,6 +104,8 @@
104BamfLauncherIcon::BamfLauncherIcon (Launcher* IconManager, BamfApplication *app, CompScreen *screen)104BamfLauncherIcon::BamfLauncherIcon (Launcher* IconManager, BamfApplication *app, CompScreen *screen)
105: SimpleLauncherIcon(IconManager)105: SimpleLauncherIcon(IconManager)
106{106{
107 _cached_desktop_file = NULL;
108 _cached_name = NULL;
107 m_App = app;109 m_App = app;
108 m_Screen = screen;110 m_Screen = screen;
109 _remote_uri = 0;111 _remote_uri = 0;
@@ -113,7 +115,7 @@
113 _menu_desktop_shortcuts = NULL;115 _menu_desktop_shortcuts = NULL;
114 char *icon_name = bamf_view_get_icon (BAMF_VIEW (m_App));116 char *icon_name = bamf_view_get_icon (BAMF_VIEW (m_App));
115117
116 SetTooltipText (bamf_view_get_name (BAMF_VIEW (app)));118 SetTooltipText (BamfName ());
117 SetIconName (icon_name);119 SetIconName (icon_name);
118 SetIconType (TYPE_APPLICATION);120 SetIconType (TYPE_APPLICATION);
119121
@@ -172,6 +174,9 @@
172 g_signal_handlers_disconnect_by_func (m_App, (void *) &BamfLauncherIcon::OnClosed, this);174 g_signal_handlers_disconnect_by_func (m_App, (void *) &BamfLauncherIcon::OnClosed, this);
173175
174 g_object_unref (m_App);176 g_object_unref (m_App);
177
178 g_free (_cached_desktop_file);
179 g_free (_cached_name);
175}180}
176181
177void182void
@@ -199,7 +204,35 @@
199const char*204const char*
200BamfLauncherIcon::DesktopFile ()205BamfLauncherIcon::DesktopFile ()
201{206{
202 return bamf_application_get_desktop_file (m_App);207 char *filename = NULL;
208 filename = (char*) bamf_application_get_desktop_file (m_App);
209
210 if (filename != NULL)
211 {
212 if (_cached_desktop_file != NULL)
213 g_free (_cached_desktop_file);
214
215 _cached_desktop_file = g_strdup (filename);
216 }
217
218 return _cached_desktop_file;
219}
220
221const char*
222BamfLauncherIcon::BamfName ()
223{
224 char *name = NULL;
225 name = (char *)bamf_view_get_name (BAMF_VIEW (m_App));
226
227 if (name != NULL)
228 {
229 if (_cached_name != NULL)
230 g_free (_cached_name);
231
232 _cached_name = g_strdup (name);
233 }
234
235 return _cached_name;
203}236}
204237
205void238void
@@ -825,7 +858,7 @@
825 }858 }
826859
827 gchar *app_name;860 gchar *app_name;
828 app_name = g_markup_escape_text (bamf_view_get_name (BAMF_VIEW (m_App)), -1);861 app_name = g_markup_escape_text (BamfName (), -1);
829862
830 item = dbusmenu_menuitem_new ();863 item = dbusmenu_menuitem_new ();
831 dbusmenu_menuitem_property_set (item,864 dbusmenu_menuitem_property_set (item,
832865
=== modified file 'src/BamfLauncherIcon.h'
--- src/BamfLauncherIcon.h 2011-04-02 07:03:30 +0000
+++ src/BamfLauncherIcon.h 2011-04-05 09:30:54 +0000
@@ -66,6 +66,8 @@
66 66
67 std::list<char *> ValidateUrisForLaunch (std::list<char *> uris);67 std::list<char *> ValidateUrisForLaunch (std::list<char *> uris);
6868
69 const char* BamfName ();
70
69private:71private:
70 BamfApplication *m_App;72 BamfApplication *m_App;
71 CompScreen *m_Screen;73 CompScreen *m_Screen;
@@ -80,6 +82,9 @@
80 sigc::connection _on_window_minimized_connection;82 sigc::connection _on_window_minimized_connection;
81 sigc::connection _hidden_changed_connection;83 sigc::connection _hidden_changed_connection;
8284
85 gchar *_cached_desktop_file;
86 gchar *_cached_name;
87
83 void EnsureWindowState ();88 void EnsureWindowState ();
8489
85 void UpdateMenus ();90 void UpdateMenus ();
8691
=== modified file 'src/PlacesController.cpp'
--- src/PlacesController.cpp 2011-03-24 00:35:26 +0000
+++ src/PlacesController.cpp 2011-04-05 09:30:54 +0000
@@ -159,8 +159,6 @@
159 _visible = false;159 _visible = false;
160 _fullscren_request = false;160 _fullscren_request = false;
161161
162 _view->SetActiveEntry (NULL, 0, "");
163
164 StartShowHideTimeline ();162 StartShowHideTimeline ();
165 163
166 ubus_server_send_message (ubus_server_get_default (), UBUS_PLACE_VIEW_HIDDEN, NULL);164 ubus_server_send_message (ubus_server_get_default (), UBUS_PLACE_VIEW_HIDDEN, NULL);
@@ -215,8 +213,12 @@
215 // Make sure the state is right213 // Make sure the state is right
216 self->_window->SetOpacity (self->_visible ? 1.0f : 0.0f);214 self->_window->SetOpacity (self->_visible ? 1.0f : 0.0f);
217 if (!self->_visible)215 if (!self->_visible)
216 {
218 self->_window->ShowWindow (false, false);217 self->_window->ShowWindow (false, false);
219218 //reset the active entry
219 self->_view->SetActiveEntry (NULL, 0, "");
220 }
221
220 return FALSE;222 return FALSE;
221 }223 }
222 return TRUE;224 return TRUE;
223225
=== modified file 'src/PlacesView.cpp'
--- src/PlacesView.cpp 2011-03-31 20:38:49 +0000
+++ src/PlacesView.cpp 2011-04-05 09:30:54 +0000
@@ -41,6 +41,7 @@
4141
42PlacesView::PlacesView (PlaceFactory *factory)42PlacesView::PlacesView (PlaceFactory *factory)
43: nux::View (NUX_TRACKER_LOCATION),43: nux::View (NUX_TRACKER_LOCATION),
44 _close_idle (0),
44 _factory (factory),45 _factory (factory),
45 _entry (NULL),46 _entry (NULL),
46 _size_mode (SIZE_MODE_FULLSCREEN),47 _size_mode (SIZE_MODE_FULLSCREEN),
@@ -134,6 +135,11 @@
134135
135PlacesView::~PlacesView ()136PlacesView::~PlacesView ()
136{137{
138 if (_close_idle != 0)
139 {
140 g_source_remove (_close_idle);
141 _close_idle = 0;
142 }
137 delete _home_entry;143 delete _home_entry;
138}144}
139145
@@ -170,7 +176,6 @@
170 geo.height = _actual_height;176 geo.height = _actual_height;
171 if (!geo.IsPointInside (ievent.e_x, ievent.e_y))177 if (!geo.IsPointInside (ievent.e_x, ievent.e_y))
172 {178 {
173 SetActiveEntry (NULL, 0, "");
174 return TraverseInfo |= nux::eMouseEventSolved;179 return TraverseInfo |= nux::eMouseEventSolved;
175 }180 }
176 }181 }
@@ -419,6 +424,7 @@
419void424void
420PlacesView::SetActiveEntry (PlaceEntry *entry, guint section_id, const char *search_string, bool signal)425PlacesView::SetActiveEntry (PlaceEntry *entry, guint section_id, const char *search_string, bool signal)
421{426{
427
422 if (signal)428 if (signal)
423 entry_changed.emit (entry);429 entry_changed.emit (entry);
424430
@@ -808,7 +814,22 @@
808void814void
809PlacesView::CloseRequest (GVariant *data, PlacesView *self)815PlacesView::CloseRequest (GVariant *data, PlacesView *self)
810{816{
817 if (self->_close_idle != 0)
818 {
819 g_source_remove (self->_close_idle);
820 self->_close_idle = 0;
821 }
822
823 //add a timeout because the home view flashes on close
824 self->_close_idle = g_timeout_add_seconds (100, (GSourceFunc)OnCloseTimeout, self);
825}
826
827gboolean
828PlacesView::OnCloseTimeout (PlacesView *self)
829{
830 self->_close_idle = 0;
811 self->SetActiveEntry (NULL, 0, "");831 self->SetActiveEntry (NULL, 0, "");
832 return FALSE;
812}833}
813834
814nux::TextEntry*835nux::TextEntry*
815836
=== modified file 'src/PlacesView.h'
--- src/PlacesView.h 2011-03-24 01:18:18 +0000
+++ src/PlacesView.h 2011-04-05 09:30:54 +0000
@@ -101,8 +101,8 @@
101 void AddProperties (GVariantBuilder *builder);101 void AddProperties (GVariantBuilder *builder);
102102
103private:103private:
104 static void CloseRequest (GVariant *data, PlacesView *self);104 static void CloseRequest (GVariant *data, PlacesView *self);
105105 static gboolean OnCloseTimeout (PlacesView *self);
106 void OnGroupAdded (PlaceEntry *entry, PlaceEntryGroup& group);106 void OnGroupAdded (PlaceEntry *entry, PlaceEntryGroup& group);
107 void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);107 void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);
108 void OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);108 void OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);
@@ -130,6 +130,8 @@
130 static gboolean OnSearchTimedOut (PlacesView *view);130 static gboolean OnSearchTimedOut (PlacesView *view);
131131
132private:132private:
133 guint _close_idle;
134
133 PlaceFactory *_factory;135 PlaceFactory *_factory;
134 nux::HLayout *_layout;136 nux::HLayout *_layout;
135 nux::LayeredLayout *_layered_layout;137 nux::LayeredLayout *_layered_layout;