denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Is there a point to denemo.conf?


From: Roy Rankin
Subject: Re: [Denemo-devel] Is there a point to denemo.conf?
Date: Mon, 04 Aug 2008 15:04:27 +1000
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

After a quick look, the tarball looks OK and I was able to build an RPM from it.

Roy

Jeremiah Benham wrote:
On Mon, 2008-08-04 at 10:19 +1000, Roy Rankin wrote:
Jeremiah,

My reaction is that it is better style to have the information in a configuration file rather then placed in the code. Also it means system administrators can set appropriate system defaults. Currently we have a foot in both hard-code and configuration file (the worst of all worlds).

Yeah. I thought about this more after I sent it out. I thought about
that school that deploys denemo in their music class. The class uses a
central server and a bunch of thin clients.
My suggestion is get the current release to read /etc/denemo/denemo.conf. In the next release remove the hard-coded fields and move them into the denemo.conf file.

I must have forgot to email you. I pushed this change to git already,
and uploaded a new tarball.

In regards to denemorc.xml, I am concerned that if we do not remove it now it will haunt us from all time to come, and to remove it, only requires.

Also pushed and in tarball.
1> removing the line
"%config(noreplace) %{_sysconfdir}/denemo/denemorc.xml"
from the denemo.spec.in

2> change the line
dist_pkgdata_DATA = denemo.conf denemorc.xml
to
dist_pkgdata_DATA = denemo.conf
in Makefile.am

done the above also.
Your new function has a small error, the following version compiles in Linux and seemed to work.

In the latest git is it resolved? I made a commit and the below looks to
be exactly what I fixed. The problem with what I pasted earlier was that
I wrote the code in my email without running it through my compiler. I
am guessing you did not do a git pull or something.
Jeremiah


diff --git a/src/utils.c b/src/utils.c
index 30b07e2..f900c30 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -542,6 +542,24 @@ get_data_dir ()
  }

  const gchar *
+get_conf_dir ()
+{
+  static gchar *confdir = NULL;
+  if (confdir == NULL)
+  {
+#ifdef G_OS_WIN32
+    gchar *rootdir = g_win32_get_package_installation_directory (NULL,
+NULL);
+    confdir = g_build_filename (rootdir, "etc", "denemo", NULL);
+    g_free (rootdir);
+#else /* not G_OS_WIN32 */
+  confdir = gbr_find_etc_dir(SYSCONFDIR);
+#endif /* not G_OS_WIN32 */
+  }
+  return confdir;
+}
+
+const gchar *
  get_plugin_dir ()
  {
    static gchar *plugindir = NULL;

Also required is

diff --git a/src/prefops.c b/src/prefops.c
index fd52442..df24107 100644
--- a/src/prefops.c
+++ b/src/prefops.c
@@ -64,7 +64,7 @@ locatedotdenemo ()
  void
  initprefs ()
  {
- gchar *systemwide = g_build_filename (get_data_dir (), "denemo.conf", NULL); + gchar *systemwide = g_build_filename (get_conf_dir (), "denemo.conf", NULL);
    DenemoPrefs *ret = &Denemo.prefs;
    gchar * dotdenemo = locatedotdenemo ();
gchar *localrc = dotdenemo?g_build_filename (dotdenemo, "denemorc", NULL):NULL;

Roy

Jeremiah Benham wrote:
denemo does not need denemo.conf to launch because all the default
values are already set in denemo itself without the need of a
denemo.conf in /etc. After the first launch a ~/.denemo/denemorc is
created and denemo configuration is read from there anyway. denemorc.xml
is installed but denemo does not even use it. I vote we just
eliminate /etc/denemo all together. The only thing I can image that
would make it useful is if users had no home directory and the admin of
the system wanted to set some default values. Normally though if a user
has a ~/.denemo then the configuration would be read from that. Or we
can keep it as it is in /etc/denemo. Opinions?

Jeremiah


_______________________________________________
Denemo-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/denemo-devel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]