~motumedia/xine-ui/ubuntu

« back to all changes in this revision

Viewing changes to src/xitk/file_browser.c

  • Committer: Reinhard Tartler
  • Date: 2007-01-30 10:33:18 UTC
  • mfrom: (2541.1.34 xine-ui.0.99.4+cvs)
  • Revision ID: siretart@tauware.de-20070130103318-evmro8n4ydtj3cwb
merge debian changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * along with this program; if not, write to the Free Software
18
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19
19
 *
20
 
 * $Id: file_browser.c,v 1.62 2006/06/29 14:08:13 dgp85 Exp $
 
20
 * $Id: file_browser.c,v 1.64 2006/07/15 23:20:25 dgp85 Exp $
21
21
 *
22
22
 */
23
23
 
979
979
      char buf[XITK_PATH_MAX + XITK_NAME_MAX + 1];
980
980
      int sel = xitk_browser_get_current_selected(fb->files_browser);
981
981
 
982
 
      memset(&buf, 0, sizeof(buf));
983
 
      snprintf(buf, sizeof(buf), "%s", fb->current_dir);
984
 
      if(strlen(fb->current_dir) > 1)
985
 
        strcat(buf, "/");
986
 
      strcat(buf, fb->norm_files[sel].name);
 
982
      snprintf(buf, sizeof(buf), "%s%s%s",
 
983
               fb->current_dir, ( strlen(fb->current_dir) ? "/" : "" ),
 
984
               fb->norm_files[sel].name);
987
985
      
988
986
      if((unlink(buf)) == -1)
989
987
        xine_error(_("Unable to delete file '%s': %s."), buf, strerror(errno));
1005
1003
 
1006
1004
    snprintf(buf, sizeof(buf), _("Do you really want to delete the file: '%s'"), fb->current_dir);
1007
1005
    if(strlen(fb->current_dir) > 1)
1008
 
      strcat(buf, "/");
1009
 
    sprintf(buf+strlen(buf), "%s' ?.", fb->norm_files[sel].name);
 
1006
      strlcat(buf, "/", sizeof(buf));
 
1007
    snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%s' ?.", fb->norm_files[sel].name);
1010
1008
    
1011
1009
    fb_deactivate(fb);
1012
1010
    xitk_window_dialog_yesno(gGui->imlib_data, _("Confirm deletion ?"),
1021
1019
  char buf[XITK_PATH_MAX + XITK_NAME_MAX + 1];
1022
1020
  int sel = xitk_browser_get_current_selected(fb->files_browser);
1023
1021
  
1024
 
  memset(&buf, 0, sizeof(buf));
1025
 
  snprintf(buf, sizeof(buf), "%s", fb->current_dir);
1026
 
  if(strlen(fb->current_dir) > 1)
1027
 
    strcat(buf, "/");
1028
 
  strcat(buf, fb->norm_files[sel].name);
1029
 
  
 
1022
  snprintf(buf, sizeof(buf), "%s%s%s",
 
1023
           fb->current_dir, ( strlen(fb->current_dir) ? "/" : "" ),
 
1024
           fb->norm_files[sel].name);
 
1025
      
1030
1026
  if((rename(buf, newname)) == -1)
1031
1027
    xine_error(_("Unable to rename file '%s' to '%s': %s."), buf, newname, strerror(errno));
1032
1028
  else
1040
1036
  if((sel = xitk_browser_get_current_selected(fb->files_browser)) >= 0) {
1041
1037
    char buf[XITK_PATH_MAX + XITK_NAME_MAX + 1];
1042
1038
    
1043
 
    memset(&buf, 0, sizeof(buf));
1044
 
    snprintf(buf, sizeof(buf), "%s", fb->current_dir);
1045
 
    if(strlen(fb->current_dir) > 1)
1046
 
      strcat(buf, "/");
1047
 
    strcat(buf, fb->norm_files[sel].name);
1048
 
    
 
1039
    snprintf(buf, sizeof(buf), "%s%s%s",
 
1040
             fb->current_dir, ( strlen(fb->current_dir) ? "/" : "" ),
 
1041
             fb->norm_files[sel].name);
 
1042
      
1049
1043
    fb_deactivate(fb);
1050
1044
    fb_create_input_window(_("Rename file"), buf, fb_rename_file_cb, fb);
1051
1045
  }
1063
1057
  filebrowser_t *fb = (filebrowser_t *) data;
1064
1058
  char           buf[XITK_PATH_MAX + XITK_NAME_MAX + 1];
1065
1059
  
1066
 
  memset(&buf, 0, sizeof(buf));
1067
 
  snprintf(buf, sizeof(buf), "%s", fb->current_dir);
1068
 
  if(strlen(fb->current_dir) > 1)
1069
 
    strcat(buf, "/");
1070
 
  
 
1060
  snprintf(buf, sizeof(buf), "%s%s",
 
1061
           fb->current_dir, ( strlen(fb->current_dir) ? "/" : "" ));
 
1062
      
1071
1063
  fb_deactivate(fb);
1072
1064
  fb_create_input_window(_("Create a new directory"), buf, fb_create_directory_cb, fb);
1073
1065
}