hrev45348 adds 1 changeset to branch 'master' old head: eb594c5cd5a3a6b8b89be13f22f0e2731273bcae new head: a595db17d6d26d923045f93a9a6277bda66444b8 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=a595db1+%5Eeb594c5 ---------------------------------------------------------------------------- a595db1: Further simplify the Time tooltips by using SetToolTip. [ Ryan Leavengood <leavengood@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev45348 Commit: a595db17d6d26d923045f93a9a6277bda66444b8 URL: http://cgit.haiku-os.org/haiku/commit/?id=a595db1 Author: Ryan Leavengood <leavengood@xxxxxxxxx> Date: Thu Mar 7 14:30:04 2013 UTC ---------------------------------------------------------------------------- 2 files changed, 3 insertions(+), 18 deletions(-) src/preferences/time/TimeZoneListView.cpp | 15 +++------------ src/preferences/time/TimeZoneListView.h | 6 ------ ---------------------------------------------------------------------------- diff --git a/src/preferences/time/TimeZoneListView.cpp b/src/preferences/time/TimeZoneListView.cpp index aa75195..84598c6 100644 --- a/src/preferences/time/TimeZoneListView.cpp +++ b/src/preferences/time/TimeZoneListView.cpp @@ -26,16 +26,13 @@ TimeZoneListView::TimeZoneListView(void) : - BOutlineListView("cityList", B_SINGLE_SELECTION_LIST), - fToolTip(NULL) + BOutlineListView("cityList", B_SINGLE_SELECTION_LIST) { } TimeZoneListView::~TimeZoneListView() { - if (fToolTip != NULL) - fToolTip->ReleaseReference(); } @@ -62,15 +59,9 @@ TimeZoneListView::GetToolTipAt(BPoint point, BToolTip** _tip) << B_TRANSLATE("\nNow: ") << nowInTimeZone << " (" << dateInTimeZone << ')'; - if (fToolTip != NULL) - fToolTip->SetText(toolTip.String()); - else { - fToolTip = new (std::nothrow) BTextToolTip(toolTip.String()); - if (fToolTip == NULL) - return false; - } + SetToolTip(toolTip.String()); - *_tip = fToolTip; + *_tip = ToolTip(); return true; } diff --git a/src/preferences/time/TimeZoneListView.h b/src/preferences/time/TimeZoneListView.h index 0b9fd48..7814e84 100644 --- a/src/preferences/time/TimeZoneListView.h +++ b/src/preferences/time/TimeZoneListView.h @@ -12,9 +12,6 @@ #include <OutlineListView.h> -class BTextToolTip; - - class TimeZoneListView : public BOutlineListView { public: TimeZoneListView(void); @@ -22,9 +19,6 @@ public: protected: virtual bool GetToolTipAt(BPoint point, BToolTip** _tip); - -private: - BTextToolTip* fToolTip; };