aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/backup-restore
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-16 23:25:56 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:09:00 +0800
commit777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 (patch)
treedfab9ca8f30c7b1539f86dfe19b8bf761d6a899c /plugins/backup-restore
parent83675abbc2b3a3bc6421094a56651d021fc0cdcd (diff)
downloadgsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.gz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.bz2
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.lz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.xz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.zst
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'plugins/backup-restore')
-rw-r--r--plugins/backup-restore/backup-restore.c37
-rw-r--r--plugins/backup-restore/backup.c22
2 files changed, 40 insertions, 19 deletions
diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c
index d6e1b05076..f558b19c71 100644
--- a/plugins/backup-restore/backup-restore.c
+++ b/plugins/backup-restore/backup-restore.c
@@ -55,20 +55,22 @@ void backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target);
void backup_restore_abort (EPlugin *ep, EMConfigTargetAccount *target);
typedef enum _br_flags {
- BR_OK = 1<<0,
- BR_START = 1<<1
+ BR_OK = 1 << 0,
+ BR_START = 1 << 1
}br_flags;
gint e_plugin_lib_enable (EPlugin *ep, gint enable);
gint
-e_plugin_lib_enable (EPlugin *ep, gint enable)
+e_plugin_lib_enable (EPlugin *ep,
+ gint enable)
{
return 0;
}
static void
-backup (const gchar *filename, gboolean restart)
+backup (const gchar *filename,
+ gboolean restart)
{
if (restart)
execl (EVOLUTION_TOOLSDIR "/evolution-backup", "evolution-backup", "--gui", "--backup", "--restart", filename, (gchar *)NULL);
@@ -77,7 +79,8 @@ backup (const gchar *filename, gboolean restart)
}
static void
-restore (const gchar *filename, gboolean restart)
+restore (const gchar *filename,
+ gboolean restart)
{
if (restart)
execl (EVOLUTION_TOOLSDIR "/evolution-backup", "evolution-backup", "--gui", "--restore", "--restart", filename, (gchar *)NULL);
@@ -111,7 +114,10 @@ sanity_check (const gchar *filename)
}
static guint32
-dialog_prompt_user (GtkWindow *parent, const gchar *string, const gchar *tag, ...)
+dialog_prompt_user (GtkWindow *parent,
+ const gchar *string,
+ const gchar *tag,
+ ...)
{
GtkWidget *dialog;
GtkWidget *check = NULL;
@@ -270,7 +276,8 @@ action_settings_restore_cb (GtkAction *action,
}
static void
-check_toggled (GtkToggleButton *button, GtkAssistant *assistant)
+check_toggled (GtkToggleButton *button,
+ GtkAssistant *assistant)
{
GtkWidget *box = g_object_get_data ((GObject *)button, "box");
gboolean state = gtk_toggle_button_get_active ((GtkToggleButton *) button);
@@ -283,7 +290,8 @@ check_toggled (GtkToggleButton *button, GtkAssistant *assistant)
}
static void
-file_changed (GtkFileChooser *chooser, GtkAssistant *assistant)
+file_changed (GtkFileChooser *chooser,
+ GtkAssistant *assistant)
{
gchar *file = NULL, *prevfile = NULL;
@@ -296,7 +304,9 @@ file_changed (GtkFileChooser *chooser, GtkAssistant *assistant)
}
static gboolean
-backup_restore_check (EConfig *ec, const gchar *pageid, gpointer data)
+backup_restore_check (EConfig *ec,
+ const gchar *pageid,
+ gpointer data)
{
GtkAssistant *assistant = data;
gint do_restore;
@@ -314,7 +324,8 @@ backup_restore_check (EConfig *ec, const gchar *pageid, gpointer data)
}
GtkWidget *
-backup_restore_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
+backup_restore_page (EPlugin *ep,
+ EConfigHookItemFactoryData *hook_data)
{
GtkWidget *page, *hbox, *label, *cbox, *button;
GtkAssistant *assistant = GTK_ASSISTANT (hook_data->parent);
@@ -359,7 +370,8 @@ backup_restore_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
return GTK_WIDGET (page);
}
void
-backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target)
+backup_restore_commit (EPlugin *ep,
+ EMConfigTargetAccount *target)
{
GtkWidget *assistant = target->target.config->widget;
gboolean state = GPOINTER_TO_INT (g_object_get_data ((GObject *)assistant, "restore")) ? TRUE : FALSE;
@@ -377,7 +389,8 @@ backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target)
}
void
-backup_restore_abort (EPlugin *ep, EMConfigTargetAccount *target)
+backup_restore_abort (EPlugin *ep,
+ EMConfigTargetAccount *target)
{
/* Nothing really */
}
diff --git a/plugins/backup-restore/backup.c b/plugins/backup-restore/backup.c
index f813b2ca55..370608ac2a 100644
--- a/plugins/backup-restore/backup.c
+++ b/plugins/backup-restore/backup.c
@@ -95,7 +95,9 @@ static GOptionEntry options[] = {
static gboolean check (const gchar *filename, gboolean *is_new_format);
static GString *
-replace_string (const gchar *text, const gchar *find, const gchar *replace)
+replace_string (const gchar *text,
+ const gchar *find,
+ const gchar *replace)
{
const gchar *p, *next;
GString *str;
@@ -183,7 +185,9 @@ replace_variables (const gchar *str)
}
static void
-replace_in_file (const gchar *filename, const gchar *find, const gchar *replace)
+replace_in_file (const gchar *filename,
+ const gchar *find,
+ const gchar *replace)
{
gchar *content = NULL;
GError *error = NULL;
@@ -338,7 +342,9 @@ backup (const gchar *filename,
}
static void
-extract_backup_dirs (const gchar *filename, gchar **data_dir, gchar **config_dir)
+extract_backup_dirs (const gchar *filename,
+ gchar **data_dir,
+ gchar **config_dir)
{
GKeyFile *key_file;
GError *error = NULL;
@@ -524,7 +530,8 @@ restore (const gchar *filename,
}
static gboolean
-check (const gchar *filename, gboolean *is_new_format)
+check (const gchar *filename,
+ gboolean *is_new_format)
{
gchar *command;
gchar *quotedfname;
@@ -650,7 +657,8 @@ dlg_response (GtkWidget *dlg,
}
gint
-main (gint argc, gchar **argv)
+main (gint argc,
+ gchar **argv)
{
GCancellable *cancellable;
gchar *file = NULL, *oper = NULL;
@@ -674,7 +682,7 @@ main (gint argc, gchar **argv)
p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy");
if (p_SetProcessDEPPolicy)
- (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
+ (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
}
#endif
#endif
@@ -770,7 +778,7 @@ main (gint argc, gchar **argv)
txt2 = _("Please wait while Evolution is restoring your data.");
} else {
/* do not translate these two, it's just a fallback when something goes wrong,
- we should never get here anyway. */
+ * we should never get here anyway. */
txt = "Oops, doing nothing...";
txt2 = "Should not be here now, really...";
}