diff options
Diffstat (limited to 'src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp')
-rw-r--r-- | src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp b/src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp index 465ec03..288be4e 100644 --- a/src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp +++ b/src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp @@ -91,13 +91,11 @@ void BtInstallProgressDialog::startThreads() { //foreach (QString mName, m_threadsByModule.keys()) { //} //QList<CSwordModuleInfo*> CSwordBackend::instance()()->takeModulesFromList(m_threadsByModule.keys()); - qDebug() << "start threads..."; //loop through the multimap of the waiting threads, start at most 3 threads for each source QMultiMap<QString, BtInstallThread*>::iterator threadIterator = m_waitingThreads.end(); // concurrency is disabled for now // while (threadIterator != m_waitingThreads.end()) { // QString sourceName = threadIterator.key(); -// qDebug() << sourceName; // if (m_runningThreads.values(sourceName).count() < 3) { // BtInstallThread* t = threadIterator.value(); // m_runningThreads.insert(sourceName, t); @@ -117,13 +115,8 @@ void BtInstallProgressDialog::startThreads() { threadIterator = m_waitingThreads.erase(threadIterator); t->start(); } - - qDebug() << "BtInstallProgressDialog::startThreads end"; } -BtInstallProgressDialog::~BtInstallProgressDialog() {} - - void BtInstallProgressDialog::slotOneItemCompleted(QString module, QString source, int status) { QString message; //status comes from the sword installer. @@ -156,9 +149,7 @@ void BtInstallProgressDialog::oneItemStoppedOrCompleted(QString module, QString //concurrency is disabled for now // //start a waiting thread if there are any // QList<BtInstallThread*> threadsForSource = m_waitingThreads.values(source); -// qDebug() << threadsForSource; // if (!threadsForSource.isEmpty()) { -// qDebug() << "Threads are waiting for turn"; // BtInstallThread* thread = threadsForSource.at(0); // m_waitingThreads.remove(source, thread); // m_runningThreads.insert(source, thread); @@ -167,7 +158,7 @@ void BtInstallProgressDialog::oneItemStoppedOrCompleted(QString module, QString //non-concurrent QMultiMap<QString, BtInstallThread*>::iterator threadIterator = m_waitingThreads.end(); - if (m_runningThreads.size() == 0 && threadIterator != m_waitingThreads.begin()) { + if (m_runningThreads.isEmpty() && threadIterator != m_waitingThreads.begin()) { threadIterator--; // the last item QString sourceName = threadIterator.key(); BtInstallThread* t = threadIterator.value(); @@ -199,8 +190,6 @@ void BtInstallProgressDialog::slotStopInstall() { } void BtInstallProgressDialog::slotStatusUpdated(QString module, int status) { - //qDebug() << "BtInstallProgressDialog::slotStatusUpdated"; - //qDebug() << "module:" << module << "status:" << status; // find the progress bar for this module and update the value QWidget* itemWidget = m_statusWidget->itemWidget(getItem(module) , 1); QProgressBar* bar = dynamic_cast<QProgressBar*>(itemWidget); @@ -212,7 +201,6 @@ void BtInstallProgressDialog::slotInstallStarted(QString module, QString) { } void BtInstallProgressDialog::slotDownloadStarted(QString module) { - qDebug() << "BtInstallProgressDialog::slotDownloadStarted" << module; getItem(module)->setText(1, QString::null); //m_statusWidget->itemWidget(getItem(module), 1)->setVisible(true); @@ -223,13 +211,10 @@ void BtInstallProgressDialog::slotDownloadStarted(QString module) { } QTreeWidgetItem* BtInstallProgressDialog::getItem(QString moduleName) { - //qDebug() << "BtInstallProgressDialog::getItem" << moduleName; return m_statusWidget->findItems(moduleName, Qt::MatchExactly).at(0); } void BtInstallProgressDialog::closeEvent(QCloseEvent* event) { - qDebug() << "BtInstallProgressDialog::closeEvent"; - if (event->spontaneous()) { event->ignore(); return; @@ -239,5 +224,5 @@ void BtInstallProgressDialog::closeEvent(QCloseEvent* event) { } bool BtInstallProgressDialog::threadsDone() { - return (m_waitingThreads.count() == 0 && m_runningThreads.count() == 0); + return (m_waitingThreads.isEmpty() && m_runningThreads.isEmpty()); } |