Build fix. CID 3165 FORWARD_NULL, avoid casting be_app.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40986 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
#include <Entry.h>
|
||||
#include <Directory.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <String.h>
|
||||
#include <TranslatorRoster.h>
|
||||
#include <TextView.h>
|
||||
|
||||
#include "DataTranslationsSettings.h"
|
||||
#include "DataTranslationsWindow.h"
|
||||
|
||||
|
||||
@@ -43,13 +43,6 @@ DataTranslationsApplication::~DataTranslationsApplication()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DataTranslationsApplication::SetWindowCorner(const BPoint& leftTop)
|
||||
{
|
||||
fSettings.SetWindowCorner(leftTop);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DataTranslationsApplication::AboutRequested()
|
||||
{
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
|
||||
#include <Application.h>
|
||||
|
||||
#include "DataTranslationsSettings.h"
|
||||
|
||||
|
||||
class BDirectory;
|
||||
class BEntry;
|
||||
@@ -28,18 +26,10 @@ public:
|
||||
virtual void RefsReceived(BMessage* message);
|
||||
virtual void AboutRequested();
|
||||
|
||||
BPoint WindowCorner() const {
|
||||
return fSettings.WindowCorner();
|
||||
}
|
||||
void SetWindowCorner(const BPoint& leftTop);
|
||||
|
||||
private:
|
||||
void _InstallError(const char* name, status_t status);
|
||||
status_t _Install(BDirectory& target, BEntry& entry);
|
||||
void _NoTranslatorError(const char* name);
|
||||
|
||||
private:
|
||||
DataTranslationsSettings fSettings;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
#include <Path.h>
|
||||
|
||||
|
||||
static DataTranslationsSettings sDataTranslationsSettings;
|
||||
|
||||
|
||||
DataTranslationsSettings::DataTranslationsSettings()
|
||||
{
|
||||
BPath path;
|
||||
@@ -61,3 +64,10 @@ DataTranslationsSettings::SetWindowCorner(BPoint corner)
|
||||
{
|
||||
fCorner = corner;
|
||||
}
|
||||
|
||||
|
||||
DataTranslationsSettings*
|
||||
DataTranslationsSettings::Instance()
|
||||
{
|
||||
return &sDataTranslationsSettings;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ public:
|
||||
BPoint WindowCorner() const { return fCorner; }
|
||||
void SetWindowCorner(BPoint corner);
|
||||
|
||||
static DataTranslationsSettings* Instance();
|
||||
|
||||
private:
|
||||
BPoint fCorner;
|
||||
};
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <TranslatorRoster.h>
|
||||
|
||||
#include "DataTranslations.h"
|
||||
#include "DataTranslationsSettings.h"
|
||||
#include "IconView.h"
|
||||
#include "TranslatorListView.h"
|
||||
|
||||
@@ -52,7 +53,7 @@ DataTranslationsWindow::DataTranslationsWindow()
|
||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
||||
| B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS)
|
||||
{
|
||||
MoveTo(static_cast<DataTranslationsApplication*>(be_app)->WindowCorner());
|
||||
MoveTo(DataTranslationsSettings::Instance()->WindowCorner());
|
||||
|
||||
_SetupViews();
|
||||
|
||||
@@ -210,9 +211,8 @@ bool
|
||||
DataTranslationsWindow::QuitRequested()
|
||||
{
|
||||
BPoint pt(Frame().LeftTop());
|
||||
dynamic_cast<DataTranslationsApplication*>(be_app)->SetWindowCorner(pt);
|
||||
DataTranslationsSettings::Instance()->SetWindowCorner(pt);
|
||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user