本文整理汇总了C++中Transfer::getTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ Transfer::getTarget方法的具体用法?C++ Transfer::getTarget怎么用?C++ Transfer::getTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transfer
的用法示例。
在下文中一共展示了Transfer::getTarget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openTransferFolder
void TransfersContentsWidget::openTransferFolder(const QModelIndex &index)
{
Transfer *transfer = getTransfer(index.isValid() ? index : m_ui->transfersViewWidget->currentIndex());
if (transfer)
{
Utils::runApplication(QString(), QUrl::fromLocalFile(QFileInfo(transfer->getTarget()).dir().canonicalPath()));
}
}
示例2: openTransfer
void TransfersContentsWidget::openTransfer(QAction *action)
{
Transfer *transfer = getTransfer(m_ui->transfersViewWidget->currentIndex());
if (transfer && action && !action->data().isNull())
{
Utils::runApplication(action->data().toString(), QUrl::fromLocalFile(transfer->getTarget()));
}
}
示例3: transferFinished
void Updater::transferFinished()
{
Transfer *transfer = qobject_cast<Transfer*>(sender());
if (transfer)
{
const QString path = transfer->getTarget();
if ((transfer->getState() == Transfer::FinishedState) && QFile::exists(path))
{
if (QFileInfo(path).suffix() == QLatin1String("xml"))
{
QFile file(SessionsManager::getWritableDataPath(QLatin1String("update.txt")));
if (file.open(QIODevice::ReadWrite | QIODevice::Text))
{
QTextStream stream(&file);
stream << path;
file.close();
}
}
}
else
{
Console::addMessage(QCoreApplication::translate("main", "Unable to download update: %1\nError: %2").arg(transfer->getSource().url()).arg(transfer->getState()), OtherMessageCategory, ErrorMessageLevel);
m_transfersSuccessful = false;
}
transfer->deleteLater();
}
else
{
m_transfersSuccessful = false;
}
++m_transfersCount;
if (m_transfersCount == 2)
{
if (!m_transfersSuccessful)
{
clearUpdate();
}
emit finished(m_transfersSuccessful);
deleteLater();
}
}
示例4: transferFinished
void TransfersManager::transferFinished()
{
Transfer *transfer = qobject_cast<Transfer*>(sender());
if (transfer)
{
if (transfer->getState() == Transfer::FinishedState)
{
connect(NotificationsManager::createNotification(NotificationsManager::TransferCompletedEvent, tr("Transfer completed:\n%1").arg(QFileInfo(transfer->getTarget()).fileName()), Notification::InformationLevel, this), SIGNAL(clicked()), transfer, SLOT(openTarget()));
}
emit transferFinished(transfer);
if (!m_privateTransfers.contains(transfer))
{
scheduleSave();
}
}
}