当前位置: 首页>>代码示例>>C++>>正文


C++ QSharedPointer::CheckFileAndPath方法代码示例

本文整理汇总了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);
  }
}
开发者ID:rselbo,项目名称:quicksync,代码行数:55,代码来源:syncsystem.cpp

示例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);
  }
}
开发者ID:rselbo,项目名称:quicksync,代码行数:21,代码来源:syncsystem.cpp


注:本文中的QSharedPointer::CheckFileAndPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。