Fix some style violations.

This commit is contained in:
plfiorini 2010-05-19 22:28:26 +00:00
parent c67f1936c0
commit 4412809657
17 changed files with 68 additions and 58 deletions

View File

@ -17,7 +17,7 @@
AboutWindow::AboutWindow(const char* appName, const char** holders,
const char** authors, const char* extraInfo)
const char** authors, const char* extraInfo)
{
fAppName = new BString(appName);

View File

@ -11,7 +11,7 @@
class AboutWindow {
public:
AboutWindow(const char* appName, const char** holders,
const char** authors, const char* extraInfo = NULL);
const char** authors, const char* extraInfo = NULL);
virtual ~AboutWindow();
void Show();

View File

@ -17,8 +17,9 @@
Account::Account(bigtime_t instanceId, CayaProtocol* cayap,
const char* name, BHandler* target)
: fIdentifier(instanceId),
const char* name, BHandler* target)
:
fIdentifier(instanceId),
fName(name),
fProtocol(cayap),
fMessenger(target),
@ -59,9 +60,9 @@ Account::Name() const
}
status_t
status_t
Account::SendMessage(BMessage* message)
{
message->AddInt64("instance", fIdentifier);
return fMessenger.SendMessage(message);
return fMessenger.SendMessage(message);
}

View File

@ -17,7 +17,8 @@ static AccountManager* fInstance = NULL;
AccountManager::AccountManager()
: fStatus(CAYA_OFFLINE)
:
fStatus(CAYA_OFFLINE)
{
TheApp* theApp = reinterpret_cast<TheApp*>(be_app);
RegisterObserver(theApp->GetMainWindow());

View File

@ -16,7 +16,8 @@
CayaProtocolAddOn::CayaProtocolAddOn(image_id image, const char* path)
: fImage(image),
:
fImage(image),
fPath(path),
fIcon(NULL)
{

View File

@ -33,7 +33,8 @@
ChatWindow::ChatWindow(ContactLinker* cl)
: BWindow(BRect(200, 200, 500, 500),
:
BWindow(BRect(200, 200, 500, 500),
cl->GetName().String(), B_DOCUMENT_WINDOW, 0),
fContactLinker(cl)
{
@ -77,7 +78,7 @@ ChatWindow::QuitRequested()
void
ChatWindow::MessageReceived(BMessage* message)
{
switch(message->what) {
switch (message->what) {
case CAYA_CHAT:
{
BString message = fSendView->Text();
@ -122,10 +123,10 @@ ChatWindow::ImMessage(BMessage* msg)
}
void
void
ChatWindow::ObserveString(int32 what, BString str)
{
switch(what) {
switch (what) {
case STR_CONTACT_NAME:
if (Lock()){
SetTitle(str);
@ -139,7 +140,7 @@ ChatWindow::ObserveString(int32 what, BString str)
}
void
void
ChatWindow::ObservePointer(int32 what, void* ptr)
{
switch (what) {
@ -149,7 +150,7 @@ ChatWindow::ObservePointer(int32 what, void* ptr)
}
void
void
ChatWindow::ObserveInteger(int32 what, int32 val)
{
switch (what) {
@ -168,25 +169,25 @@ ChatWindow::AppendStatus(CayaStatus status)
{
BString message(fContactLinker->GetName());
switch (status) {
switch (status) {
case CAYA_ONLINE:
message << " is available";
break;
case CAYA_EXTENDED_AWAY:
case CAYA_AWAY:
break;
case CAYA_EXTENDED_AWAY:
case CAYA_AWAY:
message << " is away";
break;
case CAYA_DO_NOT_DISTURB:
break;
case CAYA_DO_NOT_DISTURB:
message << " is busy, please do not disturb!";
break;
case CAYA_OFFLINE:
break;
case CAYA_OFFLINE:
message << " is offline";
break;
break;
default:
break;
break;
}
fReceiveView->Append(message.String(), COL_TEXT, COL_TEXT, R_TEXT);
fReceiveView->Append(message.String(), COL_TEXT, COL_TEXT, R_TEXT);
fReceiveView->Append("\n", COL_TEXT, COL_TEXT, R_TEXT);
fReceiveView->ScrollToSelection();
}

View File

@ -20,7 +20,8 @@
#include "CayaPreferences.h"
ContactLinker::ContactLinker(BString id, BMessenger msgn)
: fChatWindow(NULL),
:
fChatWindow(NULL),
fID(id),
fName(id),
fMessenger(msgn),

View File

@ -15,7 +15,8 @@
EditingFilter::EditingFilter(BTextView* view)
: BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN, NULL),
:
BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, B_KEY_DOWN, NULL),
_view(view)
{
}

View File

@ -23,8 +23,8 @@ ImageCache::ImageCache()
ImageCache::~ImageCache()
{
while(m_bitmaps.CountItems()) {
BBitmap* bit=m_bitmaps.ValueFor(0);
while (m_bitmaps.CountItems()) {
BBitmap* bit = m_bitmaps.ValueFor(0);
delete bit;
}
}

View File

@ -8,6 +8,7 @@
#include "TheApp.h"
int
main(int argc, char* argv[])
{

View File

@ -44,14 +44,15 @@
#include "Server.h"
#include "StatusView.h"
const uint32 kLogin = 'LOGI';
const uint32 kLogin = 'LOGI';
const uint32 kSearchContact = 'SRCH';
const uint32 kPreferences = 'WPRF';
const uint32 kPreferences = 'WPRF';
MainWindow::MainWindow()
: BWindow(BRect(0, 0, 300, 400), "Caya", B_DOCUMENT_WINDOW, 0)
:
BWindow(BRect(0, 0, 300, 400), "Caya", B_DOCUMENT_WINDOW, 0)
{
fStatusView = new StatusView("statusView");
@ -184,7 +185,7 @@ MainWindow::MessageReceived(BMessage* message)
void
MainWindow::ImError(BMessage* msg)
{
//FIXME: better error handling..
// FIXME: better error handling..
BAlert* alert = new BAlert("Error", msg->FindString("error"), "Ouch!");
alert->Go();
}

View File

@ -26,7 +26,7 @@ Notifier::UnregisterObserver(Observer* obs)
}
void
void
Notifier::NotifyString(int32 what, BString str)
{
for (int i = 0; i < fObserverList.CountItems(); i++)
@ -34,14 +34,15 @@ Notifier::NotifyString(int32 what, BString str)
}
void
void
Notifier::NotifyInteger(int32 what, int32 value)
{
for (int i = 0; i < fObserverList.CountItems(); i++)
fObserverList.ItemAt(i)->ObserveInteger(what, value);
}
void
void
Notifier::NotifyPointer(int32 what, void* ptr)
{
for (int i = 0; i < fObserverList.CountItems(); i++)

View File

@ -15,7 +15,8 @@
ProtocolLooper::ProtocolLooper(CayaProtocol* protocol)
: BLooper(),
:
BLooper(),
fProtocol(protocol)
{
Account* account = reinterpret_cast<Account*>(

View File

@ -43,7 +43,8 @@ const float kDividerWidth = 1.0f;
ProtocolSettings::ProtocolSettings(CayaProtocolAddOn* addOn)
: fAddOn(addOn),
:
fAddOn(addOn),
fTemplate(new BMessage())
{
_Init();
@ -149,9 +150,10 @@ ProtocolSettings::Load(const char* account, BView* parent)
freeText = false;
menu = new BPopUpMenu(name);
for (int j = 0; curr.FindString("valid_value", j); j++) {
for (int j = 0; curr.FindString("valid_value", j); j++) {
BMenuItem* item
= new BMenuItem(curr.FindString("valid_value", j), NULL);
= new BMenuItem(curr.FindString("valid_value", j),
NULL);
menu->AddItem(item);
}
@ -246,11 +248,14 @@ ProtocolSettings::Load(const char* account, BView* parent)
control = new BTextControl(name, _T(desc), value, NULL);
if (secret) {
dynamic_cast<BTextControl*>(control)->TextView()->HideTyping(true);
dynamic_cast<BTextControl*>(control)->SetText(_T(value));
dynamic_cast<BTextControl*>(control)->SetText(
_T(value));
}
dynamic_cast<BTextControl*>(control)->SetDivider(kDividerWidth);
dynamic_cast<BTextControl*>(control)->SetDivider(
kDividerWidth);
} else {
BStringView* label = new BStringView("NA", _T(desc), B_WILL_DRAW);
BStringView* label = new BStringView("NA", _T(desc),
B_WILL_DRAW);
layout.Add(label);
NotifyingTextView* textView

View File

@ -28,12 +28,13 @@
Server::Server()
: BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE)
:
BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE)
{
}
void
void
Server::Quit()
{
ContactLinker* linker = NULL;
@ -74,15 +75,6 @@ Server::LoginAll()
}
#if 0
void
Server::UpdateSettings(BMessage settings)
{
fProtocol->Protocol()->UpdateSettings(settings);
}
#endif
void
Server::SendProtocolMessage(BMessage* msg)
{
@ -123,7 +115,7 @@ Server::Filter(BMessage* message, BHandler **target)
{
filter_result result = B_DISPATCH_MESSAGE;
switch(message->what) {
switch (message->what) {
case IM_MESSAGE_RECEIVED:
{
BString id = message->FindString("id");
@ -249,8 +241,9 @@ Server::ImMessage(BMessage* msg)
entry_ref ref;
if (linker) {
if (msg->FindRef("ref", &ref) == B_OK) {
//BPath fullPath(&ref);
//BBitmap *bitmap = ImageCache::GetImage(BString(fullPath.Path()), BString(fullPath.Path()));
// BPath fullPath(&ref);
// BBitmap* bitmap = ImageCache::GetImage(
// BString(fullPath.Path()), BString(fullPath.Path()));
BBitmap *bitmap = BTranslationUtils::GetBitmap(&ref);
linker->SetNotifyAvatarBitmap(bitmap);
} else

View File

@ -27,7 +27,8 @@
TheApp::TheApp()
: BApplication(CAYA_SIGNATURE),
:
BApplication(CAYA_SIGNATURE),
fMainWin(NULL)
{
}

View File

@ -10,6 +10,7 @@
WindowsManager* WindowsManager::fInstance = NULL;
WindowsManager::WindowsManager()
{
fCurrentPoint.Set(40.0f, 40.0f);