[haiku-commits] r42756 - haiku/trunk/src/apps/debugger/user_interface/gui/teams_window

  • From: philippe.houdoin@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 16 Sep 2011 21:31:02 +0200 (CEST)

Author: phoudoin
Date: 2011-09-16 21:31:02 +0200 (Fri, 16 Sep 2011)
New Revision: 42756
Changeset: https://dev.haiku-os.org/changeset/42756
Ticket: https://dev.haiku-os.org/ticket/7988

Modified:
   
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp
   haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h
Log:
Do an explicit row's update when it's needed.
This should close #7988 this time, hopefully.


Modified: 
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp
===================================================================
--- 
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp 
    2011-09-15 22:14:00 UTC (rev 42755)
+++ 
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.cpp 
    2011-09-16 19:31:02 UTC (rev 42756)
@@ -201,18 +201,19 @@
 }
 
 
-status_t
-TeamRow::UpdateInfo(team_info& info)
+bool
+TeamRow::NeedsUpdate(team_info& info)
 {
        // Check if we need to rebuilt the row's fields because the team 
critical 
        // info (basically, app image running under that team ID) has changed
        
        if (info.argc != fTeamInfo.argc 
                || strncmp(info.args, fTeamInfo.args, sizeof(fTeamInfo.args)) 
!= 0) {
-               return _SetTo(info);
+               _SetTo(info);
+               return true;
        }
        
-       return B_OK;
+       return false;
 }                      
 
 
@@ -442,9 +443,10 @@
                                row = dynamic_cast<TeamRow*>(RowAt(index));
                }
 
-               if (row != NULL && tmi.team == row->TeamID()) {
+               if (row != NULL && tmi.team == row->TeamID()
+                       && row->NeedsUpdate(tmi)) {
                        // The team image app could have change due after an 
exec*() call, 
-                       row->UpdateInfo(tmi);
+                       UpdateRow(row);
                } else if (row == NULL || tmi.team != row->TeamID()) {
                        // Team not found in previously known teams list: 
insert a new row
                        TeamRow* newRow = new(std::nothrow) TeamRow(tmi);

Modified: 
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h
===================================================================
--- 
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h   
    2011-09-15 22:14:00 UTC (rev 42755)
+++ 
haiku/trunk/src/apps/debugger/user_interface/gui/teams_window/TeamsListView.h   
    2011-09-16 19:31:02 UTC (rev 42756)
@@ -69,7 +69,7 @@
 public:
                        team_id                         TeamID() const          
                { return fTeamInfo.team; }
 
-                       status_t                        UpdateInfo(team_info& 
info);
+                       bool                            NeedsUpdate(team_info& 
info);
 
        virtual void                            SetEnabled(bool enabled)        
{ fEnabled = enabled; }
                        bool                            IsEnabled() const       
                { return fEnabled; }


Other related posts:

  • » [haiku-commits] r42756 - haiku/trunk/src/apps/debugger/user_interface/gui/teams_window - philippe . houdoin