Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
2fcac611
Commit
2fcac611
authored
Aug 11, 2013
by
Felix Paul Kühne
Browse files
UPNP server list: ignore servers we can't deal with (yet)
parent
3436d376
Changes
1
Hide whitespace changes
Inline
Side-by-side
AspenProject/VLCLocalServerListViewController.m
View file @
2fcac611
...
...
@@ -18,6 +18,7 @@
@interface
VLCLocalServerListViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
{
UIBarButtonItem
*
_backToMenuButton
;
NSArray
*
_filteredDevices
;
NSArray
*
_devices
;
}
...
...
@@ -78,7 +79,7 @@
-
(
NSInteger
)
tableView
:(
UITableView
*
)
tableView
numberOfRowsInSection
:(
NSInteger
)
section
{
return
_
d
evices
.
count
;
return
_
filteredD
evices
.
count
;
}
-
(
void
)
tableView
:(
UITableView
*
)
tableView
willDisplayCell
:(
UITableViewCell
*
)
cell
forRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
...
...
@@ -94,21 +95,18 @@
if
(
cell
==
nil
)
cell
=
[
VLCLocalNetworkListCell
cellWithReuseIdentifier
:
CellIdentifier
];
BasicUPnPDevice
*
device
=
_
d
evices
[
indexPath
.
row
];
BasicUPnPDevice
*
device
=
_
filteredD
evices
[
indexPath
.
row
];
[
cell
setTitle
:[
device
friendlyName
]];
UIImage
*
icon
=
[
device
smallIcon
];
if
(
icon
)
[
cell
setIcon
:
icon
];
if
([[
device
urn
]
isEqualToString
:
@"urn:schemas-upnp-org:device:MediaServer:1"
])
[
cell
setIsDirectory
:
YES
];
[
cell
setIcon
:
icon
];
[
cell
setIsDirectory
:
YES
];
return
cell
;
}
-
(
void
)
tableView
:(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
BasicUPnPDevice
*
device
=
_
d
evices
[
indexPath
.
row
];
BasicUPnPDevice
*
device
=
_
filteredD
evices
[
indexPath
.
row
];
if
([[
device
urn
]
isEqualToString
:
@"urn:schemas-upnp-org:device:MediaServer:1"
])
{
MediaServer1Device
*
server
=
(
MediaServer1Device
*
)
device
;
VLCLocalServerFolderListViewController
*
targetViewController
=
[[
VLCLocalServerFolderListViewController
alloc
]
initWithDevice
:
server
header
:[
device
friendlyName
]
andRootID
:
@"0"
];
...
...
@@ -125,6 +123,18 @@
-
(
void
)
UPnPDBUpdated
:(
UPnPDB
*
)
sender
{
APLog
(
@"UPnPDBUpdated %d"
,
_devices
.
count
);
NSUInteger
count
=
_devices
.
count
;
BasicUPnPDevice
*
device
;
NSMutableArray
*
mutArray
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSUInteger
x
=
0
;
x
<
count
;
x
++
)
{
device
=
_devices
[
x
];
if
([[
device
urn
]
isEqualToString
:
@"urn:schemas-upnp-org:device:MediaServer:1"
])
[
mutArray
addObject
:
device
];
}
_filteredDevices
=
nil
;
_filteredDevices
=
[
NSArray
arrayWithArray
:
mutArray
];
[
self
.
tableView
performSelectorOnMainThread
:
@
selector
(
reloadData
)
withObject
:
nil
waitUntilDone
:
YES
];
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment