Exemplo n.º 1
0
// read a file at location (relative to home) into passed array
bool
LocalFileStore::readFile(QByteArray *data, QString remotename, QString)
{

    // is the path set ?
    QString path = appsettings->cvalue(context->athlete->cyclist, GC_NETWORKFILESTORE_FOLDER, "").toString();
    if (path == "") return false;

    // open the path
    QDir current_path = QDir(path);
    if (!current_path.exists()) return false;

    QFile file(path+"/"+remotename);
    if (!file.exists()) return false;

    if (file.open(QIODevice::ReadOnly)) {
        *data = file.readAll();
        file.close();
    } else {
        file.close();
        return false;
    };

    emit readComplete(data, remotename, tr("Completed."));

    return true;
}
CntSimContactFetchRequest::CntSimContactFetchRequest(CntSymbianSimEngine *engine, QContactFetchRequest *req)
    :CntAbstractSimRequest(engine, req)
{
    connect( simStore(), SIGNAL(readComplete(QList<QContact>, QContactManager::Error)),
        this, SLOT(readComplete(QList<QContact>, QContactManager::Error)), Qt::QueuedConnection );
}