コード例 #1
0
 string VarTypesFactory::typeToString(VarTypeId vt)
 {
   if (vt==VARTYPE_ID_BOOL) {
     return "bool";
   } else if (vt==VARTYPE_ID_DOUBLE) {
     return "double";
   } else if (vt==VARTYPE_ID_INT) {
     return "int";
   } else if (vt==VARTYPE_ID_STRING) {
     return "string";
   } else if (vt==VARTYPE_ID_EXTERNAL) {
     return "external";
   } else if (vt==VARTYPE_ID_BLOB) {
     return "blob";
   } else if (vt==VARTYPE_ID_VECTOR2D) {
     return "vector2d";
   } else if (vt==VARTYPE_ID_VECTOR3D) {
     return "vector3d";
   } else if (vt==VARTYPE_ID_TIMEVAR) {
     return "timevar";
   } else if (vt==VARTYPE_ID_TIMELINE) {
     return "timeline";
   } else if (vt==VARTYPE_ID_LIST) {
     return "list";
   } else if (vt==VARTYPE_ID_STRINGENUM) {
     return "stringenum";
   } else if (vt==VARTYPE_ID_SELECTION) {
     return "selection";
   } else if (vt==VARTYPE_ID_TRIGGER) {
     return "trigger";
   } else if (vt==VARTYPE_ID_QWIDGET) {
     return "qwidget";
   } else {
     string s = userTypeToString(vt);
     if (s=="" || s=="undefined") {
       printf("warning: unknown vartype: %d\n",vt);
       return "undefined";
     }
     return s;
   }
 }
コード例 #2
0
void
AnalyticsService::onGotUserInfo( const lastfm::User& user )
{
    // set all the session level custom vars
    m_customVars.clear();
    m_customVars.enqueue( QString( "http://cdn.last.fm/client/ga.html#custom?version=%1&usertype=%2" ).arg( QCoreApplication::applicationVersion(), userTypeToString( user.type() ) ) );
    m_customVarsSet = true;

    loadPages();
}