Esempio n. 1
0
void controlyPlugin::getResults(QList<InputData>* inputData, QList<CatItem>* results)
{
	// if user enters "*.controly", dynamically return all elements that we added to the primary catalog (for informational / debugging purposes only)
	if (inputData->size() == 1) {
		const QString & text = inputData->first().getText();

		if (text.compare("*.controly") == 0) {
			QList<CatItem> controlyCatalog;
			getCatalog(&controlyCatalog);
			CatItem temp("ItemCount.controly", QString::number(controlyCatalog.size()), HASH_controly, getIcon());
			temp.usage = 32000;
			results->append(temp);
			(*results) += controlyCatalog;
		}
	}

	if (inputData->count() != 2)
		return;

	if (inputData->first().getTopResult().id == HASH_controly) {
		QString text = inputData->at(1).getText();
		addCatItem(text, results, "Launchy.options", "Options");
		addCatItem(text, results, "Launchy.rebuild", "Rebuild Catalog");
		addCatItem(text, results, "Launchy.exit", "Exit");
	}	
}
Esempio n. 2
0
void VerbyPlugin::getResults(QList<InputData>* inputData, QList<CatItem>* results)
{
    if (inputData->count() == 2)
    {
        QString text = inputData->at(1).getText();

        if (inputData->first().hasLabel(HASH_DIR))
        {
            addCatItem(text, results, "Properties", "Directory properties", "properties.png");
        }
        else if (inputData->first().hasLabel(HASH_FILE))
        {
            addCatItem(text, results, "Open containing folder", "Open containing folder", "opencontainer.png");
            addCatItem(text, results, "Properties", "File properties", "properties.png");
        }
        else if (inputData->first().hasLabel(HASH_LINK))
        {
            addCatItem(text, results, "Run as", "Run as a different user", "run.png");
            addCatItem(text, results, "Open containing folder", "Open containing folder", "opencontainer.png");
            addCatItem(text, results, "Open shortcut folder", "Open shortcut folder", "opencontainer.png");
            addCatItem(text, results, "Copy path", "Copy path to clipboard", "copy.png");
            addCatItem(text, results, "Properties", "File properties", "properties.png");
        }
        else
        {
            return;
        }

        // Mark the item as a Verby item so that Verby has a chance to process it before Launchy
        inputData->first().setID(HASH_VERBY);
        inputData->first().getTopResult().id = HASH_VERBY;

        // ensure there's always an item at the top of the list for launching with parameters.
        results->push_front(CatItem(
            "Run",
            inputData->last().getText(), INT_MAX,
            getIconPath() + "run.png"));
    }
}