File tree Expand file tree Collapse file tree 2 files changed +24
-24
lines changed
Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import (
1313
1414const (
1515 NAME = "cbxv"
16- VERSION = "0.4.7 "
16+ VERSION = "0.4.8 "
1717)
1818
1919// Update listens for messages on the message channel and
Original file line number Diff line number Diff line change @@ -584,6 +584,29 @@ func (m *Model) PageToSpread(n int) int {
584584 return 0
585585}
586586
587+ func (m * Model ) StoreLayout () error {
588+ layout := Layout {
589+ FormatVersion : "0.1" ,
590+ }
591+ c := ComicData {}
592+ c .Hash = m .Hash
593+ c .FilePath = m .FilePath
594+ layout .Comic = c
595+ layout .Mode = m .LayoutMode
596+ layout .Pages = m .Pages
597+
598+ data , err := json .Marshal (layout )
599+ if err != nil {
600+ return err
601+ }
602+
603+ err = util .WriteLayout (m .Hash , string (data ))
604+ if err != nil {
605+ return err
606+ }
607+ return nil
608+ }
609+
587610func (m * Model ) loadBookmarks () {
588611 m .Bookmarks = NewBookmarkList (m .FilePath )
589612 m .Bookmarks .Load (m .Hash )
@@ -624,29 +647,6 @@ func (m *Model) applyLayout(layout *Layout) {
624647 }
625648}
626649
627- func (m * Model ) StoreLayout () error {
628- layout := Layout {
629- FormatVersion : "0.1" ,
630- }
631- c := ComicData {}
632- c .Hash = m .Hash
633- c .FilePath = m .FilePath
634- layout .Comic = c
635- layout .Mode = m .LayoutMode
636- layout .Pages = m .Pages
637-
638- data , err := json .Marshal (layout )
639- if err != nil {
640- return err
641- }
642-
643- err = util .WriteLayout (m .Hash , string (data ))
644- if err != nil {
645- return err
646- }
647- return nil
648- }
649-
650650// Make sure we always send a result message, no errors allowed
651651func (m * Model ) sendOpenFileResMsg (code ResultCode , description string ) {
652652 var d string
You can’t perform that action at this time.
0 commit comments