add:在经典工程文件中resouce文件夹将会覆盖安装目录的resouce
This commit is contained in:
parent
82e405212a
commit
d2faf5ba51
@ -1015,6 +1015,21 @@ bool db_manager_api::initCompleteProjectExe()
|
||||
srcList.append(strProductSrcPath);
|
||||
}
|
||||
|
||||
// 处理resource文件夹:当经典工程的文件夹下有resource文件时,覆盖至程序安装目录的resource文件夹
|
||||
QString strResourceDstPath = CFileUtil::getSimplePath(CFileUtil::getCurModuleDir() + "../../resource" ).c_str();
|
||||
QString strResourceSrcPath = CFileUtil::getSimplePath(CFileUtil::getCurModuleDir() + "../../products/").c_str();
|
||||
strResourceSrcPath += QDir::separator()+m_productName + QDir::separator() + m_projectName + QDir::separator()+ "resource";
|
||||
if (dbDir.exists(strResourceSrcPath))
|
||||
{
|
||||
dstList.append(strResourceDstPath);
|
||||
srcList.append(strResourceSrcPath);
|
||||
sig_showMsg(tr("复制文件resource..."));
|
||||
}
|
||||
else
|
||||
{
|
||||
sig_showMsg(tr("不复制文件resource..."));
|
||||
}
|
||||
|
||||
m_pFileOpt->deleteDir(strDataDstPath);
|
||||
if (!m_pFileOpt->copyFiles(srcList, dstList))
|
||||
{
|
||||
|
||||
@ -123,11 +123,15 @@ bool file_opt::copyDirectoryFiles(const QString& fromDir, const QString& toDir,
|
||||
continue;
|
||||
}
|
||||
|
||||
/**< 当允许覆盖操作时,将旧文件进行删除操作 */
|
||||
if ( coverFileIfExist && targetDir.exists( fileInfo.fileName() ) )
|
||||
/**< 当允许覆盖操作时,处理目标文件 */
|
||||
if ( coverFileIfExist )
|
||||
{
|
||||
// 如果目标文件存在,先删除它
|
||||
if ( targetDir.exists( fileInfo.fileName() ) )
|
||||
{
|
||||
targetDir.remove( fileInfo.fileName() );
|
||||
}
|
||||
}
|
||||
|
||||
/// 进行文件copy
|
||||
if ( !QFile::copy( fileInfo.filePath(), targetDir.filePath( fileInfo.fileName() ) ) )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user