Skip to content

Commit

Permalink
Merge b916c9b into aed43b3
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Oct 3, 2018
2 parents aed43b3 + b916c9b commit 93e44af
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ PmrWorkspacesWindowSynchronizeDialogItems PmrWorkspacesWindowSynchronizeDialog::

QChar iStatus = fileNode->status().first;
QChar wStatus = fileNode->status().second;
bool stagedFile = ((iStatus != '\0') && (iStatus != ' '))
&& ((wStatus == '\0') || (wStatus == ' '));
bool unstagedFile = (wStatus != '\0') && (wStatus != ' ');
bool stagedFile = ((iStatus != nullptr) && (iStatus != ' '))
&& ((wStatus == nullptr) || (wStatus == ' '));
bool unstagedFile = (wStatus != nullptr) && (wStatus != ' ');

if (stagedFile || unstagedFile) {
// This is a un/staged file, so check whether we already know
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,13 +1086,13 @@ PmrWorkspacesWindowItems PmrWorkspacesWindowWidget::populateWorkspace(PMRSupport
// corresponding icon for it, if needed
// Note: it may happen (e.g. when deleting a folder) that the Git
// status is not up to date, hence we need to check for the
// I and W values not to be '\0' (which would be the case for
// I and W values not to be nullptr (which would be the case for
// a folder that doesn't contain any files anymore)...

QChar iStatus = fileNode->status().first;
QChar wStatus = fileNode->status().second;

if ((iStatus == '\0') && (wStatus == '\0'))
if ((iStatus == nullptr) && (wStatus == nullptr))
continue;

QIcon icon = mFileIcon;
Expand Down Expand Up @@ -1127,10 +1127,10 @@ PmrWorkspacesWindowItems PmrWorkspacesWindowWidget::populateWorkspace(PMRSupport
icon = mWtFileIcon;

pIsStaged = pIsStaged
|| ( (iStatus != '\0') && (iStatus != ' ')
&& ((wStatus == '\0') || (wStatus == ' ')));
|| ( (iStatus != nullptr) && (iStatus != ' ')
&& ((wStatus == nullptr) || (wStatus == ' ')));
pIsUnstaged = pIsUnstaged
|| ((wStatus != '\0') && (wStatus != ' ') && (wStatus != 'C'));
|| ((wStatus != nullptr) && (wStatus != ' ') && (wStatus != 'C'));
pHasConflicts = pHasConflicts || (wStatus == 'C');

if (newItem) {
Expand Down Expand Up @@ -1176,7 +1176,7 @@ PmrWorkspacesWindowItems PmrWorkspacesWindowWidget::populateWorkspace(PMRSupport
void PmrWorkspacesWindowWidget::sortAndResizeTreeViewToContents()
{
// Sort the contents of our tree view widget and make sure that all of its
// the contents is visible
// contents is visible

mProxyModel->sort(0);

Expand Down Expand Up @@ -1440,6 +1440,12 @@ void PmrWorkspacesWindowWidget::workspaceCloned(PMRSupport::PmrWorkspace *pWorks

duplicateCloneMessage(url, folderOwned.first, pWorkspace->path());
}

// Make sure that our GUI is up to date
// Note: in case, for example, where we started OpenCOR with no workspaces
// and then cloned one...

updateGui();
}

//==============================================================================
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/support/PMRSupport/src/pmrworkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void PmrWorkspace::refreshStatus()
nullptr;

if (filePath) {
CharPair statusChars = gitStatusChars(status->status);
CharPair statusChars = gitStatusChars(uint(status->status));

if (statusChars.first != ' ')
++mStagedCount;
Expand Down Expand Up @@ -910,7 +910,7 @@ void PmrWorkspace::stageFile(const QString &pPath, bool pStage)
memset(&indexEntry, '\0', sizeof(git_index_entry));

indexEntry.id = *git_tree_entry_id(headEntry);
indexEntry.mode = git_tree_entry_filemode(headEntry);
indexEntry.mode = uint32_t(git_tree_entry_filemode(headEntry));
indexEntry.path = relativePath;

git_index_add(index, &indexEntry);
Expand Down

0 comments on commit 93e44af

Please sign in to comment.