/**
 * Executes a query.
 * @param	nType	The type of the query (@see CscopeFrontend)
 * @param	sText	The query's text
 * @param	pItem	If non-null, represents an view item passed back to
 *					the view in a call to addRecord()
 */
void QueryViewDriver::query(uint nType, const QString& sText,
	QListViewItem* pItem)
{
	CscopeFrontend* pCscope;
	
	m_pItem = pItem;
	
	// Make sure sorting is disabled while entries are added
	m_pView->setSorting(100);
	
	// Create a self-destructing Cscope process
	pCscope = new CscopeFrontend(this);	
		
	// Add records to the page when Cscope outputs them
	connect(pCscope, SIGNAL(dataReady(FrontendToken*)), this,
		SLOT(slotDataReady(FrontendToken*)));
		
	// Report progress information
	connect(pCscope, SIGNAL(progress(int, int)), this,
		SLOT(slotProgress(int, int)));

	// Perform tasks when the query process terminates
	connect(pCscope, SIGNAL(finished(uint)), this,
		SLOT(slotFinished(uint)));
		
	// Execute the query
	pCscope->query(nType, sText);
	m_bRunning = true;
	m_pView->setEnabled(false);
	m_pView->setUpdatesEnabled(false);
}
Beispiel #2
0
KFMExec::KFMExec()
{
    // Create a list of currently running KFMExecs
    if ( lstZombies == 0L )
    {
	lstZombies = new QList<KFMExec>;
	lstZombies->setAutoDelete( TRUE );
    }

    lstZombies->clear();

    // We are not prepared to die yet
    bDone = FALSE;
    dlg = 0L;
    
    dirURL = 0L;

    // We use the job to determine
    // a) the mimetype of the URL or
    // b) wether it is a directory 
    job = new KFMJob;
    connect( job, SIGNAL( error( int, const char* ) ), this, SLOT( slotError( int, const char* ) ) );
    connect( job, SIGNAL( newDirEntry( KIODirectoryEntry* ) ),
	     this, SLOT( slotNewDirEntry( KIODirectoryEntry* ) ) );
    connect( job, SIGNAL( mimeType( const char* ) ), this, SLOT( slotMimeType( const char* ) ) );
    connect( job, SIGNAL( finished( ) ), this, SLOT( slotFinished( ) ) );
}
Beispiel #3
0
void QFileTrans::slotPresenceReceived(const QXmppPresence &presence)
{
    bool check;
    Q_UNUSED(check);

    // if we don't have a recipient, or if the presence is not from the recipient,
    // do nothing
    if (m_recipient.isEmpty() ||
        QXmppUtils::jidToBareJid(presence.from()) != m_recipient ||
        presence.type() != QXmppPresence::Available)
        return;

    // send the file and connect to the job's signals
    QXmppTransferJob *job = transferManager->sendFile(presence.from(), ":/example_3_transferHandling.cpp", "example source code");

    check = connect(job, SIGNAL(error(QXmppTransferJob::Error)),
                    this, SLOT(slotError(QXmppTransferJob::Error)));
    Q_ASSERT(check);

    check = connect(job, SIGNAL(finished()),
                    this, SLOT(slotFinished()));
    Q_ASSERT(check);

    check = connect(job, SIGNAL(progress(qint64,qint64)),
                    this, SLOT(slotProgress(qint64,qint64)));
    Q_ASSERT(check);
}
Beispiel #4
0
/**
 * Class constructor.
 * @param	pParent	The parent widget
 * @param	szName	The widget's name
 */
MakeDlg::MakeDlg(QWidget* pParent, const char* szName) :
	MakeLayout(pParent, szName, MAKE_DLG_W_FLAGS)
{
	// Don't show the "Function" column
	m_pErrorView->setColumnWidth(0, 0);
	
	// Create a new make front-end
	m_pMake = new MakeFrontend();
	connect(m_pMake, SIGNAL(dataReady(FrontendToken*)), this,
		SLOT(slotShowOutput(FrontendToken*)));
	connect(m_pMake, SIGNAL(finished(uint)), this, SLOT(slotFinished(uint)));
	connect(m_pMake,
		SIGNAL(error(const QString&, const QString&, const QString&)),
		this,
		SLOT(slotAddError(const QString&, const QString&, const QString&)));
	
	// The Root URL control should browse directories
	m_pRootURL->setMode(KFile::Directory);
	
	// Handle URL links in the browser
	m_pOutputBrowser->setNotifyClick(true);
	connect(m_pOutputBrowser, SIGNAL(urlClick(const QString&)), this,
		SLOT(slotBrowserClicked(const QString&)));
		
	// Handle selections in the error view
	connect(m_pErrorView, SIGNAL(lineRequested(const QString& , uint)), this,
		SIGNAL(fileRequested(const QString&, uint)));
		
	// Do not allow duplicates in the command history
	m_pCommandHistory->setDuplicatesEnabled(false);
}
Beispiel #5
0
void VkontakteWindow::closeEvent(QCloseEvent* event)
{
    if (!event)
    {
        return;
    }

    slotFinished();
    event->accept();
}
Beispiel #6
0
void ExpoBlendingDlg::closeEvent(QCloseEvent* e)
{
    if (!e)
    {
        return;
    }

    slotFinished();
    e->accept();
}
Beispiel #7
0
void QPkBackend::removePackages()
{
    m_t = new PackageKit::Transaction(QString(), this);
    if (m_t->error() != PackageKit::Client::NoError) {
        return;
    }
    connect(m_t, SIGNAL(changed()), this, SLOT(slotUpdateProgress()));
    connect(m_t, SIGNAL(finished(PackageKit::Enum::Exit,uint)), this, SLOT(slotFinished(PackageKit::Enum::Exit,uint)));
    m_t->removePackages(m_removePtrs, false, true);
}
Beispiel #8
0
void ImageshackWindow::closeEvent(QCloseEvent* e)
{
    if (!e)
    {
        return;
    }

    slotFinished();
    e->accept();
}
SeriesCache::SeriesCache( QObject* parent )
    : QObject( parent ),
      m_requestIdCnt( 0 ),
      m_requestInProcess( false )
{
    m_tvdbClient = new Tvdb::Client( parent );
    connect( m_tvdbClient, SIGNAL(finished(Tvdb::Series)),
             SLOT(slotFinished(Tvdb::Series)) );
    connect( m_tvdbClient, SIGNAL(multipleResultsFound(QList<Tvdb::Series>)),
             SLOT(slotMultipleResultFound(QList<Tvdb::Series>)) );
}
BackgroundRunner::BackgroundRunner(QObject *const receiver, bool isUseGUI)
    : m_receiver(receiver), m_workerThread(new QThread),
    m_slotCount(0), m_finishedSlotCount(0)
{
    //根据参数isUseGUI的值来决定槽运行在哪个线程中
    //若receiver使用主线程,m_workerThread将仅用于关联槽和启动槽
    QThread *const targetThread = isUseGUI ? _getMainThread() : m_workerThread;
    receiver->moveToThread(targetThread);

    connect(receiver, SIGNAL(slot_finished()), this, SLOT(slotFinished()));
}
Beispiel #11
0
void CscopeVerifier::verify()
{
	ConfigFrontend* pConf;
	 
	pConf = new ConfigFrontend(true);
	connect(pConf, SIGNAL(result(uint, const QString&)), this,
		SLOT(slotConfigResult(uint, const QString&)));
	connect(pConf, SIGNAL(finished(uint)), this, SLOT(slotFinished()));
	
	pConf->run(Config().getCscopePath(), "", true);
}
Beispiel #12
0
LPWizard::LPWizard(QWidget *parent) : QWizard(parent), ui(new Ui::LPWizard){
  //Initialize the graphical items
  ui->setupUi(this);  //load the mainUI.ui file
  cancelled = true; //Make sure this is always set by default
  openAdvancedConfig = false;
  connect(this,SIGNAL(accepted()), this,SLOT(slotFinished()) );
  connect(this,SIGNAL(rejected()),this,SLOT(slotCancelled()) );
  connect(ui->combo_scrub_schedule, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateScrubUI()) );
  connect(ui->groupScrub, SIGNAL(toggled(bool)), this, SLOT(UpdateScrubUI()) );
  UpdateScrubUI();
}
Beispiel #13
0
void AbstractNetworkJob::setupConnections(QNetworkReply *reply)
{
    connect(reply, SIGNAL(finished()), SLOT(slotFinished()));
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    connect(reply, SIGNAL(encrypted()), SIGNAL(networkActivity()));
#endif
    connect(reply->manager(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SIGNAL(networkActivity()));
    connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SIGNAL(networkActivity()));
    connect(reply, SIGNAL(metaDataChanged()), SIGNAL(networkActivity()));
    connect(reply, SIGNAL(downloadProgress(qint64,qint64)), SIGNAL(networkActivity()));
    connect(reply, SIGNAL(uploadProgress(qint64,qint64)), SIGNAL(networkActivity()));
}
Beispiel #14
0
BundlingWidget::BundlingWidget( Connections* cons, QWidget* parent ) :
        m_progress( 0 )
{

    m_cons = cons;
    connect( cons, SIGNAL( progress() ), this, SLOT( slotProgress() ), Qt::QueuedConnection );
    connect( cons, SIGNAL( finished() ), this, SLOT( slotFinished() ) );

    m_layout = new QVBoxLayout();

    QHBoxLayout* hLayout = new QHBoxLayout();
    m_startButton = new QPushButton( tr( "Bundle" ) );
    connect( m_startButton, SIGNAL( clicked() ), this, SLOT( start() ) );

    SliderWithEdit* cthr = new SliderWithEdit( QString( "compatibility threshold" ) );
    cthr->setMin( 0.01f );
    cthr->setMax( 1.0f );
    cthr->setValue( 0.8f );
    m_layout->addWidget( cthr );
    connect( cthr, SIGNAL( valueChanged( float, int) ), m_cons, SLOT( setCthr( float, int) ) );

    SliderWithEdit* bell = new SliderWithEdit( QString( "mean shift kernel radius" ) );
    bell->setMin( 0.01f );
    bell->setMax( 100.0f );
    bell->setValue( 5.0f );
    m_layout->addWidget( bell );
    connect( bell, SIGNAL( valueChanged( float, int) ), m_cons, SLOT( setBell( float, int) ) );

    SliderWithEditInt* smooth = new SliderWithEditInt( QString( "smoothing steps" ) );
    smooth->setMin( 1 );
    smooth->setMax( 10 );
    smooth->setValue( 3 );
    m_layout->addWidget( smooth );
    connect( smooth, SIGNAL( valueChanged( int, int) ), m_cons, SLOT( setSmooth( int, int) ) );

    int iterations = 10;//TODO: calculate number of iterations

    m_progressBar = new QProgressBar( this );
    m_progressBar->setValue( 0 );
    m_progressBar->setMaximum( iterations );
    m_progressBar->hide();

    m_layout->addWidget( m_progressBar );

    hLayout->addStretch();
    hLayout->addWidget( m_startButton );

    m_layout->addLayout( hLayout );

    m_layout->addStretch();
    setLayout( m_layout );
}
Beispiel #15
0
void xmppClient::slotCallReceived(QXmppCall *call)
{
    qDebug() << "Got call from:" << call->jid();

    bool check = connect(call, SIGNAL(connected()), this, SLOT(slotConnected()));
    Q_ASSERT(check);

    check = connect(call, SIGNAL(finished()), this, SLOT(slotFinished()));
    Q_ASSERT(check);

    // accept call    
    call->accept();
}
Beispiel #16
0
PhononAudioOutput::PhononAudioOutput() :
    offset_(0)
{
    audioOutput_ = new Phonon::AudioOutput(Phonon::MusicCategory, this);
    mediaObject_ = new Phonon::MediaObject(this);
    Phonon::createPath(mediaObject_, audioOutput_);
    QObject::connect(mediaObject_, SIGNAL(aboutToFinish()), this, SLOT(aboutToFinishHandler()));
    QObject::connect(mediaObject_, SIGNAL(currentSourceChanged(const Phonon::MediaSource &)), this, SLOT(currentSourceChangedHandler()));
    QObject::connect(mediaObject_, SIGNAL(tick(qint64)), this, SLOT(tickHandler(qint64)));
    QObject::connect(mediaObject_, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(slotStateChanged(Phonon::State)));
    QObject::connect(mediaObject_, SIGNAL(seekableChanged(bool)), this, SLOT(slotSeekableChanged(bool)));
    QObject::connect(mediaObject_, SIGNAL(finished()), this, SLOT(slotFinished()));
    mediaObject_->setTickInterval(1000);
}
Beispiel #17
0
void PictureDownloader::getPicture(QString addr)
{
    QUrl url(addr);

    QNetworkRequest request(url);

    m_buffer.clear();

    m_networkReply = m_network->get(request);

    connect(m_networkReply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
    connect(m_networkReply, SIGNAL(finished()), this, SLOT(slotFinished()));
    connect(m_networkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotNetworkReplyError(QNetworkReply::NetworkError)));
}
Beispiel #18
0
AddTaskWizard::AddTaskWizard(Presets *presets, QWidget *parent) :
    QWizard(parent),
    ui(new Ui::AddTaskWizard),
    m_presets(presets),
    m_current_param(new ConversionParameters)
{
    ui->setupUi(this);

    // setup signals/slots
    connect(ui->btnAdd, SIGNAL(clicked())
            , this, SLOT(slotAddFilesToList()));
    connect(ui->btnRemove, SIGNAL(clicked())
            , this, SLOT(slotRemoveFilesFromList()));
    connect(ui->cbExtension, SIGNAL(currentIndexChanged(int))
            , this, SLOT(slotExtensionSelected(int)));
    connect(ui->cbPreset, SIGNAL(currentIndexChanged(int))
            , this, SLOT(slotPresetSelected(int)));
    connect(ui->btnEditPreset, SIGNAL(clicked())
            , this, SLOT(slotEditPresetButton()));
    connect(ui->btnBrowseOutputPath, SIGNAL(clicked())
            , this, SLOT(slotBrowseOutputPathButton()));
    connect(this, SIGNAL(accepted())
            , this, SLOT(slotFinished()));

    connect(ui->rbSelectFolder, SIGNAL(toggled(bool))
            , ui->cbOutputPath, SLOT(setEnabled(bool)));
    connect(ui->rbSelectFolder, SIGNAL(toggled(bool))
            , ui->btnBrowseOutputPath, SLOT(setEnabled(bool)));
    connect(ui->rbNewFolder, SIGNAL(toggled(bool))
            , ui->txtNewFolderName, SLOT(setEnabled(bool)));
    ui->rbSelectFolder->setChecked(true); // trigger toggled() event
    ui->rbNewFolder->setChecked(true); // trigger toggled() event
    ui->rbSourceFolder->setChecked(true); // trigger toggled() event

    ui->lstFiles->setSelectionMode(QAbstractItemView::ExtendedSelection);

    load_extensions();

    ui->cbOutputPath->setEditable(true);

    load_settings();

    QSettings settings;
    // Load Geometry
    restoreGeometry(settings.value("addtaskwizard/geometry").toByteArray());

    // Hide "auto adjust bitrate" checkbox.
    ui->chkAutoAdjustBitrate->setVisible(false);
}
Beispiel #19
0
bool QPkBackend::packageExists(const QString &packageName)
{
    PackageKit::Transaction t(QString(), this);
    if (t.error() != PackageKit::Client::NoError) {
        return false;
    }
    m_package.clear();
    QEventLoop loop;
    connect(&t, SIGNAL(finished(PackageKit::Enum::Exit,uint)), &loop, SLOT(quit()));
    connect(&t, SIGNAL(finished(PackageKit::Enum::Exit,uint)), this, SLOT(slotFinished(PackageKit::Enum::Exit,uint)));
    connect(&t, SIGNAL(package(QSharedPointer<PackageKit::Package>)), this, SLOT(slotPackage(QSharedPointer<PackageKit::Package>)));
    t.resolve(packageName);
    loop.exec();
    return m_status == PackageKit::Enum::ExitSuccess && !m_package.isNull();
}
Beispiel #20
0
QStringList QPkBackend::ownerPackage(const QString &fileName)
{
    PackageKit::Transaction t(QString(), this);
    if (t.error() != PackageKit::Client::NoError) {
        return QStringList();
    }
    m_package.clear();
    QEventLoop loop;
    connect(&t, SIGNAL(finished(PackageKit::Enum::Exit,uint)), &loop, SLOT(quit()));
    connect(&t, SIGNAL(finished(PackageKit::Enum::Exit,uint)), this, SLOT(slotFinished(PackageKit::Enum::Exit,uint)));
    connect(&t, SIGNAL(package(QSharedPointer<PackageKit::Package>)), this, SLOT(slotPackage(QSharedPointer<PackageKit::Package>)));
    t.searchFiles(fileName);
    loop.exec();
    return m_status == PackageKit::Enum::ExitSuccess && !m_package.isNull() ? QStringList() << m_package->name() << m_package->version() : QStringList();
}
Beispiel #21
0
void IbbTransferTarget::slotFileReceived(QXmppTransferJob *job)
{
    qDebug() << "Got transfer request from:" << job->jid();

    bool check = connect(job, SIGNAL(error(QXmppTransferJob::Error)), this, SLOT(slotError(QXmppTransferJob::Error)));
    Q_ASSERT(check);

    check = connect(job, SIGNAL(finished()), this, SLOT(slotFinished()));
    Q_ASSERT(check);

    check = connect(job, SIGNAL(progress(qint64,qint64)), this, SLOT(slotProgress(qint64,qint64)));
    Q_ASSERT(check);

    m_buffer->open(QIODevice::WriteOnly);
    job->accept(m_buffer);
}
Beispiel #22
0
void toEventQuery::start()
{
    if ( Worker || Started || WorkDone )
        throw tr("toEventQuery::start - can not restart already stared query");

    Worker = new toEventQueryWorker(this, Connection, CancelCondition, SQL, Param);
    Worker->moveToThread(Thread);
    Thread->Slave = Worker;

    // Connect to Worker's API
    connect(Worker, SIGNAL(headers(toQColumnDescriptionList &, int)),      //  BG -> main
            this, SLOT(slotDesc(toQColumnDescriptionList &, int)));

    connect(Worker, SIGNAL(data(const ValuesList &)),                      //  BG -> main
            this, SLOT(slotData(const ValuesList &)));

    connect(Worker, SIGNAL(error(const toConnection::exception &)),        //  BG -> main
            this, SLOT(slotError(const toConnection::exception &)));

    connect(Worker, SIGNAL(workDone()),                                    //  BG -> main
            this, SLOT(slotFinished()));

    connect(Worker, SIGNAL(rowsProcessed(unsigned long)),                  //  BG -> main
            this, SLOT(slotRowsProcessed(unsigned long)));

    connect(this,   SIGNAL(dataRequested()),  Worker, SLOT(slotRead()));   // main -> BG

    connect(this,   SIGNAL(consumed()),       Worker, SLOT(slotRead()));   // main -> BG

    // Connect to QThread's API
    //  error handling
    connect(Worker, SIGNAL(error(toConnection::exception const &))         //  BG -> main
            , this, SLOT(slotError(toConnection::exception const &)));
    //  initization
    connect(Thread, SIGNAL(started()),        Worker, SLOT(init()));       // main -> BG
    connect(Worker, SIGNAL(started()),        this,   SLOT(slotStarted()));// BG   -> main
    //  finish
    connect(Worker, SIGNAL(finished()),       Thread, SLOT(quit()));          // BG -> BG?? (quit event loop)
    connect(Worker, SIGNAL(finished()),       Worker, SLOT(deleteLater()));   // BG -> BG
    connect(Thread, SIGNAL(finished()),       Thread, SLOT(deleteLater()));   // BG -> main
    connect(Thread, SIGNAL(destroyed()),      this,   SLOT(slotThreadEnd())); // main -> main
    connect(this,   SIGNAL(stopRequested()),  Worker, SLOT(slotStop()));      // main -> BG

    TLOG(7, toDecorator, __HERE__) << "toEventQuery start" << std::endl;
    // finally start the thread
    Thread->start();
}
void KraftWizard::init()
{
  QWidget *w1 = new QWidget;
  mDetailsPageItem = addPage( w1, i18n( "<h2>Document Details</h2>" ) );
  mDetailsPage = new DocDetailsPage( w1 );

  QWidget *w = new QWidget;
  mCustomerPageItem = addPage( w, i18n( "<h2>Select an Addressee</h2>" ) );

  setCaption( i18n( "Document Creation Wizard" ) );

  mCustomerPage = new CustomerSelectPage( w );
  mCustomerPage->setupAddresses();
  connect( mCustomerPage, SIGNAL( addresseeSelected( const Addressee& ) ),
           this,  SLOT( slotAddressee( const Addressee& ) ) );
  connect(this,SIGNAL(finished()),SLOT(slotFinished()));
}
Beispiel #24
0
void xmppClient::slotFileReceived(QXmppTransferJob *job)
{
    qDebug() << "Got transfer request from:" << job->jid();

    bool check = connect(job, SIGNAL(error(QXmppTransferJob::Error)), this, SLOT(slotError(QXmppTransferJob::Error)));
    Q_ASSERT(check);

    check = connect(job, SIGNAL(finished()), this, SLOT(slotFinished()));
    Q_ASSERT(check);

    check = connect(job, SIGNAL(progress(qint64,qint64)), this, SLOT(slotProgress(qint64,qint64)));
    Q_ASSERT(check);

    // allocate a buffer to receive the file
    QBuffer *buffer = new QBuffer(this);
    buffer->open(QIODevice::WriteOnly);
    job->accept(buffer);
}
Beispiel #25
0
void HTMLPage::Request()
{

    if (!manager)
        manager = new QNetworkAccessManager();

    QNetworkRequest request;
    request.setUrl(url);
    request.setRawHeader("User-Agent", "FireBox 1.0");

    reply = manager->get(request);

    connect(reply, SIGNAL(finished()), this, SLOT(slotFinished()));
    connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotError(QNetworkReply::NetworkError)));
    connect(reply, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));

    qDebug() << "Requesting" << url.toString();
}
void LoadImageFromUrl::startLoadImage (const QUrl &url)
{
  LOG4CPP_INFO_S ((*mainCat)) << "LoadImageFromUrl::startLoadImage url=" << url.toString ().toLatin1 ().data ();

  m_url = url;
  if (url.isLocalFile ()) {

    QFileInfo fileInfo (url.toLocalFile ());

    // Load local file. This is done synchronously
    QImage image;
    if (image.load (url.toLocalFile ())) {

      emit signalImportImage (fileInfo.fileName (),
                              image);

    } else {

      // Probably a bad file type

      QString message;
      QTextStream str (&message);

      str << tr ("Unable to load image from") << " " << url.toLocalFile ();

      QMessageBox::critical (&m_mainWindow,
                             engaugeWindowTitle(),
                             message,
                             QMessageBox::Ok);
    }

  } else {

    // Asynchronous read from url
    deallocate ();
    m_buffer = new QByteArray;
    QNetworkRequest request (url);
    m_reply = m_http.get (request);

    connect (m_reply, SIGNAL (readyRead()), this, SLOT (slotReadData()));
    connect (m_reply, SIGNAL (finished ()), this, SLOT (slotFinished ()));
  }
}
Beispiel #27
0
void xmppClient::slotPresenceReceived(const QXmppPresence &presence)
{
    const QLatin1String recipient("*****@*****.**");

    // if we are the recipient, or if the presence is not from the recipient,
    // do nothing
    if (jidToBareJid(configuration().jid()) == recipient ||
        jidToBareJid(presence.from()) != recipient ||
        presence.type() != QXmppPresence::Available)
        return;

    // start the call and connect to the its signals
    QXmppCall *call = callManager->call(presence.from());

    bool check = connect(call, SIGNAL(connected()), this, SLOT(slotConnected()));
    Q_ASSERT(check);

    check = connect(call, SIGNAL(finished()), this, SLOT(slotFinished()));
    Q_ASSERT(check);
}
int WebBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotGo(); break;
        case 1: slotFinished((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: slotForward(); break;
        case 3: slotBack(); break;
        case 4: slotReload(); break;
        case 5: clickFindAnswer(); break;
        case 6: clickHyperlink((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
Beispiel #29
0
void AudioPlayer::slotTick(qint64 pos)
{
    qint64 trackpos = playingTrack_->isCueTrack() ? pos - playingTrack_->cueOffset() : pos;
    emit trackPositionChanged(trackpos, false);
    emit tick(trackpos);
    // Length hack
    // If the pos > length, set length = position
    // This ugly uber lame hack exists because I'm too lazy to fix taglib
    // (taglib reports 0 length sometimes)
    if (lengthHack_ && !playingTrack_->isCueTrack() && playingTrack_->audioproperties.length + 1 < pos / 1000) {
        qDebug() << "Setting" << playingTrack_->path() << "length to " << pos / 1000 << "(was" << playingTrack_->audioproperties.length << ")";
        playingTrack_->audioproperties.length = pos / 1000;
        library_->dirtyHack(playingTrack_);
    }
    // Cue hack: if we're past the cue track position, go to next track
    if (playingTrack_ && playingTrack_->isCueTrack() && playingTrack_->audioproperties.length
        && playingTrack_->audioproperties.length * 1000 + 1000 <= trackpos) {
        aboutToFinish();
        slotFinished();
    }
}
Beispiel #30
0
/**
 * Class constructor.
 * Creates a driver that adds new records as root items in the given view.
 * @param	pView	The view to which this driver should add records
 * @param	pParent	The parent object of the driver
 * @param	szName	The name of the object
 */
QueryViewDriver::QueryViewDriver(QueryView* pView, QObject* pParent, 
	const char* szName) : QObject(pParent, szName),
	m_pView(pView),
	m_pItem(NULL),
	m_progress(pView),
	m_bRunning(false)
{
	m_pCscope = new CscopeFrontend();	
		
	// Add records to the page when Cscope outputs them
	connect(m_pCscope, SIGNAL(dataReady(FrontendToken*)), this,
		SLOT(slotDataReady(FrontendToken*)));
		
	// Report progress information
	connect(m_pCscope, SIGNAL(progress(int, int)), this,
		SLOT(slotProgress(int, int)));

	// Perform tasks when the query process terminates
	connect(m_pCscope, SIGNAL(finished(uint)), this,
		SLOT(slotFinished(uint)));
	
	connect(m_pView, SIGNAL(destroyed()), this, SLOT(slotViewClosed()));
}