QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request,
                                                           QBluetoothTransferManager *parent)
:   QBluetoothTransferReply(parent), tempfile(0), source(input),
    m_running(false), m_finished(false), m_size(0),
    m_error(QBluetoothTransferReply::NoError), m_errorStr(), m_transfer_path()
{
    setRequest(request);
    setManager(parent);
    client = new OrgOpenobexClientInterface(QLatin1String("org.openobex.client"), QLatin1String("/"),
                                           QDBusConnection::sessionBus());

    qsrand(QTime::currentTime().msec());
    m_agent_path = agentPath;
    m_agent_path.append(QString::fromLatin1("/%1").arg(qrand()));

    agent = new AgentAdaptor(this);

    bool res = QDBusConnection::sessionBus().registerObject(m_agent_path, this);
    if(!res)
        qCWarning(QT_BT_BLUEZ) << "Failed Creating dbus objects";

    qRegisterMetaType<QBluetoothTransferReply*>("QBluetoothTransferReply*");
    QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
    m_running = true;
}
Exemplo n.º 2
0
OffBlock_Manager::OffBlock_Manager(Problem_Manager& problemMan_, 
		Epetra_CrsGraph& graph_, int probEqId, int probVarId) :
  GenericEpetraProblem(graph_.Comm(), 0),
  problemEqId(probEqId),
  problemVarId(probVarId)
{
 
  setManager(&problemMan_);

  // Assign a meaningful name
  GenericEpetraProblem &problemEq = myManager->getProblem(problemEqId),
                       &problemVar = myManager->getProblem(problemVarId);
  
  string myName = "OffBlock " + problemEq.getName() + " wrt " + problemVar.getName();
  setName(myName);

  // Set our graph (held in base class) after converting from incoming
  // global indices to shifted block indices
  AA = Teuchos::rcp( &( createBlockGraphFromComposite(graph_) ) );

  // Create a problem interface to the manager
  offBlockInterface = Teuchos::rcp(new Problem_Interface(*this));

  // Use our graph to create FDC objects needed for off-diagonal block fills
  createFDobjects( true );

  // Reset number of dofs (overwrites base constructor assignment)
  NumMyNodes = 0;

}
Exemplo n.º 3
0
Sector::Sector(string name,Manager* manager):Object() {
	_name = name;
	_resultAdapter = new EventListenerList();
	_commandAdapter = new EventListenerList();

	_superior=NULL;
	_manager = NULL;
	setManager(manager);
}
Exemplo n.º 4
0
EntityWorld::EntityWorld()
{
	m_totalGameTime = 0;
	m_delta = 0.01f;
	m_shutdown = false;
	m_hostServer = false;
	m_requestedRestart = false;
	m_serverName = "monki";
	m_serverGameTime = -1;
	
	m_aspectRatio = 800.0f/600.0f;

	m_componentManager = new ComponentManager();
	setManager( Manager::ComponentManager, m_componentManager );
		
	m_entityManager = new EntityManager();
	setManager(  Manager::EntityManager, m_entityManager );

	m_systemManager = new SystemManager( this );
	setManager(  Manager::SystemManager, m_systemManager );
}
Exemplo n.º 5
0
PrintDialogController::PrintDialogController(QString symbol,QWidget *parent)
{
    setSymbol(symbol);
    setPrinter(new QPrinter(QPrinter::HighResolution));
    setSettings(new QSettings());
    setDocumentService(new DocumentServices());
    setSaveToPdf(false);
    setPrintReleated(false);
    setPrintAndSave(1);
    setPreferences(new SettingsPreferencesService());
    setManager(new PrintManager());
    setView(new PrintDialogView(parent,this));
    directories();
    restoreDefaultPrintPreferences();
}
QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request,
                                                           QBluetoothTransferManager *parent)
:   QBluetoothTransferReply(parent),
    m_client(0), m_agent(0), m_clientBluez(0), m_objectPushBluez(0),
    m_tempfile(0), m_source(input),
    m_running(false), m_finished(false), m_size(0),
    m_error(QBluetoothTransferReply::NoError), m_errorStr(), m_transfer_path()
{
    setRequest(request);
    setManager(parent);

    if (!input) {
        qCWarning(QT_BT_BLUEZ) << "Invalid input device (null)";
        m_errorStr = QBluetoothTransferReply::tr("Invalid input device (null)");
        m_error = QBluetoothTransferReply::FileNotFoundError;
        m_finished = true;
        return;
    }

    if (isBluez5()) {
        m_clientBluez = new OrgBluezObexClient1Interface(QStringLiteral("org.bluez.obex"),
                                                        QStringLiteral("/org/bluez/obex"),
                                                        QDBusConnection::sessionBus(), this);


    } else {
        m_client = new OrgOpenobexClientInterface(QStringLiteral("org.openobex.client"),
                                                  QStringLiteral("/"),
                                                  QDBusConnection::sessionBus());

        m_agent_path = agentPath;
        m_agent_path.append(QStringLiteral("/%1%2/%3").
                            arg(QCoreApplication::applicationName()).
                            arg(QCoreApplication::applicationPid()).
                            arg(agentPathCounter.fetchAndAddOrdered(1)));

        m_agent = new AgentAdaptor(this);

        if (!QDBusConnection::sessionBus().registerObject(m_agent_path, this))
            qCWarning(QT_BT_BLUEZ) << "Failed creating obex agent dbus objects";
    }

    QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
    m_running = true;
}
QT_BEGIN_NAMESPACE

QBluetoothTransferReplyQnx::QBluetoothTransferReplyQnx(QIODevice *input, const QBluetoothTransferRequest &request,
                                                       QBluetoothTransferManager *parent)
:   QBluetoothTransferReply(parent), tempfile(0), source(input),
    m_running(false), m_finished(false),
    m_error(QBluetoothTransferReply::NoError), m_errorStr()
{
    setRequest(request);
    setManager(parent);

    ppsRegisterControl();
    //qsrand(QTime::currentTime().msec());
    //m_agent_path = agentPath;
    //m_agent_path.append(QString::fromLatin1("/%1").arg(qrand()));
    ppsRegisterForEvent(QStringLiteral("opp_update"), this);
    ppsRegisterForEvent(QStringLiteral("opp_complete"), this);
    ppsRegisterForEvent(QStringLiteral("opp_cancelled"), this);

    QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
    m_running = true;
}