mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
Fix most of critical issues reported by Sonar (GTK client) (#2309)
* (C++) Macros should not be used to define constants * (C++) Memory should not be managed manually * (C++) "void*" should not be used in typedefs, member variables, function parameters or return type * (C++) When the "Rule-of-Zero" is not applicable, the "Rule-of-Five" should be followed * (C++) "switch" statements should have "default" clauses * (C++) "explicit" should be used on single-parameter constructors and conversiosn operators * (C++) Non-const global variables should not be used
This commit is contained in:
@@ -38,8 +38,6 @@
|
||||
#include "PrefsDialog.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#define MY_CONFIG_NAME "transmission"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
std::string gl_confdir;
|
||||
@@ -133,7 +131,7 @@ static tr_variant* getPrefs()
|
||||
{
|
||||
tr_variantInitDict(&settings, 0);
|
||||
tr_prefs_init_defaults(&settings);
|
||||
tr_sessionLoadSettings(&settings, gl_confdir.c_str(), MY_CONFIG_NAME);
|
||||
tr_sessionLoadSettings(&settings, gl_confdir.c_str(), nullptr);
|
||||
ensure_sound_cmd_is_a_list(&settings);
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user