void WikiDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req) { std::cerr << "WikiDialog::loadRequest() UserType: " << req.mUserType; std::cerr << std::endl; if (queue == mWikiQueue) { /* now switch on req */ switch(req.mUserType) { case WIKIDIALOG_LISTING_GROUPMETA: loadGroupMeta(req.mToken); break; case WIKIDIALOG_LISTING_PAGES: loadPages(req.mToken); break; case WIKIDIALOG_WIKI_PAGE: loadWikiPage(req.mToken); break; #define GXSGROUP_NEWGROUPID 1 case GXSGROUP_NEWGROUPID: insertWikiGroups(); break; default: std::cerr << "WikiDialog::loadRequest() ERROR: INVALID TYPE"; std::cerr << std::endl; break; } } }
void AnalyticsService::onLoadFinished() { #ifdef LASTFM_ANALYTICS m_pageLoaded = true; loadPages(); #endif }
void AnalyticsService::sendPageView( const QString& url ) { #ifdef LASTFM_ANALYTICS m_queue.enqueue( QString( "http://cdn.last.fm/client/ga.html#pageview?url=%1" ).arg( url ) ); loadPages(); #endif }
void AnalyticsService::sendEvent( const QString& category, const QString& action, const QString& label, const QString& value ) { #ifdef LASTFM_ANALYTICS m_queue.enqueue( QString( "http://cdn.last.fm/client/ga.html#event?category=%1&action=%2&label=%3&value=%4" ).arg( category, action, label, value ) ); loadPages(); #endif }
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(); }
bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > &pagesVector ) { //kDebug(DviDebug) << "file:" << fileName; KUrl base( fileName ); (void)userMutex(); m_dviRenderer = new dviRenderer(documentMetaData("TextHinting", QVariant()).toBool()); connect( m_dviRenderer, SIGNAL( error(QString,int) ), this, SIGNAL( error(QString,int) ) ); connect( m_dviRenderer, SIGNAL( warning(QString,int) ), this, SIGNAL( warning(QString,int) ) ); connect( m_dviRenderer, SIGNAL( notice(QString,int) ), this, SIGNAL( notice(QString,int) ) ); #ifdef DVI_OPEN_BUSYLOOP static const ushort s_waitTime = 800; // milliseconds static const int s_maxIterations = 10; int iter = 0; for ( ; !m_dviRenderer->isValidFile( fileName ) && iter < s_maxIterations; ++iter ) { kDebug(DviDebug).nospace() << "file not valid after iteration #" << iter << "/" << s_maxIterations << ", waiting for " << s_waitTime; #ifdef Q_OS_WIN Sleep( uint( s_waitTime ) ); #else struct timespec ts = { 0, s_waitTime * 1000 * 1000 }; nanosleep( &ts, NULL ); #endif } if ( iter >= s_maxIterations && !m_dviRenderer->isValidFile( fileName ) ) { kDebug(DviDebug) << "file still not valid after" << s_maxIterations; delete m_dviRenderer; m_dviRenderer = 0; return false; } #else if ( !m_dviRenderer->isValidFile( fileName ) ) { delete m_dviRenderer; m_dviRenderer = 0; return false; } #endif if ( ! m_dviRenderer->setFile( fileName, base ) ) { delete m_dviRenderer; m_dviRenderer = 0; return false; } kDebug(DviDebug) << "# of pages:" << m_dviRenderer->dviFile->total_pages; m_resolution = dpi().height(); loadPages( pagesVector ); return true; }
bool DjVuGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > & pagesVector ) { QMutexLocker locker( userMutex() ); if ( !m_djvu->openFile( fileName ) ) return false; locker.unlock(); loadPages( pagesVector, 0 ); return true; }