Commit 89c2a1d6 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Only let the user to commit if there's only one selected item.

parent b837392d
......@@ -186,5 +186,18 @@ void VcsDiff::setBaseDiff(const KUrl& url) const
d->baseDiff=url;
}
void VcsDiff::clear()
{
// d->content;
// d->type;
d->leftBinaries.clear();
d->rightBinaries.clear();
d->leftTexts.clear();
d->rightTexts.clear();
d->diff.clear();
d->baseDiff.clear();
}
}
......@@ -124,6 +124,9 @@ public:
/** @returns whether there are not changes on the diff */
bool isEmpty() const;
/** Clears the diff information and it becomes an empty patch. */
void clear();
private:
class VcsDiffPrivate* const d;
};
......
......@@ -143,6 +143,7 @@ struct VcsPluginHelper::VcsPluginHelperPrivate {
annotationAction->setEnabled(singleVersionedFile);
diffToHeadAction->setEnabled(singleVersionedFile);
diffToBaseAction->setEnabled(singleVersionedFile);
commitAction->setEnabled(singleVersionedFile);
return menu;
}
......
......@@ -153,7 +153,7 @@ void VcsCommitDialog::setCommitCandidatesAndShow( const KUrl &url )
}
d->urls.clear();
d->diff=KDevelop::VcsDiff();
d->diff.clear();
//DVCS uses some "hack", see DistributedVersionControlPlugin::status()
//Thus DVCS gets statuses for all files in the repo. But project->relativeUrl() below helps us
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment