@@ -1143,10 +1143,14 @@ find_token_type (const gchar *str, TokenType *token_type)
1143
1143
* token_type = TOKEN_URI_LIST ;
1144
1144
return ptr ;
1145
1145
}
1146
- if (g_str_has_prefix (ptr , TOKEN_EXEC_PARENT )) {
1146
+ if (g_str_has_prefix (ptr , TOKEN_EXEC_LOCATION_PATH )) {
1147
1147
* token_type = TOKEN_PARENT_PATH ;
1148
1148
return ptr ;
1149
1149
}
1150
+ if (g_str_has_prefix (ptr , TOKEN_EXEC_LOCATION_URI )) {
1151
+ * token_type = TOKEN_PARENT_URI ;
1152
+ return ptr ;
1153
+ }
1150
1154
if (g_str_has_prefix (ptr , TOKEN_EXEC_FILE_NAME )) {
1151
1155
* token_type = TOKEN_FILE_DISPLAY_NAME ;
1152
1156
return ptr ;
@@ -1322,7 +1326,7 @@ get_insertion_string (NemoAction *action,
1322
1326
first = FALSE;
1323
1327
}
1324
1328
} else {
1325
- goto default_parent_path ;
1329
+ goto default_parent_uri ;
1326
1330
}
1327
1331
break ;
1328
1332
case TOKEN_PARENT_PATH :
@@ -1343,6 +1347,33 @@ get_insertion_string (NemoAction *action,
1343
1347
str = insert_quote (action , str );
1344
1348
g_free (path );
1345
1349
break ;
1350
+ case TOKEN_PARENT_URI :
1351
+ ;
1352
+ default_parent_uri :
1353
+ ;
1354
+ gchar * uri ;
1355
+ gchar * name = nemo_file_get_display_name (parent );
1356
+ if (g_strcmp0 (name , "x-nemo-desktop" ) == 0 ) {
1357
+ gchar * real_desktop_path = nemo_get_desktop_directory ();
1358
+ if (real_desktop_path ) {
1359
+ GFile * file ;
1360
+ file = g_file_new_for_path (real_desktop_path );
1361
+ uri = g_file_get_uri (file );
1362
+ g_object_unref (file );
1363
+ g_free (real_desktop_path );
1364
+ } else {
1365
+ uri = NULL ;
1366
+ }
1367
+ } else {
1368
+ uri = nemo_file_get_uri (parent );
1369
+ }
1370
+
1371
+ str = insert_quote (action , str );
1372
+ str = score_append (action , str , uri );
1373
+ str = insert_quote (action , str );
1374
+ g_free (name );
1375
+ g_free (uri );
1376
+ break ;
1346
1377
case TOKEN_FILE_DISPLAY_NAME :
1347
1378
if (g_list_length (selection ) > 0 ) {
1348
1379
gchar * file_display_name = nemo_file_get_display_name (NEMO_FILE (selection -> data ));
0 commit comments