1 /***************************************************************************
2 xf86configpath.cpp - description
4 begin : Mon Dec 30 2002
5 copyright : (C) 2002 by Michael v.Ostheim
6 email : ostheimm@users.berlios.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
23 #include "xf86configpath.h"
27 XF86ConfigPath::XF86ConfigPath(){
28 vector
<string
> searchPaths
;
29 searchPaths
.push_back("/etc/X11/XF86Config-4");
30 searchPaths
.push_back("/etc/X11/XF86Config");
31 searchPaths
.push_back("/etc/XF86Config");
32 searchPaths
.push_back("/usr/X11R6/etc/X11/XF86Config-4");
33 searchPaths
.push_back("/usr/X11R6/etc/X11/XF86Config");
34 searchPaths
.push_back("/usr/X11R6/lib/X11/XF86Config-4");
35 searchPaths
.push_back("/usr/X11R6/lib/X11/XF86Config");
37 searchPaths
.push_back("/etc/X11/xorg.conf-4");
38 searchPaths
.push_back("/etc/X11/xorg.conf");
39 searchPaths
.push_back("/etc/xorg.conf");
40 searchPaths
.push_back("/usr/X11R6/etc/X11/xorg.conf-4");
41 searchPaths
.push_back("/usr/X11R6/etc/X11/xorg.conf");
42 searchPaths
.push_back("/usr/X11R6/lib/X11/xorg.conf-4");
43 searchPaths
.push_back("/usr/X11R6/lib/X11/xorg.conf");
45 vector
<string
>::iterator it
= searchPaths
.begin();
46 for (; it
!= searchPaths
.end(); ++it
)
47 if ( !access( (Path
= *it
).c_str(), F_OK
) ) break;
50 XF86ConfigPath::~XF86ConfigPath(){
54 const char* XF86ConfigPath::get(){
55 return( Path
.c_str() );