compile with Exiv2 < 0.18
[kdegraphics.git] / kgamma / kcmkgamma / xf86configpath.cpp
blobe6f7163bfde3c013da325f99484b3d90cb863cbf
1 /***************************************************************************
2 xf86configpath.cpp - description
3 -------------------
4 begin : Mon Dec 30 2002
5 copyright : (C) 2002 by Michael v.Ostheim
6 email : ostheimm@users.berlios.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #include <stdlib.h>
19 #include <unistd.h>
21 #include <vector>
23 #include "xf86configpath.h"
25 using namespace std;
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(){
53 /** Returns path */
54 const char* XF86ConfigPath::get(){
55 return( Path.c_str() );