Changeset View
Changeset View
Standalone View
Standalone View
src/drive/about.cpp
Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Line(s) | 307 | public: | |||
---|---|---|---|---|---|
320 | QString domainSharingPolicy; | 320 | QString domainSharingPolicy; | ||
321 | FormatsList importFormats; | 321 | FormatsList importFormats; | ||
322 | FormatsList exportFormats; | 322 | FormatsList exportFormats; | ||
323 | AdditionalRoleInfosList additionalRoleInfo; | 323 | AdditionalRoleInfosList additionalRoleInfo; | ||
324 | FeaturesList features; | 324 | FeaturesList features; | ||
325 | MaxUploadSizesList maxUploadSizes; | 325 | MaxUploadSizesList maxUploadSizes; | ||
326 | QString permissionId; | 326 | QString permissionId; | ||
327 | bool isCurrentAppInstalled; | 327 | bool isCurrentAppInstalled; | ||
328 | bool canCreateDrives; | ||||
328 | UserPtr user; | 329 | UserPtr user; | ||
329 | }; | 330 | }; | ||
330 | 331 | | |||
331 | About::Private::Private(): | 332 | About::Private::Private(): | ||
332 | quotaBytesTotal(-1), | 333 | quotaBytesTotal(-1), | ||
333 | quotaBytesUsed(-1), | 334 | quotaBytesUsed(-1), | ||
334 | quotaBytesUsedInTrash(-1), | 335 | quotaBytesUsedInTrash(-1), | ||
335 | quotaBytesUsedAggregate(-1), | 336 | quotaBytesUsedAggregate(-1), | ||
336 | largestChangeId(-1), | 337 | largestChangeId(-1), | ||
337 | remainingChangeIds(-1), | 338 | remainingChangeIds(-1), | ||
338 | isCurrentAppInstalled(false) | 339 | isCurrentAppInstalled(false), | ||
340 | canCreateDrives(false) | ||||
339 | { | 341 | { | ||
340 | } | 342 | } | ||
341 | 343 | | |||
342 | About::Private::Private(const About::Private &other): | 344 | About::Private::Private(const About::Private &other): | ||
343 | selfLink(other.selfLink), | 345 | selfLink(other.selfLink), | ||
344 | name(other.name), | 346 | name(other.name), | ||
345 | quotaBytesTotal(other.quotaBytesTotal), | 347 | quotaBytesTotal(other.quotaBytesTotal), | ||
346 | quotaBytesUsed(other.quotaBytesUsed), | 348 | quotaBytesUsed(other.quotaBytesUsed), | ||
347 | quotaBytesUsedInTrash(other.quotaBytesUsedInTrash), | 349 | quotaBytesUsedInTrash(other.quotaBytesUsedInTrash), | ||
348 | quotaBytesUsedAggregate(other.quotaBytesUsedAggregate), | 350 | quotaBytesUsedAggregate(other.quotaBytesUsedAggregate), | ||
349 | largestChangeId(other.largestChangeId), | 351 | largestChangeId(other.largestChangeId), | ||
350 | remainingChangeIds(other.remainingChangeIds), | 352 | remainingChangeIds(other.remainingChangeIds), | ||
351 | rootFolderId(other.rootFolderId), | 353 | rootFolderId(other.rootFolderId), | ||
352 | domainSharingPolicy(other.domainSharingPolicy), | 354 | domainSharingPolicy(other.domainSharingPolicy), | ||
353 | importFormats(other.importFormats), | 355 | importFormats(other.importFormats), | ||
354 | exportFormats(other.exportFormats), | 356 | exportFormats(other.exportFormats), | ||
355 | additionalRoleInfo(other.additionalRoleInfo), | 357 | additionalRoleInfo(other.additionalRoleInfo), | ||
356 | features(other.features), | 358 | features(other.features), | ||
357 | maxUploadSizes(other.maxUploadSizes), | 359 | maxUploadSizes(other.maxUploadSizes), | ||
358 | permissionId(other.permissionId), | 360 | permissionId(other.permissionId), | ||
359 | isCurrentAppInstalled(other.isCurrentAppInstalled), | 361 | isCurrentAppInstalled(other.isCurrentAppInstalled), | ||
362 | canCreateDrives(other.canCreateDrives), | ||||
360 | user(other.user) | 363 | user(other.user) | ||
361 | { | 364 | { | ||
362 | } | 365 | } | ||
363 | 366 | | |||
364 | const QString About::Fields::AdditionalRoleInfo = QStringLiteral("additionalRoleInfo"); | 367 | const QString About::Fields::AdditionalRoleInfo = QStringLiteral("additionalRoleInfo"); | ||
365 | const QString About::Fields::AdditionalRoles = QStringLiteral("additionalRoles"); | 368 | const QString About::Fields::AdditionalRoles = QStringLiteral("additionalRoles"); | ||
366 | const QString About::Fields::BackgroundImageLink = QStringLiteral("backgroundImageLink"); | 369 | const QString About::Fields::BackgroundImageLink = QStringLiteral("backgroundImageLink"); | ||
367 | const QString About::Fields::BytesUsed = QStringLiteral("bytesUsed"); | 370 | const QString About::Fields::BytesUsed = QStringLiteral("bytesUsed"); | ||
368 | const QString About::Fields::CanCreateTeamDrives = QStringLiteral("canCreateTeamDrives"); | 371 | const QString About::Fields::CanCreateDrives = QStringLiteral("canCreateDrives"); | ||
369 | const QString About::Fields::ColorRgb = QStringLiteral("colorRgb"); | 372 | const QString About::Fields::ColorRgb = QStringLiteral("colorRgb"); | ||
370 | const QString About::Fields::DisplayName = QStringLiteral("displayName"); | 373 | const QString About::Fields::DisplayName = QStringLiteral("displayName"); | ||
371 | const QString About::Fields::DomainSharingPolicy = QStringLiteral("domainSharingPolicy"); | 374 | const QString About::Fields::DomainSharingPolicy = QStringLiteral("domainSharingPolicy"); | ||
372 | const QString About::Fields::EmailAddress = QStringLiteral("emailAddress"); | 375 | const QString About::Fields::EmailAddress = QStringLiteral("emailAddress"); | ||
373 | const QString About::Fields::Etag = QStringLiteral("etag"); | 376 | const QString About::Fields::Etag = QStringLiteral("etag"); | ||
374 | const QString About::Fields::ExportFormats = QStringLiteral("exportFormats"); | 377 | const QString About::Fields::ExportFormats = QStringLiteral("exportFormats"); | ||
375 | const QString About::Fields::FeatureName = QStringLiteral("featureName"); | 378 | const QString About::Fields::FeatureName = QStringLiteral("featureName"); | ||
376 | const QString About::Fields::FeatureRate = QStringLiteral("featureRate"); | 379 | const QString About::Fields::FeatureRate = QStringLiteral("featureRate"); | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 428 | { | |||
439 | GAPI_COMPARE(domainSharingPolicy) | 442 | GAPI_COMPARE(domainSharingPolicy) | ||
440 | GAPI_COMPARE_CONTAINERS(importFormats) | 443 | GAPI_COMPARE_CONTAINERS(importFormats) | ||
441 | GAPI_COMPARE_CONTAINERS(exportFormats) | 444 | GAPI_COMPARE_CONTAINERS(exportFormats) | ||
442 | GAPI_COMPARE_CONTAINERS(additionalRoleInfo) | 445 | GAPI_COMPARE_CONTAINERS(additionalRoleInfo) | ||
443 | GAPI_COMPARE_CONTAINERS(features) | 446 | GAPI_COMPARE_CONTAINERS(features) | ||
444 | GAPI_COMPARE_CONTAINERS(maxUploadSizes) | 447 | GAPI_COMPARE_CONTAINERS(maxUploadSizes) | ||
445 | GAPI_COMPARE(permissionId) | 448 | GAPI_COMPARE(permissionId) | ||
446 | GAPI_COMPARE(isCurrentAppInstalled) | 449 | GAPI_COMPARE(isCurrentAppInstalled) | ||
450 | GAPI_COMPARE(canCreateDrives) | ||||
447 | GAPI_COMPARE_SHAREDPTRS(user) | 451 | GAPI_COMPARE_SHAREDPTRS(user) | ||
448 | return true; | 452 | return true; | ||
449 | } | 453 | } | ||
450 | 454 | | |||
451 | QUrl About::selfLink() const | 455 | QUrl About::selfLink() const | ||
452 | { | 456 | { | ||
453 | return d->selfLink; | 457 | return d->selfLink; | ||
454 | } | 458 | } | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 542 | { | |||
539 | return d->isCurrentAppInstalled; | 543 | return d->isCurrentAppInstalled; | ||
540 | } | 544 | } | ||
541 | 545 | | |||
542 | UserPtr About::user() const | 546 | UserPtr About::user() const | ||
543 | { | 547 | { | ||
544 | return d->user; | 548 | return d->user; | ||
545 | } | 549 | } | ||
546 | 550 | | |||
551 | bool About::canCreateDrives() const | ||||
552 | { | ||||
553 | return d->canCreateDrives; | ||||
554 | } | ||||
555 | | ||||
547 | AboutPtr About::fromJSON(const QByteArray &jsonData) | 556 | AboutPtr About::fromJSON(const QByteArray &jsonData) | ||
548 | { | 557 | { | ||
549 | QJsonDocument document = QJsonDocument::fromJson(jsonData); | 558 | QJsonDocument document = QJsonDocument::fromJson(jsonData); | ||
550 | if (document.isNull()) { | 559 | if (document.isNull()) { | ||
551 | return AboutPtr(); | 560 | return AboutPtr(); | ||
552 | } | 561 | } | ||
553 | const QVariantMap map = document.toVariant().toMap(); | 562 | const QVariantMap map = document.toVariant().toMap(); | ||
554 | 563 | | |||
Show All 12 Lines | |||||
567 | about->d->quotaBytesUsedInTrash = map.value(QStringLiteral("quotaBytesUsedInTrash")).toLongLong(); | 576 | about->d->quotaBytesUsedInTrash = map.value(QStringLiteral("quotaBytesUsedInTrash")).toLongLong(); | ||
568 | about->d->quotaBytesUsedAggregate = map.value(QStringLiteral("quotaBytesUsedAggregate")).toLongLong(); | 577 | about->d->quotaBytesUsedAggregate = map.value(QStringLiteral("quotaBytesUsedAggregate")).toLongLong(); | ||
569 | about->d->largestChangeId = map.value(QStringLiteral("largestChangeId")).toLongLong(); | 578 | about->d->largestChangeId = map.value(QStringLiteral("largestChangeId")).toLongLong(); | ||
570 | about->d->remainingChangeIds = map.value(QStringLiteral("remainingChangeIds")).toLongLong(); | 579 | about->d->remainingChangeIds = map.value(QStringLiteral("remainingChangeIds")).toLongLong(); | ||
571 | about->d->rootFolderId = map.value(QStringLiteral("rootFolderId")).toString(); | 580 | about->d->rootFolderId = map.value(QStringLiteral("rootFolderId")).toString(); | ||
572 | about->d->domainSharingPolicy = map.value(QStringLiteral("domainSharingPolicy")).toString(); | 581 | about->d->domainSharingPolicy = map.value(QStringLiteral("domainSharingPolicy")).toString(); | ||
573 | about->d->permissionId = map.value(QStringLiteral("permissionId")).toString(); | 582 | about->d->permissionId = map.value(QStringLiteral("permissionId")).toString(); | ||
574 | about->d->isCurrentAppInstalled = map.value(QStringLiteral("isCurrentAppInstalled")).toBool(); | 583 | about->d->isCurrentAppInstalled = map.value(QStringLiteral("isCurrentAppInstalled")).toBool(); | ||
584 | about->d->canCreateDrives = map.value(QStringLiteral("canCreateDrives")).toBool(); | ||||
575 | 585 | | |||
576 | const QVariantList importFormats = map.value(QStringLiteral("importFormats")).toList(); | 586 | const QVariantList importFormats = map.value(QStringLiteral("importFormats")).toList(); | ||
577 | for (const QVariant &v : importFormats) { | 587 | for (const QVariant &v : importFormats) { | ||
578 | const QVariantMap importFormat = v.toMap(); | 588 | const QVariantMap importFormat = v.toMap(); | ||
579 | FormatPtr format(new Format()); | 589 | FormatPtr format(new Format()); | ||
580 | format->d->source = importFormat.value(QStringLiteral("source")).toString(); | 590 | format->d->source = importFormat.value(QStringLiteral("source")).toString(); | ||
581 | format->d->targets = importFormat.value(QStringLiteral("targets")).toStringList(); | 591 | format->d->targets = importFormat.value(QStringLiteral("targets")).toStringList(); | ||
582 | 592 | | |||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |