summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Lipovský <janlipovsky@gmail.com>2011-01-03 14:57:25 +0100
committerJan Lipovský <janlipovsky@gmail.com>2011-01-03 14:57:25 +0100
commit4417f2a62618da98a50db1d5d2bd4807a1163508 (patch)
treeb262fb8a862c5f14602ddb3b6518ab9f49d9f46a
parent1579a7769f997fcf9e3f9dc51e113f4d3604e84d (diff)
downloadgncpmount-4417f2a62618da98a50db1d5d2bd4807a1163508.tar.gz
gncpmount-4417f2a62618da98a50db1d5d2bd4807a1163508.tar.xz
gncpmount-4417f2a62618da98a50db1d5d2bd4807a1163508.zip
Code cleanup
-rw-r--r--globals.c2
-rw-r--r--globals.h2
-rw-r--r--gncpmount.c41
3 files changed, 20 insertions, 25 deletions
diff --git a/globals.c b/globals.c
index 64ad24d..86c48f3 100644
--- a/globals.c
+++ b/globals.c
@@ -11,7 +11,7 @@ void set_parameter_text (GtkWidget *entry, gchar **param)
g_strstrip(tmp);
- if(!strcmp(tmp,""))
+ if(!g_strcmp0(tmp,""))
{
g_free(tmp);
tmp = g_strdup(NULL);;
diff --git a/globals.h b/globals.h
index e1172f3..907adf3 100644
--- a/globals.h
+++ b/globals.h
@@ -3,8 +3,6 @@
#include <gtk/gtk.h>
-#include <string.h>
-
#define PROG_VERSION "0.0.3"
#define GUI_TITLE "gncpmount - 0.0.3"
diff --git a/gncpmount.c b/gncpmount.c
index 797dd4c..ef71acc 100644
--- a/gncpmount.c
+++ b/gncpmount.c
@@ -1,6 +1,3 @@
-#include <stdlib.h>
-
-
#include "keyfile.h"
#include "ncpwrapper.h"
#include "dialogs.h"
@@ -104,7 +101,7 @@ enable_mount_button ()
* for mount point
*/
static void
-open_folder (GtkWidget *wid, GtkWidget *win)
+open_folder ()
{
GtkWidget *dialog;
dialog = gtk_file_chooser_dialog_new ("Select folder - mount point",
@@ -132,7 +129,7 @@ open_folder (GtkWidget *wid, GtkWidget *win)
* and load cmd_params from file
*/
static void
-open_file (GtkWidget *wid, GtkWidget *win)
+open_file ()
{
GtkWidget *dialog;
dialog = gtk_file_chooser_dialog_new ("Load options from file",
@@ -162,7 +159,7 @@ open_file (GtkWidget *wid, GtkWidget *win)
* and save cmd_params to file
*/
static void
-save_file (GtkWidget *wid, GtkWidget *win)
+save_file ()
{
GtkWidget *dialog;
dialog = gtk_file_chooser_dialog_new ("Save options to file",
@@ -202,7 +199,7 @@ save_file (GtkWidget *wid, GtkWidget *win)
* Call ncpmount command
*/
static void
-call_ncpmount (GtkWidget *wid, GtkWidget *win)
+call_ncpmount ()
{
save_gui_to_cmdparams();
run_ncpmount();
@@ -214,7 +211,7 @@ call_ncpmount (GtkWidget *wid, GtkWidget *win)
* Set true if -P (password) is used or not
*/
static void
-passwd_usage (GtkWidget *wid, GtkWidget *win)
+passwd_usage ()
{
cmd_params.n = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gui.check_n));
@@ -242,7 +239,7 @@ passwd_usage (GtkWidget *wid, GtkWidget *win)
* Open Options dialog
*/
static void
-run_options_dialog ( GtkWidget *w, gpointer data )
+run_options_dialog ()
{
show_options_dialog();
}
@@ -253,7 +250,7 @@ run_options_dialog ( GtkWidget *w, gpointer data )
* Open Show command dialog
*/
static void
-run_command_dialog ( GtkWidget *w, gpointer data )
+run_command_dialog ()
{
save_gui_to_cmdparams();
show_ncpmount_command();
@@ -265,7 +262,7 @@ run_command_dialog ( GtkWidget *w, gpointer data )
* Clear cmd_params and set gui to default
*/
static void
-clear_gui ( GtkWidget *w, gpointer data )
+clear_gui ()
{
clear_cmdparams();
set_gui_from_cmdparams();
@@ -276,16 +273,16 @@ clear_gui ( GtkWidget *w, gpointer data )
/** Menu, an array of GtkItemFactoryEntry structures that defines each menu item */
static GtkItemFactoryEntry menu_items[] =
{
- { "/_File", NULL, NULL, 0, "<Branch>" },
- { "/File/_New", "<control>N", clear_gui, 0, "<StockItem>", GTK_STOCK_NEW },
- { "/File/_Load", "<control>L", open_file, 0, "<StockItem>", GTK_STOCK_OPEN },
- { "/File/_Save", "<control>S", save_file, 0, "<StockItem>", GTK_STOCK_SAVE },
- { "/File/sep1", NULL, NULL, 0, "<Separator>" },
- { "/File/_Quit", "<CTRL>Q", gtk_main_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
- { "/Tools", NULL, NULL, 0, "<Branch>" },
- { "/_Tools/Options", "<control>O", run_options_dialog, 0, "<Item>" },
- { "/_Tools/Show command", NULL, run_command_dialog, 0, "<Item>" },
- { "/_Help", NULL, NULL, 0, "<Branch>" },
+ { "/_File", NULL, NULL, 0, "<Branch>", NULL},
+ { "/File/_New", "<control>N", clear_gui, 0, "<StockItem>", GTK_STOCK_NEW},
+ { "/File/_Load", "<control>L", open_file, 0, "<StockItem>", GTK_STOCK_OPEN},
+ { "/File/_Save", "<control>S", save_file, 0, "<StockItem>", GTK_STOCK_SAVE},
+ { "/File/sep1", NULL, NULL, 0, "<Separator>", NULL},
+ { "/File/_Quit", "<CTRL>Q", gtk_main_quit, 0, "<StockItem>", GTK_STOCK_QUIT},
+ { "/Tools", NULL, NULL, 0, "<Branch>", NULL },
+ { "/_Tools/Options", "<control>O", run_options_dialog, 0, "<Item>", NULL},
+ { "/_Tools/Show command", NULL, run_command_dialog, 0, "<Item>", NULL},
+ { "/_Help", NULL, NULL, 0, "<Branch>", NULL},
{ "/_Help/About...", NULL, show_about, 0, "<Item>", GTK_STOCK_ABOUT},
};
@@ -472,7 +469,7 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (gui.btnbox), gui.btn_close, TRUE, TRUE, 0);
- /* Fill in informations from cmd_params to wiidgets */
+ /* Fill in informations from cmd_params to widgets */
clear_cmdparams ();
set_gui_from_cmdparams();