@@ -285,7 +285,7 @@ ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* default
285285 .treeView = false,
286286 .treeViewAlwaysByPID = false,
287287 .allBranchesCollapsed = false,
288- .generic = false,
288+ .dynamic = false,
289289 };
290290
291291 ScreenSettings_readFields (ss , this -> dynamicColumns , defaults -> columns );
@@ -369,9 +369,9 @@ static bool Settings_read(Settings* this, const char* fileName, unsigned int ini
369369 } else if (String_eq (option [0 ], "tree_view" ) && this -> config_version <= 2 ) {
370370 screen = Settings_defaultScreens (this );
371371 screen -> treeView = atoi (option [1 ]);
372- } else if (String_eq (option [0 ], "generic_screen " ) && this -> config_version <= 2 ) {
372+ } else if (String_eq (option [0 ], "dynamic_screen " ) && this -> config_version <= 2 ) {
373373 screen = Settings_defaultScreens (this );
374- screen -> generic = atoi (option [1 ]);
374+ screen -> dynamic = atoi (option [1 ]);
375375 } else if (String_eq (option [0 ], "tree_view_always_by_pid" ) && this -> config_version <= 2 ) {
376376 // old (no screen) naming also supported for backwards compatibility
377377 screen = Settings_defaultScreens (this );
@@ -502,9 +502,9 @@ static bool Settings_read(Settings* this, const char* fileName, unsigned int ini
502502 } else if (String_eq (option [0 ], ".tree_view" )) {
503503 if (screen )
504504 screen -> treeView = atoi (option [1 ]);
505- } else if (String_eq (option [0 ], ".generic_screen " )) {
505+ } else if (String_eq (option [0 ], ".dynamic_screen " )) {
506506 if (screen )
507- screen -> generic = atoi (option [1 ]);
507+ screen -> dynamic = atoi (option [1 ]);
508508 } else if (String_eq (option [0 ], ".tree_view_always_by_pid" )) {
509509 if (screen )
510510 screen -> treeViewAlwaysByPID = atoi (option [1 ]);
@@ -530,7 +530,7 @@ static void writeFields(FILE* fd, const ProcessField* fields, Hashtable* columns
530530 fprintf (fd , "%s%s" , sep , pName );
531531 } else if (fields [i ] >= LAST_PROCESSFIELD && byName ) {
532532 const char * pName = toFieldName (columns , fields [i ]);
533- fprintf (fd , " Dynamic (%s)" , pName );
533+ fprintf (fd , "%sDynamic (%s)" , sep , pName );
534534 } else {
535535 // This "-1" is for compatibility with the older enum format.
536536 fprintf (fd , "%s%d" , sep , (int ) fields [i ] - 1 );
@@ -643,20 +643,21 @@ int Settings_write(const Settings* this, bool onCrash) {
643643 printSettingInteger ("tree_view_always_by_pid" , this -> screens [0 ]-> treeViewAlwaysByPID );
644644 printSettingInteger ("all_branches_collapsed" , this -> screens [0 ]-> allBranchesCollapsed );
645645
646+ fprintf (stderr , "writing %d screens\n" , (int )this -> nScreens );
646647 for (unsigned int i = 0 ; i < this -> nScreens ; i ++ ) {
647- if (this -> screens [i ]-> generic )
648- continue ;
649648 ScreenSettings * ss = this -> screens [i ];
650649 fprintf (fd , "screen:%s=" , ss -> name );
651650 writeFields (fd , ss -> fields , this -> dynamicColumns , true, separator );
652- printSettingString (".sort_key" , toFieldName (this -> dynamicColumns , ss -> sortKey ));
653- printSettingString (".tree_sort_key" , toFieldName (this -> dynamicColumns , ss -> treeSortKey ));
654- printSettingInteger (".tree_view" , ss -> treeView );
655- printSettingInteger (".tree_view_always_by_pid" , ss -> treeViewAlwaysByPID );
656- printSettingInteger (".sort_direction" , ss -> direction );
657- printSettingInteger (".tree_sort_direction" , ss -> treeDirection );
658- printSettingInteger (".all_branches_collapsed" , ss -> allBranchesCollapsed );
659- printSettingInteger (".generic_screen" , ss -> generic );
651+ if (ss -> dynamic == false) {
652+ printSettingString (".sort_key" , toFieldName (this -> dynamicColumns , ss -> sortKey ));
653+ printSettingString (".tree_sort_key" , toFieldName (this -> dynamicColumns , ss -> treeSortKey ));
654+ printSettingInteger (".tree_view" , ss -> treeView );
655+ printSettingInteger (".tree_view_always_by_pid" , ss -> treeViewAlwaysByPID );
656+ printSettingInteger (".sort_direction" , ss -> direction );
657+ printSettingInteger (".tree_sort_direction" , ss -> treeDirection );
658+ printSettingInteger (".all_branches_collapsed" , ss -> allBranchesCollapsed );
659+ }
660+ printSettingInteger (".dynamic_screen" , ss -> dynamic );
660661 }
661662
662663 #undef printSettingString
0 commit comments