/*!
 * Modifies the detail definitions. The default detail definitions are
 * queried from QContactManagerEngine::schemaDefinitions and then modified
 * with this function in the transform leaf classes.
 *
 * \a definitions The detail definitions to modify.
 * \a contactType The contact type the definitions apply for.
 */
void CntTransformOnlineAccount::detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const
{
    Q_UNUSED(contactType);

    if(definitions.contains(QContactOnlineAccount::DefinitionName)) {
        QContactDetailDefinition d = definitions.value(QContactOnlineAccount::DefinitionName);
        QMap<QString, QContactDetailFieldDefinition> fields = d.fields();
        QContactDetailFieldDefinition f;

        // Not all fields are supported
        fields.remove(QContactOnlineAccount::FieldCapabilities);
        fields.remove(QContactOnlineAccount::FieldDetailUri);
        fields.remove(QContactOnlineAccount::FieldLinkedDetailUris);
        fields.remove(QContactOnlineAccount::FieldServiceProvider);
        fields.remove(QContactOnlineAccount::FieldContext);

        // Support only certain subtypes 
        f.setDataType(QVariant::StringList);
        QVariantList subTypes;
        subTypes << QString(QLatin1String(QContactOnlineAccount::SubTypeSip));
        subTypes << QString(QLatin1String(QContactOnlineAccount::SubTypeSipVoip));
        subTypes << QString(QLatin1String(QContactOnlineAccount::SubTypeVideoShare));
        f.setAllowableValues(subTypes);
        fields[QContactOnlineAccount::FieldSubTypes] = f;

        d.setFields(fields);

        // Replace original definitions
        definitions.insert(d.name(), d);
    }
}
/*!
 * Modifies the detail definitions. The default detail definitions are
 * queried from QContactManagerEngine::schemaDefinitions and then modified
 * with this function in the transform leaf classes.
 *
 * \a definitions The detail definitions to modify.
 * \a contactType The contact type the definitions apply for.
 */
void CntTransformAnniversarySimple::detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const
{
    Q_UNUSED(contactType);

    if(definitions.contains(QContactAnniversary::DefinitionName)) {
        QContactDetailDefinition d = definitions.value(QContactAnniversary::DefinitionName);
        QMap<QString, QContactDetailFieldDefinition> fields = d.fields();

        // Following fields not supported in symbian (pre-10.1) back-end, remove
        fields.remove(QContactAnniversary::FieldCalendarId);
        fields.remove(QContactAnniversary::FieldEvent);

        // Sub-types not supported in symbian back-end, remove
        fields.remove(QContactAnniversary::FieldSubType);

        // Context not supported in symbian back-end, remove
        fields.remove(QContactAnniversary::FieldContext);

        d.setFields(fields);
        d.setUnique(true);

        // Replace original definitions
        definitions.insert(d.name(), d);
    }
}
/*! Return the parameters relevant to the creation of this QOrganizerManager
  \since 1.1
*/
QMap<QString, QString> QOrganizerManager::managerParameters() const
{
    QMap<QString, QString> params = d->m_engine->managerParameters();

    params.remove(QString::fromAscii(QTORGANIZER_VERSION_NAME));
    params.remove(QString::fromAscii(QTORGANIZER_IMPLEMENTATION_VERSION_NAME));
    return params;
}
Example #4
0
/*! Return the parameters relevant to the creation of this QContactManager */
QMap<QString, QString> QContactManager::managerParameters() const
{
    QMap<QString, QString> params = d->m_engine->managerParameters();

    params.remove(QString::fromAscii(QTCONTACTS_VERSION_NAME));
    params.remove(QString::fromAscii(QTCONTACTS_IMPLEMENTATION_VERSION_NAME));
    return params;
}
Example #5
0
QString ImageView::GetRandomEffect(void) const
{
    QMap<QString,QString> tmpMap = m_effect_map;
    tmpMap.remove("none");
    tmpMap.remove("Ken Burns (gl)");
    QStringList t = tmpMap.keys();
    int i = (int) ( (float)(t.count()) * random() / (RAND_MAX + 1.0f) );
    return tmpMap[t[i]];
}
Example #6
0
void OrganizerItemTypeTransform::modifyBaseSchemaDefinitions(QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > &schemaDefs) const
{
#ifndef AGENDA_EXT_SUPPORT
    // Note not supported on legacy platforms
    schemaDefs.remove(QOrganizerItemType::TypeNote);
#endif    
    // Journal is not supported on Symbian. Remove the type itself
    schemaDefs.remove(QOrganizerItemType::TypeJournal);
}
Example #7
0
void PluginCollection::scanPlugins() {
  QMap<QString,QString> backup = _installedPluginNames;
  bool changed = false;
  _installedPlugins.clear();
  _installedPluginNames.clear();

  QStringList dirs = KGlobal::dirs()->resourceDirs("kstplugins");
  dirs += KGlobal::dirs()->resourceDirs("kstpluginlib");
  for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
    //kdDebug() << "Scanning [" << *it << "] for plugins." << endl;
    QDir d(*it);

    d.setFilter(QDir::Files | QDir::NoSymLinks);
    d.setNameFilter("*.xml");

    const QFileInfoList *list = d.entryInfoList();
    if (!list) {
      continue;
    }

    QFileInfoListIterator fit(*list);
    QFileInfo *fi;

    while ((fi = fit.current()) != 0L) {
      if (_parser->parseFile(*it + fi->fileName()) == 0) {
        // dupe? - prefer earlier installations
        if (_installedPluginNames.contains(_parser->data()._name)) {
          ++fit;
          continue;
        }
        _installedPlugins[*it + fi->fileName()] = _parser->data();
        _installedPluginNames[_parser->data()._name] = *it + fi->fileName();
        if (!backup.contains(_parser->data()._name)) {
          emit pluginInstalled(_parser->data()._name);
          changed = true;
        } else {
          backup.remove(_parser->data()._name);
        }
      } else {
        KstDebug::self()->log(i18n("Error parsing XML file '%1'; skipping.").arg(*it + fi->fileName()), KstDebug::Warning);
      }
      ++fit;
    }
  }

  while (!backup.isEmpty()) {
    KstDebug::self()->log(i18n("Detected disappearance of '%1'.").arg(backup.begin().key()));
    emit pluginRemoved(backup.begin().key());
    backup.remove(backup.begin());
    changed = true;
  }

  if (changed) {
    emit pluginListChanged();
  }
}
QList<QVariantMap > HsMenuClientPrivate::getList(const QVariantMap &queryPreference)
{
    QList<QVariantMap> list;
    QMap<QString, QVariant> map = queryPreference;
    
    map.remove(hsItemName);
    map.remove(hsItemDescription);
    
    CaQuery query;
    // define query
    query.setFlagsOn(VisibleEntryFlag);
    query.setEntryRoles(ItemEntryRole);
    query.setEntryTypeNames(QStringList(Hs::templatedApplicationTypeName));
    
    
    // add atributes to caquery
    QMapIterator<QString, QVariant> k(map);
    while (k.hasNext()) {
        k.next();
        query.setAttribute(k.key(),k.value().toString());
    }  
    QList< QSharedPointer<CaEntry> > entries = CaService::instance()->getEntries(query);
    map.clear();
    if (entries.count()) {
        QMap<QString, QString> attrMap;
        QMapIterator<QString, QString> k(attrMap);
        //walk trought entrys and extract keys into map
        for (int i = 0; i < entries.count(); ++i) {
            map[hsItemId] = entries.at(i)->id();
            map[hsItemName] = entries.at(i)->text();
            map[hsItemDescription] = entries.at(i)->description();
            CaIconDescription iconDesc = entries.at(i)->iconDescription();
            map[hsIconFileName] = iconDesc.filename();
            map[hsIconName] = iconDesc.skinId();
            map[hsIconApplicationId] = iconDesc.applicationId();
            
            // extract entry atributes
            attrMap = entries.at(i)->attributes();
            QMapIterator<QString, QString> k(attrMap);
            // insert entrys attr into map
            while (k.hasNext()) {
                k.next();
                map.insert(k.key(),k.value());
            }
            list.append(map); //append entry map to list
            // clean used maps
            map.clear();
            attrMap.clear();
        }
    }
    return list;
}
Example #9
0
QList<TLType> GeneratorNG::solveTypes(QMap<QString, TLType> types)
{
    QList<TLType> solvedTypes;
    QStringList solvedTypesNames = nativeTypes;
    solvedTypesNames.append(tlValueName);

    int previousSolvedTypesCount = -1;

    // In order to successful compilation, type must rely only on defined types.
    while (solvedTypes.count() != previousSolvedTypesCount) { // Check for infinity loop
        previousSolvedTypesCount = solvedTypes.count();
        foreach(const QString &typeName, types.keys()) {
            const TLType &type = types.value(typeName);

            bool solved = true;

            if (nativeTypes.contains(type.name)) {
                types.remove(typeName);
                continue;
            }

            foreach (const TLSubType &subType, type.subTypes) {
                foreach (const TLParam &member, subType.members) {
                    QString memberType = getTypeOrVectorType(member.type);

                    if (!solvedTypesNames.contains(memberType)) {
                        solved = false;
                        break;
                    }
                }

                if (!solved) {
                    break;
                }
            }

            if (solved) {
                solvedTypes.append(type);
                types.remove(typeName);
                solvedTypesNames.append(typeName);

                qDebug() << "Solved:" << typeName;
            }
        }
    }

    qDebug() << "Unresolved:" << types.count();

    return solvedTypes;
}
Example #10
0
NS_IMETHODIMP KDEWallet::SetLoginSavingEnabled(const nsAString & aHost,
        bool isEnabled) {
    PR_LOG( gKDEWalletLog, PR_LOG_DEBUG, ( "KDEWallet::SetLoginSavingEnabled() Called") );

    nsresult res = checkWallet();
    NS_ENSURE_SUCCESS(res, res);

    QMap< QString, QString > saveDisabledHostMap;

    wallet->readMap( kSaveDisabledHostsMapName, saveDisabledHostMap );
    if( isEnabled ) { //Remove form disabled list, if it is there
        if( saveDisabledHostMap.contains( NSString2QtString(aHost) ) )
            if( saveDisabledHostMap.remove( NSString2QtString(aHost) ) != 1 ) {
                NS_ERROR("Can not remove save map information");
                return NS_ERROR_FAILURE;
            }
    }
    else 	// Add to disabled list
        saveDisabledHostMap[ NSString2QtString(aHost) ] = "TRUE";
    if( wallet->writeMap( kSaveDisabledHostsMapName, saveDisabledHostMap ) ) {
        NS_ERROR("Can not save map information");
        return NS_ERROR_FAILURE;
    }
    return NS_OK;
}
Example #11
0
void ResetBrowserPreferences()
{
   // We only reset the preferences that show in the Preferences Browser
   QStringList options;
   options << "DefaultForceField"
           << "UndoLimit"
           << "LabelFontSize"
           << "FragmentDirectory"
           << "QChemDatabaseFilePath"
           << "LogFilePath"
           << "LogFileHidden"
           << "LoggingEnabled"
           << "SurfaceOpacity"
           // And a few others
           << "MainWindowSize"
           << "QuiWindowSize"
           << "ShowModelView"
           << "ShaderDirectory"
           << "DefaultShader"
           << "DefaultShaderParameters"
           << "BackgroundColor"
           << "ForegroundColor"
           << "CurrentProcessList"
           << "JobMonitorList"
           << "FileDisplayWindowSize"
;

   QSettings settings(QSettings::UserScope, s_organization, s_application);
   for (int i = 0; i < options.size(); ++i) {
       s_preferencesCache.remove(options[i]);
       settings.remove(options[i]);
   }
}
QContactAbstractRequest* QContactJsonDbRequestManager::removeRequest(QJsonDbRequest *jsonDbRequest, RequestType &requestType, int &contactIndex, QString *partitionName)
{
    QMutexLocker locker(m_operationMutex);
    if (m_jsonDbRequestTypeMap.contains(jsonDbRequest)) {
        requestType = m_jsonDbRequestTypeMap.value(jsonDbRequest);
        m_jsonDbRequestTypeMap.remove(jsonDbRequest);
        if (requestType == OrphanRequest || requestType == InvalidRequest)
            return 0;
    } else {
        qWarning() << Q_FUNC_INFO << "Could not find jsondbRequest:" << jsonDbRequest;
        requestType = InvalidRequest;
        return 0;
    }
    QList<QContactAbstractRequest*> reqList = m_activeRequests.keys();
    for (int i = 0; i < reqList.size(); i++) {
        QContactAbstractRequest* req = reqList.at(i);
        QMap<QJsonDbRequest*, int>* requestMap = &(m_activeRequests.value(req)->m_jsonDbRequestMap);
        if (requestMap->contains(jsonDbRequest)) {
            *partitionName = jsonDbRequest->partition();
            contactIndex = requestMap->value(jsonDbRequest);
            requestMap->remove(jsonDbRequest);
            return reqList.at(i);
        }
    }
    // request already deleted so mark this as orphan.
    requestType = OrphanRequest;
    return 0;
}
void CollectionMapBridge::onCollectionsLoaded(std::vector<Collection> collections, bool /*ok*/)
{
  qDebug() << "Loaded" << collections.size() << "collections";

  // clear deleted collections on map
  if (delegatedMap == nullptr) {
    displayedCollection.clear();
  }else{
    QMap<qint64, DisplayedCollection> collectionToHide = displayedCollection;

    for (const auto &c: collections){
      if (c.visible){
        collectionToHide.remove(c.id);
        collectionDetailRequest(c);
      }
    }

    for (const auto &colId: collectionToHide.keys()) {
      DisplayedCollection col=displayedCollection.take(colId);
      for (const auto &wpt: col.waypoints) {
        delegatedMap->removeOverlayObject(wpt.id);
      }
      for (const auto &trk:col.tracks){
        for (const auto &id:trk.ids){
          delegatedMap->removeOverlayObject(id);
        }
      }
    }
  }
}
Example #14
0
Downloader::Downloader(QStringList tags, QStringList postfiltering, QStringList sources, int page, int max, int perpage, QString location, QString filename, QString user, QString password, bool blacklist, QStringList blacklistedtags, bool noduplicates, int tagsmin, QString tagsformat)
	: m_tags(tags), m_postfiltering(postfiltering), m_sources(sources), m_page(page), m_max(max), m_perpage(perpage), m_location(location), m_filename(filename), m_user(user), m_password(password), m_blacklist(blacklist), m_noduplicates(noduplicates), m_tagsmin(tagsmin), m_tagsformat(tagsformat), m_blacklistedTags(blacklistedtags)
{
	m_quit = false;
	QMap<QString, Site*> *sites = Site::getAllSites();

	m_sites = new QList<Site*>();
	for (QString source : sources)
	{
		if (!sites->contains(source))
			std::cerr << "Source '"+source.toStdString()+"' not found" << std::endl;
		else
        {
			m_sites->append(sites->value(source));
            sites->remove(source);
        }
	}
    qDeleteAll(*sites);
    delete sites;

	m_pages = new QList<Page*>();
    m_pagesC = new QList<Page*>();
	m_pagesT = new QList<Page*>();
	m_pagesP = new QList<QPair<Site*, int> >();
	m_opages = new QList<Page*>();
	m_opagesC = new QList<Page*>();
	m_opagesT = new QList<Page*>();
	m_opagesP = new QList<QPair<Site*, int> >();
	m_waiting = 0;
	m_ignored = 0;
	m_duplicates = 0;
	m_results = new QList<Tag>();
	m_images = new QList<Image*>();
}
Example #15
0
void IrcChannelPrivate::changeModes(const QString& value, const QStringList& arguments)
{
    Q_Q(IrcChannel);
    const IrcNetwork* network = q->network();

    QMap<QString, QString> ms = modes;
    QStringList args = arguments;

    bool add = true;
    for (int i = 0; i < value.size(); ++i) {
        const QString m = value.at(i);
        if (m == QLatin1String("+")) {
            add = true;
        } else if (m == QLatin1String("-")) {
            add = false;
        } else {
            if (add) {
                QString a;
                if (!args.isEmpty() && network && network->channelModes(IrcNetwork::TypeB | IrcNetwork::TypeC).contains(m))
                    a = args.takeFirst();
                ms.insert(m, a);
            } else {
                ms.remove(m);
            }
        }
    }

    if (modes != ms) {
        setKey(ms.value(QLatin1String("k")));
        modes = ms;
        emit q->modeChanged(q->mode());
    }
}
Example #16
0
void tGraph::setSetColor(int set, const QColor * color) {
    if(color) {
        _setColors[set] = *color;
    } else {
        _setColors.remove(set);
    }
}
LyricsProvidersDialog::LyricsProvidersDialog(QString state, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LyricsProvidersDialog)
{
    ui->setupUi(this);

    ui->upButton->setIcon(QIcon::fromTheme("keyboard_move_up"));
    ui->checkButton->setIcon(QIcon::fromTheme("widgets_tickmark_grid"));
    ui->downButton->setIcon(QIcon::fromTheme("keyboard_move_down"));
    ui->providersList->setItemDelegate(new ProviderListItemDelegate(ui->providersList));

    QMap<QString,QString> availableProviders = LyricsManager::listProviders();
    QStringList configList = state.split(',', QString::SkipEmptyParts);

    foreach(QString config, configList) {
        bool active;

        if (active = config.startsWith('+'))
            config = config.mid(1);

        if (availableProviders.contains(config))
            addProvider(config, availableProviders.value(config), active);

        availableProviders.remove(config);
    }
Example #18
0
UrlParseLock::~UrlParseLock() {
  QMutexLocker lock(&urlParseMutex);
  Q_ASSERT(parsingUrls.contains(m_url));
  Q_ASSERT(parsingUrls[m_url].first == QThread::currentThread());
  --parsingUrls[m_url].second;
  if(parsingUrls[m_url].second == 0)
    parsingUrls.remove(m_url);
}
Example #19
0
void SubsystemContainer::captureListSet(QHash<QString,QVariant>* subsystemElement, QString key){
    for(QVariant el : subsystemElement->value(key).toList()){
        QMap<QString,QVariant> set = el.toMap();
        QString setKey = set.value("id").toString();
        set.remove("id");
        m_sets.insert(setKey,set);
    }
}
Example #20
0
/// \brief LoggerBase deconstructor.  Removes the logger instance from the
///        loggerMap.
LoggerBase::~LoggerBase()
{
    QMutexLocker locker(&loggerMapMutex);
    loggerMap.remove(QString(m_handle));

    if (m_handle)
        free(m_handle);
}
Example #21
0
void KPMarginPage::getOptions(QMap<QString,QString>& opts, bool /* incldef */)
{
	if (m_margin->isCustomEnabled() /*|| incldef*/)
	{
		opts["kde-margin-top"] = QString::number(m_margin->top());
		opts["kde-margin-left"] = QString::number(m_margin->left());
		opts["kde-margin-bottom"] = QString::number(m_margin->bottom());
		opts["kde-margin-right"] = QString::number(m_margin->right());
	}
	else
	{
		opts.remove("kde-margin-top");
		opts.remove("kde-margin-left");
		opts.remove("kde-margin-bottom");
		opts.remove("kde-margin-right");
	}
}
Example #22
0
void ServerLight::readyRead() {
    BL_FUNC_DEBUG
    static QByteArray array = "";
    QByteArray lectura = "";
    QTcpSocket *socket = (QTcpSocket *) sender();
    lectura = socket->readAll();
    g_buffers[socket]  += lectura;
    array += lectura;
    QString mensaje = _("Mensaje desde: ")+ socket->peerAddress().toString() + "\n";
    
    QString texto(g_buffers[socket]);

    fprintf(stderr, "\nPaquete recibido:\n");
    fprintf(stderr, array);
    fprintf(stderr, "\nPaquete finalizado :\n");
    fprintf(stderr, QString::number(array.size()).toAscii());
    fprintf(stderr, "\nFin Paquete recibido :\n");
    
    /// Si se detecta el final de la transmision se procesa la informacion.
    if (texto.contains("</DOCUMENT>", Qt::CaseInsensitive)) {
    
	if (texto.contains("<GETCOMMAND>categoria_articulo</GETCOMMAND>", Qt::CaseInsensitive)) {
	    fprintf(stderr, categoryArticleXML().toAscii() );
	    socket->write(categoryArticleXML().toAscii());
	    /// Hay que cerrar el socket despues del envio.
	    g_buffers[socket] = "";
	    g_buffers.remove(socket);
	    socket->close();
	
        } else if (texto.contains("<PUTCOMMAND>ticket_data</PUTCOMMAND>", Qt::CaseInsensitive)) {
	    /// Nos han mandado la informacion de un ticket.
	    processTicketDataXML(texto);
	    g_buffers[socket] = "";
	    g_buffers.remove(socket);
	    socket->close();
        } else {
	    //fprintf(stderr, "--NO ENTIENDO--");
	} // end if

	/// Como se ha completado la recepcion de datos y se han procesado, se resetea el buffer de entrada.
	array = "";

    } // end if

    
}
QByteArray TwitterDataUtil::authorizationHeader(const QByteArray &oauthConsumerKey,
                                                const QByteArray &oauthConsumerSecret,
                                                const QByteArray &requestMethod,
                                                const QByteArray &requestUrl,
                                                const std::vector<std::pair<QByteArray, QByteArray>> &parameters,
                                                const QByteArray &oauthToken,
                                                const QByteArray &oauthTokenSecret,
                                                const QByteArray &oauthNonce,
                                                const QByteArray &oauthTimestamp)
{
    // Twitter requires all requests to be signed with an authorization header.
    QByteArray nonce {oauthNonce};
    if (nonce.isEmpty()) {
        nonce = QUuid::createUuid().toByteArray().toBase64();
    }
    QByteArray timestamp {oauthTimestamp};
    if (timestamp.isEmpty()) {
        timestamp = QByteArray::number(qFloor(QDateTime::currentMSecsSinceEpoch() / 1000.0));
    }

    // now build up the encoded parameters map.  We use a map to perform alphabetical sorting.
    QMap<QByteArray, QByteArray> encodedParams {};
    encodedParams.insert(QByteArray("oauth_consumer_key").toPercentEncoding(), QByteArray(oauthConsumerKey).toPercentEncoding());
    encodedParams.insert(QByteArray("oauth_nonce").toPercentEncoding(), nonce.toPercentEncoding());
    encodedParams.insert(QByteArray("oauth_signature_method").toPercentEncoding(), QByteArray(OAUTH_SIGNATURE_METHOD).toPercentEncoding());
    encodedParams.insert(QByteArray("oauth_timestamp").toPercentEncoding(), timestamp.toPercentEncoding());
    encodedParams.insert(QByteArray("oauth_version").toPercentEncoding(), QByteArray(OAUTH_VERSION).toPercentEncoding());
    if (!oauthToken.isEmpty()) {
        encodedParams.insert(QByteArray("oauth_token").toPercentEncoding(), oauthToken.toPercentEncoding());
    }
    for (const std::pair<QByteArray, QByteArray> &parameter : parameters) {
        encodedParams.insert(parameter.first, parameter.second);
    }

    QByteArray parametersByteArray {};
    QList<QByteArray> keys = encodedParams.keys();
    for (const QByteArray &key : keys) {
        parametersByteArray += key + QByteArray("=") + encodedParams.value(key) + QByteArray("&");
    }
    parametersByteArray.chop(1);

    QByteArray signatureBaseString {requestMethod.toUpper() + QByteArray("&") + requestUrl.toPercentEncoding() + QByteArray("&") + parametersByteArray.toPercentEncoding()};
    QByteArray signingKey {oauthConsumerSecret.toPercentEncoding() + QByteArray("&") + oauthTokenSecret.toPercentEncoding()};

    QByteArray oauthSignature {QMessageAuthenticationCode::hash(signatureBaseString, signingKey, QCryptographicHash::Sha1).toBase64()};
    encodedParams.insert(QByteArray("oauth_signature").toPercentEncoding(), oauthSignature.toPercentEncoding());

    // now generate the Authorization header from the encoded parameters map.
    // we need to remove the query items from the encoded parameters map first.
    QByteArray authHeader = QByteArray("OAuth ");

    for (const std::pair<QByteArray, QByteArray> &parameter : parameters) {
        encodedParams.remove(parameter.first);
    }
    keys = encodedParams.keys();
    foreach (const QByteArray &key, keys) {
        authHeader += key + "=\"" + encodedParams.value(key) + "\", ";
    } 
void MsgAudioSelectionEngine::HandleQueryCompletedL(CMdEQuery& aQuery,
        TInt aError)
    {
    iNameList.clear();
    iUriList.clear();
    if (aError == KErrCancel)
        {
        emit queryError(aError);
        return;
        }
    else
        {
        QMap<QString,QString> nameUriList;
        CMdEObjectQuery* query = static_cast<CMdEObjectQuery*> (&aQuery);
        TInt count = query->Count();
        for (TInt i = 0; i < count; ++i)
            {
            CMdEObject* object =
                    (CMdEObject*) query->TakeOwnershipOfResult(i);
            CleanupStack::PushL(object);
            CMdEPropertyDef& propDef = MsgAudioSelectionEngine::PropertyDefL(
                    iSession, MsgAudioSelectionEngine::EAttrFileName);

            CMdEProperty* property = 0;
            TInt err = object->Property(propDef, property, 0);
            if (err != KErrNotFound && property)
                {
                QString songName(XQConversions::s60DescToQString(
                        property->TextValueL()));
                QString uriValue(XQConversions::s60DescToQString(
                        object->Uri()));
                
                //insert into the map
                nameUriList.insertMulti(uriValue, songName);
                }
            CleanupStack::PopAndDestroy(object);
            }
        
        //now get all the song names and sort them
        iNameList = nameUriList.values();
        iNameList.sort();
        
        // go through the song list and get the associated uri
        // insert into the uri list
        int nameListTotal = iNameList.count();
        for(int nameListCount = 0; 
                nameListCount<nameListTotal;
                nameListCount++)
            {
            QString key = nameUriList.key(iNameList.at(nameListCount));
            iUriList.append(key);
            nameUriList.remove(key);                        
            }
        
        // emit the list to the model
        emit queryComplete(iNameList, iUriList);
        }
    }
Example #25
0
/*!
 * Modifies the detail definitions. The default detail definitions are
 * queried from QContactManagerEngine::schemaDefinitions and then modified
 * with this function in the transform leaf classes.
 *
 * \a definitions The detail definitions to modify.
 * \a contactType The contact type the definitions apply for.
 */
void CntTransformName::detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const
{
    if(definitions.contains(QContactName::DefinitionName)) {
        QContactDetailDefinition d = definitions.value(QContactName::DefinitionName);
        QMap<QString, QContactDetailFieldDefinition> fields = d.fields();

        // groups support only custom label
        if(contactType == QContactType::TypeGroup) {
            fields.remove(QContactName::FieldPrefix);
            fields.remove(QContactName::FieldFirstName);
            fields.remove(QContactName::FieldMiddleName);
            fields.remove(QContactName::FieldLastName);
            fields.remove(QContactName::FieldSuffix);
        } else {
            // Note: Custom labels cannot be enabled for a contact in pre-10.1
            // platforms because setting custom label for a contact causes
            // issues for S60 Phonebook editor. If custom label support is
            // needed in 10.1 or later, it needs to be variated away from
            // pre-10.1 platforms.
#ifndef SYMBIAN_BACKEND_USE_CNTMODEL_V2        
            fields.remove(QContactName::FieldCustomLabel);
#endif            
        }

        // Context not supported in symbian back-end, remove
        fields.remove(QContactName::FieldContext);

        d.setFields(fields);
        d.setUnique(true);

        // Replace original definitions
        definitions.insert(d.name(), d);
    }
}
Example #26
0
 void recordMemberRemoved(Record &def, Variable &key)
 {
     if(keys.contains(key.name()))
     {
         key.audienceForChangeFrom() -= this;
         parents.remove(&key);
         removeFromLookup(key.name(), key.value(), def);
     }
 }
Example #27
0
QMap<QString, QSharedPointer<types::TypeExpression>> LuaSemanticAnalyzer::variableTypes() const
{
	QMap<QString, QSharedPointer<qrtext::core::types::TypeExpression>> result = SemanticAnalyzer::variableTypes();
	for (const QString &identifier : mIntrinsicFunctions.keys()) {
		result.remove(identifier);
	}

	return result;
}
Example #28
0
QString QNPutExtraPrivate::remove(const QString &key)
{
    QString value;
    if(m_params.contains(key))
    {
        value = m_params.value(key);
        m_params.remove(key);
    }
    return value;
}
AndroidSurfaceTexture::~AndroidSurfaceTexture()
{
    if (QtAndroidPrivate::androidSdkVersion() > 13 && m_surfaceView.isValid())
        m_surfaceView.callMethod<void>("release");

    if (m_surfaceTexture.isValid()) {
        release();
        g_objectMap.remove(m_texID);
    }
}
bool Activity::updateActivity(QString activityID, QMap<QString, QString> valuesToChange) {
    // Lookup the course to change just by the key since it can't change
    QMap<QString, QString> tmp;
    tmp.insert(getKey(), activityID);

    // Auto incremented, so why would this need to change
    valuesToChange.remove(getKey());

    return updateDBItem(tmp, valuesToChange);
}