Skip to content

Commit

Permalink
fixed serialize of unions bug (missing data on input)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy committed Sep 24, 2016
1 parent fb61460 commit 651901e
Show file tree
Hide file tree
Showing 176 changed files with 1,088 additions and 429 deletions.
2 changes: 2 additions & 0 deletions src/dropbox/async/AsyncLaunchEmptyResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ void LaunchEmptyResult::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("async_job_id") == 0){
m_tag = LaunchResultBase_ASYNC_JOB_ID;
m_async_job_id = js["async_job_id"].toString();
}
if(s.compare("complete") == 0){
m_tag = LaunchEmptyResult_COMPLETE;

}
}

Expand Down
1 change: 1 addition & 0 deletions src/dropbox/async/AsyncLaunchResultBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void LaunchResultBase::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("async_job_id") == 0){
m_tag = LaunchResultBase_ASYNC_JOB_ID;
m_async_job_id = js["async_job_id"].toString();
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/dropbox/async/AsyncPollEmptyResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ void PollEmptyResult::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("in_progress") == 0){
m_tag = PollResultBase_IN_PROGRESS;

}
if(s.compare("complete") == 0){
m_tag = PollEmptyResult_COMPLETE;

}
}

Expand Down
7 changes: 5 additions & 2 deletions src/dropbox/async/AsyncPollError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ void PollError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("invalid_async_job_id") == 0){
m_tag = PollError_INVALID_ASYNC_JOB_ID;

}
if(s.compare("internal_error") == 0){
else if(s.compare("internal_error") == 0){
m_tag = PollError_INTERNAL_ERROR;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = PollError_OTHER;

}
}

Expand Down
1 change: 1 addition & 0 deletions src/dropbox/async/AsyncPollResultBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void PollResultBase::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("in_progress") == 0){
m_tag = PollResultBase_IN_PROGRESS;

}
}

Expand Down
10 changes: 7 additions & 3 deletions src/dropbox/auth/AuthAuthError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ void AuthError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("invalid_access_token") == 0){
m_tag = AuthError_INVALID_ACCESS_TOKEN;

}
if(s.compare("invalid_select_user") == 0){
else if(s.compare("invalid_select_user") == 0){
m_tag = AuthError_INVALID_SELECT_USER;

}
if(s.compare("invalid_select_admin") == 0){
else if(s.compare("invalid_select_admin") == 0){
m_tag = AuthError_INVALID_SELECT_ADMIN;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = AuthError_OTHER;

}
}

Expand Down
7 changes: 5 additions & 2 deletions src/dropbox/auth/AuthRateLimitReason.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ void RateLimitReason::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("too_many_requests") == 0){
m_tag = RateLimitReason_TOO_MANY_REQUESTS;

}
if(s.compare("too_many_write_operations") == 0){
else if(s.compare("too_many_write_operations") == 0){
m_tag = RateLimitReason_TOO_MANY_WRITE_OPERATIONS;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = RateLimitReason_OTHER;

}
}

Expand Down
13 changes: 10 additions & 3 deletions src/dropbox/files/FilesAddPropertiesError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,31 @@ void AddPropertiesError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("template_not_found") == 0){
m_tag = PropertyTemplateError_TEMPLATE_NOT_FOUND;
m_template_not_found = js["template_not_found"].toString();
}
if(s.compare("restricted_content") == 0){
else if(s.compare("restricted_content") == 0){
m_tag = PropertyTemplateError_RESTRICTED_CONTENT;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = PropertyTemplateError_OTHER;

}
if(s.compare("path") == 0){
m_tag = PropertiesError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("property_field_too_large") == 0){
m_tag = InvalidPropertyGroupError_PROPERTY_FIELD_TOO_LARGE;

}
if(s.compare("does_not_fit_template") == 0){
else if(s.compare("does_not_fit_template") == 0){
m_tag = InvalidPropertyGroupError_DOES_NOT_FIT_TEMPLATE;

}
if(s.compare("property_group_already_exists") == 0){
m_tag = AddPropertiesError_PROPERTY_GROUP_ALREADY_EXISTS;

}
}

Expand Down
2 changes: 2 additions & 0 deletions src/dropbox/files/FilesAlphaGetMetadataError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ void AlphaGetMetadataError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = GetMetadataError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("properties_error") == 0){
m_tag = AlphaGetMetadataError_PROPERTIES_ERROR;
m_properties_error.fromJson(js["properties_error"].toObject());
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dropbox/files/FilesCreateFolderError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void CreateFolderError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = CreateFolderError_PATH;
m_path.fromJson(js["path"].toObject());
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/dropbox/files/FilesDeleteError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ void DeleteError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path_lookup") == 0){
m_tag = DeleteError_PATH_LOOKUP;
m_path_lookup.fromJson(js["path_lookup"].toObject());
}
if(s.compare("path_write") == 0){
else if(s.compare("path_write") == 0){
m_tag = DeleteError_PATH_WRITE;
m_path_write.fromJson(js["path_write"].toObject());
}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = DeleteError_OTHER;

}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesDownloadError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ void DownloadError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = DownloadError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = DownloadError_OTHER;

}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesGetCopyReferenceError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ void GetCopyReferenceError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = GetCopyReferenceError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = GetCopyReferenceError_OTHER;

}
}

Expand Down
1 change: 1 addition & 0 deletions src/dropbox/files/FilesGetMetadataError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void GetMetadataError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = GetMetadataError_PATH;
m_path.fromJson(js["path"].toObject());
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesGetTemporaryLinkError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ void GetTemporaryLinkError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = GetTemporaryLinkError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = GetTemporaryLinkError_OTHER;

}
}

Expand Down
12 changes: 9 additions & 3 deletions src/dropbox/files/FilesInvalidPropertyGroupError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,27 @@ void InvalidPropertyGroupError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("template_not_found") == 0){
m_tag = PropertyTemplateError_TEMPLATE_NOT_FOUND;
m_template_not_found = js["template_not_found"].toString();
}
if(s.compare("restricted_content") == 0){
else if(s.compare("restricted_content") == 0){
m_tag = PropertyTemplateError_RESTRICTED_CONTENT;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = PropertyTemplateError_OTHER;

}
if(s.compare("path") == 0){
m_tag = PropertiesError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("property_field_too_large") == 0){
m_tag = InvalidPropertyGroupError_PROPERTY_FIELD_TOO_LARGE;

}
if(s.compare("does_not_fit_template") == 0){
else if(s.compare("does_not_fit_template") == 0){
m_tag = InvalidPropertyGroupError_DOES_NOT_FIT_TEMPLATE;

}
}

Expand Down
7 changes: 5 additions & 2 deletions src/dropbox/files/FilesListFolderContinueError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ void ListFolderContinueError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = ListFolderContinueError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("reset") == 0){
else if(s.compare("reset") == 0){
m_tag = ListFolderContinueError_RESET;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = ListFolderContinueError_OTHER;

}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesListFolderError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ void ListFolderError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = ListFolderError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = ListFolderError_OTHER;

}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesListFolderLongpollError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ void ListFolderLongpollError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("reset") == 0){
m_tag = ListFolderLongpollError_RESET;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = ListFolderLongpollError_OTHER;

}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesListRevisionsError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ void ListRevisionsError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = ListRevisionsError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = ListRevisionsError_OTHER;

}
}

Expand Down
1 change: 1 addition & 0 deletions src/dropbox/files/FilesLookUpPropertiesError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void LookUpPropertiesError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("property_group_not_found") == 0){
m_tag = LookUpPropertiesError_PROPERTY_GROUP_NOT_FOUND;

}
}

Expand Down
16 changes: 11 additions & 5 deletions src/dropbox/files/FilesLookupError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,27 @@ void LookupError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("malformed_path") == 0){
m_tag = LookupError_MALFORMED_PATH;
m_malformed_path = js["malformed_path"].toString();
}
if(s.compare("not_found") == 0){
else if(s.compare("not_found") == 0){
m_tag = LookupError_NOT_FOUND;

}
if(s.compare("not_file") == 0){
else if(s.compare("not_file") == 0){
m_tag = LookupError_NOT_FILE;

}
if(s.compare("not_folder") == 0){
else if(s.compare("not_folder") == 0){
m_tag = LookupError_NOT_FOLDER;

}
if(s.compare("restricted_content") == 0){
else if(s.compare("restricted_content") == 0){
m_tag = LookupError_RESTRICTED_CONTENT;

}
if(s.compare("other") == 0){
else if(s.compare("other") == 0){
m_tag = LookupError_OTHER;

}
}

Expand Down
4 changes: 3 additions & 1 deletion src/dropbox/files/FilesMediaInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ void MediaInfo::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("pending") == 0){
m_tag = MediaInfo_PENDING;

}
if(s.compare("metadata") == 0){
else if(s.compare("metadata") == 0){
m_tag = MediaInfo_METADATA;
m_metadata.fromJson(js);
}
}

Expand Down
10 changes: 7 additions & 3 deletions src/dropbox/files/FilesPreviewError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ void PreviewError::fromJson(const QJsonObject& js){
QString s = js[".tag"].toString();
if(s.compare("path") == 0){
m_tag = PreviewError_PATH;
m_path.fromJson(js["path"].toObject());
}
if(s.compare("in_progress") == 0){
else if(s.compare("in_progress") == 0){
m_tag = PreviewError_IN_PROGRESS;

}
if(s.compare("unsupported_extension") == 0){
else if(s.compare("unsupported_extension") == 0){
m_tag = PreviewError_UNSUPPORTED_EXTENSION;

}
if(s.compare("unsupported_content") == 0){
else if(s.compare("unsupported_content") == 0){
m_tag = PreviewError_UNSUPPORTED_CONTENT;

}
}

Expand Down
Loading

0 comments on commit 651901e

Please sign in to comment.