Sunday, February 23, 2014

Patch for PCManFM to remember view mode

There is a bug in PCManFM that causes it not to remember the view mode (the view mode is icons, compact, thumbnails, or detailed list). This patch fixes it.
 commit 7c137a883350025a9724be1d8c2d8bd0307b1305  
 Author: sashoalm <sashoalm@aspire>  
 Date:  Sun Feb 23 20:59:58 2014 +0200  
   Remember view mode.  
 diff --git a/src/main-win.c b/src/main-win.c  
 index 6a65035..3947de3 100644  
 --- a/src/main-win.c  
 +++ b/src/main-win.c  
 @@ -1266,6 +1266,9 @@ static void on_fullscreen(GtkToggleAction* act, FmMainWin* win)  
      gtk_window_unfullscreen(GTK_WINDOW(win));  
  }  
 +  
 +extern char* profile;  
 +  
  static void on_change_mode(GtkRadioAction* act, GtkRadioAction *cur, FmMainWin* win)  
  {  
    int mode = gtk_radio_action_get_current_value(cur);  
 @@ -1277,8 +1280,11 @@ static void on_change_mode(GtkRadioAction* act, GtkRadioAction *cur, FmMainWin*  
                       win->current_page->sort_type,  
                       win->current_page->sort_by, mode,  
                       win->current_page->show_hidden, NULL);  
 -  else  
 +  else {  
      win->current_page->view_mode = mode;  
 +    app_config->view_mode = mode;  
 +    fm_app_config_save_profile(app_config, profile);  
 +  }  
  }  
  static void on_sort_by(GtkRadioAction* act, GtkRadioAction *cur, FmMainWin* win)  
 diff --git a/src/pcmanfm.c b/src/pcmanfm.c  
 index 2fe3482..7ea63c2 100644  
 --- a/src/pcmanfm.c  
 +++ b/src/pcmanfm.c  
 @@ -52,7 +52,7 @@ static guint save_config_idle = 0;  
  static char** files_to_open = NULL;  
  static int n_files_to_open = 0;  
 -static char* profile = NULL;  
 +char* profile = NULL;  
  static gboolean no_desktop = FALSE;  
  static gboolean show_desktop = FALSE;  
  static gboolean desktop_off = FALSE;  

No comments:

Post a Comment