Commit b119aa9a authored by Paweł Wegner's avatar Paweł Wegner
Browse files

Cloudbrowser: added null check.

parent bdd1a53b
......@@ -216,8 +216,9 @@ void Window::play(int item_id) {
ItemModel* item = directory_model_.get(item_id);
stop();
item_data_request_ = cloud_provider_->getItemDataAsync(
item->item()->id(),
[this](IItem::Pointer i) { emit runPlayerFromUrl(i->url().c_str()); });
item->item()->id(), [this](IItem::Pointer i) {
if (i) emit runPlayerFromUrl(i->url().c_str());
});
}
void Window::stop() {
......
......@@ -45,11 +45,12 @@ Item {
Connections {
target: window
onOpenBrowser: {
browserView.visible = true;
browser.visible = true;
browser.url = url;
}
onCloseBrowser: {
browserView.visible = false;
if (browser.visible) directory.focus = true;
browser.visible = false;
if (!directory.focus) cloudView.focus = true;
}
onRunListDirectory: {
......@@ -218,15 +219,9 @@ Item {
anchors.left: parent.left
}
ScrollView {
id: browserView
WebView {
id: browser
visible: false
anchors.fill: parent
WebView {
id: browser
anchors.fill: parent
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment