Skip to content

Rework server list#1442

Merged
kambala-decapitator merged 7 commits intoxbmc:masterfrom
wutschel:rework_serverlist
Mar 28, 2026
Merged

Rework server list#1442
kambala-decapitator merged 7 commits intoxbmc:masterfrom
wutschel:rework_serverlist

Conversation

@wutschel
Copy link
Copy Markdown
Collaborator

Description

This PR applies two main changes:

Introduce updateServerCellStatus

The new method updateServerCellStatus updates the server list cell's connection status icon only. This allows to reduce the amount of releadData calls, which was before used to do this.

Introduce noFoundLabel

The UILabel noFoundLabel is used to signal an empty server list. It is faded in/out depending on the state of the list. This allows to remove the former solution which based on a dummy cell.

Other smaller changer were related to coding styles and minor refactoring.

Summary for release notes

Improvement: Using UILabel to signal "No saved hosts found" instead of creating a dummy cell
Improvement: Avoid calling reloadData by only updating connection status icon when needed
Maintenance: Coding styles and minor refactoring

@wutschel wutschel mentioned this pull request Jan 25, 2026
@wutschel wutschel force-pushed the rework_serverlist branch 2 times, most recently from b2c4280 to 9a5be34 Compare March 18, 2026 05:56
Comment thread XBMC Remote/HostManagementViewController.m
Comment thread XBMC Remote/HostManagementViewController.m
Copy link
Copy Markdown
Collaborator

@kambala-decapitator kambala-decapitator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although subclassing UILabel isn't really needed when you can do just

@implementation UILabel (NoFound)
- (instancetype)initAsNoFoundWithFrame:(CGRect)frame {
  self = [self initWithFrame:frame];
}

// or even instead of the initializer:
- (void)configureAsNoFound {
  ...
}
@end

Comment thread XBMC Remote/NoFoundLabel.h Outdated

@import UIKit;

@interface NoFoundLabel : UILabel;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@interface NoFoundLabel : UILabel;
@interface NoFoundLabel : UILabel

Comment thread XBMC Remote/NoFoundLabel.h Outdated

@interface NoFoundLabel : UILabel;

- (id)initWithFrame:(CGRect)frame;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- (id)initWithFrame:(CGRect)frame;
- (instancetype)initWithFrame:(CGRect)frame;

Comment thread XBMC Remote/NoFoundLabel.m Outdated

@implementation NoFoundLabel

- (id)initWithFrame:(CGRect)frame {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- (id)initWithFrame:(CGRect)frame {
- (instancetype)initWithFrame:(CGRect)frame {

@kambala-decapitator
Copy link
Copy Markdown
Collaborator

please also fix conflicts

@wutschel
Copy link
Copy Markdown
Collaborator Author

@implementation UILabel

Wouldn't this require to define this again several times, for controller it is used in? I thought of either subclassing (as I did now) or adding an extension (also 2 new files). You have different solution in mind?

@wutschel wutschel force-pushed the rework_serverlist branch from 38a7372 to 8eea564 Compare March 26, 2026 21:03
@xbmc xbmc deleted a comment from wutschel Mar 27, 2026
@kambala-decapitator
Copy link
Copy Markdown
Collaborator

kambala-decapitator commented Mar 27, 2026

I gave you an example of extension :) without the interface declaration (which is trivial to create) to type less

@wutschel
Copy link
Copy Markdown
Collaborator Author

I gave you an example of extension :) without the interface declaration (which is trivial to create) to type less

Yes, I recognized this 😉 My question is about where to place such extension? If I need to declare this separately for each controller, there's still code duplication.

@kambala-decapitator
Copy link
Copy Markdown
Collaborator

no, of course no duplication. Simply place it in separate files just like you did with the other extensions.

btw you can also include all extensions in PCH to have them accessible everywhere.

@wutschel wutschel force-pushed the rework_serverlist branch from 8eea564 to 9ac90d6 Compare March 27, 2026 15:09
@wutschel
Copy link
Copy Markdown
Collaborator Author

FInally, I went for a standard, full-blown extension. Will use the same pattern for future extensions. I have several extension to come with next PRs.

Copy link
Copy Markdown
Collaborator

@kambala-decapitator kambala-decapitator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI you're not limited to a single extension for a given class, you can have as many as you want.

@wutschel
Copy link
Copy Markdown
Collaborator Author

FYI you're not limited to a single extension for a given class, you can have as many as you want.

Yep, this is what I will do with #1425 and #1428. But will need to move them from Utilities to dedicated files.

@wutschel
Copy link
Copy Markdown
Collaborator Author

You're ok with the solution? In this case I would make this ready for merge.

@wutschel wutschel force-pushed the rework_serverlist branch from 9ac90d6 to 362a198 Compare March 27, 2026 21:51
@kambala-decapitator kambala-decapitator merged commit e9a6a69 into xbmc:master Mar 28, 2026
1 check passed
@wutschel wutschel deleted the rework_serverlist branch March 28, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants