Sc/refsview#99
Conversation
Which code are you talking about? this code omits your reading of the repository from disc on each drawing, so it is faster.
No, these icons don't make any sense in the header. And having an icon for all items finally removes that annoying cluttering that made it impossible to spot the actual hierarchy. Everything is now aligned as it usually is in a tree.
No, this isn't done. The underlying data model doesn't carry that information and I don't want to reintroduce the code that reads this information from disc on every drawing operation.
Same cause, same solution. The model has to carry this data, determined once during a refresh and updated with events accordingly. |
Yes, this is exactly what I was thinking about :). There's some other aspects to: i.e. you kicked the sort model layer. But this is the main point. It's not too bad, as the lookup is always done on the items drawn on screen (which is always <50). Ah ... I'm not writing any more, until I reviewed the code :).
I'll adapt to this and see what future brings. 😄
Happy to hear that. We need to discuss the In current implementation that means: QVariant RefBranch::data(int role) const
{
Q_ASSERT(mObject);
switch (role) {
case Qt::FontRole:
if( isCurrentBranch() )
{
QFont f;
f.setBold( true );
return f;
}
#endif
break;
case RefItem::RowBgGradientRole:
if ( equalsHeadId() )
{
QColor back = isCurrentBranch()
? QColor::fromHsl(35, 255, 190)
: QColor::fromHsl(35, 255, 190).lighter(130);
return back;
}
#endif
break;
case Qt::EditRole:
return object()->name();
}
return RefItemObject::data(role);
}
// spice it up with some private salt & pepper :)
const RM::Ref* RefBranch::findHEAD( const RM::Repo* repo ) {
// this can be optimized in libMacGitverCore, by providing a RM::Repo::head() method
// Anyways, this code will work!
RM::Ref* HEAD = NULL;
const QString headStr = QStringLiteral("HEAD");
foreach ( RM::Ref* candidate, repo->heads().childObjects<RM::Ref>() ) {
if ( candidate.fullName() == headStr ) {
HEAD = candidate;
break;
}
}
return HEAD;
}
bool RefBranch::isCurrentBranch() const
{
const RM::Repo* repo = mObject->repository();
const RM::Ref* HEAD = findHEAD( repo );
// Q_ASSERT( HEAD );
return HEAD && HEAD->symbolicTarget() == object()->fullName();
}
bool RefBranch::equalsHeadId() const
{
const RM::Repo* repo = mObject->repository();
const RM::Ref* HEAD = findHEAD( repo );
// Q_ASSERT( HEAD );
return HEAD && HEAD->id() == object()->id();
} |
There was a problem hiding this comment.
We can safely remove this class!
4209cc2 to
deefcc5
Compare
|
This needs rebasing due to the macro changes in |
Yepp. Though my local branch still has that commit around - I never start to develop on the "development" branch; not even for fixes :) |
|
Rebase done :) |
Maybe that's why lg2 renamed their "development" branch back to "master" 😄.
It's funny to see the website updating while writing in this box 😄. Thanks! |
d447993 to
8e49c1a
Compare
This is also valid for a renamed reference! Minor downside: When a scope/namespace has no more children, it will still stay visible.
As far as _behaviour_ is concerned, we don't want the headlines enabled. So that they cannot actually even be focused. However, this is certainly not what we want to draw.

An alternative approach to improve the RefsView.
This is based upon ngf/model-update and includes the compile-fix commit, which should be removed from the branches by rebasing them to development.
This approach doesn't consider stashes and namespaces yet. The support for stashes is lacking in RepoMan and probably in GitWrap. For namespaces I'm simply not sure how to display them correctly. The basic problem is, that each namespace could have both branches and tags (as well as other namespaces, in fact).
But we're actually having the same problem with remotes, where we should show a separate tree for tags.