示例#1
0
KXmlCommand* KMSpecialManager::loadCommand(KMPrinter *pr)
{
	KXmlCommand	*xmlCmd = loadCommand(pr->option("kde-special-command"));
	if (xmlCmd && xmlCmd->driver())
		xmlCmd->driver()->set("text", pr->printerName());
	return xmlCmd;
}
// ---------------------------------------------------------------------------
// Name:        gdProjectSettingsExtension::setSettingsFromXMLString
// Description: Get the project settings from the XML string
// Arguments:   const gtString& projectAsXMLString
// Return Val:  bool - Success / failure.
// Author:      Sigal Algranaty
// Date:        8/4/2012
// ---------------------------------------------------------------------------
bool gdProjectSettingsExtension::SetSettingsFromXMLString(const gtString& projectAsXMLString)
{
    bool retVal = false;
    // Load the project settings from the XML string:
    gdLoadProjectCommand loadCommand(projectAsXMLString);
    retVal = loadCommand.execute();

    // Get the loaded settings:
    const apDebugProjectSettings& loadedDebugSettings = loadCommand.loadedProjectSettings();

    // Copy to a new object:
    apProjectSettings projectSettings = afProjectManager::instance().currentProjectSettings();

    // Create a settings with both configurations:
    apDebugProjectSettings debugSettings(projectSettings, loadedDebugSettings);

    // Set the current project settings:
    gdGDebuggerGlobalVariablesManager::instance().setCurrentDebugProjectSettings(debugSettings);

    // Trigger breakpoints update event:
    // The -1 states the all the breakpoints are updated, and lists should be updated from scratch:
    apBreakpointsUpdatedEvent eve(-1);
    apEventsHandler::instance().registerPendingDebugEvent(eve);

    // Load settings to the controls:
    retVal = RestoreCurrentSettings() && retVal;

    return retVal;
}
示例#3
0
DrMain* KMSpecialManager::loadDriver(KMPrinter *pr)
{
	KXmlCommand	*xmlCmd;
	DrMain	*driver(0);

	if ((xmlCmd=loadCommand(pr)) != 0)
	{
		driver = xmlCmd->takeDriver();
		delete xmlCmd;
	}

	return driver;
}
示例#4
0
QString KMSpecialManager::setupCommand(const QString& cmd, const QMap<QString,QString>& opts)
{
	QString	s(cmd);
	if (!s.isEmpty())
	{
		KXmlCommand	*xmlCmd = loadCommand(cmd);
		if (xmlCmd)
		{
			s = xmlCmd->buildCommand(opts, false, false);
			delete xmlCmd;
		}
	}

	return s;
}