"file:" URLs?



The patch attached to this message is an attempt to make Balsa recognise
URLs of type "file:" within messages. It doesn't work. Can anyone explain
why?

-- 
Toralf Lund <toralf@kscanners.com>  +47 66 85 51 22
Kongsberg Scanners AS               +47 66 85 51 00 (switchboard)
http://www.kscanners.no/~toralf     +47 66 85 51 01 (fax)
Index: balsa-message.c
===================================================================
RCS file: /cvs/gnome/balsa/src/balsa-message.c,v
retrieving revision 1.174
diff -c -r1.174 balsa-message.c
*** balsa-message.c	2001/08/10 13:40:52	1.174
--- balsa-message.c	2001/08/17 15:26:51
***************
*** 1135,1141 ****
      URL_FTP,
      URL_MAILTO,
      URL_NNTP,
!     URL_NEWS
  } url_proto_t;
  
  typedef struct _message_url_t {
--- 1135,1142 ----
      URL_FTP,
      URL_MAILTO,
      URL_NNTP,
!     URL_NEWS,
!     URL_FILE
  } url_proto_t;
  
  typedef struct _message_url_t {
***************
*** 1153,1161 ****
  #define DEFAULT_TAB_STOP_WIDTH   8      /* chars per tab */
  
  #ifdef HAVE_PCRE
! static const char *url_str = "\\b(((https?|ftps?|nntp)://)|(mailto:|news:))(%[0-9A-F]{2}|[-_.!~*';/?:@&=+$,#\\w])+\\b";
  #else
! static const char *url_str = "(((https?|ftps?|nntp)://)|(mailto:|news:))(%[0-9A-F]{2}|[-_.!~*';/?:@&=+$,#[:alnum:]])+";
  #endif
  
  /* the cursors which are displayed over URL's and normal message text */
--- 1154,1162 ----
  #define DEFAULT_TAB_STOP_WIDTH   8      /* chars per tab */
  
  #ifdef HAVE_PCRE
! static const char *url_str = "\\b(((https?|ftps?|nntp)://)|(mailto:|news:|file:))(%[0-9A-F]{2}|[-_.!~*';/?:@&=+$,#\\w])+\\b";
  #else
! static const char *url_str = "(((https?|ftps?|nntp)://)|(mailto:|news:|file:))(%[0-9A-F]{2}|[-_.!~*';/?:@&=+$,#[:alnum:]])+";
  #endif
  
  /* the cursors which are displayed over URL's and normal message text */
***************
*** 1299,1305 ****
  	    if (tolower(*buf) == 'h')
  		url_found->url_protocol = URL_HTTP;
  	    else if (tolower(*buf) == 'f')
! 		url_found->url_protocol = URL_FTP;
  	    else if (tolower(*buf) == 'm')
  		url_found->url_protocol = URL_MAILTO;
  	    else if (tolower(*buf) == 'n') {
--- 1300,1306 ----
  	    if (tolower(*buf) == 'h')
  		url_found->url_protocol = URL_HTTP;
  	    else if (tolower(*buf) == 'f')
! 		url_found->url_protocol = tolower(buf[1]=='i'?URL_FILE:URL_FTP);
  	    else if (tolower(*buf) == 'm')
  		url_found->url_protocol = URL_MAILTO;
  	    else if (tolower(*buf) == 'n') {
***************
*** 1520,1525 ****
--- 1521,1527 ----
      switch (url->url_protocol) {
      case URL_FTP:
      case URL_HTTP:
+     case URL_FILE:
  	notice = g_strdup_printf(_("Calling browser with %s..."),
  				 url->url);
  	gnome_appbar_set_status(balsa_app.appbar, notice);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]