~ubuntu-branches/ubuntu/jaunty/gvfs/jaunty-updates

« back to all changes in this revision

Viewing changes to daemon/gvfsbackendgphoto2.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-03-02 18:10:40 UTC
  • mfrom: (1.1.37 upstream)
  • Revision ID: james.westby@ubuntu.com-20090302181040-bozliyntjtpd0ozp
Tags: 1.1.7-0ubuntu1
* New upstream version:
  - Fix build on some platforms
  - ftp: Fix short read errors (lp: #208750)
  - gphoto2: Make it work on iphone
  - sftp: Fix symlink creation
  - fuse: Better support of truncation, fixing OOo save (lp: #317587)
  - proxy monitors: Support mount operations, etc
  - gvfs-mount: add --device commandline support
  - sftp: Fix protocol bug that made some servers not work (lp: #286053)
  - general support for query_info over streams, implemented for smb, sftp
  - Initial support for .xdg-volume-info reading (lp: #269159)
  - fix trash crasher (lp: #332554)
  - use ssh config (lp: #264803)
* debian/patches/02_support_xdg_volume_info.patch:
  - the new version fixes this issue
* debian/patches/91_upstream_change_fix_trash_crasher.patch:
  - upstream change to fix a trash crasher (lp: #333791)
* debian/rules:
  - shlibs version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
  GPContext *context;
173
173
  Camera *camera;
174
174
 
 
175
  /* see comment in ensure_ignore_prefix() */
 
176
  char *ignore_prefix;
 
177
 
175
178
  /* list of open files */
176
179
  int num_open_files_for_reading;
177
180
 
226
229
/* ------------------------------------------------------------------------------------------------- */
227
230
 
228
231
typedef struct {
229
 
  /* this is the path of the dir/file */
 
232
  /* this is the path of the dir/file including ignore_prefix */
230
233
  char *path;
231
234
  GVfsMonitor *vfs_monitor;
232
235
} MonitorProxy;
348
351
  GList *l;
349
352
  char *filepath;
350
353
 
 
354
  g_return_if_fail (g_str_has_prefix (dir, gphoto2_backend->ignore_prefix));
 
355
 
351
356
  DEBUG ("monitors_emit_internal() %s for '%s' '%s'", event_name, dir, name);
352
357
 
353
358
  for (l = gphoto2_backend->dir_monitor_proxies; l != NULL; l = l->next)
356
361
      if (strcmp (proxy->path, dir) == 0)
357
362
        {
358
363
          char *path;
359
 
          path = g_build_filename (dir, name, NULL);
 
364
          path = g_build_filename (dir + strlen (gphoto2_backend->ignore_prefix), name, NULL);
360
365
          g_vfs_monitor_emit_event (proxy->vfs_monitor, event, path, NULL);
361
366
          DEBUG ("  emitted %s for '%s' on dir monitor for '%s'", event_name, path, dir);
362
367
          g_free (path);
369
374
      MonitorProxy *proxy = l->data;
370
375
      if (strcmp (proxy->path, filepath) == 0)
371
376
        {
372
 
          g_vfs_monitor_emit_event (proxy->vfs_monitor, event, filepath, NULL);
373
 
          DEBUG ("  emitted %s for '%s' on file monitor", event_name, filepath);
 
377
          const char *path = filepath + strlen (gphoto2_backend->ignore_prefix);
 
378
          g_vfs_monitor_emit_event (proxy->vfs_monitor, event, path, NULL);
 
379
          DEBUG ("  emitted %s for '%s' on file monitor", event_name, path);
374
380
        }
375
381
    }
376
382
  g_free (filepath);
555
561
  g_free (gphoto2_backend->hal_icon_name);
556
562
  gphoto2_backend->hal_icon_name = NULL;
557
563
 
 
564
  g_free (gphoto2_backend->ignore_prefix);
 
565
  gphoto2_backend->ignore_prefix = NULL;
 
566
 
558
567
  if (gphoto2_backend->info_cache != NULL)
559
568
    {
560
569
      g_hash_table_unref (gphoto2_backend->info_cache);
903
912
/* ------------------------------------------------------------------------------------------------- */
904
913
 
905
914
static void
906
 
split_filename (GVfsBackendGphoto2 *gphoto2_backend, const char *filename, char **dir, char **name)
 
915
split_filename_with_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, const char *filename, char **dir, char **name)
907
916
{
908
917
  char *s;
909
918
 
910
919
  s = g_path_get_dirname (filename);
911
920
  if (s[0] == '/')
912
 
    *dir = g_strconcat ("/", s + 1, NULL);
 
921
    *dir = g_strconcat (gphoto2_backend->ignore_prefix, s + 1, NULL);
913
922
  else
914
 
    *dir = g_strconcat ("/", s, NULL);
 
923
    *dir = g_strconcat (gphoto2_backend->ignore_prefix, s, NULL);
915
924
  g_free (s);
916
925
 
917
926
  if (strcmp (filename, "/") == 0)
923
932
  if (s[strlen(s)] == '/')
924
933
    s[strlen(s)] = '\0';
925
934
 
926
 
  /*DEBUG ("split_filename: '%s' -> '%s' '%s'", filename, *dir, *name);*/
927
 
}
928
 
 
929
 
/* ------------------------------------------------------------------------------------------------- */
930
 
 
 
935
  /*DEBUG ("split_filename_with_ignore_prefix: '%s' -> '%s' '%s'", filename, *dir, *name);*/
 
936
}
 
937
 
 
938
/* ------------------------------------------------------------------------------------------------- */
 
939
 
 
940
static char *
 
941
add_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, const char *filename)
 
942
{
 
943
  char *result;
 
944
 
 
945
  if (filename[0] == '/')
 
946
    result = g_strconcat (gphoto2_backend->ignore_prefix, filename + 1, NULL);
 
947
  else
 
948
    result = g_strconcat (gphoto2_backend->ignore_prefix, filename, NULL);
 
949
 
 
950
  /*DEBUG ("add_ignore_prefix: '%s' -> '%s'", filename, result);*/
 
951
  return result;
 
952
}
 
953
 
 
954
/* ------------------------------------------------------------------------------------------------- */
 
955
 
 
956
/* the passed 'dir' variable must contain ignore_prefix */
931
957
static gboolean
932
958
file_get_info (GVfsBackendGphoto2 *gphoto2_backend, 
933
959
               const char *dir, 
951
977
  full_path = g_build_filename (dir, name, NULL);
952
978
  DEBUG ("file_get_info() try_cache_only=%d dir='%s', name='%s'\n"
953
979
         "                full_path='%s'", 
954
 
         try_cache_only, dir, name, full_path);
 
980
         try_cache_only, dir, name, full_path, gphoto2_backend->ignore_prefix);
955
981
 
956
982
 
957
983
  /* first look up cache */
978
1004
  g_file_info_unset_attribute_mask (info);
979
1005
 
980
1006
  /* handle root directory */
981
 
  if (strcmp (full_path, "/") == 0)
 
1007
  if (strcmp (full_path, gphoto2_backend->ignore_prefix) == 0 || strcmp (full_path, "/") == 0)
982
1008
    {
983
1009
      char *display_name;
984
1010
      display_name = compute_display_name (gphoto2_backend);
1110
1136
      GMountSpec *mount_spec;
1111
1137
 
1112
1138
      mount_spec = g_vfs_backend_get_mount_spec (G_VFS_BACKEND (gphoto2_backend));
1113
 
      icon_id = g_strdup_printf ("preview:%s/%s", dir, name);
 
1139
      icon_id = g_strdup_printf ("preview:%s/%s", dir + strlen (gphoto2_backend->ignore_prefix), name);
1114
1140
      icon = g_vfs_icon_new (mount_spec,
1115
1141
                             icon_id);
1116
1142
      g_file_info_set_attribute_object (info,
1268
1294
 
1269
1295
/* ------------------------------------------------------------------------------------------------- */
1270
1296
 
 
1297
/* If we only have a single storage head, the gphoto2 volume monitor
 
1298
 * will not use activation roots into our mount. This is mainly to
 
1299
 * work around buggy devices where the basedir of the storage head
 
1300
 * changes on every camera initialization, e.g. the iPhone.
 
1301
 *
 
1302
 * So, if we have only one storage head, do use basedir of that
 
1303
 * head as ignore_prefix.
 
1304
 *
 
1305
 * See also update_cameras() in ggphoto2volumemonitor.c.
 
1306
 *
 
1307
 * This function needs to be called from do_mount().
 
1308
 */
 
1309
static gboolean
 
1310
ensure_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, GVfsJob *job)
 
1311
{
 
1312
  gchar *prefix;
 
1313
  CameraStorageInformation *storage_info;
 
1314
  int num_storage_info;
 
1315
 
 
1316
  /* already set */
 
1317
  if (gphoto2_backend->ignore_prefix != NULL)
 
1318
    return TRUE;
 
1319
 
 
1320
  prefix = NULL;
 
1321
 
 
1322
  if (gp_camera_get_storageinfo (gphoto2_backend->camera,
 
1323
                                 &storage_info,
 
1324
                                 &num_storage_info,
 
1325
                                 gphoto2_backend->context) != 0)
 
1326
    goto out;
 
1327
 
 
1328
  if (num_storage_info > 1)
 
1329
    goto out;
 
1330
 
 
1331
  prefix = g_strdup_printf ("%s/", storage_info[0].basedir);
 
1332
 
 
1333
 out:
 
1334
 
 
1335
  if (prefix == NULL)
 
1336
    gphoto2_backend->ignore_prefix = g_strdup ("/");
 
1337
  else
 
1338
    gphoto2_backend->ignore_prefix = prefix;
 
1339
 
 
1340
  return TRUE;
 
1341
}
 
1342
 
 
1343
/* ------------------------------------------------------------------------------------------------- */
 
1344
 
1271
1345
static void
1272
1346
do_mount (GVfsBackend *backend,
1273
1347
          GVfsJobMount *job,
1443
1517
      return;
1444
1518
    }
1445
1519
 
 
1520
  if (!ensure_ignore_prefix (gphoto2_backend, G_VFS_JOB (job)))
 
1521
    {
 
1522
      release_device (gphoto2_backend);
 
1523
      return;
 
1524
    }
 
1525
 
1446
1526
  /* Translator: %s represents the device, e.g. usb:001,042  */
1447
1527
  fuse_name = g_strdup_printf (_("gphoto2 mount on %s"), gphoto2_backend->gphoto2_port);
1448
1528
  icon_name = compute_icon_name (gphoto2_backend);
1589
1669
 
1590
1670
  ensure_not_dirty (gphoto2_backend);
1591
1671
 
1592
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
1672
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
1593
1673
 
1594
1674
  if (is_directory (gphoto2_backend, dir, name))
1595
1675
    {
1819
1899
 
1820
1900
  DEBUG ("query_info (%s)", filename);
1821
1901
 
1822
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
1902
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
1823
1903
 
1824
1904
  error = NULL;
1825
1905
  if (!file_get_info (gphoto2_backend, dir, name, info, &error, FALSE))
1855
1935
 
1856
1936
  ret = FALSE;
1857
1937
 
1858
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
1938
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
1859
1939
 
1860
1940
  if (!file_get_info (gphoto2_backend, dir, name, info, NULL, TRUE))
1861
1941
    {
1889
1969
  CameraList *list;
1890
1970
  int n;
1891
1971
  int rc;
 
1972
  char *filename;
1892
1973
  gboolean using_cached_dir_list;
1893
1974
  gboolean using_cached_file_list;
1894
1975
  char *as_dir;
1898
1979
  using_cached_dir_list = FALSE;
1899
1980
  using_cached_file_list = FALSE;
1900
1981
 
 
1982
  filename = add_ignore_prefix (gphoto2_backend, given_filename);
1901
1983
  DEBUG ("enumerate (%s)", given_filename);
1902
1984
 
1903
 
  split_filename (gphoto2_backend, given_filename, &as_dir, &as_name);
 
1985
  split_filename_with_ignore_prefix (gphoto2_backend, given_filename, &as_dir, &as_name);
1904
1986
  if (!is_directory (gphoto2_backend, as_dir, as_name))
1905
1987
    {
1906
1988
      if (is_regular (gphoto2_backend, as_dir, as_name))
1924
2006
 
1925
2007
  /* first, list the folders */
1926
2008
  g_mutex_lock (gphoto2_backend->lock);
1927
 
  list = g_hash_table_lookup (gphoto2_backend->dir_name_cache, given_filename);
 
2009
  list = g_hash_table_lookup (gphoto2_backend->dir_name_cache, filename);
1928
2010
  if (list == NULL)
1929
2011
    {
1930
2012
      g_mutex_unlock (gphoto2_backend->lock);
1931
2013
 
1932
2014
      ensure_not_dirty (gphoto2_backend);
1933
2015
 
1934
 
      DEBUG ("  Generating dir list for dir '%s'", given_filename);
 
2016
      DEBUG ("  Generating dir list for dir '%s'", filename);
1935
2017
 
1936
2018
      gp_list_new (&list);
1937
2019
      rc = gp_camera_folder_list_folders (gphoto2_backend->camera, 
1938
 
                                          given_filename, 
 
2020
                                          filename, 
1939
2021
                                          list, 
1940
2022
                                          gphoto2_backend->context);
1941
2023
      if (rc != 0)
1943
2025
          error = get_error_from_gphoto2 (_("Failed to get folder list"), rc);
1944
2026
          g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
1945
2027
          g_error_free (error);
 
2028
          g_free (filename);
1946
2029
          return;
1947
2030
        }  
1948
2031
    }
1949
2032
  else
1950
2033
    {
1951
 
      DEBUG ("  Using cached dir list for dir '%s'", given_filename);
 
2034
      DEBUG ("  Using cached dir list for dir '%s'", filename);
1952
2035
      using_cached_dir_list = TRUE;
1953
2036
      gp_list_ref (list);
1954
2037
      g_mutex_unlock (gphoto2_backend->lock);
1961
2044
      DEBUG ("  enum folder '%s'", name);
1962
2045
      info = g_file_info_new ();
1963
2046
      error = NULL;
1964
 
      if (!file_get_info (gphoto2_backend, given_filename, name, info, &error, FALSE))
 
2047
      if (!file_get_info (gphoto2_backend, filename, name, info, &error, FALSE))
1965
2048
        {
1966
2049
          g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
1967
2050
          g_error_free (error);
1976
2059
    {
1977
2060
#ifndef DEBUG_NO_CACHING
1978
2061
      g_mutex_lock (gphoto2_backend->lock);
1979
 
      g_hash_table_insert (gphoto2_backend->dir_name_cache, g_strdup (given_filename), list);
 
2062
      g_hash_table_insert (gphoto2_backend->dir_name_cache, g_strdup (filename), list);
1980
2063
      g_mutex_unlock (gphoto2_backend->lock);
1981
2064
#endif
1982
2065
    }
1990
2073
 
1991
2074
  /* then list the files in each folder */
1992
2075
  g_mutex_lock (gphoto2_backend->lock);
1993
 
  list = g_hash_table_lookup (gphoto2_backend->file_name_cache, given_filename);
 
2076
  list = g_hash_table_lookup (gphoto2_backend->file_name_cache, filename);
1994
2077
  if (list == NULL)
1995
2078
    {
1996
2079
      g_mutex_unlock (gphoto2_backend->lock);
1997
2080
      ensure_not_dirty (gphoto2_backend);
1998
2081
 
1999
 
      DEBUG ("  Generating file list for dir '%s'", given_filename);
 
2082
      DEBUG ("  Generating file list for dir '%s'", filename);
2000
2083
 
2001
2084
      gp_list_new (&list);
2002
2085
      rc = gp_camera_folder_list_files (gphoto2_backend->camera, 
2003
 
                                        given_filename,
 
2086
                                        filename, 
2004
2087
                                        list, 
2005
2088
                                        gphoto2_backend->context);
2006
2089
      if (rc != 0)
2008
2091
          error = get_error_from_gphoto2 (_("Failed to get file list"), rc);
2009
2092
          g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
2010
2093
          g_error_free (error);
 
2094
          g_free (filename);
2011
2095
          return;
2012
2096
        }
2013
2097
    }
2014
2098
  else
2015
2099
    {
2016
 
      DEBUG ("  Using cached file list for dir '%s'", given_filename);
 
2100
      DEBUG ("  Using cached file list for dir '%s'", filename);
2017
2101
      using_cached_file_list = TRUE;
2018
2102
      gp_list_ref (list);
2019
2103
      g_mutex_unlock (gphoto2_backend->lock);
2027
2111
 
2028
2112
      info = g_file_info_new ();
2029
2113
      error = NULL;
2030
 
      if (!file_get_info (gphoto2_backend, given_filename, name, info, &error, FALSE))
 
2114
      if (!file_get_info (gphoto2_backend, filename, name, info, &error, FALSE))
2031
2115
        {
2032
2116
          g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
2033
2117
          g_error_free (error);
2042
2126
    {
2043
2127
#ifndef DEBUG_NO_CACHING
2044
2128
      g_mutex_lock (gphoto2_backend->lock);
2045
 
      g_hash_table_insert (gphoto2_backend->file_name_cache, g_strdup (given_filename), list);
 
2129
      g_hash_table_insert (gphoto2_backend->file_name_cache, g_strdup (filename), list);
2046
2130
      g_mutex_unlock (gphoto2_backend->lock);
2047
2131
#endif
2048
2132
    }
2060
2144
  g_list_foreach (l, (GFunc) g_object_unref, NULL);
2061
2145
  g_list_free (l);
2062
2146
  g_vfs_job_enumerate_done (job);
 
2147
 
 
2148
  g_free (filename);
2063
2149
}
2064
2150
 
2065
2151
/* ------------------------------------------------------------------------------------------------- */
2077
2163
  GError *error;
2078
2164
  CameraList *list;
2079
2165
  int n;
 
2166
  char *filename;
2080
2167
  const char *name;
2081
2168
 
2082
2169
  l = NULL;
2083
2170
 
 
2171
  filename = add_ignore_prefix (gphoto2_backend, given_filename);
2084
2172
  DEBUG ("try_enumerate (%s)", given_filename);
2085
2173
 
2086
2174
  /* first, list the folders */
2087
2175
  g_mutex_lock (gphoto2_backend->lock);
2088
 
  list = g_hash_table_lookup (gphoto2_backend->dir_name_cache, given_filename);
 
2176
  list = g_hash_table_lookup (gphoto2_backend->dir_name_cache, filename);
2089
2177
  if (list == NULL)
2090
2178
    {
2091
2179
      g_mutex_unlock (gphoto2_backend->lock);
2098
2186
      gp_list_get_name (list, n, &name);
2099
2187
      DEBUG ("  try_enum folder '%s'", name);
2100
2188
      info = g_file_info_new ();
2101
 
      if (!file_get_info (gphoto2_backend, given_filename, name, info, &error, TRUE))
 
2189
      if (!file_get_info (gphoto2_backend, filename, name, info, &error, TRUE))
2102
2190
        {
2103
2191
          g_mutex_lock (gphoto2_backend->lock);
2104
2192
          gp_list_unref (list);
2113
2201
 
2114
2202
  /* then list the files in each folder */
2115
2203
  g_mutex_lock (gphoto2_backend->lock);
2116
 
  list = g_hash_table_lookup (gphoto2_backend->file_name_cache, given_filename);
 
2204
  list = g_hash_table_lookup (gphoto2_backend->file_name_cache, filename);
2117
2205
  if (list == NULL)
2118
2206
    {
2119
2207
      g_mutex_unlock (gphoto2_backend->lock);
2127
2215
      DEBUG ("  try_enum file '%s'", name);
2128
2216
 
2129
2217
      info = g_file_info_new ();
2130
 
      if (!file_get_info (gphoto2_backend, given_filename, name, info, &error, TRUE))
 
2218
      if (!file_get_info (gphoto2_backend, filename, name, info, &error, TRUE))
2131
2219
        {
2132
2220
          g_mutex_lock (gphoto2_backend->lock);
2133
2221
          gp_list_unref (list);
2148
2236
  g_list_free (l);
2149
2237
  g_vfs_job_enumerate_done (job);
2150
2238
 
 
2239
  g_free (filename);
2151
2240
  DEBUG ("  YAY got info from cache for try_enumerate (%s)", given_filename);
2152
2241
  return TRUE;
2153
2242
 
2155
2244
  g_list_foreach (l, (GFunc) g_object_unref, NULL);
2156
2245
  g_list_free (l);
2157
2246
 
 
2247
  g_free (filename);
2158
2248
  DEBUG ("  BUU no info from cache for try_enumerate (%s)", given_filename);
2159
2249
  return FALSE;
2160
2250
}
2282
2372
      goto out;
2283
2373
    }
2284
2374
 
2285
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
2375
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
2286
2376
 
2287
2377
  rc = gp_camera_folder_make_dir (gphoto2_backend->camera,
2288
2378
                                  dir,
2491
2581
      goto out;
2492
2582
    }
2493
2583
 
2494
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
2584
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
2495
2585
 
2496
2586
  /* refuse is desired name is already taken */
2497
2587
  if (is_directory (gphoto2_backend, dir, display_name) ||
2546
2636
  monitors_emit_deleted (gphoto2_backend, dir, name);
2547
2637
  monitors_emit_created (gphoto2_backend, dir, display_name);
2548
2638
 
2549
 
  new_name = g_build_filename (dir, display_name, NULL);
 
2639
  new_name = g_build_filename (dir + strlen (gphoto2_backend->ignore_prefix), display_name, NULL);
2550
2640
  g_vfs_job_set_display_name_set_new_path (job, new_name);
2551
2641
 
2552
2642
  g_vfs_job_succeeded (G_VFS_JOB (job));
2588
2678
      goto out;
2589
2679
    }
2590
2680
 
2591
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
2681
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
2592
2682
 
2593
2683
  if (is_directory (gphoto2_backend, dir, name))
2594
2684
    {
2595
 
      if (!is_directory_empty (gphoto2_backend, filename))
 
2685
      dir_name = add_ignore_prefix (gphoto2_backend, filename);
 
2686
      if (!is_directory_empty (gphoto2_backend, dir_name))
2596
2687
        {
2597
2688
          g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR,
2598
2689
                            G_IO_ERROR_NOT_EMPTY,
2680
2771
      goto out;
2681
2772
    }
2682
2773
 
2683
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
2774
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
2684
2775
 
2685
2776
  if (is_directory (gphoto2_backend, dir, name))
2686
2777
    {
2838
2929
 
2839
2930
  dir = NULL;
2840
2931
  name = NULL;
2841
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
2932
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
2842
2933
  
2843
2934
  /* write a new file
2844
2935
   * - will delete the existing one when done in do_close_write() 
2865
2956
 
2866
2957
  dir = NULL;
2867
2958
  name = NULL;
2868
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
2959
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
2869
2960
  
2870
2961
  /* write a new file
2871
2962
   * - will read existing data in do_create_internal
3085
3176
 
3086
3177
  ensure_not_dirty (gphoto2_backend);
3087
3178
 
3088
 
  split_filename (gphoto2_backend, source, &src_dir, &src_name);
3089
 
  split_filename (gphoto2_backend, destination, &dst_dir, &dst_name);
 
3179
  split_filename_with_ignore_prefix (gphoto2_backend, source, &src_dir, &src_name);
 
3180
  split_filename_with_ignore_prefix (gphoto2_backend, destination, &dst_dir, &dst_name);
3090
3181
 
3091
3182
  /* this is an limited implementation that can only move files / folders in the same directory */
3092
3183
  if (strcmp (src_dir, dst_dir) != 0)
3220
3311
 
3221
3312
  DEBUG ("create_dir_monitor (%s)", filename);
3222
3313
 
3223
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
3314
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
3224
3315
 
3225
3316
  proxy = g_new0 (MonitorProxy, 1);
3226
 
  proxy->path = g_strdup (filename);
 
3317
  proxy->path = add_ignore_prefix (gphoto2_backend, filename);
3227
3318
  proxy->vfs_monitor = g_vfs_monitor_new (backend);
3228
3319
 
3229
3320
  gphoto2_backend->dir_monitor_proxies = g_list_prepend (gphoto2_backend->dir_monitor_proxies, proxy);
3270
3361
 
3271
3362
  DEBUG ("create_file_monitor (%s)", filename);
3272
3363
 
3273
 
  split_filename (gphoto2_backend, filename, &dir, &name);
 
3364
  split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
3274
3365
 
3275
3366
  proxy = g_new0 (MonitorProxy, 1);
3276
 
  proxy->path = g_strdup (filename);
 
3367
  proxy->path = add_ignore_prefix (gphoto2_backend, filename);
3277
3368
  proxy->vfs_monitor = g_vfs_monitor_new (backend);
3278
3369
 
3279
3370
  gphoto2_backend->file_monitor_proxies = g_list_prepend (gphoto2_backend->file_monitor_proxies, proxy);