Skip to content

Commit 5b5b1e1

Browse files
committed
fix build on nightly
1 parent e0bcfdb commit 5b5b1e1

File tree

6 files changed

+44
-14
lines changed

6 files changed

+44
-14
lines changed

source/StationFinder.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ StationFinderService::StationFinderService()
114114
: serviceName("unknown"),
115115
serviceHomePage(""),
116116
serviceLogo(NULL),
117+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
118+
findByCapabilities(5)
119+
#else
117120
findByCapabilities(5, true)
121+
#endif
118122
{
119123
}
120124

@@ -451,7 +455,7 @@ StationFinderWindow::DoSearch(const char* text)
451455

452456
be_app->SetCursor(new BCursor(B_CURSOR_ID_PROGRESS));
453457

454-
BObjectList<Station>* result = fCurrentService->FindBy(fDdSearchBy->Value(), text, this);
458+
StationList* result = fCurrentService->FindBy(fDdSearchBy->Value(), text, this);
455459
if (result != NULL) {
456460
for (int32 i = 0; i < result->CountItems(); i++)
457461
fResultView->AddItem(new StationListViewItem(result->ItemAt(i)));

source/StationFinder.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
#define RES_BN_SEARCH 10
5151

5252

53+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
54+
typedef BObjectList<Station, true> StationList;
55+
#else
56+
typedef BObjectList<Station> StationList;
57+
#endif
58+
5359
typedef class StationFinderService* (*InstantiateFunc)();
5460

5561

@@ -97,7 +103,7 @@ class StationFinderService {
97103
static void RegisterSelf();
98104
static StationFinderService* Instantiate();
99105

100-
virtual BObjectList<Station>* FindBy(
106+
virtual StationList* FindBy(
101107
int capabilityIndex, const char* searchFor, BLooper* resultUpdateTarget)
102108
= 0;
103109

@@ -114,7 +120,11 @@ class StationFinderService {
114120
BString serviceName;
115121
BUrl serviceHomePage;
116122
BBitmap* serviceLogo;
123+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
124+
BObjectList<FindByCapability, true> findByCapabilities;
125+
#else
117126
BObjectList<FindByCapability> findByCapabilities;
127+
#endif
118128

119129
// Helper functions
120130
BBitmap* RetrieveLogo(BUrl url);

source/StationFinderListenLive.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ StationFinderListenLive::~StationFinderListenLive()
154154
}
155155

156156

157-
BObjectList<Station>*
157+
StationList*
158158
StationFinderListenLive::FindBy(
159159
int capabilityIndex, const char* searchFor, BLooper* resultUpdateTarget)
160160
{
@@ -164,7 +164,7 @@ StationFinderListenLive::FindBy(
164164
fPlsLookupList.MakeEmpty(false);
165165
fLookupNotify = resultUpdateTarget;
166166

167-
BObjectList<Station>* result = NULL;
167+
StationList* result = NULL;
168168

169169
BString urlString(kBaseUrl);
170170
strlwr((char*)searchFor);
@@ -202,10 +202,14 @@ StationFinderListenLive::FindBy(
202202
}
203203

204204

205-
BObjectList<Station>*
205+
StationList*
206206
StationFinderListenLive::ParseCountryReturn(BMallocIO* data, const char* searchFor)
207207
{
208-
BObjectList<Station>* result = new BObjectList<Station>(20, true);
208+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
209+
StationList* result = new StationList(20);
210+
#else
211+
StationList* result = new StationList(20, true);
212+
#endif
209213
if (result == NULL)
210214
return result;
211215

@@ -286,10 +290,14 @@ StationFinderListenLive::ParseCountryReturn(BMallocIO* data, const char* searchF
286290
}
287291

288292

289-
BObjectList<Station>*
293+
StationList*
290294
StationFinderListenLive::ParseGenreReturn(BMallocIO* data, const char* searchFor)
291295
{
292-
BObjectList<Station>* result = new BObjectList<Station>(20, true);
296+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
297+
StationList* result = new StationList(20);
298+
#else
299+
StationList* result = new StationList(20, true);
300+
#endif
293301
if (result == NULL)
294302
return result;
295303

source/StationFinderListenLive.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class StationFinderListenLive : public StationFinderService {
3131
static void RegisterSelf();
3232
static StationFinderService* Instantiate();
3333

34-
virtual BObjectList<Station>* FindBy(
34+
virtual StationList* FindBy(
3535
int capabilityIndex, const char* searchFor, BLooper* resultUpdateTarget);
3636

37-
BObjectList<Station>* ParseCountryReturn(BMallocIO* data, const char* country);
38-
BObjectList<Station>* ParseGenreReturn(BMallocIO* data, const char* genre);
37+
StationList* ParseCountryReturn(BMallocIO* data, const char* country);
38+
StationList* ParseGenreReturn(BMallocIO* data, const char* genre);
3939

4040
private:
4141
static int32 _PlsLookupFunc(void* data);

source/StationFinderRadioNetwork.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ IconLookup::IconLookup(Station* station, BUrl iconUrl)
4848
StationFinderRadioNetwork::StationFinderRadioNetwork()
4949
: StationFinderService(),
5050
fIconLookupThread(-1),
51+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
52+
fIconLookupList(100)
53+
#else
5154
fIconLookupList(100, true)
55+
#endif
5256
{
5357
serviceName.SetTo(B_TRANSLATE("Community Radio Browser"));
5458
serviceHomePage.SetUrlString("https://www.radio-browser.info");
@@ -84,7 +88,7 @@ StationFinderRadioNetwork::RegisterSelf()
8488
}
8589

8690

87-
BObjectList<Station>*
91+
StationList*
8892
StationFinderRadioNetwork::FindBy(
8993
int capabilityIndex, const char* searchFor, BLooper* resultUpdateTarget)
9094
{
@@ -93,7 +97,7 @@ StationFinderRadioNetwork::FindBy(
9397
fIconLookupList.MakeEmpty(true);
9498
fIconLookupNotify = resultUpdateTarget;
9599

96-
BObjectList<Station>* result = new BObjectList<Station>();
100+
StationList* result = new StationList();
97101
if (result == NULL)
98102
return result;
99103

source/StationFinderRadioNetwork.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class StationFinderRadioNetwork : public StationFinderService {
3939
static void RegisterSelf();
4040
static StationFinderService* Instantiate();
4141

42-
virtual BObjectList<Station>* FindBy(
42+
virtual StationList* FindBy(
4343
int capabilityIndex, const char* searchFor, BLooper* resultUpdateTarget);
4444

4545
private:
@@ -52,7 +52,11 @@ class StationFinderRadioNetwork : public StationFinderService {
5252
static BString sCachedServerUrl;
5353

5454
thread_id fIconLookupThread;
55+
#if B_HAIKU_VERSION > B_HAIKU_VERSION_1_BETA_5
56+
BObjectList<IconLookup, true> fIconLookupList;
57+
#else
5558
BObjectList<IconLookup> fIconLookupList;
59+
#endif
5660
BLooper* fIconLookupNotify;
5761
};
5862

0 commit comments

Comments
 (0)