Пример #1
0
bool ViewRegistryReader::ReadElement(const SmartPointer<IConfigurationElement> &element)
{
  QString elementName = element->GetName();
  if (elementName == WorkbenchRegistryConstants::TAG_VIEW)
  {
    this->ReadView(element);
    return true;
  }
  if (elementName == WorkbenchRegistryConstants::TAG_CATEGORY)
  {
    this->ReadCategory(element);
    this->ReadElementChildren(element);
    return true;
  }
  if (elementName == WorkbenchRegistryConstants::TAG_STICKYVIEW)
  {
    this->ReadSticky(element);
    return true;
  }

  return false;
}
Пример #2
0
bool EditorHistoryItem::Matches(const SmartPointer<IEditorInput>& input) const
{
  if (IsRestored())
  {
    return input == GetInput();
  }
  // if not restored, compare name, tool tip text and factory id,
  // avoiding as much work as possible
  if (GetName() != input->GetName())
  {
    return false;
  }
  if (GetToolTipText() != input->GetToolTipText())
  {
    return false;
  }

  const IPersistableElement* persistable = input->GetPersistable();
  QString inputId = persistable ? QString::null : persistable->GetFactoryId();
  QString myId = GetFactoryId();
  return myId.isEmpty() ? inputId.isEmpty() : myId == inputId;
}