Skip to content

Commit

Permalink
Merge branch 'unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanisław committed Dec 21, 2019
2 parents fd607aa + 8abd007 commit 18926fb
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 40 deletions.
7 changes: 3 additions & 4 deletions data/com.github.stsdc.monitor.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
<url type="help">https://github.com/stsdc/monitor/issues</url>

<releases>
<release version="0.6.1" date="2019-11-13">
<release version="0.6.2" date="2019-12-21">
​ <description>
​ <ul>
<li> Update Portuguese translation (Hugo Carvalho)</li>
<li> Update French translation (Nathan Bonnemains and Skeudwenn)</li>
<li> Fix: Don't show swap percentage when it's not available (Ryo Nakano) </li>
<li> Bugfix (potential) of crushes and high CPU usage</li>
<li> Update German translation (Carsten Dietrich)</li>
</ul>
​ </description>
​ </release>
Expand Down
10 changes: 5 additions & 5 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ icon_sizes = ['16', '24', '32', '48', '64', '128']
foreach i : icon_sizes
install_data(
join_paths('icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
install_dir: join_paths(icondir, i + 'x' + i, 'apps')
)
install_data(
join_paths('icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps')
install_dir: join_paths(icondir, i + 'x' + i + '@2', 'apps')
)
endforeach

install_data(
meson.project_name() + '.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
)

i18n.merge_file(
Expand All @@ -22,13 +22,13 @@ i18n.merge_file(
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
install_dir: join_paths(datadir, 'applications')
)

i18n.merge_file(
input: meson.project_name() + '.appdata.xml.in',
output: meson.project_name() + '.appdata.xml',
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
install_dir: join_paths(datadir, 'metainfo')
)
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
com.github.stsdc.monitor (0.6.2) bionic; urgency=low

* Bugfix (potential) of crushes and high CPU usage
* Update German translation (Carsten Dietrich)

-- Stanisław Dac <[email protected]> Sat, 21 Dec 2019 14:06:37 +0100

com.github.stsdc.monitor (0.6.1) bionic; urgency=low

* Update Portuguese translation (Hugo Carvalho)
Expand Down
12 changes: 8 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@

project('com.github.stsdc.monitor', 'vala', 'c', version: '0.6.0')
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.6.2')

# these are Meson modules
gnome = import('gnome')
i18n = import('i18n')

# common dirs
prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
libdir = join_paths(prefix, get_option('libdir'))
icondir = join_paths(datadir, 'icons', 'hicolor')

# and these are project dependencies
glib = dependency('glib-2.0')
granite = dependency('granite', version: '>= 5.2.0')
Expand Down Expand Up @@ -106,9 +112,7 @@ shared_module(
wingpanel
],
install: true,
install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir'),
# install_dir : '/usr/lib/x86_64-linux-gnu/wingpanel/'

install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir', define_variable: ['libdir', libdir]),
)

# Add in a post install script
Expand Down
21 changes: 4 additions & 17 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,20 @@ msgid "Monitor"
msgstr "Monitor"

#: src/Widgets/Headerbar.vala:23
#, fuzzy
msgid "End Process"
msgstr "Prozess beenden"

#: src/Widgets/Headerbar.vala:26
#, fuzzy
msgid "End selected process"
msgstr "Prozess beenden"
msgstr "Ausgewählten Prozess beenden"

#: src/Widgets/Headerbar.vala:30
#, fuzzy
msgid "Kill Process"
msgstr ""
msgstr "Prozess abwürgen"

#: src/Widgets/Headerbar.vala:32
msgid "Kill selected process"
msgstr ""
msgstr "Ausgewählten Prozess abwürgen"

#: src/Widgets/Headerbar.vala:42
msgid "Settings"
Expand Down Expand Up @@ -93,9 +90,8 @@ msgid "Search Process"
msgstr "Suche Prozess"

#: src/Widgets/Search.vala:15
#, fuzzy
msgid "Type process name or PID to search"
msgstr "Geben Sie den Prozessnamen oder PID ein"
msgstr "Geben Sie den zu suchenden Prozessnamen oder die PID ein"

#: src/Widgets/Statusbar/Statusbar.vala:12
#: src/Widgets/Statusbar/Statusbar.vala:16
Expand All @@ -105,12 +101,3 @@ msgstr "Berechne…"
#: src/Models/GenericModel.vala:274
msgid "Background Applications"
msgstr "Hintergrundanwendungen"

#~ msgid "Ctrl+E"
#~ msgstr "Strg+E"

#~ msgid "CPU:"
#~ msgstr "CPU:"

#~ msgid "Memory:"
#~ msgstr "Arbeitsspeicher:"
40 changes: 31 additions & 9 deletions src/Models/GenericModel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,18 @@ namespace Monitor {
return true;
}

// THE BUG IS SOMEWHERE IN HERE
// reparent children to background processes
private void reparent (Gtk.TreeIter iter) {
private void reparent (ref Gtk.TreeIter iter) {
Gtk.TreeIter child_iter;
Value pid_value_prev;

while (iter_children (out child_iter, iter)) {
Value pid_value;
get_value (child_iter, Column.PID, out pid_value);
pid_value_prev = pid_value;
debug( "reparent %d", pid_value.get_int ());

add_process_to_row (background_apps_iter, pid_value.get_int ());
}
}
Expand All @@ -176,10 +182,26 @@ namespace Monitor {
// if process rows has pid
if (process_rows.has_key (pid)) {
var row = process_rows.get (pid);
var iter = row.iter;
reparent (iter);
// remove row from model
remove (ref iter);
Gtk.TreeIter iter = row.iter;

debug ("remove process: user_data %d, stamp %d", (int) iter.user_data, iter.stamp);

Value pid_value;
get_value (iter, Column.PID, out pid_value);

// Column.NAME, for example returns (null)
// Column.PID return 0

debug("removing %d", pid_value.get_int());

// sometimes iter has null values
// this potentially should prevent segfaults
if (pid_value.get_int() != 0) {
reparent (ref iter);
// remove row from model
remove (ref iter);
}

// remove row from row cache
process_rows.unset (pid);
}
Expand Down Expand Up @@ -223,7 +245,7 @@ namespace Monitor {
// reparenting it and it's children if it already exists.
private bool add_process_to_row (Gtk.TreeIter row, int pid) {
var process = process_manager.get_process (pid);
debug ("add_process_to_row %d", pid);
debug ("add_process_to_row pid:%d", pid);

if (process != null) {
// if process is already in list, then we need to reparent it and it's children
Expand Down Expand Up @@ -252,9 +274,9 @@ namespace Monitor {
// i.e. skip if subprocess is already in but isn't an ancestor of this process row
if (process_rows.has_key (sub_pid) && (
(old_location != null && !is_ancestor (old_location, process_rows[sub_pid].iter))
|| old_location == null))
continue;

|| old_location == null)) {
continue;
}
add_process_to_row (iter, sub_pid);
}

Expand Down
1 change: 0 additions & 1 deletion src/Widgets/OverallView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ namespace Monitor {
pid_column.expand = false;
pid_column.alignment = 0.5f;
pid_column.set_sort_column_id (Column.PID);
pid_column.pack_start (pid_cell, false);
pid_column.add_attribute (pid_cell, "text", Column.PID);
insert_column (pid_column, -1);

Expand Down

0 comments on commit 18926fb

Please sign in to comment.