|
|
|
@ -370,33 +370,21 @@ void Page::navigation_reload(
@@ -370,33 +370,21 @@ void Page::navigation_reload(
|
|
|
|
|
action__update->activate(); |
|
|
|
|
|
|
|
|
|
// Parse meta
|
|
|
|
|
Socket::Client::Gemini::Response::Status status; |
|
|
|
|
|
|
|
|
|
Socket::Client::Gemini::Response::Status status; // @TODO make page global?
|
|
|
|
|
Socket::Client::Gemini::Response::Match::meta( |
|
|
|
|
buffer, |
|
|
|
|
status, |
|
|
|
|
mime |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Try detect mime by file extension on still undefined @TODO
|
|
|
|
|
// MIME type not detected
|
|
|
|
|
if (mime == MIME::UNDEFINED) |
|
|
|
|
{ |
|
|
|
|
// Try detect by file extension
|
|
|
|
|
if (Glib::str_has_suffix(g_uri_get_path(uri), ".gmi")) |
|
|
|
|
{ |
|
|
|
|
mime = MIME::TEXT_GEMINI; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Update
|
|
|
|
|
title = _("Oops"); |
|
|
|
|
|
|
|
|
|
description = _("MIME type not supported"); |
|
|
|
|
|
|
|
|
|
progress_fraction = 1; |
|
|
|
|
|
|
|
|
|
action__update->activate(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Route by status code
|
|
|
|
@ -404,12 +392,10 @@ void Page::navigation_reload(
@@ -404,12 +392,10 @@ void Page::navigation_reload(
|
|
|
|
|
{ |
|
|
|
|
case Socket::Client::Gemini::Response::Status::SUCCESS: |
|
|
|
|
|
|
|
|
|
// Update
|
|
|
|
|
title = _("Done"); // @TODO page title
|
|
|
|
|
|
|
|
|
|
description = g_uri_get_host( |
|
|
|
|
uri |
|
|
|
|
); |
|
|
|
|
// Route by MIME
|
|
|
|
|
switch (mime) |
|
|
|
|
{ |
|
|
|
|
case MIME::TEXT_GEMINI: |
|
|
|
|
|
|
|
|
|
progress_fraction = 1; |
|
|
|
|
|
|
|
|
@ -430,6 +416,27 @@ void Page::navigation_reload(
@@ -430,6 +416,27 @@ void Page::navigation_reload(
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
|
|
// Update
|
|
|
|
|
title = _("Oops"); |
|
|
|
|
|
|
|
|
|
description = _("MIME type not supported"); |
|
|
|
|
|
|
|
|
|
progress_fraction = 1; |
|
|
|
|
|
|
|
|
|
action__update->activate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Update
|
|
|
|
|
title = _("Done"); // @TODO page title
|
|
|
|
|
|
|
|
|
|
description = g_uri_get_host( |
|
|
|
|
uri |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
// @TODO other statuses..
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|