AIM : Removed _declspec and removed a unuseful parameter, both were causing warnings. Replaced List<> a std::list wrapper, with BObjectList and removed the _TR macro in ProtocolSettings that is apparently not doing anything.

This commit is contained in:
barrett 2012-02-25 20:33:28 +00:00
parent 68e42252d6
commit 9c43174dce
6 changed files with 23 additions and 23 deletions

View File

@ -20,6 +20,7 @@
#include <MenuItem.h> #include <MenuItem.h>
#include <MenuField.h> #include <MenuField.h>
#include <Message.h> #include <Message.h>
#include <ObjectList.h>
#include <Path.h> #include <Path.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
#include <Resources.h> #include <Resources.h>
@ -37,8 +38,6 @@
#include "ProtocolManager.h" #include "ProtocolManager.h"
#include "ProtocolSettings.h" #include "ProtocolSettings.h"
#define _T(str) (str)
const float kDividerWidth = 1.0f; const float kDividerWidth = 1.0f;
@ -71,10 +70,10 @@ ProtocolSettings::AddOn() const
} }
List<BString> BObjectList<BString>
ProtocolSettings::Accounts() const ProtocolSettings::Accounts() const
{ {
List<BString> list; BObjectList<BString> list(true);
BPath path(CayaAccountPath(fAddOn->Signature())); BPath path(CayaAccountPath(fAddOn->Signature()));
if (path.InitCheck() != B_OK) if (path.InitCheck() != B_OK)
@ -89,7 +88,7 @@ ProtocolSettings::Accounts() const
if (msg.Unflatten(&file) == B_OK) { if (msg.Unflatten(&file) == B_OK) {
char buffer[B_PATH_NAME_LENGTH]; char buffer[B_PATH_NAME_LENGTH];
if (entry.GetName(buffer) == B_OK) if (entry.GetName(buffer) == B_OK)
list.AddItem(BString(buffer)); list.AddItem(new BString(buffer));
} }
} }
@ -230,7 +229,7 @@ ProtocolSettings::Load(const char* account, BView* parent)
active = false; active = false;
} }
control = new BCheckBox(name, _T(desc), NULL); control = new BCheckBox(name, desc, NULL);
if (active) if (active)
dynamic_cast<BCheckBox*>(control)->SetValue(B_CONTROL_ON); dynamic_cast<BCheckBox*>(control)->SetValue(B_CONTROL_ON);
break; break;
@ -245,26 +244,25 @@ ProtocolSettings::Load(const char* account, BView* parent)
if (!control) { if (!control) {
if (freeText) { if (freeText) {
if (!multiLine) { if (!multiLine) {
control = new BTextControl(name, _T(desc), value, NULL); control = new BTextControl(name, desc, value, NULL);
if (secret) { if (secret) {
dynamic_cast<BTextControl*>(control)->TextView()->HideTyping(true); dynamic_cast<BTextControl*>(control)->TextView()->HideTyping(true);
dynamic_cast<BTextControl*>(control)->SetText( dynamic_cast<BTextControl*>(control)->SetText(value);
_T(value));
} }
dynamic_cast<BTextControl*>(control)->SetDivider( dynamic_cast<BTextControl*>(control)->SetDivider(
kDividerWidth); kDividerWidth);
} else { } else {
BStringView* label = new BStringView("NA", _T(desc), BStringView* label = new BStringView("NA", desc,
B_WILL_DRAW); B_WILL_DRAW);
layout.Add(label); layout.Add(label);
NotifyingTextView* textView NotifyingTextView* textView
= new NotifyingTextView(name); = new NotifyingTextView(name);
control = new BScrollView("NA", textView, 0, false, true); control = new BScrollView("NA", textView, 0, false, true);
textView->SetText(_T(value)); textView->SetText(value);
} }
} else { } else {
control = new BMenuField(name, _T(desc), menu); control = new BMenuField(name, desc, menu);
dynamic_cast<BMenuField*>(control)->SetDivider(kDividerWidth); dynamic_cast<BMenuField*>(control)->SetDivider(kDividerWidth);
} }
} }

View File

@ -6,7 +6,7 @@
#ifndef _PROTOCOL_SETTINGS_H #ifndef _PROTOCOL_SETTINGS_H
#define _PROTOCOL_SETTINGS_H #define _PROTOCOL_SETTINGS_H
#include <libsupport/List.h> #include <ObjectList.h>
class BMessage; class BMessage;
class CayaProtocolAddOn; class CayaProtocolAddOn;
@ -19,7 +19,7 @@ public:
status_t InitCheck() const; status_t InitCheck() const;
CayaProtocolAddOn* AddOn() const; CayaProtocolAddOn* AddOn() const;
List<BString> Accounts() const; BObjectList<BString> Accounts() const;
status_t LoadTemplate(BView* parent); status_t LoadTemplate(BView* parent);
status_t Load(const char* account, BView* parent); status_t Load(const char* account, BView* parent);

View File

@ -227,13 +227,13 @@ PreferencesAccounts::_LoadListView(ProtocolSettings* settings)
if (!settings) if (!settings)
return; return;
List<BString> accounts = settings->Accounts(); BObjectList<BString> accounts = settings->Accounts();
// Add accounts to list view // Add accounts to list view
for (uint32 i = 0; i < accounts.CountItems(); i++) { for (int32 i = 0; i < accounts.CountItems(); i++) {
BString account = accounts.ItemAt(i); BString* account = accounts.ItemAt(i);
AccountListItem* listItem AccountListItem* listItem
= new AccountListItem(settings, account.String()); = new AccountListItem(settings, account->String());
fListView->AddItem(listItem); fListView->AddItem(listItem);
} }
} }

View File

@ -298,7 +298,7 @@ AIMProtocol::WaitForData(void* aimProtocol)
void void
AIMProtocol::GotMessage(void* imcomm, char* who, int auto, char* recvmsg) AIMProtocol::GotMessage(void* imcomm, char* who, char* recvmsg)
{ {
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
msg.AddInt32("im_what", IM_MESSAGE_RECEIVED); msg.AddInt32("im_what", IM_MESSAGE_RECEIVED);

View File

@ -37,7 +37,7 @@ public:
static int32 WaitForData(void*); static int32 WaitForData(void*);
static void GotMessage(void*, char*, int, char*); static void GotMessage(void*, char*, char*);
static void BuddyOnline(void*, char*); static void BuddyOnline(void*, char*);
static void BuddyOffline(void*, char*); static void BuddyOffline(void*, char*);
static void BuddyAway(void*, char*); static void BuddyAway(void*, char*);

View File

@ -5,9 +5,11 @@
#include "AIM.h" #include "AIM.h"
extern "C" __declspec(dllexport) CayaProtocol* protocol(); extern "C" {
extern "C" __declspec(dllexport) const char* signature(); CayaProtocol* protocol();
extern "C" __declspec(dllexport) const char* friendly_signature(); const char* signature();
const char* friendly_signature();
};
CayaProtocol* CayaProtocol*
protocol() protocol()