diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kgamma/kcmkgamma/xf86configpath.cpp | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kgamma/kcmkgamma/xf86configpath.cpp')
-rw-r--r-- | kgamma/kcmkgamma/xf86configpath.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/kgamma/kcmkgamma/xf86configpath.cpp b/kgamma/kcmkgamma/xf86configpath.cpp new file mode 100644 index 00000000..e6f7163b --- /dev/null +++ b/kgamma/kcmkgamma/xf86configpath.cpp @@ -0,0 +1,56 @@ +/*************************************************************************** + xf86configpath.cpp - description + ------------------- + begin : Mon Dec 30 2002 + copyright : (C) 2002 by Michael v.Ostheim + email : ostheimm@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <stdlib.h> +#include <unistd.h> + +#include <vector> + +#include "xf86configpath.h" + +using namespace std; + +XF86ConfigPath::XF86ConfigPath(){ + vector <string> searchPaths; + searchPaths.push_back("/etc/X11/XF86Config-4"); + searchPaths.push_back("/etc/X11/XF86Config"); + searchPaths.push_back("/etc/XF86Config"); + searchPaths.push_back("/usr/X11R6/etc/X11/XF86Config-4"); + searchPaths.push_back("/usr/X11R6/etc/X11/XF86Config"); + searchPaths.push_back("/usr/X11R6/lib/X11/XF86Config-4"); + searchPaths.push_back("/usr/X11R6/lib/X11/XF86Config"); + + searchPaths.push_back("/etc/X11/xorg.conf-4"); + searchPaths.push_back("/etc/X11/xorg.conf"); + searchPaths.push_back("/etc/xorg.conf"); + searchPaths.push_back("/usr/X11R6/etc/X11/xorg.conf-4"); + searchPaths.push_back("/usr/X11R6/etc/X11/xorg.conf"); + searchPaths.push_back("/usr/X11R6/lib/X11/xorg.conf-4"); + searchPaths.push_back("/usr/X11R6/lib/X11/xorg.conf"); + + vector<string>::iterator it = searchPaths.begin(); + for (; it != searchPaths.end(); ++it ) + if ( !access( (Path = *it).c_str(), F_OK ) ) break; +} + +XF86ConfigPath::~XF86ConfigPath(){ +} + +/** Returns path */ +const char* XF86ConfigPath::get(){ + return( Path.c_str() ); +} |