Пример #1
0
void
OpenWithContainerWindow::MakeDefaultAndOpen()
{
	int32 count = PoseView()->SelectionList()->CountItems();
	ASSERT(count == 1);
	if (count == 0)
		return;

	BPose* selectedAppPose = PoseView()->SelectionList()->FirstItem();
	ASSERT(selectedAppPose != NULL);
	if (selectedAppPose == NULL)
		return;

	// collect all the types of all the opened documents into a list
	BObjectList<BString> openedFileTypes(10, true);
	EachEntryRef(EntryList(), AddOneUniqueDocumentType, &openedFileTypes, 100);

	// set the default application to be the selected pose for all the
	// mime types in the list
	openedFileTypes.EachElement(SetDefaultAppForOneType,
		(void*)selectedAppPose->TargetModel()->EntryRef());

	// done setting the default application, now launch the app with the
	// documents
	OpenWithSelection();
}
Пример #2
0
void Lvk::FE::ChatHistoryWidget::addConversationEntry(const Lvk::Cmn::Conversation::Entry &entry)
{
    // Do not display Facebook's own messages
    if (entry.from.startsWith(OWN_MESSAGE_TOKEN)) {
        return;
    }

    QString key = hashKey(entry);

    if (!m_entries.contains(key)) {
        m_entries[key] = EntryList();

        addDateContactTableRow(entry);

        if (ui->dateContactTable->rowCount() == 1) {
            ui->dateContactTable->selectRow(0);
        }
    }

    m_entries[key].append(entry);

    if (ui->dateContactTable->rowCount() == 1) {
        addConversationTableRow(entry);
    } else if (ui->dateContactTable->selectionModel()->hasSelection()) {
        QModelIndex selectedIndex = ui->dateContactTable->selectionModel()->currentIndex();
        const QString &selectedKey = selectedIndex.data(HashKeyRole).toString();

        if (key == selectedKey) {
            addConversationTableRow(entry);
        }
    }

    ui->removeHistoryButton->setEnabled(true);
    ui->filter->setEnabled(true);
}
Пример #3
0
vector<HANDLE_OBJECT>
ObOpenObjectDirectory(
    _In_ ULONG64 InputObject
)
/*++

Routine Description:

    Description.

Arguments:

    InputObject - 

Return Value:

    vector<HANDLE_OBJECT>.

--*/
{
    vector<HANDLE_OBJECT> Handles;
    HANDLE_OBJECT Handle = { 0 };
    ExtRemoteTyped Directory;

    ULONG64 ObjectDir = InputObject;

    if (!ObjectDir)
    {
        ReadPointer(GetExpression("nt!ObpRootDirectoryObject"), &ObjectDir);
    }

    Directory = ExtRemoteTyped("(nt!_OBJECT_DIRECTORY *)@$extin", ObjectDir);

    ObReadObject(ObjectDir, &Handle);

    for (UINT i = 0; i < 37; i += 1)
    {
        ULONG64 Entry = Directory.Field("HashBuckets").ArrayElement(i).GetPointerTo().GetPtr();
        if (!Entry) continue;

        //
        // ExtRemoteTypedList requires a POINTER to the first entry. Not the offset of the first entry.
        //
        ExtRemoteTypedList EntryList(Entry, "nt!_OBJECT_DIRECTORY_ENTRY", "ChainLink");

        for (EntryList.StartHead(); EntryList.HasNode(); EntryList.Next())
        {
            HANDLE_OBJECT Handle = {0};

            ULONG64 Object = EntryList.GetTypedNode().Field("Object").GetPtr();
            ObReadObject(Object, &Handle);

            Handles.push_back(Handle);
        }
    }

    return Handles;
}
Пример #4
0
void Kiten::setupExportListDock()
{
  _exportListDock = new QDockWidget( i18n( "Export List" ), this );
  _exportListDockContents = new QWidget( _exportListDock );
  _exportListDock->setWidget( _exportListDockContents );
  addDockWidget( Qt::RightDockWidgetArea, _exportListDock );


  QVBoxLayout *layout = new QVBoxLayout( _exportListDockContents );
  _exportListDockContents->setLayout( layout );

  _exportList = new EntryListView( _exportListDockContents );

  layout->addWidget( _exportList );

  _exportList->setModel( new EntryListModel( EntryList() ) );
}