Skip to content

Commit 35379eb

Browse files
committed
fix: Gtk helpers
1 parent 7975eaa commit 35379eb

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

flatpak/org.nickvision.application.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"cleanup":[
1616
"/include",
1717
"/lib/cmake",
18-
"/lib/debug",
1918
"/lib/pkgconfig",
2019
"/man",
2120
"*.a"

inno/setup.iss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,4 @@ Name: "{autodesktop}\{#MyAppShortName}"; Filename: "{app}\Release\{#MyAppExeName
9999
[Run]
100100
Filename: "{app}\vc_redist.exe"; Parameters: "/install /quiet /norestart"
101101
Filename: "{app}\windowsappruntimeinstall.exe"
102-
Filename: "{app}\Release\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
103-
104-
[InstallDelete]
105-
Type: filesandordirs; Name: {group}\*;
102+
Filename: "{app}\Release\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

org.nickvision.application.gnome/include/helpers/gtkhelpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Nickvision::Application::GNOME::Helpers::GtkHelpers
1717
void addToBox(GtkBox* box, GtkWidget* widget, bool addSeparator = false);
1818
/**
1919
* @brief Runs the function on the main UI thread.
20-
* @param function The function to run
20+
* @param function The function to run
2121
*/
2222
void dispatchToMainThread(const std::function<void()>& function);
2323
/**
@@ -50,7 +50,7 @@ namespace Nickvision::Application::GNOME::Helpers::GtkHelpers
5050
* @param selected An optional index that should be selected
5151
* @param allowEllipse Whether or not to allow ellipses in the combo row
5252
*/
53-
void setComboRowModel(AdwComboRow* row, const std::vector<std::string>& strs, size_t selected, bool allowEllipse = true);
53+
void setComboRowModel(AdwComboRow* row, const std::vector<std::string>& strs, const size_t& selected, bool allowEllipse = true);
5454
}
5555

5656
#endif //GTKHELPERS_H

org.nickvision.application.gnome/src/helpers/gtkhelpers.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "helpers/gtkhelpers.h"
2-
#include <adwaita.h>
32

43
namespace Nickvision::Application::GNOME::Helpers
54
{
@@ -71,10 +70,11 @@ namespace Nickvision::Application::GNOME::Helpers
7170
}), nullptr);
7271
}
7372
adw_combo_row_set_model(row, G_LIST_MODEL(list));
73+
g_object_unref(list);
7474
adw_combo_row_set_selected(row, selectedIndex);
7575
}
7676

77-
void GtkHelpers::setComboRowModel(AdwComboRow* row, const std::vector<std::string>& strs, size_t selected, bool allowEllipse)
77+
void GtkHelpers::setComboRowModel(AdwComboRow* row, const std::vector<std::string>& strs, const size_t& selected, bool allowEllipse)
7878
{
7979
GtkStringList* list{ gtk_string_list_new(nullptr) };
8080
for(const std::string& str : strs)
@@ -91,7 +91,8 @@ namespace Nickvision::Application::GNOME::Helpers
9191
}), nullptr);
9292
}
9393
adw_combo_row_set_model(row, G_LIST_MODEL(list));
94-
if(selected >= 0 && selected < strs.size())
94+
g_object_unref(list);
95+
if(selected < strs.size())
9596
{
9697
adw_combo_row_set_selected(row, selected);
9798
}

0 commit comments

Comments
 (0)