Exemple #1
0
	void UpManager::handleUpFinished (const QByteArray& id, const QString& filePath)
	{
		RemovePending (filePath);
		const auto& e =Util::MakeNotification ("NetStoreManager",
				tr ("File %1 was uploaded successfully")
						.arg ("<em>" + QFileInfo (filePath).fileName () + "</em>"),
				PInfo_);
		Proxy_->GetEntityManager ()->HandleEntity (e);

		URLHandlers_ [id] << [this, filePath] (const QUrl& url, const QByteArray&)
		{
			emit fileUploaded (filePath, url);
		};

		if (Autoshare_.remove (filePath))
		{
			auto ifl = qobject_cast<ISupportFileListings*> (sender ());
			if (!ifl)
			{
				qWarning () << Q_FUNC_INFO
						<< "account doesn't support file listings, cannot autoshare";
				return;
			}

			ifl->RequestUrl (id);
		}
	}
Exemple #2
0
	void UpManager::handleError (const QString& str, const QString& path)
	{
		qWarning () << Q_FUNC_INFO << str << path;

		RemovePending (path);

		auto plugin = GetSenderPlugin ();
		const Entity& e = Util::MakeNotification (plugin->GetStorageName (),
				tr ("Failed to upload %1: %2.")
					.arg (path)
					.arg (str),
				PWarning_);
		Proxy_->GetEntityManager ()->HandleEntity (e);
	}
Exemple #3
0
	void UpManager::handleGotURL (const QUrl& url, const QString& path)
	{
		const QString& urlStr = url.toString ();
		qApp->clipboard ()->setText (urlStr, QClipboard::Clipboard);
		qApp->clipboard ()->setText (urlStr, QClipboard::Selection);

		RemovePending (path);

		auto plugin = GetSenderPlugin ();
		const Entity& e = Util::MakeNotification (plugin->GetStorageName (),
				tr ("%1 is successfully uploaded, URL is pasted into clipboard.")
					.arg (QFileInfo (path).fileName ()),
				PInfo_);
		emit gotEntity (e);
	}