~ubuntu-branches/ubuntu/natty/gnome-mplayer/natty

« back to all changes in this revision

Viewing changes to src/libgmlib/gm_file.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Tirabassi
  • Date: 2009-06-06 19:49:50 UTC
  • mfrom: (1.1.16 upstream) (0.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090606194950-r2k3q5heupe2ewq4
Tags: 0.9.6-1
* New upstream release:
  - new media tracker and audio meter
  - new key "use_pulse_flat_volume" to be set if you are using
    Pulse Audio 0.9.15 (see /usr/share/doc/gnome-mplayer/NEWS.Debian.gz
    and /usr/share/doc/gnome-mplayer/changelog.gz for additional info)
  - workaround for opening files on smb shares (LP: #369426)
  - prevent adding an "empty" filename to the playlist (LP: #348864)
  - add new --large_buttons and --always_hide_after_timeout command
    line options to man page
  - update debian/copyright with the newly added upstream source files
  - upstream is now widely using libtool, which is causing rpath and
    dependancies issues. libtool is really not needed for such a simple
    case so it has been patched out in favour of static linking:
    + updated debian/patches/avoid_libtool.patch to patch configure.in
      and Makefile.am instead of directly Makefile.in
    + debian/rules:
      - patch is now applied in the configure target
      - add aclocal/autoconf/automake calls in the configure target
    + debian/control:
      add autoconf and automake as Build-Depends
  - add debian/NEWS
* Update debian/copyright in line with updated proposal specification
* Add patch description to avoid_libtool.patch (thanks lintian)
* Remove deprecated dh_desktop call
* Use new dh_quilt_patch and dh_quilt_unpatch commands
* No change bump of Standards-Version to 3.8.1
* Changed Section to video (and debug for the dbg binary), in line
  with the new sections recently added to the Debian archive
* Use LDFLAGS=-Wl,--as-needed instead of specifying manually all libraries

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 
2
/*
 
3
 * gm_file.c
 
4
 * Copyright (C) Kevin DeKorte 2006 <kdekorte@gmail.com>
 
5
 * 
 
6
 * gm_file.c is free software.
 
7
 * 
 
8
 * You may redistribute it and/or modify it under the terms of the
 
9
 * GNU General Public License, as published by the Free Software
 
10
 * Foundation; either version 2 of the License, or (at your option)
 
11
 * any later version.
 
12
 * 
 
13
 * gm_file.c is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
16
 * See the GNU General Public License for more details.
 
17
 * 
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with playlist.c.  If not, write to:
 
20
 *      The Free Software Foundation, Inc.,
 
21
 *      51 Franklin Street, Fifth Floor
 
22
 *      Boston, MA  02110-1301, USA.
 
23
 */
 
24
 
 
25
#include "gm_file.h"
 
26
 
 
27
gchar *gm_tempname(gchar * path, const gchar * name_template)
 
28
{
 
29
    gchar *result;
 
30
    gchar *replace;
 
31
    gchar *basename;
 
32
    gchar *localpath;
 
33
 
 
34
    basename = g_strdup(name_template);
 
35
 
 
36
    if (path == NULL && g_getenv("TMPDIR") == NULL) {
 
37
        localpath = g_strdup("/tmp");
 
38
    } else if (path == NULL && g_getenv("TMPDIR") != NULL) {
 
39
        localpath = g_strdup(g_getenv("TMPDIR"));
 
40
    } else {
 
41
        localpath = g_strdup(path);
 
42
    }
 
43
 
 
44
    while ((replace = g_strrstr(basename, "X"))) {
 
45
        replace[0] = (gchar) g_random_int_range((gint) 'a', (gint) 'z');
 
46
    }
 
47
 
 
48
    result = g_strdup_printf("%s/%s", localpath, basename);
 
49
    g_free(basename);
 
50
    g_free(localpath);
 
51
 
 
52
    return result;
 
53
}