Skip to content

Commit 245f333

Browse files
committed
Functional storage and notemanager
1 parent d000b4d commit 245f333

File tree

5 files changed

+10
-252
lines changed

5 files changed

+10
-252
lines changed

src/Application.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Please wait while the app remembers all the things...
165165
/* Either we show all sticky notes, or we load everything lol */
166166
if (manager.open_notes.size > 0) {
167167
foreach (var window in manager.open_notes) {
168-
if (window.visible) { window.present ();}
168+
if (window.visible) {window.present ();}
169169
}
170170
} else {
171171
manager.init ();

src/Services/Jason.vala

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/Services/NoteManager.vala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
*/
1212
public class Jorts.NoteManager : Object {
1313

14-
private Gtk.Application application;
14+
private Jorts.Application application;
1515
public Gee.ArrayList<StickyNoteWindow> open_notes;
1616
public Jorts.Storage storage;
1717

1818
public NoteManager (Jorts.Application app) {
19-
Object (application: app);
19+
this.application = app;
2020
}
2121

2222
construct {
@@ -41,9 +41,11 @@ public class Jorts.NoteManager : Object {
4141
create_note (note_data);
4242

4343
} else {
44-
foreach (Json.Node json_data in loaded_data.get_elements ()) {
44+
foreach (var json_data in loaded_data.get_elements()) {
4545
var json_obj = json_data.dup_object ();
4646
var note_data = new NoteData.from_json (json_obj);
47+
48+
print ("\nLoaded: " + note_data.title);
4749
create_note (note_data);
4850
}
4951
}
@@ -75,8 +77,10 @@ public class Jorts.NoteManager : Object {
7577

7678
/* LETSGO */
7779
open_notes.add (note);
80+
note.show ();
7881
note.present ();
79-
note.changed.connect (save_all.begin);
82+
note.changed.connect (save_all);
83+
8084
}
8185

8286
/*************************************************/

src/Services/Stash.vala

Lines changed: 0 additions & 152 deletions
This file was deleted.

src/Services/Storage.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* save() takes a Json.Node instead of an NoteData[] so we avoid looping twice through all notes
1515
* It is agressively persistent in
1616
*/
17-
public class Jorts.Storage {
17+
public class Jorts.Storage : Object {
1818

1919
private const string FILENAME = "saved_state.json";
2020
private const string FILENAME_BACKUP = "backup_state.json";

0 commit comments

Comments
 (0)