Switch to unified view

a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.26 2006-03-29 13:08:08 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.27 2006-04-03 11:43:07 dockes Exp $ (C) 2004 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
23
#include <errno.h>
23
#include <errno.h>
24
#include <langinfo.h>
24
#include <langinfo.h>
25
25
26
#include <sys/types.h>
26
#include <sys/types.h>
27
#include <sys/stat.h>
27
#include <sys/stat.h>
28
#ifdef __FreeBSD__
29
#include <osreldate.h>
30
#endif
28
31
29
#include <iostream>
32
#include <iostream>
30
33
31
#include "pathut.h"
34
#include "pathut.h"
32
#include "rclconfig.h"
35
#include "rclconfig.h"
...
...
159
    cp = nl_langinfo(CODESET);
162
    cp = nl_langinfo(CODESET);
160
    // We don't keep US-ASCII. It's better to use a superset
163
    // We don't keep US-ASCII. It's better to use a superset
161
    // Ie: me have a C locale and some french file names, and I
164
    // Ie: me have a C locale and some french file names, and I
162
    // can't imagine a version of iconv that couldn't translate
165
    // can't imagine a version of iconv that couldn't translate
163
    // from iso8859?
166
    // from iso8859?
167
  // The 646 thing is for solaris. 
164
    if (cp && *cp && strcmp(cp, "US-ASCII")) {
168
    if (cp && *cp && strcmp(cp, "US-ASCII") 
169
#ifdef sun
170
      && strcmp(cp, "646")
171
#endif
172
      ) {
165
        localecharset = string(cp);
173
        localecharset = string(cp);
166
    } else {
174
    } else {
175
      // Note: it seems that all versions of iconv will take
176
      // iso-8859. Some won't take iso8859
167
        localecharset = string("ISO8859-1");
177
        localecharset = string("ISO-8859-1");
168
    }
178
    }
169
    }
179
    }
170
180
171
    if (defcharset.empty()) {
181
    if (defcharset.empty()) {
172
    defcharset = localecharset;
182
    defcharset = localecharset;
...
...
243
    if (iconname.empty())
253
    if (iconname.empty())
244
    iconname = "document";
254
    iconname = "document";
245
255
246
    if (path) {
256
    if (path) {
247
    string iconsdir;
257
    string iconsdir;
258
259
#if defined (__FreeBSD__) && __FreeBSD_version < 500000
260
  // gcc 2.95 dies if we call getConfParam here ??
261
  if (m_conf) m_conf->get(string("iconsdir"), iconsdir, m_keydir);
262
#else
248
    getConfParam("iconsdir", iconsdir);
263
    getConfParam("iconsdir", iconsdir);
264
#endif
249
    if (iconsdir.empty()) {
265
    if (iconsdir.empty()) {
250
        iconsdir = path_cat(m_datadir, "images");
266
        iconsdir = path_cat(m_datadir, "images");
251
    } else {
267
    } else {
252
        iconsdir = path_tildexpand(iconsdir);
268
        iconsdir = path_tildexpand(iconsdir);
253
    }
269
    }