Skip to content

Commit

Permalink
clang-tidy: implementing some suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmm committed Mar 9, 2024
1 parent ec4a8b0 commit 8f19fe1
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 13 deletions.
6 changes: 4 additions & 2 deletions include/chart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
#pragma once

#include <adwaita.h>
#include <gdk/gdk.h>
#include <glib-object.h>
#include <glibconfig.h>
#include <gtk/gtkshortcut.h>
#define FMT_HEADER_ONLY
#include <fmt/core.h>
#include <fmt/format.h>
#include <sigc++/sigc++.h>
#include <algorithm>
#include <ranges>
#include <string>
#include <vector>
#include "ui_helpers.hpp"
Expand Down
24 changes: 18 additions & 6 deletions include/ui_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,30 @@
#pragma once

#include <adwaita.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gvariant.h>
#include <glib/gvarianttype.h>
#include <gtk/deprecated/gtkcomboboxtext.h>
#include <gtk/gtk.h>
#include <gtk/gtkdropdown.h>
#include <gtk/gtklabel.h>
#include <gtk/gtklevelbar.h>
#include <gtk/gtkscale.h>
#include <gtk/gtkshortcut.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkstringlist.h>
#include <gtk/gtkswitch.h>
#include <gtk/gtktogglebutton.h>
#include <sys/types.h>
#include <locale>
#define FMT_HEADER_ONLY
#include <fmt/core.h>
#include <fmt/format.h>
#include <glib/gi18n.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include "string_literal_wrapper.hpp"
#include "tags_app.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

namespace ui {
Expand Down
1 change: 1 addition & 0 deletions src/app_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "app_info.hpp"
#include <STTypes.h>
#define FMT_HEADER_ONLY
#include <fmt/core.h>
#include <fmt/format.h>
#include <gio/gio.h>
Expand Down
23 changes: 23 additions & 0 deletions src/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,30 @@
*/

#include "chart.hpp"
#include <cairo.h>
#include <fmt/format.h>
#include <gdk/gdk.h>
#include <glib-object.h>
#include <gobject/gobject.h>
#include <graphene.h>
#include <gsk/gsk.h>
#include <gsk/gskroundedrect.h>
#include <gtk/gtk.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkeventcontrollermotion.h>
#include <gtk/gtkshortcut.h>
#include <pango/pango-font.h>
#include <pango/pango-layout.h>
#include <sys/types.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <string>
#include <vector>
#include "tags_resources.hpp"
#include "ui_helpers.hpp"
#include "util.hpp"

namespace ui::chart {

Expand Down
19 changes: 19 additions & 0 deletions src/equalizer_band_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
*/

#include "equalizer_band_box.hpp"
#include <adwaita.h>
#include <fmt/core.h>
#include <fmt/format.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkbutton.h>
#include <gtk/gtkpopover.h>
#include <gtk/gtkscale.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkswitch.h>
#include "tags_app.hpp"
#include "tags_equalizer.hpp"
#include "tags_resources.hpp"
#include "ui_helpers.hpp"
#include "util.hpp"

namespace ui::equalizer_band_box {

Expand Down
26 changes: 21 additions & 5 deletions src/preferences_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
*/

#include "preferences_general.hpp"
#include <adwaita.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkswitch.h>
#include <filesystem>
#include <fstream>
#include "tags_app.hpp"
#include "tags_resources.hpp"
#include "ui_helpers.hpp"
#include "util.hpp"

namespace ui::preferences::general {

Expand All @@ -27,7 +41,8 @@ struct _PreferencesGeneral {
AdwPreferencesPage parent_instance;

GtkSwitch *enable_autostart, *process_all_inputs, *process_all_outputs, *theme_switch, *shutdown_on_window_close,
*use_cubic_volumes, *inactivity_timer_enable, *autohide_popovers, *exclude_monitor_streams, *show_native_plugin_ui;
*use_cubic_volumes, *inactivity_timer_enable, *autohide_popovers, *exclude_monitor_streams,
*show_native_plugin_ui;

GtkSpinButton *inactivity_timeout, *meters_update_interval, *lv2ui_update_frequency;

Expand Down Expand Up @@ -128,12 +143,13 @@ void preferences_general_init(PreferencesGeneral* self) {
// initializing some widgets

gsettings_bind_widgets<"process-all-inputs", "process-all-outputs", "use-dark-theme", "shutdown-on-window-close",
"use-cubic-volumes", "autohide-popovers", "exclude-monitor-streams", "inactivity-timer-enable", "inactivity-timeout",
"meters-update-interval", "lv2ui-update-frequency", "show-native-plugin-ui">(
"use-cubic-volumes", "autohide-popovers", "exclude-monitor-streams", "inactivity-timer-enable",
"inactivity-timeout", "meters-update-interval", "lv2ui-update-frequency",
"show-native-plugin-ui">(
self->settings, self->process_all_inputs, self->process_all_outputs, self->theme_switch,
self->shutdown_on_window_close, self->use_cubic_volumes, self->autohide_popovers, self->exclude_monitor_streams,
self->inactivity_timer_enable, self->inactivity_timeout, self->meters_update_interval, self->lv2ui_update_frequency,
self->show_native_plugin_ui);
self->inactivity_timer_enable, self->inactivity_timeout, self->meters_update_interval,
self->lv2ui_update_frequency, self->show_native_plugin_ui);

#ifdef ENABLE_LIBPORTAL
libportal::init(self->enable_autostart, self->shutdown_on_window_close);
Expand Down
10 changes: 10 additions & 0 deletions src/preferences_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@
*/

#include "preferences_window.hpp"
#include <adwaita.h>
#include <glib-object.h>
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include <string>
#include "config.h"
#include "preferences_general.hpp"
#include "preferences_spectrum.hpp"
#include "tags_app.hpp"
#include "tags_resources.hpp"
#include "util.hpp"

namespace ui::preferences::window {

Expand Down

0 comments on commit 8f19fe1

Please sign in to comment.