150
150
pFileInfo = g_file_enumerator_next_file (pFileEnum, NULL, &erreur);
151
151
if (erreur != NULL)
153
cd_warning ("gnome_integration : %s", erreur->message);
153
cd_warning ("gvfs-integration : %s", erreur->message);
154
154
g_error_free (erreur);
311
311
cValidUri = g_filename_from_uri (cNautilusFile, NULL, &erreur);
312
312
if (erreur != NULL)
314
cd_warning ("gnome_integration : %s", erreur->message);
314
cd_warning ("gvfs-integration : %s", erreur->message);
315
315
g_error_free (erreur);
370
370
//g_object_unref (pFile);
371
371
if (erreur != NULL) // peut arriver si l'emplacement n'est pas monte.
373
cd_debug ("gnome_integration : %s", erreur->message); // inutile d'en faire un warning.
373
cd_debug ("gvfs-integration : %s", erreur->message); // inutile d'en faire un warning.
374
374
g_error_free (erreur);
375
375
g_free (cValidUri);
376
376
g_object_unref (pFile);
714
714
pFileInfo = g_file_enumerator_next_file (pFileEnum, NULL, &erreur);
715
715
if (erreur != NULL)
717
cd_warning ("gnome_integration : %s", erreur->message);
717
cd_warning ("gvfs-integration : %s", erreur->message);
718
718
g_error_free (erreur);
889
889
icon = cairo_dock_create_dummy_launcher (g_strdup ("home"),
890
890
g_strdup (pRootIcon->cFileName),
891
g_strdup (g_getenv ("HOME")),
894
894
icon->iTrueType = CAIRO_DOCK_ICON_TYPE_FILE;
895
895
icon->iGroup = iNewIconsGroup;
896
icon->cBaseURI = g_strdup_printf ("file://%s", "/home");
896
icon->cBaseURI = g_strdup_printf ("file://%s", g_getenv ("HOME"));
897
897
icon->iVolumeID = 0;
899
899
pIconList = g_list_insert_sorted (pIconList,
943
943
pFileInfo = g_file_enumerator_next_file (pFileEnum, NULL, &erreur);
944
944
if (erreur != NULL)
946
cd_warning ("gnome_integration : %s", erreur->message);
946
cd_warning ("gvfs-integration : %s", erreur->message);
947
947
g_error_free (erreur);
1014
1014
static void cairo_dock_gio_vfs_launch_uri (const gchar *cURI)
1016
1016
g_return_if_fail (cURI != NULL);
1018
// in case it's a mount point, take the URI that can actually be launched.
1017
1019
GError *erreur = NULL;
1018
1020
gchar *cValidUri = (*cURI == '/' ? g_strconcat ("file://", cURI, NULL) : g_strdup (cURI));
1019
1021
cd_message ("%s (%s)", __func__, cValidUri);
1021
1023
gchar *cTargetURI = _cd_find_target_uri (cValidUri);
1022
gboolean bSuccess = g_app_info_launch_default_for_uri (cTargetURI != NULL ? cTargetURI : cValidUri,
1024
cURI= (cTargetURI ? cTargetURI : cValidUri);
1026
// now, try to launch it with the default program know by gvfs.
1027
gboolean bSuccess = g_app_info_launch_default_for_uri (cURI,
1026
g_free (cTargetURI);
1030
if (erreur != NULL) // error can happen (for instance, opening 'trash:/' on XFCE with a previous installation of nautilus) => try with another method.
1029
cd_warning ("gnome_integration : couldn't launch '%s' [%s]", cURI, erreur->message);
1032
cd_debug ("gvfs-integration : couldn't launch '%s' [%s]", cURI, erreur->message);
1030
1033
g_error_free (erreur);
1036
// get the mime-type.
1037
GFile *pFile = (*cURI == '/' ? g_file_new_for_path (cURI) : g_file_new_for_uri (cURI));
1038
const gchar *cQuery = G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE;
1039
GFileInfo *pFileInfo = g_file_query_info (pFile,
1041
G_FILE_QUERY_INFO_NONE,
1044
if (erreur != NULL) // if no mime-type (can happen with not mounted volumes), abort.
1046
cd_warning ("gvfs-integration : %s", erreur->message);
1047
g_error_free (erreur);
1051
// get all the apps that can launch it.
1052
const gchar *cMimeType = g_file_info_get_content_type (pFileInfo);
1053
GList *pAppsList = g_app_info_get_all_for_type (cMimeType);
1058
for (a = pAppsList; a != NULL; a = a->next)
1061
cExec = g_app_info_get_executable (pAppInfo);
1062
if (cExec) // use the first available. it is supposed to be the most suitable, but the default method doesn't seem to use it.
1064
gchar *cPath = g_filename_from_uri (cURI, NULL, NULL);
1065
cairo_dock_launch_command_printf ("%s \"%s\"", NULL, cExec, cPath?cPath:cURI); // in case the program doesn't handle URI (geeqie, etc).
1070
g_list_free (pAppsList);
1072
g_object_unref (pFile);
1075
g_free (cTargetURI);
1034
1078
static GMount *_cd_find_mount_from_uri (const gchar *cURI, gchar **cTargetURI)
1143
1187
bSuccess = g_mount_eject_finish (G_MOUNT (pObject), res, &erreur);
1144
1188
if (erreur != NULL)
1146
cd_warning ("gnome-integration : %s", erreur->message);
1190
cd_warning ("gvfs-integration : %s", erreur->message);
1147
1191
g_error_free (erreur);
1298
1342
//g_object_unref (pFile);
1299
1343
if (erreur != NULL)
1301
cd_warning ("gnome-integration : couldn't add monitor on '%s' (%d) [%s]", cURI, bDirectory, erreur->message);
1345
cd_warning ("gvfs-integration : couldn't add monitor on '%s' (%d) [%s]", cURI, bDirectory, erreur->message);
1302
1346
g_error_free (erreur);
1356
1400
bSuccess = g_file_delete (pFile, NULL, &erreur);
1357
1401
if (erreur != NULL)
1359
cd_warning ("gnome-integration : %s", erreur->message);
1403
cd_warning ("gvfs-integration : %s", erreur->message);
1360
1404
g_error_free (erreur);
1365
1409
bSuccess = g_file_trash (pFile, NULL, &erreur);
1366
1410
if (erreur != NULL)
1368
cd_warning ("gnome-integration : %s", erreur->message);
1412
cd_warning ("gvfs-integration : %s", erreur->message);
1369
1413
g_error_free (erreur);
1381
1425
GFile *pNewFile = g_file_set_display_name (pOldFile, cNewName, NULL, &erreur);
1382
1426
if (erreur != NULL)
1384
cd_warning ("gnome-integration : %s", erreur->message);
1428
cd_warning ("gvfs-integration : %s", erreur->message);
1385
1429
g_error_free (erreur);
1387
1431
gboolean bSuccess = (pNewFile != NULL);
1436
1480
g_file_create (pFile, G_FILE_CREATE_PRIVATE, NULL, &erreur);
1437
1481
if (erreur != NULL)
1439
cd_warning ("gnome-integration : %s", erreur->message);
1483
cd_warning ("gvfs-integration : %s", erreur->message);
1440
1484
g_error_free (erreur);
1441
1485
bSuccess = FALSE;
1546
1590
pFileInfo = g_file_enumerator_next_file (pFileEnum, NULL, &erreur);
1547
1591
if (erreur != NULL)
1549
cd_warning ("gnome_integration : %s", erreur->message);
1593
cd_warning ("gvfs-integration : %s", erreur->message);
1550
1594
g_error_free (erreur);
1567
1611
g_file_delete (file, NULL, &erreur);
1568
1612
if (erreur != NULL)
1570
cd_warning ("gnome_integration : %s", erreur->message);
1614
cd_warning ("gvfs-integration : %s", erreur->message);
1571
1615
g_error_free (erreur);
1618
1662
pFileInfo = g_file_enumerator_next_file (pFileEnum, NULL, &erreur);
1619
1663
if (erreur != NULL)
1621
cd_warning ("gnome_integration : %s", erreur->message);
1665
cd_warning ("gvfs-integration : %s", erreur->message);
1622
1666
g_error_free (erreur);