Issue 336 2

These patches consolidate the parse of command line options to ConfigManager.
In addition, it also parses a configuration file.
> This NULL check is needless.

OK. I confirmed that in the reference manual at
https://developer.gnome.org/glib/2.26/glib-Key-value-file-parser.html#g-key-file-load-from-file

I'll fix it.


2014-08-12 11:36 GMT+09:00 Kouhei Sutou <notifications@github.com>:

> In server/src/ConfigManager.cc:
>
> > +
> > +		GKeyFile *keyFile = g_key_file_new();
> > +		if (!keyFile) {
> > +			MLPL_CRIT("Failed to call g_key_file_new().\n");
> > +			return false;
> > +		}
> > +		Reaper<GKeyFile> keyFileReaper(keyFile, g_key_file_unref);
> > +
> > +		GError *error = NULL;
> > +		gboolean succeeded =
> > +		  g_key_file_load_from_file(keyFile, path.c_str(),
> > +		                            G_KEY_FILE_NONE, &error);
> > +		if (!succeeded) {
> > +			MLPL_DBG("Failed to load config file: %s (%s)\n",
> > +			         path.c_str(),
> > +			         error ? error->message : "Unknown reason");
>
> This NULL check is needless.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/project-hatohol/hatohol/pull/365/files#r16093102>.
>