Tracker: style fixes to ContainerWindow
This commit is contained in:
@@ -167,10 +167,11 @@ ActivateWindowFilter(BMessage*, BHandler** target, BMessageFilter*)
|
|||||||
// activate the window if no PoseView or DraggableContainerIcon had been
|
// activate the window if no PoseView or DraggableContainerIcon had been
|
||||||
// pressed (those will activate the window themselves, if necessary)
|
// pressed (those will activate the window themselves, if necessary)
|
||||||
if (view != NULL
|
if (view != NULL
|
||||||
&& !dynamic_cast<BPoseView*>(view)
|
&& dynamic_cast<BPoseView*>(view) == NULL
|
||||||
&& !dynamic_cast<DraggableContainerIcon*>(view)
|
&& dynamic_cast<DraggableContainerIcon*>(view) == NULL
|
||||||
&& view->Window())
|
&& view->Window() != NULL) {
|
||||||
view->Window()->Activate(true);
|
view->Window()->Activate(true);
|
||||||
|
}
|
||||||
|
|
||||||
return B_DISPATCH_MESSAGE;
|
return B_DISPATCH_MESSAGE;
|
||||||
}
|
}
|
||||||
@@ -570,14 +571,14 @@ BContainerWindow::BContainerWindow(LockingList<BWindow>* list,
|
|||||||
|
|
||||||
Run();
|
Run();
|
||||||
|
|
||||||
// Watch out for settings changes:
|
// watch out for settings changes
|
||||||
if (TTracker* app = dynamic_cast<TTracker*>(be_app)) {
|
TTracker* tracker = dynamic_cast<TTracker*>(be_app);
|
||||||
app->Lock();
|
if (tracker != NULL && tracker->Lock()) {
|
||||||
app->StartWatching(this, kWindowsShowFullPathChanged);
|
tracker->StartWatching(this, kWindowsShowFullPathChanged);
|
||||||
app->StartWatching(this, kSingleWindowBrowseChanged);
|
tracker->StartWatching(this, kSingleWindowBrowseChanged);
|
||||||
app->StartWatching(this, kShowNavigatorChanged);
|
tracker->StartWatching(this, kShowNavigatorChanged);
|
||||||
app->StartWatching(this, kDontMoveFilesToTrashChanged);
|
tracker->StartWatching(this, kDontMoveFilesToTrashChanged);
|
||||||
app->Unlock();
|
tracker->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToDo: remove me once we have undo/redo menu items
|
// ToDo: remove me once we have undo/redo menu items
|
||||||
@@ -592,13 +593,13 @@ BContainerWindow::~BContainerWindow()
|
|||||||
ASSERT(IsLocked());
|
ASSERT(IsLocked());
|
||||||
|
|
||||||
// stop the watchers
|
// stop the watchers
|
||||||
if (TTracker* app = dynamic_cast<TTracker*>(be_app)) {
|
TTracker* tracker = dynamic_cast<TTracker*>(be_app);
|
||||||
app->Lock();
|
if (tracker != NULL && tracker->Lock()) {
|
||||||
app->StopWatching(this, kWindowsShowFullPathChanged);
|
tracker->StopWatching(this, kWindowsShowFullPathChanged);
|
||||||
app->StopWatching(this, kSingleWindowBrowseChanged);
|
tracker->StopWatching(this, kSingleWindowBrowseChanged);
|
||||||
app->StopWatching(this, kShowNavigatorChanged);
|
tracker->StopWatching(this, kShowNavigatorChanged);
|
||||||
app->StopWatching(this, kDontMoveFilesToTrashChanged);
|
tracker->StopWatching(this, kDontMoveFilesToTrashChanged);
|
||||||
app->Unlock();
|
tracker->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fTaskLoop;
|
delete fTaskLoop;
|
||||||
@@ -3924,7 +3925,7 @@ BContainerWindow::RestoreWindowState(AttributeStreamNode* node)
|
|||||||
void
|
void
|
||||||
BContainerWindow::RestoreWindowState(const BMessage& message)
|
BContainerWindow::RestoreWindowState(const BMessage& message)
|
||||||
{
|
{
|
||||||
if (dynamic_cast<BDeskWindow*>(this)) {
|
if (dynamic_cast<BDeskWindow*>(this) != NULL) {
|
||||||
// don't restore any window state if we are the Desktop
|
// don't restore any window state if we are the Desktop
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -4411,7 +4412,7 @@ BackgroundView::PoseViewFocused(bool focused)
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
||||||
BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
|
BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
|
||||||
if (!window)
|
if (window == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BScrollBar* hScrollBar = window->PoseView()->HScrollBar();
|
BScrollBar* hScrollBar = window->PoseView()->HScrollBar();
|
||||||
@@ -4439,7 +4440,7 @@ void
|
|||||||
BackgroundView::Draw(BRect updateRect)
|
BackgroundView::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
|
BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
|
||||||
if (!window)
|
if (window == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BPoseView* poseView = window->PoseView();
|
BPoseView* poseView = window->PoseView();
|
||||||
@@ -4495,6 +4496,6 @@ void
|
|||||||
BackgroundView::Pulse()
|
BackgroundView::Pulse()
|
||||||
{
|
{
|
||||||
BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
|
BContainerWindow* window = dynamic_cast<BContainerWindow*>(Window());
|
||||||
if (window)
|
if (window != NULL)
|
||||||
window->PulseTaskLoop();
|
window->PulseTaskLoop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user