~ubuntu-branches/debian/wheezy/brasero/wheezy

« back to all changes in this revision

Viewing changes to src/brasero-async-task-manager.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Pedro Fragoso, Luca Bruno, Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2009-06-24 18:59:46 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624185946-iyxkgf3gjptir5y3
Tags: 2.26.2-1
[ Pedro Fragoso ]
* Add myself to Maintainer field
  - Thanks Ondřej Surý
* New upstream version (Closes: #528945)
  - Split package into brasero, libbrasero-media0 and libbrasero-dev
  - Add Replaces to libbrasero-media0
  - Bump libgtk to 2.14.0
  - Remove libnotify Build-dep
  - Add Build-dep libnautilus-extension-dev (>= 2.22.2)
    and install it.
  - Add Build-dep to libsm-dev
  - Add Build-dep on intltool
* Install omf files to prevent crash on Help
* Move gstreamer0.10-plugins-bad to Suggests, and add
  dvdauthor and vcdimager
* Recommends gvfs (Closes: #491827)
* Pass --disable-scrollkeeper in DEB_CONFIGURE_EXTRA_FLAGS
* debian/patches/007-fix-gnome-doc-utils-path.patch:
  - Removed, not needed anymore
* debian/patches/008-fix-volume-identifier-crash.patch:
  - Removed, merged upstream
* debian/patches/011_nautilus_menu_move.patch:
 - Move CD/DVD Creator Menu to Acessories, taken from Ubuntu

[ Luca Bruno ]
* debian/control.in:
  - Add Build-Depend gtk-doc-tools 1.9.
* debian/patches/006-fix-libdvdcss.patch:
  - Removed as applied upstream.

[ Josselin Mouette ]
* New upstream release.
* Update build-dependencies.
* Move the translations and data to a new brasero-common package.
* Rewrite the descriptions.
* Add -dev depends to the development package.
* Remove inappropriate recommends in the library package.
* Let’s not forget dvd+rw-tools so that we can write DVDs too.
* Rework dependencies accordingly.
* Put the nautilus extension in brasero.
* Conflict against nautilus-cd-burner to avoid having two burning 
  extensions.
* Include clean-la.mk and gnome-version.mk; build-depend on 
  gnome-pkg-tools 0.7.
* Don’t run dh_makeshlibs on brasero and libbrasero-plugins.
* 011_nautilus_menu_move.patch: add NoDisplay=true, this icon is 
  duplicating existing functionality (brasero icon in sound&video 
  menu, and nautilus autorun).
* Update list of copyright holders.

[ Emilio Pozuelo Monfort ]
* debian/copyright: updated.

[ Josselin Mouette ]
* copyright: improve indentation, and point to versioned LGPL.
* 090_relibtoolize.patch: add a relibtoolization patch to avoid the 
  rpath crap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 ***************************************************************************/
8
8
 
9
9
/*
10
 
 *  This program is free software; you can redistribute it and/or modify
 
10
 *  Brasero is free software; you can redistribute it and/or modify
11
11
 *  it under the terms of the GNU General Public License as published by
12
12
 *  the Free Software Foundation; either version 2 of the License, or
13
13
 *  (at your option) any later version.
14
14
 *
15
 
 *  This program is distributed in the hope that it will be useful,
 
15
 *  Brasero is distributed in the hope that it will be useful,
16
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
18
 *  GNU Library General Public License for more details.
19
19
 *
20
20
 *  You should have received a copy of the GNU General Public License
21
 
 *  along with this program; if not, write to the Free Software
22
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
21
 *  along with this program; if not, write to:
 
22
 *      The Free Software Foundation, Inc.,
 
23
 *      51 Franklin Street, Fifth Floor
 
24
 *      Boston, MA  02110-1301, USA.
23
25
 */
24
26
 
25
27
#ifdef HAVE_CONFIG_H
263
265
                self->priv->active_tasks = g_slist_remove (self->priv->active_tasks, ctx);
264
266
                g_cond_signal (self->priv->task_finished);
265
267
 
266
 
                if (g_cancellable_is_cancelled (cancel)) {
267
 
                        if (ctx->type->destroy)
268
 
                                ctx->type->destroy (self, ctx->data);
269
 
 
270
 
                        g_free (ctx);
271
 
                }
272
 
                else if (res == BRASERO_ASYNC_TASK_RESCHEDULE) {
273
 
                        if (self->priv->waiting_tasks) {
274
 
                                BraseroAsyncTaskCtx *next;
275
 
 
276
 
                                next = self->priv->waiting_tasks->data;
277
 
                                if (next->priority > ctx->priority)
278
 
                                        brasero_async_task_manager_insert_task (self, ctx);
 
268
                /* NOTE: when threads are cancelled then they are destroyed in
 
269
                 * the function that cancelled them to destroy callback_data in
 
270
                 * the active main loop */
 
271
                if (!g_cancellable_is_cancelled (cancel)) {
 
272
                        if (res == BRASERO_ASYNC_TASK_RESCHEDULE) {
 
273
                                if (self->priv->waiting_tasks) {
 
274
                                        BraseroAsyncTaskCtx *next;
 
275
 
 
276
                                        next = self->priv->waiting_tasks->data;
 
277
                                        if (next->priority > ctx->priority)
 
278
                                                brasero_async_task_manager_insert_task (self, ctx);
 
279
                                        else
 
280
                                                self->priv->waiting_tasks = g_slist_prepend (self->priv->waiting_tasks, ctx);
 
281
                                }
279
282
                                else
280
283
                                        self->priv->waiting_tasks = g_slist_prepend (self->priv->waiting_tasks, ctx);
281
284
                        }
282
 
                        else
283
 
                                self->priv->waiting_tasks = g_slist_prepend (self->priv->waiting_tasks, ctx);
284
 
                }
285
 
                else {
286
 
                        if (ctx->type->destroy)
287
 
                                ctx->type->destroy (self, ctx->data);
288
 
                        g_free (ctx);
289
 
                }
290
 
 
291
 
                g_cancellable_reset (cancel);
 
285
                        else {
 
286
                                if (ctx->type->destroy)
 
287
                                        ctx->type->destroy (self, FALSE, ctx->data);
 
288
                                g_free (ctx);
 
289
                        }
 
290
                }
 
291
                else
 
292
                        g_cancellable_reset (cancel);
292
293
        }
293
294
 
294
295
end:
421
422
 
422
423
                        tasks = g_slist_remove (tasks, ctx);
423
424
 
424
 
                        /* NOTE: no need to call destroy callback here 
425
 
                         * since it was done in the thread loop. */
 
425
                        /* destroy it */
 
426
                        if (ctx->type->destroy)
 
427
                                ctx->type->destroy (self, TRUE, ctx->data);
 
428
 
 
429
                        g_free (ctx);
426
430
                }
427
431
        }
428
432
 
453
457
 
454
458
                        /* call the destroy callback */
455
459
                        if (ctx->type->destroy)
456
 
                                ctx->type->destroy (self, ctx->data);
 
460
                                ctx->type->destroy (self, TRUE, ctx->data);
457
461
 
458
462
                        g_free (ctx);
459
463
                }