|
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.44 2007-06-02 08:30:41 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.45 2007-06-08 12:31:54 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
|
|
... |
|
... |
103 |
}
|
103 |
}
|
104 |
|
104 |
|
105 |
list<string> cdirs;
|
105 |
list<string> cdirs;
|
106 |
cdirs.push_back(m_confdir);
|
106 |
cdirs.push_back(m_confdir);
|
107 |
cdirs.push_back(path_cat(m_datadir, "examples"));
|
107 |
cdirs.push_back(path_cat(m_datadir, "examples"));
|
|
|
108 |
string cnferrloc = m_confdir + " or " + path_cat(m_datadir, "examples");
|
108 |
|
109 |
|
109 |
m_conf = new ConfStack<ConfTree>("recoll.conf", cdirs, true);
|
110 |
m_conf = new ConfStack<ConfTree>("recoll.conf", cdirs, true);
|
110 |
if (m_conf == 0 || !m_conf->ok()) {
|
111 |
if (m_conf == 0 || !m_conf->ok()) {
|
111 |
m_reason = string("No/bad main configuration file in: ") + m_confdir;
|
112 |
m_reason = string("No/bad main configuration file in: ") + cnferrloc;
|
112 |
return;
|
113 |
return;
|
113 |
}
|
114 |
}
|
114 |
|
115 |
|
115 |
mimemap = new ConfStack<ConfTree>("mimemap", cdirs, true);
|
116 |
mimemap = new ConfStack<ConfTree>("mimemap", cdirs, true);
|
116 |
if (mimemap == 0 || !mimemap->ok()) {
|
117 |
if (mimemap == 0 || !mimemap->ok()) {
|
117 |
m_reason = string("No or bad mimemap file in: ") + m_confdir;
|
118 |
m_reason = string("No or bad mimemap file in: ") + cnferrloc;
|
118 |
return;
|
119 |
return;
|
119 |
}
|
120 |
}
|
120 |
|
121 |
|
121 |
mimeconf = new ConfStack<ConfTree>("mimeconf", cdirs, true);
|
122 |
mimeconf = new ConfStack<ConfTree>("mimeconf", cdirs, true);
|
122 |
if (mimeconf == 0 || !mimeconf->ok()) {
|
123 |
if (mimeconf == 0 || !mimeconf->ok()) {
|
123 |
m_reason = string("No/bad mimeconf in: ") + m_confdir;
|
124 |
m_reason = string("No/bad mimeconf in: ") + cnferrloc;
|
124 |
return;
|
125 |
return;
|
125 |
}
|
126 |
}
|
126 |
mimeview = new ConfStack<ConfTree>("mimeview", cdirs, true);
|
127 |
mimeview = new ConfStack<ConfTree>("mimeview", cdirs, true);
|
127 |
if (mimeconf == 0 || !mimeconf->ok()) {
|
128 |
if (mimeconf == 0 || !mimeconf->ok()) {
|
128 |
m_reason = string("No/bad mimeview in: ") + m_confdir;
|
129 |
m_reason = string("No/bad mimeview in: ") + cnferrloc;
|
129 |
return;
|
130 |
return;
|
130 |
}
|
131 |
}
|
131 |
|
132 |
|
132 |
setKeyDir("");
|
133 |
setKeyDir("");
|
133 |
|
134 |
|