Skip to main content

Thread: What do you do with a patch?


sorry noob question, ive wondered this. lot of times when report bug, 1 of developers post patch, dont know it. example, patch lubuntu mailing list:
code:
--- a/src/desktop-ui.c	2010-10-15 10:26:53.000000000 +0200  +++ b/src/desktop-ui.c	2011-08-12 12:37:56.279733976 +0200  @@ -26,6 +26,7 @@ static const char desktop_menu_xml[] =     "<menu action='createnew'>"       "<menuitem action='newfolder'/>"       "<menuitem action='newblank'/>"  +    "<menuitem action='newshortcut'/>"     "</menu>"     "<separator/>"     "<menuitem action='paste'/>"  @@ -55,6 +56,7 @@ static const gtkactionentry desktop_acti       {"createnew", gtk_stock_new, n_("_new"), "", null, null},       {"newfolder", "folder", n_("folder"), "<ctrl><shift>n", null, g_callback(on_create_new)},       {"newblank", "text-x-generic", n_("blank file"), null, null, g_callback(on_create_new)},  +    {"newshortcut", "system-run", n_("shortcut"), null, null, g_callback(on_create_new)},       {"prop", gtk_stock_properties, n_("desktop preferences"), "<alt>return", null, g_callback(fm_desktop_preference)}   };     --- a/src/desktop.c	2011-08-12 13:20:45.000000000 +0200  +++ b/src/desktop.c	2011-08-12 12:40:07.370541766 +0200  @@ -2002,6 +2002,8 @@ void on_create_new(gtkaction* act, gpoin           name = templ_name_folder;       else if( strcmp(name, "newblank") == 0 )           name = templ_name_blank;  +    else if( strcmp(name, "newshortcut") == 0)  +        name = templ_name_shortcut;       pcmanfm_create_new(null, fm_path_get_desktop(), name);   }     --- a/src/main-win-ui.c	2010-10-15 10:26:53.000000000 +0200  +++ b/src/main-win-ui.c	2011-08-12 13:07:28.554932704 +0200  @@ -100,6 +100,7 @@ static const char main_menu_xml[] =     "<menu action='createnew'>"       "<menuitem action='newfolder'/>"       "<menuitem action='newblank'/>"  +    "<menuitem action='newshortcut'/>"     "</menu>"     "<separator/>"     "<menuitem action='paste'/>"  @@ -171,6 +172,7 @@ static gtkactionentry main_win_actions[]       {"createnew", gtk_stock_new, n_("_new"), "", null, null},       {"newfolder", "folder", n_("folder"), "<ctrl><shift>n", null, g_callback(on_create_new)},       {"newblank", "text-x-generic", n_("blank file"), null, null, g_callback(on_create_new)},  +    {"newshortcut", "system-run", n_("shortcut"), null, null, g_callback(on_create_new)},       {"prop", gtk_stock_properties, null, null, null, g_callback(on_prop)}   };    --- a/src/main-win.c	2011-08-12 13:20:45.000000000 +0200  +++ b/src/main-win.c	2011-08-12 15:00:27.662364700 +0200  @@ -1262,6 +1262,8 @@ void on_create_new(gtkaction* action, fm           name = templ_name_folder;       else if( strcmp(name, "newblank") == 0 )           name = templ_name_blank;  +    else if( strcmp(name, "newshortcut") == 0 )  +        name = templ_name_shortcut;       pcmanfm_create_new(gtk_window(win), fm_folder_view_get_cwd(fv), name);   }    --- a/src/pcmanfm.h	2010-10-15 10:26:53.000000000 +0200  +++ b/src/pcmanfm.h	2011-08-12 15:19:38.503970818 +0200  @@ -44,6 +44,7 @@ void pcmanfm_open_folder_in_terminal(gtk      #define templ_name_folder    null   #define templ_name_blank     (const char*)-1  +#define templ_name_shortcut  (const char*)-2   void pcmanfm_create_new(gtkwindow* parent, fmpath* cwd, const char* templ);      g_end_decls      --- a/src/pcmanfm.c	2011-08-12 13:20:45.000000000 +0200  +++ b/src/pcmanfm.c	2011-08-12 15:25:46.655997442 +0200  @@ -607,6 +607,15 @@ _retry:           }           g_object_unref(gf);       }  +    else if ( templ == templ_name_shortcut )  +    {  +      char buf[256];  +      gfile* gf = fm_path_to_gfile(dest);  +      printf("creating shortcut..."); // debug message  +      sprintf(buf, "/usr/bin/lxshortcut -i %s",g_file_get_path(gf));  +      system(buf);  +      g_object_unref(gf);  +    }       else /* templates in ~/templates */       {           fmpath* dir = fm_path_new_for_str(g_get_user_special_dir(g_user_directory_templates));
https://lists.launchpad.net/lubuntu-.../msg04582.html

do this?



Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [all variants] What do you do with a patch?


Ubuntu

Comments

Popular posts from this blog

Joomla 3.3 Installation Error message - Joomla! Forum - community, help and support

Multilanguage infinite redirect loop error. - Joomla! Forum - community, help and support

trim media limit reached