Skip to content

Commit 6d4697a

Browse files
committed
Plug possible memory leaks, add a legacy manifest
1 parent b75022a commit 6d4697a

File tree

5 files changed

+52
-37
lines changed

5 files changed

+52
-37
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
id: com.github.lainsce.notejot
2+
runtime: io.elementary.Platform
3+
runtime-version: '8'
4+
sdk: io.elementary.Sdk
5+
command: com.github.lainsce.notejot
6+
finish-args:
7+
- '--share=ipc'
8+
- '--device=dri'
9+
- '--socket=x11'
10+
cleanup:
11+
- '/include'
12+
- '/lib/pkgconfig'
13+
- '/man'
14+
- '/share/doc'
15+
- '/share/gtk-doc'
16+
- '/share/man'
17+
- '/share/pkgconfig'
18+
- '/share/installed-tests'
19+
- '*.la'
20+
- '*.a'
21+
modules:
22+
- name: gtksourceview3
23+
config-opts: ["--enable-gtk-doc=no"]
24+
sources:
25+
- type: archive
26+
url: https://download.gnome.org/sources/gtksourceview/3.24/gtksourceview-3.24.11.tar.xz
27+
sha256: 691b074a37b2a307f7f48edc5b8c7afa7301709be56378ccf9cc9735909077fd
28+
- name: notejot
29+
buildsystem: meson
30+
sources:
31+
- type: git
32+
url: https://github.com/ellie-commons/Jorts.git
33+
commit: a67fb85e81032e4a73067906ea99b1dc9d8176b3

make-appimage.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@ gtk4-update-icon-cache -q -t -f "$PROJECT_DIR/builddir/AppDir/usr/share/icons/hi
1818
update-desktop-database -q "$PROJECT_DIR/builddir/AppDir/usr/share/applications"
1919

2020
# Run appimage-builder to create the AppImage
21-
appimage-builder --recipe ../io.github.ellie_commons.jorts.appimage.yml
22-
23-
# Move the generated AppImage to the project directory
24-
mv Mingle-*-x86_64.AppImage "$PROJECT_DIR"
21+
appimage-builder --recipe ../io.github.ellie_commons.jorts.appimage.yml --appdir ./Jorts-x86_64.AppImage

src/Application.vala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ namespace jorts {
119119
var save_action = new SimpleAction ("save", null);
120120
set_accels_for_action ("app.save", {"<Control>s"});
121121
add_action (save_action);
122-
save_action.activate.connect (() => {
123-
this.save_to_stash ();
124-
});
122+
save_action.activate.connect (save_to_stash);
125123
var zoom_out = new SimpleAction ("zoom_out", null);
126124
set_accels_for_action ("app.zoom_out", { "<Control>minus", "<Control>KP_Subtract", null });
127125
add_action (zoom_out);
@@ -143,9 +141,7 @@ namespace jorts {
143141
var toggle_hidebar = new SimpleAction ("toggle_hidebar", null);
144142
set_accels_for_action ("app.toggle_hidebar", { "<Control>t", null });
145143
add_action (toggle_hidebar);
146-
toggle_hidebar.activate.connect (() => {
147-
this.toggle_hidebar();
148-
});
144+
toggle_hidebar.activate.connect (this.toggle_hidebar);
149145

150146
}
151147

src/MainWindow.vala

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ namespace jorts {
159159

160160
view = new jorts.StickyView (this.content);
161161

162-
view.buffer.changed.connect (() => {
163-
on_buffer_changed();
164-
});
162+
view.buffer.changed.connect (on_buffer_changed);
165163

166164
scrolled.set_child (view);
167165

@@ -232,14 +230,10 @@ namespace jorts {
232230
this.set_zoom(data.zoom);
233231

234232
// The settings popover tells us a new theme has been chosen!
235-
this.popover.theme_changed.connect ((selected) => {
236-
this.update_theme(selected);
237-
});
233+
this.popover.theme_changed.connect (update_theme);
238234

239235
// The settings popover tells us a new zoom has been chosen!
240-
this.popover.zoom_changed.connect ((zoomkind) => {
241-
this.on_zoom_changed(zoomkind);
242-
});
236+
this.popover.zoom_changed.connect (on_zoom_changed);
243237

244238
var app_button = new Gtk.MenuButton();
245239
app_button.has_tooltip = true;
@@ -282,23 +276,15 @@ namespace jorts {
282276
//});
283277

284278
// Use the color theme of this sticky note when focused
285-
this.notify["is-active"].connect(() => {
286-
this.on_focus_changed();
287-
});
279+
this.notify["is-active"].connect(on_focus_changed);
288280

289281
//The application tells us the squiffly state has changed!
290-
Application.gsettings.changed["scribbly-mode-active"].connect (() => {
291-
this.on_scribbly_changed();
292-
});
282+
Application.gsettings.changed["scribbly-mode-active"].connect (on_scribbly_changed);
293283

294284
//The application tells us the squiffly state has changed!
295-
Application.gsettings.changed["hide-bar"].connect (() => {
296-
this.on_hidebar_changed();
297-
});
285+
Application.gsettings.changed["hide-bar"].connect (on_hidebar_changed);
298286

299-
gtk_settings.notify["enable-animations"].connect (() => {
300-
this.on_reduceanimation_changed();
301-
});
287+
gtk_settings.notify["enable-animations"].connect (on_reduceanimation_changed);
302288

303289
} // END OF MAIN CONSTRUCT
304290

src/Preferences.vala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,7 @@ namespace jorts {
253253
reset_button.tooltip_markup = (_("Reset all settings to defaults"));
254254
actionbar.pack_end (reset_button);
255255

256-
reset_button.clicked.connect(() => {
257-
string[] keys = {"scribbly-mode-active","hide-bar"};
258-
foreach (var key in keys) {
259-
Application.gsettings.reset (key);
260-
}
261-
});
256+
reset_button.clicked.connect(on_reset);
262257

263258

264259
// var close_button = new Gtk.Button();
@@ -286,6 +281,14 @@ namespace jorts {
286281
}
287282

288283

284+
private void on_reset() {
285+
string[] keys = {"scribbly-mode-active","hide-bar"};
286+
foreach (var key in keys) {
287+
Application.gsettings.reset (key);
288+
}
289+
}
290+
291+
289292
}
290293
}
291294

0 commit comments

Comments
 (0)