[gnome-settings-daemon] background: Simplify test app



commit 6bc644951d03f9e48517518d3c4a452bb6cf6f9d
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 26 17:20:09 2012 +0100

    background: Simplify test app

 plugins/background/Makefile.am       |    1 +
 plugins/background/test-background.c |   63 ++-------------------------------
 2 files changed, 5 insertions(+), 59 deletions(-)
---
diff --git a/plugins/background/Makefile.am b/plugins/background/Makefile.am
index 50e03bf..5dfbc0c 100644
--- a/plugins/background/Makefile.am
+++ b/plugins/background/Makefile.am
@@ -14,6 +14,7 @@ test_background_SOURCES = 		\
 
 test_background_CPPFLAGS = \
 	-I$(top_srcdir)/gnome-settings-daemon		\
+	-I$(top_srcdir)/plugins/common			\
 	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
 	$(AM_CPPFLAGS)
 
diff --git a/plugins/background/test-background.c b/plugins/background/test-background.c
index e17083f..41ecce1 100644
--- a/plugins/background/test-background.c
+++ b/plugins/background/test-background.c
@@ -1,61 +1,6 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 William Jon McCann <mccann jhu edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <libintl.h>
-#include <locale.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-
+#define NEW gsd_background_manager_new
+#define START gsd_background_manager_start
+#define MANAGER GsdBackgroundManager
 #include "gsd-background-manager.h"
 
-static gboolean
-idle (GsdBackgroundManager *manager)
-{
-        gsd_background_manager_start (manager, NULL);
-        return FALSE;
-}
-
-int
-main (int argc, char *argv[])
-{
-        GsdBackgroundManager *manager;
-
-        bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
-        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-        textdomain (GETTEXT_PACKAGE);
-
-        setlocale (LC_ALL, "");
-
-	g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
-
-        gtk_init (&argc, &argv);
-
-        manager = gsd_background_manager_new ();
-        g_idle_add ((GSourceFunc)idle, manager);
-
-        gtk_main ();
-
-        return 0;
-}
+#include "test-plugin.h"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]