Terminal: HyperLink: Remove base address, add text property
* The base address is no longer used (it was in a an earlier, never committed version), so we can as remove it. * Introduce a text property.
This commit is contained in:
@@ -20,11 +20,19 @@ HyperLink::HyperLink()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HyperLink::HyperLink(const BString& address, Type type,
|
HyperLink::HyperLink(const BString& address, Type type)
|
||||||
const BString& baseAddress)
|
|
||||||
:
|
:
|
||||||
|
fText(address),
|
||||||
|
fAddress(address),
|
||||||
|
fType(type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HyperLink::HyperLink(const BString& text, const BString& address, Type type)
|
||||||
|
:
|
||||||
|
fText(text),
|
||||||
fAddress(address),
|
fAddress(address),
|
||||||
fBaseAddress(baseAddress.IsEmpty() ? address : baseAddress),
|
|
||||||
fType(type)
|
fType(type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,20 +20,21 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
HyperLink();
|
HyperLink();
|
||||||
HyperLink(const BString& address, Type type,
|
HyperLink(const BString& address, Type type);
|
||||||
const BString& baseAddress = BString());
|
HyperLink(const BString& text,
|
||||||
|
const BString& address, Type type);
|
||||||
|
|
||||||
bool IsValid() const { return !fAddress.IsEmpty(); }
|
bool IsValid() const { return !fAddress.IsEmpty(); }
|
||||||
|
|
||||||
|
const BString& Text() const { return fText; }
|
||||||
const BString& Address() const { return fAddress; }
|
const BString& Address() const { return fAddress; }
|
||||||
const BString& BaseAddress() const { return fBaseAddress; }
|
|
||||||
Type GetType() const { return fType; }
|
Type GetType() const { return fType; }
|
||||||
|
|
||||||
status_t Open();
|
status_t Open();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
BString fText;
|
||||||
BString fAddress;
|
BString fAddress;
|
||||||
BString fBaseAddress;
|
|
||||||
Type fType;
|
Type fType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -836,8 +836,7 @@ TermView::HyperLinkState::_GetHyperLinkAt(BPoint where, bool pathPrefixOnly,
|
|||||||
_link = HyperLink(text,
|
_link = HyperLink(text,
|
||||||
i == 0
|
i == 0
|
||||||
? HyperLink::TYPE_PATH_WITH_LINE
|
? HyperLink::TYPE_PATH_WITH_LINE
|
||||||
: HyperLink::TYPE_PATH_WITH_LINE_AND_COLUMN,
|
: HyperLink::TYPE_PATH_WITH_LINE_AND_COLUMN);
|
||||||
path);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user