1. 15 Nov, 2021 3 commits
  2. 11 Nov, 2021 4 commits
  3. 10 Nov, 2021 1 commit
    • Jan Ziak's avatar
      Remove default values from RC configuration files · ef71ba5a
      Jan Ziak authored
      This simplifies updates over time (that is: users who are using default
      values will automatically receive the updated values when switching
      from xfce4-sensors-plugin version N to version N+1).
      
      Changes:
      
      - Remove sensors_init_default_values() -> Add t_sensors constructor
      - Specify default values in 1 place (t_sensors constructor),
        instead of 2 places (sensors-interface-common.cc, configuration.cc)
      - Add xfce4::Rc::write_default_... functions
      - Add support for floating-point values (32-bit) to xfce4::Rc
      - Add parse_float() and parse_double()
      
      Fixed issues:
      
      - Save the current width&height values (not the stale values) to RC file
      - Rc::read_entry() fallback code-path
      
      See also: #26
      ef71ba5a
  4. 08 Nov, 2021 2 commits
    • Jan Ziak's avatar
      Suppress title after the user adds the 1st sensor · 5b445f24
      Jan Ziak authored
      The updated behavior takes effect only when a new instance of this plugin
      is added to a panel. Configurations of existing instances are not fixed by
      this patch because the RC configuration file already/always contains the
      Show_Title item irrespective of its default value.
      
      Closes: #26
      5b445f24
    • Jan Ziak's avatar
      Remove hard-coded limits restricting the maximum number of sensors · 2307634f
      Jan Ziak authored
      List of changes:
      
      - t_labelledlevelbar *panels[MAX_NUM_CHIPS][MAX_NUM_FEATURES] -> std::map
      - GtkTreeStore *myListStore[MAX_NUM_CHIPS] -> std::vector
      - Remove the constants MAX_NUM_CHIPS and MAX_NUM_FEATURES
      - t_sensors* -> Ptr<t_sensors>
      - t_sensors_dialog* -> Ptr<t_sensors_dialog>
      - Move NULL pointer checks from run-time to compile-time
      - Remove redundant @param in the documentation of functions
      - Add xfce4::put(), because std::map.insert_or_assign() is a C++17 feature
      2307634f
  5. 06 Nov, 2021 2 commits
    • Jan Ziak's avatar
      Code cleanup: Return xfce4::Optional from sensor_get_value() · 156761d1
      Jan Ziak authored
      As a side-effect, this avoids the invalid documentation "returns >0 on
      error" when the function was actually returning negative integers in case
      of an error.
      156761d1
    • Jan Ziak's avatar
      Use xfce4::connect instead of the less safe g_signal_connect · 006abac1
      Jan Ziak authored
      The type-safe GTK wrapper functions (new file gtk.cc) have been copied
      from the most recent version of xfce4-cpugraph-plugin, and several new
      type-safe wrappers have been added as required by xfce4-sensors-plugin.
      
      The conversion from a less safe C code to a more safe C++ code revealed
      several issues that were missed because of the simplicity of C's type
      system. Slider value handlers in the UI-style panel (in the properties
      dialog when tachos are selected) were returning void, instead of gboolean,
      which means that the sliders were being updated according to the
      pseudo-random value present (in case of an AMD64 binary) in the %rax
      register when the handler function returned to its caller (the caller
      was expecting a non-random gboolean in the %rax register).
      
      Configuration dialog changes:
      
      - Align elements in the UI-style panel when configuring tachos
      
      See also: https://gitlab.xfce.org/panel-plugins/xfce4-cpugraph-plugin/-/tree/5a33de908bbed4c71648e2d60e1614c0959e9923/xfce4%2B%2B/util
      006abac1
  6. 29 Oct, 2021 1 commit
    • Jan Ziak's avatar
      Replace C pointers and collections with C++ equivalents · f1b75973
      Jan Ziak authored
      Please note that the code hasn't been thoroughly examined/tested for
      memory leaks yet.
      
      Changes:
      
       - gboolean -> bool
       - gchar* -> std::string
       - gpointer chip -> Ptr<t_chip>
       - gpointer chip_feature -> Ptr<t_chipfeature>
       - GPtrArray -> std::vector
       - t_chip* -> Ptr<t_chip>
       - Remove @param comments describing just the parameter's data type
       - GtkWidget *tachos[MAX_NUM_CHIPS][MAX_NUM_FEATURES] -> std::map
       - Remove hard-coded limit on the maximum number of tachos
       - Remove redundant field t_chip::num_features
       - free_chip() -> t_chip::~t_chip()
       - free_chipfeature() -> default auto-generated destructor
       - new t_chip() -> xfce4::make<t_chip>()
       - new t_chipfeature() -> xfce4::make<t_chipfeature>()
      
      Bug fixes:
      
       - strncmp(disk, "/dev/fd", 6) -> xfce4::starts_with(disk, "/dev/fd")
      f1b75973
  7. 20 Oct, 2021 2 commits
  8. 19 Oct, 2021 1 commit
  9. 17 Oct, 2021 3 commits
  10. 16 Oct, 2021 1 commit
  11. 15 Oct, 2021 1 commit
  12. 13 Oct, 2021 3 commits
  13. 12 Oct, 2021 4 commits
  14. 11 Oct, 2021 2 commits
  15. 08 Oct, 2021 1 commit
  16. 29 Sep, 2021 1 commit
  17. 22 Sep, 2021 1 commit
  18. 21 Sep, 2021 1 commit
  19. 18 Sep, 2021 1 commit
  20. 08 Sep, 2021 1 commit
  21. 23 Aug, 2021 1 commit
  22. 20 Aug, 2021 3 commits