MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ghb_reload_queue

Function ghb_reload_queue

gtk/src/queuehandler.c:1926–2000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1924}
1925
1926gboolean
1927ghb_reload_queue (signal_user_data_t *ud)
1928{
1929 GhbValue *queue;
1930 gint count, ii;
1931 gint pid;
1932 gint status;
1933 GhbValue *queueDict, *uiDict;
1934
1935 ghb_log_func();
1936
1937find_pid:
1938 pid = ghb_find_pid_file();
1939 if (pid < 0)
1940 goto done;
1941
1942 queue = ghb_load_old_queue(pid);
1943 ghb_remove_old_queue_file(pid);
1944 if (!ghb_get_load_queue())
1945 {
1946 ghb_value_free(&queue);
1947 goto find_pid;
1948 }
1949
1950 // Look for unfinished entries
1951 count = ghb_array_len(queue);
1952 for (ii = count-1; ii >= 0; ii--)
1953 {
1954 queueDict = ghb_array_get(queue, ii);
1955 uiDict = ghb_dict_get(queueDict, "uiSettings");
1956 if (uiDict == NULL ||
1957 ghb_dict_get_value(uiDict, "job_status") == NULL)
1958 {
1959 ghb_array_remove(queue, ii);
1960 continue;
1961 }
1962 status = ghb_dict_get_int(uiDict, "job_status");
1963 if (status == GHB_QUEUE_DONE || status == GHB_QUEUE_CANCELED)
1964 {
1965 ghb_array_remove(queue, ii);
1966 continue;
1967 }
1968 }
1969 count = ghb_array_len(queue);
1970 if (count == 0)
1971 {
1972 ghb_value_free(&queue);
1973 goto find_pid;
1974 }
1975 else
1976 {
1977 queue_window_show(ud);
1978 ud->queue = queue;
1979 for (ii = 0; ii < count; ii++)
1980 {
1981 queueDict = ghb_array_get(queue, ii);
1982 uiDict = ghb_dict_get(queueDict, "uiSettings");
1983 ghb_dict_set_int(uiDict, "job_unique_id", 0);

Callers

nothing calls this directly

Calls 15

ghb_find_pid_fileFunction · 0.85
ghb_load_old_queueFunction · 0.85
ghb_get_load_queueFunction · 0.85
ghb_dict_get_valueFunction · 0.85
ghb_dict_get_intFunction · 0.85
queue_window_showFunction · 0.85
ghb_dict_set_intFunction · 0.85
ghb_add_to_queue_listFunction · 0.85
ghb_queue_buttons_greyFunction · 0.85
ghb_save_queueFunction · 0.85
ghb_update_pendingFunction · 0.85

Tested by

no test coverage detected