Commit 99387c1a authored by Antenore Gatta's avatar Antenore Gatta Committed by Giovanni Panozzo

Doc and code cleaning

parent 9634da32
...@@ -1549,8 +1549,8 @@ align_with_tabs = true # false/true ...@@ -1549,8 +1549,8 @@ align_with_tabs = true # false/true
# Whether to bump out to the next tab when aligning # Whether to bump out to the next tab when aligning
align_on_tabstop = true # false/true align_on_tabstop = true # false/true
# Whether to left-align numbers # Whether to right-align numbers
align_number_left = false # false/true align_number_right = true # false/true
# Whether to keep whitespace not required for alignment. # Whether to keep whitespace not required for alignment.
align_keep_extra_space = false # false/true align_keep_extra_space = false # false/true
......
...@@ -95,7 +95,7 @@ remmina_file_new(void) ...@@ -95,7 +95,7 @@ remmina_file_new(void)
if (remminafile) { if (remminafile) {
g_free(remminafile->filename); g_free(remminafile->filename);
remminafile->filename = NULL; remminafile->filename = NULL;
}else { }else {
remminafile = remmina_file_new_empty(); remminafile = remmina_file_new_empty();
} }
...@@ -252,14 +252,14 @@ remmina_file_load(const gchar *filename) ...@@ -252,14 +252,14 @@ remmina_file_load(const gchar *filename)
/* Annotate in spsettings that this value comes from secret_plugin */ /* Annotate in spsettings that this value comes from secret_plugin */
g_hash_table_insert(remminafile->spsettings, g_strdup(key), NULL); g_hash_table_insert(remminafile->spsettings, g_strdup(key), NULL);
g_free(sec); g_free(sec);
}else { }else {
remmina_file_set_string(remminafile, key, s); remmina_file_set_string(remminafile, key, s);
} }
}else { }else {
remmina_file_set_string_ref(remminafile, key, remmina_crypt_decrypt(s)); remmina_file_set_string_ref(remminafile, key, remmina_crypt_decrypt(s));
} }
g_free(s); g_free(s);
}else { }else {
/* If we find "resolution", then we split it in two */ /* If we find "resolution", then we split it in two */
if (strcmp(key, "resolution") == 0) { if (strcmp(key, "resolution") == 0) {
resolution_str = g_key_file_get_string(gkeyfile, "remmina", key, NULL); resolution_str = g_key_file_get_string(gkeyfile, "remmina", key, NULL);
...@@ -271,7 +271,7 @@ remmina_file_load(const gchar *filename) ...@@ -271,7 +271,7 @@ remmina_file_load(const gchar *filename)
remmina_file_set_string_ref(remminafile, "resolution_height", NULL); remmina_file_set_string_ref(remminafile, "resolution_height", NULL);
} }
g_free(resolution_str); g_free(resolution_str);
}else { }else {
remmina_file_set_string_ref(remminafile, key, remmina_file_set_string_ref(remminafile, key,
g_key_file_get_string(gkeyfile, "remmina", key, NULL)); g_key_file_get_string(gkeyfile, "remmina", key, NULL));
} }
...@@ -279,7 +279,7 @@ remmina_file_load(const gchar *filename) ...@@ -279,7 +279,7 @@ remmina_file_load(const gchar *filename)
} }
g_strfreev(keys); g_strfreev(keys);
} }
}else { }else {
remminafile = NULL; remminafile = NULL;
} }
...@@ -308,7 +308,7 @@ void remmina_file_set_string_ref(RemminaFile *remminafile, const gchar *setting, ...@@ -308,7 +308,7 @@ void remmina_file_set_string_ref(RemminaFile *remminafile, const gchar *setting,
return; return;
} }
g_hash_table_insert(remminafile->settings, g_strdup(setting), value); g_hash_table_insert(remminafile->settings, g_strdup(setting), value);
}else { }else {
g_hash_table_insert(remminafile->settings, g_strdup(setting), g_strdup("")); g_hash_table_insert(remminafile->settings, g_strdup(setting), g_strdup(""));
} }
} }
...@@ -440,21 +440,21 @@ void remmina_file_save(RemminaFile *remminafile) ...@@ -440,21 +440,21 @@ void remmina_file_save(RemminaFile *remminafile)
secret_plugin->store_password(remminafile, key, value); secret_plugin->store_password(remminafile, key, value);
} }
g_key_file_set_string(gkeyfile, "remmina", key, "."); g_key_file_set_string(gkeyfile, "remmina", key, ".");
}else { }else {
g_key_file_set_string(gkeyfile, "remmina", key, ""); g_key_file_set_string(gkeyfile, "remmina", key, "");
secret_plugin->delete_password(remminafile, key); secret_plugin->delete_password(remminafile, key);
} }
}else { }else {
if (value && value[0]) { if (value && value[0]) {
s = remmina_crypt_encrypt(value); s = remmina_crypt_encrypt(value);
g_key_file_set_string(gkeyfile, "remmina", key, s); g_key_file_set_string(gkeyfile, "remmina", key, s);
g_free(s); g_free(s);
}else { }else {
g_key_file_set_string(gkeyfile, "remmina", key, ""); g_key_file_set_string(gkeyfile, "remmina", key, "");
} }
} }
} }
}else { }else {
g_key_file_set_string(gkeyfile, "remmina", key, value); g_key_file_set_string(gkeyfile, "remmina", key, value);
} }
} }
...@@ -588,6 +588,16 @@ void remmina_file_unsave_password(RemminaFile *remminafile) ...@@ -588,6 +588,16 @@ void remmina_file_unsave_password(RemminaFile *remminafile)
remmina_file_save(remminafile); remmina_file_save(remminafile);
} }
/**
* Return the string date of the last time a file has been modified.
*
* This is used to return the modification date of a file and it's used
* to return the modification date and time of a givwn remmina file.
* If it fails it will return "26/01/1976 23:30:00", that is just a date to don't
* return an empty string (challenge: what was happened that day at that time?).
* @return A date string in the form "%d/%m/%Y %H:%M:%S".
* @todo This should be moved to remmina_utils.c
*/
gchar* gchar*
remmina_file_get_datetime(RemminaFile *remminafile) remmina_file_get_datetime(RemminaFile *remminafile)
{ {
...@@ -631,8 +641,13 @@ remmina_file_get_datetime(RemminaFile *remminafile) ...@@ -631,8 +641,13 @@ remmina_file_get_datetime(RemminaFile *remminafile)
return modtime_string; return modtime_string;
} }
/* Function used to update the atime and mtime of a given remmina file, partially /**
* taken from suckless sbase */ * Update the atime and mtime of a given filename.
* Function used to update the atime and mtime of a given remmina file, partially
* taken from suckless sbase
* @see https://git.suckless.org/sbase/tree/touch.c
* @todo This should be moved to remmina_utils.c
*/
void void
remmina_file_touch(RemminaFile *remminafile) remmina_file_touch(RemminaFile *remminafile)
{ {
......
...@@ -347,13 +347,16 @@ gboolean remmina_protocol_widget_close_connection(RemminaProtocolWidget* gp) ...@@ -347,13 +347,16 @@ gboolean remmina_protocol_widget_close_connection(RemminaProtocolWidget* gp)
return retval; return retval;
} }
/* Check if the plugin accepts keystrokes */ /** Check if the plugin accepts keystrokes.
*/
gboolean remmina_protocol_widget_plugin_receives_keystrokes(RemminaProtocolWidget* gp) gboolean remmina_protocol_widget_plugin_receives_keystrokes(RemminaProtocolWidget* gp)
{ {
return gp->priv->plugin->send_keystrokes ? TRUE : FALSE; return gp->priv->plugin->send_keystrokes ? TRUE : FALSE;
} }
/* Send to the plugin some keystrokes */ /**
* Send to the plugin some keystrokes.
*/
void remmina_protocol_widget_send_keystrokes(RemminaProtocolWidget* gp, GtkMenuItem *widget) void remmina_protocol_widget_send_keystrokes(RemminaProtocolWidget* gp, GtkMenuItem *widget)
{ {
TRACE_CALL(__func__); TRACE_CALL(__func__);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
* *
*/ */
/* /**
* General utility functions, non-GTK related. * General utility functions, non-GTK related.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment