telsale-management/代码/telsale_aux_kit/source/SystemData.cpp

65 lines
1.2 KiB
C++

#include <QtCore/QtCore>
#include "SystemData.h"
//hash_map<string, string> parameters; //存放参数的hashmap
//版本号
const string cstrVersion = "0.99";
const string DB_FILE_NAME = "config.db";
string strUserCode;
string strUserName;
string strUserPassword;
//参数
//Parameters parameters( "config.db" );
Parameters* pParameters;
//bool checkVersion()
//{
// bool result = false;
// hash_map<string,string>::iterator iter = parameters.find( string("版本号") );
//
// if ( iter != parameters.end() && iter->second == cstrVersion )
// {
// result = true;
// }
//
// return result;
//}
void init_parameters()
{
QString dbFilePath = QCoreApplication::applicationDirPath();
dbFilePath.append( QString::fromLocal8Bit( "/" ) );
dbFilePath.append( QString::fromLocal8Bit( DB_FILE_NAME.c_str() ) );
pParameters = new Parameters( dbFilePath.toStdString() );
}
string getUserCode()
{
return strUserCode;
}
string getUserName()
{
return strUserName;
}
void setUserCode( const string& cstrUserCode )
{
strUserCode = cstrUserCode;
}
void setUserName( const string& cstrUserName )
{
strUserName = cstrUserName;
}
string getVersion()
{
return pParameters->getParameter( "version" );
}