! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
register application by file extensions
Status:
RESOLVED: FIXED
Priority:
Very Low

Comments

Description Avelino de Almeida Bego 2004-10-26 04:11:29 CEST
n my house, I'm use xfce and this program is very good!

But, the xffm have one problem, with register application by file extensions:

Its take the "complete" extension for file:

eg:

file.one.two.bz2

extension in applications.xml

.one.two.bz2

I have register this file for file-roller application, but, another file:

file.a.b.c.bz2

I have AGAIN to file-roller application, becouse the extension in
applications.xml is:

.a.b.c.bz2

and not only .bz2!

I modify two sources (runc.c and reg.c), changed the strchr function (locate teh
FIRST occurrence of char) by strrchr (locate de LAST ocurrence of char).

This is part of code of

run.c

int on_run_path(GtkTreeView * treeview, char *in_cmd, char *path, gboolean
in_terminal, gboolean remember, gboolean put_in_history)

....

    if(path && remember)
    {
    char *sfx;
   
    // Avelino de Almeida Bego
    // 07/05/2004
    // Changed for capture only last sufix
   
    sfx = strrchr(path, '.');
    if (sfx && strchr(sfx,'/')) {
        sfx=strrchr(sfx,'/');
        sfx=strrchr(sfx,'.');
    }

....


reg.c

reg_t *reg_prog_by_file (char *file)
{
  reg_t *reg;
  char *sfx;
  if (!file) return NULL;
 
  /*
  * Avelino de Almeida Bego
  * abego@ig.com.br
  * 07/05/2004
  * Changed for capture only last sufix
  **/
 
  if (strrchr(file,'.') && strlen(strrchr(file,'.')) > 1) {
    sfx = g_strdup(strrchr(file,'.'));
      if (strchr(sfx,'-')) *(strchr(sfx,'-'))=0;
  }
  else sfx = g_strdup(file);

The propose of this change is, register only LAST sufix of file name:

eg

file.one.two.bz2
and
file.a.b.c.bz2

register in applications.xml, only sufix .bz2
Comment 1 edscott editbugs 2004-10-26 12:48:41 CEST
This has been fixed in 4.2 beta. When you register files with multiple
extensions, a dialog will popup asking you which extension you want to register.
This allows you to choose either the complete extension or just the last part of
the extension.

Bug #414

Reported by:
Avelino de Almeida Bego
Reported on: 2004-10-26
Last modified on: 2009-07-14

People

Assignee:
edscott
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information