improve tox client (prevent excessive saving)

and reorder construction/destruction order of plugin manager in main
This commit is contained in:
2024-04-10 12:06:11 +02:00
parent 4b39541d93
commit 4b7ef79f38
3 changed files with 12 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ class ToxClient : public ToxDefaultImpl, public ToxEventProviderBase {
std::string _tox_profile_path;
std::string _tox_profile_password;
bool _tox_profile_dirty {true}; // set in callbacks
float _save_heat {0.f};
public:
ToxClient(ConfigModelI& conf, std::string_view save_path, std::string_view save_password);
@@ -35,7 +36,7 @@ class ToxClient : public ToxDefaultImpl, public ToxEventProviderBase {
void setDirty(void) { _tox_profile_dirty = true; }
// returns false when we shoul stop the program
bool iterate(void);
bool iterate(float time_delta);
void stop(void); // let it know it should exit
void setToxProfilePath(const std::string& new_path) { _tox_profile_path = new_path; }
@@ -48,4 +49,3 @@ class ToxClient : public ToxDefaultImpl, public ToxEventProviderBase {
void saveToxProfile(void);
};