remove deprecated construction

This commit is contained in:
yggverse 2024-10-18 11:30:55 +03:00
parent da3618aa0a
commit fed376ea2f

View File

@ -26,7 +26,7 @@ use gtk::{
Box, Box,
}; };
use sqlite::Transaction; use sqlite::Transaction;
use std::{cell::RefCell, path::Path, sync::Arc}; use std::{cell::RefCell, sync::Arc};
pub struct Page { pub struct Page {
id: GString, id: GString,
@ -250,19 +250,10 @@ impl Page {
// Format response // Format response
meta.borrow_mut().status = Some(Status::Response); meta.borrow_mut().status = Some(Status::Response);
meta.borrow_mut().description = Some(host); meta.borrow_mut().description = Some(host);
meta.borrow_mut().title = Some(uri.path()); meta.borrow_mut().title = uri.host();
action_update.activate(Some(&id)); action_update.activate(Some(&id));
// Try create short base for title
let path = uri.path();
let path = Path::new(&path);
if let Some(base) = path.file_name() {
if let Some(base_str) = base.to_str() {
meta.borrow_mut().title = Some(GString::from(base_str));
}
}
// Parse response @TODO read bytes // Parse response @TODO read bytes
let parts = Regex::split_simple( let parts = Regex::split_simple(
r"^(\d+)?\s([\w]+\/[\w]+)?(.*)?", r"^(\d+)?\s([\w]+\/[\w]+)?(.*)?",