Ejemplo n.º 1
0
	void DriveManager::Rename (const QString& id, const QString& newName)
	{
		if (id.isEmpty ())
			return;
		ApiCallQueue_ << [this, id, newName] (const QString& key) { RequestRenameItem (id, newName, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 2
0
void DropboxAuthenticator::RedirectArrived(LocalRedirectServer* server) {
  server->deleteLater();
  QUrl request_url = server->request_url();
  qLog(Debug) << Q_FUNC_INFO << request_url;
  uid_ = request_url.queryItemValue("uid");
  RequestAccessToken();
}
Ejemplo n.º 3
0
	void DriveManager::Move (const QString& id, const QString& parentId)
	{
		if (id.isEmpty ())
			return;
		ApiCallQueue_ << [this, id, parentId] (const QString& key) { RequestMoveItem (id, parentId, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 4
0
void OAuthenticator::RedirectArrived(QTcpSocket* socket, QByteArray buffer) {
  buffer.append(socket->readAll());

  if (socket->atEnd() || buffer.endsWith("\r\n\r\n")) {
    socket->deleteLater();
    const QByteArray& code = ParseHttpRequest(buffer);
    qLog(Debug) << "Code:" << code;
    RequestAccessToken(code, socket->localPort());
  } else {
    NewClosure(socket, SIGNAL(readyReady()),
               this, SLOT(RedirectArrived(QTcpSocket*, QByteArray)), socket, buffer);
  }
}
Ejemplo n.º 5
0
	void DriveManager::RequestFileChanges (qlonglong startId)
	{
		ApiCallQueue_ << [this, startId] (const QString& key) { GetFileChanges (startId, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 6
0
	void DriveManager::Copy (const QString& id, const QString& parentId)
	{
		ApiCallQueue_ << [this, id, parentId] (const QString& key) { RequestCopyItem (id, parentId, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 7
0
	void DriveManager::CreateDirectory (const QString& name, const QString& parentId)
	{
		ApiCallQueue_ << [this, name, parentId] (const QString& key) { RequestCreateDirectory (name, parentId, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 8
0
	void DriveManager::Upload (const QString& filePath, const QStringList& parentId)
	{
		QString parent = parentId.value (0);
		ApiCallQueue_ << [this, filePath, parent] (const QString& key) { RequestUpload (filePath, parent, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 9
0
	void DriveManager::ShareEntry (const QString& id)
	{
		ApiCallQueue_ << [this, id] (const QString& key) { RequestSharingEntry (id, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 10
0
	void DriveManager::RestoreEntryFromTrash (const QString& id)
	{
		ApiCallQueue_ << [this, id] (const QString& key) { RequestRestoreEntryFromTrash (id, key); };
		RequestAccessToken ();
	}
Ejemplo n.º 11
0
void OAuthenticator::RedirectArrived(LocalRedirectServer* server, QUrl url) {
  server->deleteLater();
  QUrl request_url = server->request_url();
  qLog(Debug) << Q_FUNC_INFO << request_url;
  RequestAccessToken(request_url.queryItemValue("code").toUtf8(), url);
}