Use the function strstr to find matches inside the command line, and not
only starting with. Browsing through matches can be done by typing the
arrows down and up.
The CPU usage computation done for the processes were broken when the
refresh rate was different than a second. The introduced fix is only
necessary for the Linux and OpenSolaris implementations.
Fixed old-style function definitions, dropped unused variables, renamed
signal to xtm_signal (it shadowed a previous global declaration from
signal.h,) dropped the G_UN/LIKELY calls, missing includes and casted
here and there.
The task-manager-*.c files /would/ have to be individually fixed.
The Swap usage is retrieved through swapctl(). Also on a separate change, read
the CPU time from the nanosecs instead of ticks for increased precision.
The functions send_signal_to_pid() and set_priority_to_pid() are using
POSIX functions and “should” be safe in task-manager.c. Still keep the
enumeration as a bridge between virtual values and real values, there is
no benefit removing them (wasting minutes) and it won't make the code
look better (or worse).
The functions have been removed from the Linux and BSD implementations.
Switched the get_hostname() get_owner_uid() public in task-manager.c,
the owner uid is needed in the tree view class in order to filter out
user processes from others.
<sigh>
I started to rename "Show sytem processes" to "Show all processes"
and included a GtkTreeModelFilter in between the GtkListStore and
GtkTreeView but nooooo... I had to write private code to sort the
columns. In fact the GtkTreeViewColumn class assumes the model to
be sortable but GtkTreeModelFilter is not, although it provides an
accessor function to the underlying model which is.
And not to mention that understanding GtkTreeViewColumn is a task
on its own! Having the code under the hand is the only exit.
</sigh>
The function pid_is_sleeping() is implement by the different OS
implementations and returns TRUE or FALSE. It is used in the tree view
context menu to show either the signal Stop or Continue.
Base signals and priorities are defined inside the task-manager.h file
to be reused as general values inside the interface. The different OS
implementations have to do the conversion from the enumeration to real
values.