Refactor Deskbar preferences window.

* Remove locking from Prefs window QuitRequested(), thanks Axel.
* Remove kConfigClose message, no longer needed since window sticks
  around and is hidden on close instead of being deleted.
* delete fPreferencesWindow on BarApp QuitRequested() so it will
  remove the memory used by preference window when Deskbar quits.
This commit is contained in:
John Scipione 2012-12-21 16:16:39 -05:00
parent ee70bd8b1f
commit 879fe42c09
3 changed files with 2 additions and 16 deletions

View File

@ -184,6 +184,7 @@ TBarApp::QuitRequested()
fPreferencesWindow->PostMessage(B_QUIT_REQUESTED);
fPreferencesWindow->Unlock();
}
delete fPreferencesWindow;
break;
}
}
@ -480,10 +481,6 @@ TBarApp::MessageReceived(BMessage* message)
fSettings.recentDocsEnabled = enabled && count > 0;
break;
case kConfigClose:
fPreferencesWindow = NULL;
break;
case B_SOME_APP_LAUNCHED:
{
team_id team = -1;

View File

@ -288,7 +288,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
PreferencesWindow::~PreferencesWindow()
{
UpdateRecentCounts();
be_app->PostMessage(kConfigClose);
}
@ -327,19 +326,10 @@ PreferencesWindow::MessageReceived(BMessage* message)
bool
PreferencesWindow::QuitRequested()
{
bool isHidden = false;
if (Lock()) {
isHidden = IsHidden();
Unlock();
} else
return true;
if (isHidden)
if (IsHidden())
return true;
Hide();
return false;
}

View File

@ -10,7 +10,6 @@
const uint32 kConfigShow = 'show';
const uint32 kConfigClose = 'canc';
const uint32 kUpdateRecentCounts = 'upct';
const uint32 kEditMenuInTracker = 'mtrk';