~ubuntu-branches/ubuntu/lucid/nautilus-actions/lucid

« back to all changes in this revision

Viewing changes to plugin/nautilus-actions-utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Christine Spang
  • Date: 2006-05-02 21:15:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060502211503-ygoa8zap193bi9gq
Tags: 1.2-1
* New upstream release.
  - Add support for filtering using mimetypes of selected files
  - Add support for choice about case sensitiveness of file patterns
  - New Tango style icons
  - Grammar and spelling errors fixed
  - Fix segfault when defining an action with an empty file pattern
  - Fix a crash when selecting a cdrom drive with Nautilus 2.14
  - Added Bengali translation; others updated
  - Other minor bugfixes
* Bumped standards version to 2.7.0.0; no change.
* Added debian/watch

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 */
23
23
 
24
24
#include <glib.h>
25
 
#include <libgnomevfs/gnome-vfs-file-info.h>
 
25
#include <string.h>
 
26
//#include <libgnomevfs/gnome-vfs-file-info.h>
26
27
#include <libnautilus-extension/nautilus-file-info.h>
 
28
#include <libgnomevfs/gnome-vfs.h>
27
29
 
28
30
#include "nautilus-actions-utils.h"
29
31
 
50
52
                GString* tmp_string = g_string_new ("");
51
53
                gchar* iter = g_strdup (param_template);
52
54
                gchar* old_iter = iter;
53
 
                int current_len = strlen (iter);
 
55
                //int current_len = strlen (iter);
54
56
                gchar* uri = nautilus_file_info_get_uri ((NautilusFileInfo*)files->data);
55
57
                GnomeVFSURI* gvfs_uri = gnome_vfs_uri_new (uri);
56
58
                gchar* filename;
71
73
                g_free (tmp);
72
74
 
73
75
                tmp = nautilus_file_info_get_name ((NautilusFileInfo*)files->data);
 
76
                if (!tmp)
 
77
                {
 
78
                        tmp = g_strdup ("");
 
79
                }
 
80
 
74
81
                filename = g_shell_quote (tmp);
75
82
                tmp2 = g_build_path ("/", dirname, tmp, NULL);
76
83
                g_free (tmp);
85
92
                {
86
93
                        gchar* tmp_filename = nautilus_file_info_get_name ((NautilusFileInfo*)file_iter->data);
87
94
                        
 
95
                        if (!tmp_filename)
 
96
                        {
 
97
                                tmp_filename = g_strdup ("");
 
98
                        }
 
99
 
88
100
                        gchar* quoted_tmp_filename = g_shell_quote (tmp_filename);
89
101
                        g_string_append_printf (tmp_file_list, " %s", quoted_tmp_filename);
90
102
 
101
113
                path_file_list = g_string_free (tmp_path_file_list, FALSE);
102
114
 
103
115
                
104
 
                while (iter = g_strstr_len (iter, strlen (iter), "%"))
 
116
                while ((iter = g_strstr_len (iter, strlen (iter), "%")))
105
117
                {
106
118
                        tmp_string = g_string_append_len (tmp_string, old_iter, strlen (old_iter) - strlen (iter));
107
119
                        switch (iter[1])