/*! Locate the package identified by the \c QModelIndex \a ix and send a request to the device to initiate fetching and installing of the package. */ void PackageScanner::sendPackage( const QModelIndex &ix ) { if ( !ix.isValid() ) return; PackageItem *pkg = mPackageList[ix.row()]; sendIt( pkg ); }
// checks if the current job in the timer-based process queue is subject // for deletion (that is, it has failed or succeeded) // // if not, it will send the job and increment the list iterator. // // this method is called once per tick from the timer based scheduler in // hotkeyhandler.cpp. // // returns true if more jobs are awaiting processing, false otherwise. // bool CSendLater::processCurrentJob() { if (!m_sendLaterJobList.getCount() || m_currJob == -1) return false; if (m_currJob >= m_sendLaterJobList.getCount()) { m_currJob = -1; return false; } CSendLaterJob *p = m_sendLaterJobList[m_currJob]; if (p->fSuccess || p->fFailed) { if (p->mustDelete()) { m_sendLaterJobList.remove(m_currJob); delete p; } else m_currJob++; } else sendIt(m_sendLaterJobList[m_currJob++]); if (m_currJob >= m_sendLaterJobList.getCount()) { m_currJob = -1; return false; } return true; }
/*! Locate the package identified by the name, or part of name \a nameStr and send a request to the device to initiate fetching and installing of the package. */ void PackageScanner::sendPackage( const QString &nameStr ) { PackageItem *pkg = findPackageByName( nameStr ); if ( pkg == NULL ) { QString warning = tr( "Could not find a package: %1" ).arg( nameStr ); QMessageBox::warning( 0, tr("No Such Packages"), warning ); return; } sendIt( pkg ); }