Sort headers using clang-tidy
[geeqie.git] / src / options.cc
index 4df093f..8e64145 100644 (file)
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
 
-#include "main.h"
 #include "options.h"
 
+#include <config.h>
+
+#include "debug.h"
 #include "histogram.h" /* HCHAN_RGB */
 #include "image-overlay.h" /* OSD_SHOW_NOTHING */
-#include "layout.h"
+#include "intl.h"
 #include "layout-image.h"
+#include "layout.h"
+#include "main-defines.h"
+#include "misc.h"
 #include "rcfile.h"
 #include "ui-bookmark.h"
 #include "ui-fileops.h"
@@ -75,10 +80,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->file_ops.safe_delete_path = nullptr;
        options->file_ops.no_trash = FALSE;
 
-       options->file_sort.ascending = TRUE;
        options->file_sort.case_sensitive = FALSE;
-       options->file_sort.method = SORT_NAME;
-       options->file_sort.natural = FALSE;
 
        options->fullscreen.above = FALSE;
        options->fullscreen.clean_flip = FALSE;
@@ -88,19 +90,23 @@ ConfOptions *init_options(ConfOptions *options)
        options->appimage_notifications = TRUE;
        options->marks_save = TRUE;
        options->with_rename = FALSE;
+       options->collections_duplicates = FALSE;
        options->collections_on_top = FALSE;
        options->hide_window_in_fullscreen = TRUE;
 
        memset(&options->image.border_color, 0, sizeof(options->image.border_color));
        memset(&options->image.alpha_color_1, 0, sizeof(options->image.alpha_color_1));
        memset(&options->image.alpha_color_2, 0, sizeof(options->image.alpha_color_2));
+       options->image.border_color.red = static_cast<gdouble>(0x009999) / 65535;
+       options->image.border_color.green = static_cast<gdouble>(0x009999) / 65535;
+       options->image.border_color.blue = static_cast<gdouble>(0x009999) / 65535;
 /* alpha channel checkerboard background (same as gimp) */
-       options->image.alpha_color_1.red = 0x009999;
-       options->image.alpha_color_1.green = 0x009999;
-       options->image.alpha_color_1.blue = 0x009999;
-       options->image.alpha_color_2.red = 0x006666;
-       options->image.alpha_color_2.green = 0x006666;
-       options->image.alpha_color_2.blue = 0x006666;
+       options->image.alpha_color_1.red = static_cast<gdouble>(0x009999) / 65535;
+       options->image.alpha_color_1.green = static_cast<gdouble>(0x009999) / 65535;
+       options->image.alpha_color_1.blue = static_cast<gdouble>(0x009999) / 65535;
+       options->image.alpha_color_2.red = static_cast<gdouble>(0x006666) / 65535;
+       options->image.alpha_color_2.green = static_cast<gdouble>(0x006666) / 65535;
+       options->image.alpha_color_2.blue = static_cast<gdouble>(0x006666) / 65535;
        options->image.enable_read_ahead = TRUE;
        options->image.exif_rotate_enable = TRUE;
        options->image.fit_window_to_image = FALSE;
@@ -125,7 +131,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->image_overlay.template_string = nullptr;
        options->image_overlay.x = 10;
        options->image_overlay.y = -10;
-       options->image_overlay.font = nullptr;
+       options->image_overlay.font = g_strdup("Sans 10");
        options->image_overlay.text_red = 0;
        options->image_overlay.text_green = 0;
        options->image_overlay.text_blue = 0;
@@ -139,8 +145,8 @@ ConfOptions *init_options(ConfOptions *options)
        options->mousewheel_scrolls = FALSE;
        options->image_lm_click_nav = TRUE;
        options->image_l_click_archive = FALSE;
-       options->image_l_click_video = FALSE;
-       options->image_l_click_video_editor = nullptr;
+       options->image_l_click_video = TRUE;
+       options->image_l_click_video_editor = g_strdup("video-player.desktop");
        options->open_recent_list_maxsize = 10;
        options->recent_folder_image_list_maxsize = 10;
        options->place_dialogs_under_mouse = FALSE;
@@ -168,6 +174,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->show_star_rating = FALSE;
        options->show_predefined_keyword_tree = TRUE;
        options->expand_menu_toolbar = FALSE;
+       options->hamburger_menu = FALSE;
 
        options->slideshow.delay = 50;
        options->slideshow.random = FALSE;
@@ -183,7 +190,6 @@ ConfOptions *init_options(ConfOptions *options)
        options->thumbnails.use_exif = FALSE;
        options->thumbnails.use_color_management = FALSE;
        options->thumbnails.use_ft_metadata = TRUE;
-//     options->thumbnails.use_ft_metadata_small = TRUE;
        options->thumbnails.collection_preview = 20;
 
        options->tree_descend_subdirs = FALSE;
@@ -203,7 +209,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->log_window.line_wrap = FALSE;
        options->log_window.paused = FALSE;
        options->log_window.timer_data = FALSE;
-       options->log_window.action = g_strdup("");
+       options->log_window.action = g_strdup("echo");
 
        options->read_metadata_in_idle = FALSE;
        options->star_rating.star = STAR_RATING_STAR;
@@ -216,7 +222,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->printer.image_text_position = 1;
        options->printer.page_text_position = 3;
 
-       options->threads.duplicates = -1;
+       options->threads.duplicates = get_cpu_cores() - 1;
 
        options->disabled_plugins = nullptr;
 
@@ -293,7 +299,11 @@ LayoutOptions *init_layout_options(LayoutOptions *options)
 
        options->dir_view_type = DIRVIEW_LIST;
        options->dir_view_list_sort.ascend = TRUE;
+       options->dir_view_list_sort.case_sensitive = TRUE;
        options->dir_view_list_sort.method = SORT_NAME;
+       options->file_view_list_sort.ascend = TRUE;
+       options->file_view_list_sort.case_sensitive = TRUE;
+       options->file_view_list_sort.method = SORT_NAME;
        options->file_view_type = FILEVIEW_LIST;
        options->float_window.h = 450;
        options->float_window.vdivider_pos = -1;
@@ -329,7 +339,7 @@ LayoutOptions *init_layout_options(LayoutOptions *options)
        options->show_thumbnails = FALSE;
        options->style = 0;
        options->show_info_pixel = FALSE;
-       options->toolbar_hidden = FALSE;
+       options->selectable_toolbars_hidden = FALSE;
        options->tools_float = FALSE;
        options->tools_hidden = FALSE;
        options->image_overlay.histogram_channel = HCHAN_RGB;
@@ -337,8 +347,8 @@ LayoutOptions *init_layout_options(LayoutOptions *options)
        options->image_overlay.state = OSD_SHOW_NOTHING;
        options->animate = TRUE;
        options->bars_state.hidden = FALSE;
-       options->log_window.w = 520;
-       options->log_window.h = 400;
+       options->log_window.width = 520;
+       options->log_window.height = 400;
        options->preferences_window.w = 700;
        options->preferences_window.h = 600;
        options->split_pane_sync = FALSE;
@@ -353,7 +363,6 @@ static void sync_options_with_current_state(ConfOptions *options)
        if (layout_valid(&lw))
                {
                layout_sync_options_with_current_state(lw);
-               layout_sort_get(lw, &options->file_sort.method, &options->file_sort.ascending);
 
                options->color_profile.enabled = layout_image_color_profile_get_use(lw);
                layout_image_color_profile_get(lw,
@@ -374,7 +383,7 @@ void save_options(ConfOptions *options)
        g_free(rc_path);
 }
 
-gboolean load_options(ConfOptions *UNUSED(options))
+gboolean load_options(ConfOptions *)
 {
        gboolean success;
        gchar *rc_path;