mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
move migration api out of struct implementation
This commit is contained in:
parent
06f43f34f3
commit
39ee50c4ba
12 changed files with 173 additions and 177 deletions
|
|
@ -391,21 +391,6 @@ impl Page {
|
|||
&self.widget.gobject()
|
||||
}
|
||||
|
||||
// Tools
|
||||
pub fn migrate(tx: &Transaction) -> Result<(), String> {
|
||||
// Migrate self components
|
||||
if let Err(e) = Database::init(tx) {
|
||||
return Err(e.to_string());
|
||||
}
|
||||
|
||||
// Delegate migration to childs
|
||||
Meta::migrate(tx)?;
|
||||
Navigation::migrate(tx)?;
|
||||
|
||||
// Success
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Private helpers @TODO move outside
|
||||
fn load_gemini(&self, uri: Uri) {
|
||||
// Use local namespaces @TODO
|
||||
|
|
@ -938,6 +923,20 @@ impl Page {
|
|||
|
||||
// Tools
|
||||
|
||||
pub fn migrate(tx: &Transaction) -> Result<(), String> {
|
||||
// Migrate self components
|
||||
if let Err(e) = Database::init(tx) {
|
||||
return Err(e.to_string());
|
||||
}
|
||||
|
||||
// Delegate migration to childs
|
||||
meta::migrate(tx)?;
|
||||
navigation::migrate(tx)?;
|
||||
|
||||
// Success
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Helper function, extract readable title from [Uri](https://docs.gtk.org/glib/struct.Uri.html)
|
||||
///
|
||||
/// Useful as common placeholder when page title could not be detected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue