当前位置: 首页>>代码示例>>C++>>正文


C++ Transfer::getTarget方法代码示例

本文整理汇总了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()));
	}
}
开发者ID:lpxxn,项目名称:otter-browser,代码行数:9,代码来源:TransfersContentsWidget.cpp

示例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()));
	}
}
开发者ID:lpxxn,项目名称:otter-browser,代码行数:9,代码来源:TransfersContentsWidget.cpp

示例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();
	}
}
开发者ID:aurhat,项目名称:otter-browser,代码行数:51,代码来源:Updater.cpp

示例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();
		}
	}
}
开发者ID:kyleivey,项目名称:otter-browser,代码行数:19,代码来源:TransfersManager.cpp


注:本文中的Transfer::getTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。