Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
c10a40e5
Commit
c10a40e5
authored
15 years ago
by
Lynx Linden
Browse files
Options
Downloads
Patches
Plain Diff
DEV-41358: corrected a minor typo in a comment and refactored some
code to avoid duplication.
parent
aa59710b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llui/llurlentry.cpp
+16
-30
16 additions, 30 deletions
indra/llui/llurlentry.cpp
indra/llui/llurlentry.h
+1
-1
1 addition, 1 deletion
indra/llui/llurlentry.h
with
17 additions
and
31 deletions
indra/llui/llurlentry.cpp
+
16
−
30
View file @
c10a40e5
...
@@ -145,6 +145,18 @@ void LLUrlEntryBase::callObservers(const std::string &id, const std::string &lab
...
@@ -145,6 +145,18 @@ void LLUrlEntryBase::callObservers(const std::string &id, const std::string &lab
}
}
}
}
static
std
::
string
getStringAfterToken
(
const
std
::
string
str
,
const
std
::
string
token
)
{
size_t
pos
=
str
.
find
(
token
);
if
(
pos
==
std
::
string
::
npos
)
{
return
""
;
}
pos
+=
token
.
size
();
return
str
.
substr
(
pos
,
str
.
size
()
-
pos
);
}
//
//
// LLUrlEntryHTTP Describes generic http: and https: Urls
// LLUrlEntryHTTP Describes generic http: and https: Urls
//
//
...
@@ -154,7 +166,6 @@ LLUrlEntryHTTP::LLUrlEntryHTTP()
...
@@ -154,7 +166,6 @@ LLUrlEntryHTTP::LLUrlEntryHTTP()
boost
::
regex
::
perl
|
boost
::
regex
::
icase
);
boost
::
regex
::
perl
|
boost
::
regex
::
icase
);
mMenuName
=
"menu_url_http.xml"
;
mMenuName
=
"menu_url_http.xml"
;
mTooltip
=
LLTrans
::
getString
(
"TooltipHttpUrl"
);
mTooltip
=
LLTrans
::
getString
(
"TooltipHttpUrl"
);
//mIcon = "gear.tga";
}
}
std
::
string
LLUrlEntryHTTP
::
getLabel
(
const
std
::
string
&
url
,
const
LLUrlLabelCallback
&
cb
)
std
::
string
LLUrlEntryHTTP
::
getLabel
(
const
std
::
string
&
url
,
const
LLUrlLabelCallback
&
cb
)
...
@@ -390,7 +401,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC
...
@@ -390,7 +401,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC
}
}
//
//
// LLUrlEntryPlace Describes secondlife://
/
<location> URLs
// LLUrlEntryPlace Describes secondlife://<location> URLs
//
//
LLUrlEntryPlace
::
LLUrlEntryPlace
()
LLUrlEntryPlace
::
LLUrlEntryPlace
()
{
{
...
@@ -433,15 +444,7 @@ std::string LLUrlEntryPlace::getLabel(const std::string &url, const LLUrlLabelCa
...
@@ -433,15 +444,7 @@ std::string LLUrlEntryPlace::getLabel(const std::string &url, const LLUrlLabelCa
std
::
string
LLUrlEntryPlace
::
getLocation
(
const
std
::
string
&
url
)
const
std
::
string
LLUrlEntryPlace
::
getLocation
(
const
std
::
string
&
url
)
const
{
{
// return the part of the Url after secondlife:// part
// return the part of the Url after secondlife:// part
const
std
::
string
search_string
=
"://"
;
return
::
getStringAfterToken
(
url
,
"://"
);
size_t
pos
=
url
.
find
(
search_string
);
if
(
pos
==
std
::
string
::
npos
)
{
return
""
;
}
pos
+=
search_string
.
size
();
return
url
.
substr
(
pos
,
url
.
size
()
-
pos
);
}
}
//
//
...
@@ -506,15 +509,7 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe
...
@@ -506,15 +509,7 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe
std
::
string
LLUrlEntryTeleport
::
getLocation
(
const
std
::
string
&
url
)
const
std
::
string
LLUrlEntryTeleport
::
getLocation
(
const
std
::
string
&
url
)
const
{
{
// return the part of the Url after ///app/teleport
// return the part of the Url after ///app/teleport
const
std
::
string
search_string
=
"teleport"
;
return
::
getStringAfterToken
(
url
,
"app/teleport/"
);
size_t
pos
=
url
.
find
(
search_string
);
if
(
pos
==
std
::
string
::
npos
)
{
return
""
;
}
pos
+=
search_string
.
size
()
+
1
;
return
url
.
substr
(
pos
,
url
.
size
()
-
pos
);
}
}
///
///
...
@@ -638,14 +633,5 @@ std::string LLUrlEntryWorldMap::getLabel(const std::string &url, const LLUrlLabe
...
@@ -638,14 +633,5 @@ std::string LLUrlEntryWorldMap::getLabel(const std::string &url, const LLUrlLabe
std
::
string
LLUrlEntryWorldMap
::
getLocation
(
const
std
::
string
&
url
)
const
std
::
string
LLUrlEntryWorldMap
::
getLocation
(
const
std
::
string
&
url
)
const
{
{
// return the part of the Url after secondlife:///app/worldmap/ part
// return the part of the Url after secondlife:///app/worldmap/ part
const
std
::
string
search_string
=
"//app/worldmap/"
;
return
::
getStringAfterToken
(
url
,
"app/worldmap/"
);
size_t
pos
=
url
.
find
(
search_string
);
if
(
pos
==
std
::
string
::
npos
)
{
return
""
;
}
}
pos
+=
search_string
.
size
();
return
url
.
substr
(
pos
,
url
.
size
()
-
pos
);
}
This diff is collapsed.
Click to expand it.
indra/llui/llurlentry.h
+
1
−
1
View file @
c10a40e5
...
@@ -186,7 +186,7 @@ class LLUrlEntryParcel : public LLUrlEntryBase
...
@@ -186,7 +186,7 @@ class LLUrlEntryParcel : public LLUrlEntryBase
///
///
/// LLUrlEntryPlace Describes a Second Life location Url, e.g.,
/// LLUrlEntryPlace Describes a Second Life location Url, e.g.,
/// secondlife://
/
Ahern/50/50/50
/// secondlife://Ahern/50/50/50
///
///
class
LLUrlEntryPlace
:
public
LLUrlEntryBase
class
LLUrlEntryPlace
:
public
LLUrlEntryBase
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment