Permalink
Browse files

Adding a comment updates the comment total / number of pages

  • Loading branch information...
jacob1 committed Oct 2, 2015
1 parent b184c78 commit 55d20f1bb2020ff6b3125f6ceead8d7dc37d050b
Showing with 10 additions and 0 deletions.
  1. +1 −0 src/gui/preview/PreviewController.cpp
  2. +8 −0 src/gui/preview/PreviewModel.cpp
  3. +1 −0 src/gui/preview/PreviewModel.h
@@ -86,6 +86,7 @@ bool PreviewController::SubmitComment(std::string comment)
}
else
{
previewModel->CommentAdded();
previewModel->UpdateComments(1);
}
}
@@ -141,6 +141,13 @@ void PreviewModel::UpdateComments(int pageNumber)
}
}
void PreviewModel::CommentAdded()
{
if (save)
save->Comments++;
commentsTotal++;
}
void PreviewModel::OnResponseReady(void * object, int identifier)
{
if (identifier == 1)
@@ -166,6 +173,7 @@ void PreviewModel::OnResponseReady(void * object, int identifier)
saveComments = (std::vector<SaveComment*>*)object;
commentsLoaded = true;
notifySaveCommentsChanged();
notifyCommentsPageChanged();
}
if (identifier == 1 || identifier == 2)
@@ -48,6 +48,7 @@ class PreviewModel: RequestListener {
int GetCommentsPageNum();
int GetCommentsPageCount();
void UpdateComments(int pageNumber);
void CommentAdded();
void AddObserver(PreviewView * observer);
void UpdateSave(int saveID, int saveDate);

0 comments on commit 55d20f1

Please sign in to comment.