@@ -1143,10 +1143,14 @@ find_token_type (const gchar *str, TokenType *token_type)
11431143 * token_type = TOKEN_URI_LIST ;
11441144 return ptr ;
11451145 }
1146- if (g_str_has_prefix (ptr , TOKEN_EXEC_PARENT )) {
1146+ if (g_str_has_prefix (ptr , TOKEN_EXEC_LOCATION_PATH )) {
11471147 * token_type = TOKEN_PARENT_PATH ;
11481148 return ptr ;
11491149 }
1150+ if (g_str_has_prefix (ptr , TOKEN_EXEC_LOCATION_URI )) {
1151+ * token_type = TOKEN_PARENT_URI ;
1152+ return ptr ;
1153+ }
11501154 if (g_str_has_prefix (ptr , TOKEN_EXEC_FILE_NAME )) {
11511155 * token_type = TOKEN_FILE_DISPLAY_NAME ;
11521156 return ptr ;
@@ -1322,7 +1326,7 @@ get_insertion_string (NemoAction *action,
13221326 first = FALSE;
13231327 }
13241328 } else {
1325- goto default_parent_path ;
1329+ goto default_parent_uri ;
13261330 }
13271331 break ;
13281332 case TOKEN_PARENT_PATH :
@@ -1343,6 +1347,33 @@ get_insertion_string (NemoAction *action,
13431347 str = insert_quote (action , str );
13441348 g_free (path );
13451349 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 ;
13461377 case TOKEN_FILE_DISPLAY_NAME :
13471378 if (g_list_length (selection ) > 0 ) {
13481379 gchar * file_display_name = nemo_file_get_display_name (NEMO_FILE (selection -> data ));
0 commit comments