void QEditorSettings::init(const QByteArray &data){ m_content = data; QJsonParseError error; QJsonDocument jsondoc = QJsonDocument::fromJson(data, &error); if ( error.error != QJsonParseError::NoError ){ emit initError(error.errorString()); qCritical("Failed to parse settings file: %s", qPrintable(error.errorString())); } fromJson(jsondoc.object()); }
void ObexManagerPrivate::getManagedObjectsFinished(QDBusPendingCallWatcher *watcher) { const QDBusPendingReply<DBusManagerStruct> &reply = *watcher; watcher->deleteLater(); if (reply.isError()) { Q_EMIT initError(reply.error().message()); return; } DBusManagerStruct::const_iterator it; const DBusManagerStruct &managedObjects = reply.value(); for (it = managedObjects.constBegin(); it != managedObjects.constEnd(); ++it) { const QString &path = it.key().path(); const QVariantMapMap &interfaces = it.value(); if (interfaces.contains(Strings::orgBluezObexSession1())) { addSession(path, interfaces.value(Strings::orgBluezObexSession1())); } else if (interfaces.contains(Strings::orgBluezObexClient1()) && interfaces.contains(Strings::orgBluezObexAgentManager1())) { m_obexClient = new ObexClient(Strings::orgBluezObex(), path, DBusConnection::orgBluezObex(), this); m_obexAgentManager = new ObexAgentManager(Strings::orgBluezObex(), path, DBusConnection::orgBluezObex(), this); } } if (!m_obexClient) { Q_EMIT initError(QStringLiteral("Cannot find org.bluez.obex.Client1 object!")); return; } if (!m_obexAgentManager) { Q_EMIT initError(QStringLiteral("Cannot find org.bluez.obex.AgentManager1 object!")); return; } m_loaded = true; m_initialized = true; Q_EMIT q->operationalChanged(true); Q_EMIT initFinished(); }
void ObexManagerPrivate::nameHasOwnerFinished(QDBusPendingCallWatcher *watcher) { const QDBusPendingReply<bool> &reply = *watcher; watcher->deleteLater(); if (reply.isError()) { Q_EMIT initError(reply.error().message()); return; } m_obexRunning = reply.value(); if (m_obexRunning) { load(); } else { m_initialized = true; Q_EMIT initFinished(); } }
ThinklightPlugin::ThinklightPlugin( QObject *parent, const QStringList & /* args */ ) : Kopete::Plugin( ThinkLightPluginFactory::componentData(), parent ), m_toggles( 0 ), m_initProcess( this ) { if ( s_pPlugin != 0 ) return; s_pPlugin = this; connect( Kopete::ChatSessionManager::self() , SIGNAL( aboutToReceive( Kopete::Message & ) ) , this, SLOT( handleEvent() ) ); connect( this , SIGNAL( settingsChanged() ) , this , SLOT( settingsChanged() ) ); connect( &m_timer, SIGNAL( timeout() ), SLOT( toggle() ) ); connect( &m_initProcess, SIGNAL( finished( int, QProcess::ExitStatus ) ), SLOT( initFinished( int, QProcess::ExitStatus ) ) ); connect( &m_initProcess, SIGNAL( error( QProcess::ProcessError ) ), SLOT( initError( QProcess::ProcessError ) ) ); m_initProcess.start( ThinklightKcfg::self()->initScript() ); }
void mtspSolution::checkError() const { graphError(); initError(); }
void init(void) { initBeep(); initError(); }