~ubuntu-branches/ubuntu/utopic/gnome-online-accounts/utopic

« back to all changes in this revision

Viewing changes to src/daemon/main.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Laurent Bigonville, Andreas Henriksson
  • Date: 2014-05-16 11:42:52 UTC
  • mfrom: (1.1.28) (0.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20140516114252-u5ect6mk6ht8i38x
Tags: 3.12.2-1
[ Laurent Bigonville ]
* debian/control.in: Recommends realmd package (Closes: #725965)

[ Andreas Henriksson ]
* New upstream release.
  - Removes chat support from Windows Live provider (XMPP gateway gone).
* Bump Standards-Version to 3.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 * Lesser General Public License for more details.
14
14
 *
15
15
 * You should have received a copy of the GNU Lesser General
16
 
 * Public License along with this library; if not, write to the
17
 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18
 
 * Boston, MA 02111-1307, USA.
 
16
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19
17
 *
20
18
 * Author: David Zeuthen <davidz@redhat.com>
21
19
 */
28
26
#include <signal.h>
29
27
#include <gio/gio.h>
30
28
 
31
 
#include <goabackend/goalogging.h>
32
 
 
33
29
#include "goadaemon.h"
34
30
#include "goatpaccountlinker.h"
35
31
 
39
35
static GMainLoop *loop = NULL;
40
36
static gboolean opt_replace = FALSE;
41
37
static gboolean opt_no_sigint = FALSE;
42
 
static gboolean opt_no_color = FALSE;
43
38
static GOptionEntry opt_entries[] =
44
39
{
45
40
  {"replace", 0, 0, G_OPTION_ARG_NONE, &opt_replace, "Replace existing daemon", NULL},
46
41
  {"no-sigint", 0, 0, G_OPTION_ARG_NONE, &opt_no_sigint, "Do not handle SIGINT for controlled shutdown", NULL},
47
 
  {"no-color", 0, 0, G_OPTION_ARG_NONE, &opt_no_color, "Do not display colors in output", NULL},
48
42
  {NULL }
49
43
};
50
44
static GoaDaemon *the_daemon = NULL;
57
51
{
58
52
  if (connection != NULL)
59
53
    the_daemon = goa_daemon_new ();
60
 
  goa_info ("Connected to the session bus");
 
54
  g_debug ("Connected to the session bus");
61
55
}
62
56
 
63
57
static void
65
59
              const gchar     *name,
66
60
              gpointer         user_data)
67
61
{
68
 
  goa_info ("Lost (or failed to acquire) the name %s on the session message bus", name);
 
62
  g_info ("Lost (or failed to acquire) the name %s on the session message bus", name);
69
63
  g_main_loop_quit (loop);
70
64
}
71
65
 
74
68
                  const gchar     *name,
75
69
                  gpointer         user_data)
76
70
{
77
 
  goa_info ("Acquired the name %s on the session message bus", name);
 
71
  g_debug ("Acquired the name %s on the session message bus", name);
78
72
 
79
73
  tp_linker = goa_tp_account_linker_new ();
80
74
}
82
76
static gboolean
83
77
on_sigint (gpointer user_data)
84
78
{
85
 
  goa_info ("Caught SIGINT. Initiating shutdown.");
 
79
  g_info ("Caught SIGINT. Initiating shutdown.");
86
80
  g_main_loop_quit (loop);
87
81
  return FALSE;
88
82
}
108
102
  error = NULL;
109
103
  if (!g_option_context_parse (opt_context, &argc, &argv, &error))
110
104
    {
111
 
      goa_error ("Error parsing options: %s", error->message);
 
105
      g_critical ("Error parsing options: %s", error->message);
112
106
      g_error_free (error);
113
107
      goto out;
114
108
    }
115
109
 
116
 
  goa_log_init (opt_no_color);
117
 
  goa_notice ("goa-daemon version %s starting", PACKAGE_VERSION);
 
110
  g_message ("goa-daemon version %s starting", PACKAGE_VERSION);
118
111
 
119
112
  loop = g_main_loop_new (NULL, FALSE);
120
113
 
134
127
                                  NULL,
135
128
                                  NULL);
136
129
 
137
 
  goa_info ("Entering main event loop");
 
130
  g_debug ("Entering main event loop");
138
131
 
139
132
  g_main_loop_run (loop);
140
133
 
154
147
  if (opt_context != NULL)
155
148
    g_option_context_free (opt_context);
156
149
 
157
 
  goa_notice ("goa-daemon version %s exiting", PACKAGE_VERSION);
 
150
  g_message ("goa-daemon version %s exiting", PACKAGE_VERSION);
158
151
 
159
152
  return ret;
160
153
}