Fix how pending apps are installed from the installed page

In the installed page, whenever the list of pending apps changes, the
page will try to install any app in it. This was fine when there were
no limited number of concurrent installations, but right now this may
be a problem (if an app that gets installed by the page goes in the
pending list, then this may trigger another install call from the page
and so on...).

Since the page only cares about installing the apps for when the list
of pending apps is loaded from disk (on start up), to prevent the issue
mentioned above these changes only install the pending apps on start up.
It also skips calling refine on all the pending apps after start up,
since apps are added to the pending apps list usually after being very
recently refined (i.e. we only need to refine them on start up, so this
patch may make things a bit faster in this regard).

https://phabricator.endlessm.com/T21194
1 job for jrocha/fix-install-queue in 6 minutes and 45 seconds (queued for 4 seconds)
latest
Status Job ID Name Coverage
  Build
failed #51103
build-gnome-software

00:06:45

 
Name Stage Failure
failed
build-gnome-software Build
cc -Ilib/lib@@libgnomesoftware@sta -Ilib -I../lib -Ilib/.. -I../lib/.. -I/usr/include/libappstream-glib -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/libgcab-1.0 -I/usr/include/uuid -I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-glib-1.0 -I/usr/include/libsecret-1 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/valgrind -I/usr/include/polkit-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O0 -g -fstack-protector-strong -Waggregate-return -Warray-bounds -Wcast-align -Wclobbered -Wdeclaration-after-statement -Wempty-body -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wignored-qualifiers -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-discarded-qualifiers -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-suggest-attribute=format -Wno-unused-parameter -Wold-style-definition -Woverride-init -Wpacked -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wtype-limits -Wundef -Wuninitialized -Wunused-but-set-variable -Wwrite-strings -D_XOPEN_SOURCE=700 -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE -DI_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE -fPIC -pthread '-DG_LOG_DOMAIN="Gs"' '-DLOCALPLUGINDIR=""'  -MD -MQ 'lib/lib@@libgnomesoftware@sta/gs-plugin-loader.c.o' -MF 'lib/lib@@libgnomesoftware@sta/gs-plugin-loader.c.o.d' -o 'lib/lib@@libgnomesoftware@sta/gs-plugin-loader.c.o' -c ../lib/gs-plugin-loader.c
../lib/gs-plugin-loader.c: In function 'gs_plugin_loader_network_changed_cb':
../lib/gs-plugin-loader.c:3060:41: error: 'GsPluginLoaderPrivate {aka struct <anonymous>}' has no member named 'global_cache'
GsApp *app = gs_app_list_lookup (priv->global_cache, id);
^~
[15/225] cc -Ilib/lib@@libgnomesoftware@sta -Ilib -I../lib -Ilib/.. -I../lib/.. -I/usr/include/libappstream-glib -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/libgcab-1.0 -I/usr/include/uuid -I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-glib-1.0 -I/usr/include/libsecret-1 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/valgrind -I/usr/include/polkit-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O0 -g -fstack-protector-strong -Waggregate-return -Warray-bounds -Wcast-align -Wclobbered -Wdeclaration-after-statement -Wempty-body -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wignored-qualifiers -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-discarded-qualifiers -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-suggest-attribute=format -Wno-unused-parameter -Wold-style-definition -Woverride-init -Wpacked -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wtype-limits -Wundef -Wuninitialized -Wunused-but-set-variable -Wwrite-strings -D_XOPEN_SOURCE=700 -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE -DI_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE -fPIC -pthread '-DG_LOG_DOMAIN="Gs"' '-DLOCALPLUGINDIR=""' -MD -MQ 'lib/lib@@libgnomesoftware@sta/gs-test.c.o' -MF 'lib/lib@@libgnomesoftware@sta/gs-test.c.o.d' -o 'lib/lib@@libgnomesoftware@sta/gs-test.c.o' -c ../lib/gs-test.c
[16/225] cc -Ilib/lib@@libgnomesoftware@sta -Ilib -I../lib -Ilib/.. -I../lib/.. -I/usr/include/libappstream-glib -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/libgcab-1.0 -I/usr/include/uuid -I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/json-glib-1.0 -I/usr/include/libsecret-1 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/valgrind -I/usr/include/polkit-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O0 -g -fstack-protector-strong -Waggregate-return -Warray-bounds -Wcast-align -Wclobbered -Wdeclaration-after-statement -Wempty-body -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wignored-qualifiers -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-discarded-qualifiers -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-suggest-attribute=format -Wno-unused-parameter -Wold-style-definition -Woverride-init -Wpacked -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wtype-limits -Wundef -Wuninitialized -Wunused-but-set-variable -Wwrite-strings -D_XOPEN_SOURCE=700 -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE -DI_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE -fPIC -pthread '-DG_LOG_DOMAIN="Gs"' '-DLOCALPLUGINDIR=""' -MD -MQ 'lib/lib@@libgnomesoftware@sta/gs-utils.c.o' -MF 'lib/lib@@libgnomesoftware@sta/gs-utils.c.o.d' -o 'lib/lib@@libgnomesoftware@sta/gs-utils.c.o' -c ../lib/gs-utils.c
ninja: build stopped: subcommand failed.
ERROR: Job failed: exit code 1