~mitya57/ubuntu/precise/nautilus/desktop-window-fixes

« back to all changes in this revision

Viewing changes to eel/eel-vfs-extensions.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-16 18:53:51 UTC
  • mfrom: (1.17.16 upstream) (2.2.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20110516185351-9mpn1rya1t645ixq
Tags: 1:3.0.1.1-0ubuntu1
* Resynchronize on Debian using the GNOME3 ppa work, thanks to those who
  contributed there
* Known issues:
  - the indicator-application patch needs to be updated or dropped
    (design recommended to use a normal dialog for copies so maybe drop it)
  - the indicator-appmenu export patch needs to be updated
  - desktop icons are not displayed by default in GNOME3, you can set
    org.gnome.desktop.background show-desktop-icons to true in dconf-editor
    or using the gsettings command to get those back 
* New upstream version
* Remaining diffs:
* debian/changelog, debian/rules: set epoch number (which was added by error)
* debian/control.in:
  - Build-Depend on liblaunchpad-integration-dev, libappindicator-dev
  - Don't recommends desktop-base, don't suggests tracker
* debian/mount-archive.desktop:
* debian/mount-archive.desktop.in:
  - New nautilus context menu item to allow mounting zip, iso, etc
* debian/nautilus.gschema.override:
  - Change the default desktop icon configuration
* debian/nautilus-data.install:
  - Install Apport hook
* debian/nautilus.install:
  - Install mount-archive menu
* nautilus-desktop.desktop
* debian/source_nautilus.py:
  - Apport hook to list versions of files in /usr/lib/nautilus and reassign
    the crashes when there are not due to nautilus code directly
* debian/patches/00_do_not_require_unpackage_libexif.patch:
  - dropped, not required in Ubuntu since libexif is recent enough
* debian/patches/01_lpi.patch:
  - Launchpad changes.
* debian/patches/02_additional_marge_for_unity.patch:
  - ensure we don't move desktop icons when locking or unlocking the unity
    launcher 
* debian/patches/03_translations_list_update.patch:
  - Translate the mount-archive menu entry
* debian/patches/04_suppress_umount_in_ltsp.patch:
  - Don't list unmount and eject actions on LTSP clients
* debian/patches/05_desktop_menu_export.patch:
  - export the desktop menus for appmenu (lp #624274), commented for now
* debian/patches/06_never_exec_nonexec_launchers.patch:
  - Implement non-exec policy for .desktop handler.
* debian/patches/07_use_application_indicator.patch:
  - Use the application-indicator, needs to be updated
* debian/patches/08_fix_nautilus_desktop_autostart.patch
  - git commit, remove obsolete autostart code so that Nautilus windows
    can still be opened when desktop icons are shown
* debian/patches/09_no-initial-fade.patch:
  - Patch to disable the initial fade-in of the background without disabling 
    crossfades when the background is changed.
* debian/watch:
  - Watch unstable series
* Dropped:
* debian/patches/02_dont_set_default.patch:
  - deprecated in the new version
* debian/patches/03_menu_entry.patch:
  - no menu simplication needed with unity or gnome-shell
* debian/patches/17_disable_locked_automounting.patch:
  - the change is in the new upstream version
* debian/patches/82_gnome-app-install.patch:
  - don't use gnome-app-install it's deprecated
* debian/patches/90_git_audio_preview_url.patch:
  - the change is in the new version
* debian/patches/91_correct_rgba_use.patch:
  - the gtk rgba ubuntu specific work never landed no need to keep that one
* debian/patches/97_keyboard_nav_in_sidebar.patch:
  - the change is in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
*/
28
28
 
29
29
#include <config.h>
30
 
#include "eel-i18n.h"
31
30
#include "eel-vfs-extensions.h"
32
31
#include "eel-glib-extensions.h"
33
32
#include "eel-lib-self-check-functions.h"
 
33
 
34
34
#include <glib.h>
 
35
#include <glib/gi18n-lib.h>
35
36
#include <gio/gio.h>
36
37
 
37
38
#include "eel-string.h"
95
96
        return g_string_free (string, FALSE);
96
97
}
97
98
 
98
 
/**
99
 
 * eel_format_uri_for_display:
100
 
 *
101
 
 * Filter, modify, unescape and change URIs to make them appropriate
102
 
 * to display to users. The conversion is done such that the roundtrip
103
 
 * to UTf8 is reversible.
104
 
 * 
105
 
 * Rules:
106
 
 *      file: URI's without fragments should appear as local paths
107
 
 *      file: URI's with fragments should appear as file: URI's
108
 
 *      All other URI's appear as expected
109
 
 *
110
 
 * @uri: a URI
111
 
 *
112
 
 * returns a g_malloc'd UTF8 string
113
 
 **/
114
 
char *
115
 
eel_format_uri_for_display (const char *uri) 
116
 
{
117
 
        GFile *file;
118
 
        char *res;
119
 
 
120
 
        file = g_file_new_for_uri (uri);
121
 
        res = g_file_get_parse_name (file);
122
 
        g_object_unref (file);
123
 
        return res;
124
 
}
125
 
 
126
 
char *
127
 
eel_filename_strip_extension (const char * filename_with_extension)
128
 
{
129
 
        char *filename, *end, *end2;
130
 
 
131
 
        if (filename_with_extension == NULL) {
132
 
                return NULL;
133
 
        }
134
 
        
135
 
        filename = g_strdup (filename_with_extension);
 
99
char *
 
100
eel_filename_get_extension_offset (const char *filename)
 
101
{
 
102
        char *end, *end2;
136
103
 
137
104
        end = strrchr (filename, '.');
138
105
 
150
117
                                end = end2;
151
118
                        }
152
119
                }
 
120
        }
 
121
 
 
122
        return end;
 
123
}
 
124
 
 
125
char *
 
126
eel_filename_strip_extension (const char * filename_with_extension)
 
127
{
 
128
        char *filename, *end;
 
129
 
 
130
        if (filename_with_extension == NULL) {
 
131
                return NULL;
 
132
        }
 
133
 
 
134
        filename = g_strdup (filename_with_extension);
 
135
        end = eel_filename_get_extension_offset (filename);
 
136
 
 
137
        if (end && end != filename) {
153
138
                *end = '\0';
154
139
        }
155
140