本文整理汇总了C++中QSharedPointer::CheckFileAndPath方法的典型用法代码示例。如果您正苦于以下问题:C++ QSharedPointer::CheckFileAndPath方法的具体用法?C++ QSharedPointer::CheckFileAndPath怎么用?C++ QSharedPointer::CheckFileAndPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSharedPointer
的用法示例。
在下文中一共展示了QSharedPointer::CheckFileAndPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotFileRenamed
//////////////////////////////////////////////////////////////////////////
/// A FileSystemWatcher notification when a file is renamed
//////////////////////////////////////////////////////////////////////////
void SyncSystem::slotFileRenamed(QString oldName, QString newName)
{
if(m_LostSyncTimer->isActive())
{
//Force the timer to run for 5 more seconds
m_LostSyncTimer->setInterval(s_ResyncTimeout);
}
QSharedPointer<SyncRules> oldPathRules = GetSyncRulesForPath(oldName);
QSharedPointer<SyncRules> newPathRules = GetSyncRulesForPath(newName);
SyncRuleFlags_e eOldFlags;
SyncRuleFlags_e eFlags;
if(oldPathRules->CheckFileAndPath(oldName.toLower(), eOldFlags) )
{
if(checkForRescan(newName))
{
return;
}
bool oldBinary = ((eOldFlags & e_Binary) == e_Binary);
bool oldExecutable = ((eOldFlags & e_Executable) == e_Executable);
//old name should be synced
if(newPathRules->CheckFileAndPath(newName.toLower(), eFlags))
{
bool binary = ((eFlags & e_Binary) == e_Binary);
bool executable = ((eFlags & e_Executable) == e_Executable);
//new file should also be synced, delete the old sync the new (to avoid the need for new server protocol)
addTodo(oldName, oldBinary, oldExecutable, true);
addTodo(newName, binary, executable, false);
}
else
{
//old name was in sync, new is not. delete
addTodo(oldName, oldBinary, oldExecutable, true);
}
}
else if(newPathRules->CheckFileAndPath(newName.toLower(), eFlags))
{
if(checkForRescan(newName))
{
return;
}
bool binary = ((eFlags & e_Binary) == e_Binary);
bool executable = ((eFlags & e_Executable) == e_Executable);
//Old file was not in sync, but the new is
addTodo(newName, binary, executable, false);
}
}
示例2: slotFileChanged
//////////////////////////////////////////////////////////////////////////
/// A FileSystemWatcher notification when a file is changed
//////////////////////////////////////////////////////////////////////////
void SyncSystem::slotFileChanged(QString file)
{
if(m_LostSyncTimer->isActive())
{
//Force the timer to run for 5 more seconds
m_LostSyncTimer->setInterval(s_ResyncTimeout);
}
QSharedPointer<SyncRules> rules = GetSyncRulesForPath(file);
SyncRuleFlags_e eFlags;
if(rules->CheckFileAndPath(file.toLower(), eFlags))
{
bool binary = ((eFlags & e_Binary) == e_Binary);
bool executable = ((eFlags & e_Executable) == e_Executable);
addTodo(file, binary, executable, false);
}
}