Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4QSettings.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4QSettings.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "qdir.h" 
00021 
00022 bool TGo4QSettings::fgbUSEMYLOCATION=false;
00023 QString TGo4QSettings::fgxSETTINGSLOCATION="";
00024 QString TGo4QSettings::fgxSETTINGSNAME="/go4";
00025 QString TGo4QSettings::fgxHOMESETTINGSNAME="/go4";
00026 
00027 TGo4QSettings::TGo4QSettings() : QSettings()
00028 {
00029    SetSettingsPath();
00030 }
00031 
00032 TGo4QSettings::TGo4QSettings ( Format format ): QSettings(format) 
00033 {
00034    SetSettingsPath();   
00035 }
00036 
00037 
00038 TGo4QSettings::~TGo4QSettings()
00039 {
00040 }
00041 
00042 void TGo4QSettings::SetToCurrentDir(bool on)
00043 {
00044     fgbUSEMYLOCATION=on;
00045     if(on)
00046         {
00047             fgxSETTINGSLOCATION=QDir::currentDirPath()+ "/.go4"; 
00048             fgxSETTINGSNAME=fgxHOMESETTINGSNAME+"local";
00049         }
00050      else
00051         {
00052             fgxSETTINGSNAME=fgxHOMESETTINGSNAME;   
00053         }
00054 }
00055 
00056 
00057 void TGo4QSettings::DumpSettingsLocation()
00058 {
00059 if(fgbUSEMYLOCATION)
00060    {
00061       cout <<"Using Qt Settings at "<<fgxSETTINGSLOCATION+fgxSETTINGSNAME+"rc" << endl;
00062    }
00063 else
00064    {
00065       cout <<"Using Qt Settings at "<<QDir::homeDirPath()+ "/.qt"+fgxSETTINGSNAME+"rc"<<endl;
00066    }   
00067 }
00068 
00069 void TGo4QSettings::SetSettingsPath()
00070 {
00071 if(fgbUSEMYLOCATION)
00072    {
00073       // user defined path
00074       //cout <<"TGo4QSettings set path to"<<fgxSETTINGSLOCATION.data() << endl;
00075       insertSearchPath( QSettings::Unix, fgxSETTINGSLOCATION);
00076    }
00077 else
00078    {
00079       //use QSettings default
00080       //cout <<"TGo4QSettings with default QSettings"<<endl;
00081    }
00082    
00083 }
00084    
00085 
00086 
00087 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:02 2005 for Go4-v2.10-5 by doxygen1.2.15