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

View File

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

View File

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

View File

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

View File

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

View File

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