void RSS::downloadSelected(const QString& folder) { const auto& indices = ui_.tableView->selectionModel()->selectedRows(); if (indices.isEmpty()) return; bool actions = false; for (int i=0; i<indices.size(); ++i) { const auto row = indices[i].row(); const auto& item = model_.getItem(row); const auto& desc = item.title; if (!passDuplicateCheck(this, desc, item.type)) continue; if (!passSpaceCheck(this, desc, folder, item.size, item.size)) continue; const auto acc = selectAccount(this, desc); if (acc == 0) continue; model_.downloadNzbContent(row, acc, folder); actions = true; } if (actions) { ui_.progressBar->setVisible(true); ui_.actionStop->setEnabled(true); } }
void YourAccounts::accountCreated(Account account) { if (!account) return; m_accountManager->addItem(account); account.accountContact().setOwnerBuddy(m_myself->buddy()); m_configurationManager->flush(); selectAccount(account); }
void YourAccounts::accountCreated(Account account) { if (!account) return; AccountManager::instance()->addItem(account); account.accountContact().setOwnerBuddy(Core::instance()->myself()); ConfigurationManager::instance()->flush(); selectAccount(account); }
bool DailymotionAccountModel::removeAccount(int row) { QString userId = data(index(row, 0)).toString(); if (removeRows(row, 1)) { if (userId == Dailymotion::instance()->userId()) { if (rowCount() > 0) { selectAccount(0); } else { Dailymotion::instance()->setUserId(QString()); } } emit countChanged(rowCount()); return true; } return false; }
bool SoundCloudAccountModel::removeAccount(int row) { const QString userId = data(index(row, 0)).toString(); Logger::log(QString("SoundCloudAccountModel::removeAccount(). Row: %1, User ID: %2").arg(row).arg(userId), Logger::MediumVerbosity); if (removeRows(row, 1)) { if (userId == SoundCloud::userId()) { if (rowCount() > 0) { selectAccount(0); } else { SoundCloud::setUserId(QString()); } } emit countChanged(rowCount()); return true; } return false; }