加入忽略一些负荷的功能。

Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab
2015-01-16 16:27:05 +08:00
parent 9faa1cce49
commit 491f5e2276
5 changed files with 35 additions and 3 deletions

View File

@@ -18,22 +18,40 @@ LoadMapping::~LoadMapping()
bool LoadMapping::load(const QString &loadDir,const QString &matchdDir,const QString &exceptionFile)
{
if(LoadMapping::ht->keys().length()>0)
{
return true;//只执行一次
}
if(!QFileInfo::exists(loadDir)|!QFileInfo::exists(matchdDir)|!QFileInfo::exists(exceptionFile))
if(!QFileInfo::exists(loadDir))
{
std::cout<<"load file not exists."<<std::endl;
return false;
}
if(!QFileInfo::exists(matchdDir))
{
std::cout<<"match file not exists."<<std::endl;
return false;
}
if(!QFileInfo::exists(exceptionFile))
{
std::cout<<"match file not exists."<<std::endl;
return false;
}
if(!this->readMatch(matchdDir))
{
std::cout<<"read match failed"<<std::endl;
return false;
}
this->loadMatchException.init(exceptionFile);
if(!this->readLoads(loadDir))
{
std::cout<<"read load failed"<<std::endl;
return false;
}
return true;
}
@@ -57,6 +75,12 @@ bool LoadMapping::readLoads(const QString &dir)
continue;
}
QString fileName=fileInfo.baseName();
if(this->loadMatchException.contains(fileName))
{
std::cout<<"ignore "<<fileName.toLocal8Bit().data()<<std::endl;
continue;
}
if(!this->loadsToLoadInfo.contains(fileName))
{
std::cout<<filePath.toLocal8Bit().data()<<" no match."<<std::endl;