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
e5597b83
Commit
e5597b83
authored
11 years ago
by
maksymsproductengine
Browse files
Options
Downloads
Patches
Plain Diff
CHUI-836 FIXED [CHUIBUG]Opening chat history from the conversation log sometimes crashes the viewer
parent
a0244eb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llfloaterconversationpreview.cpp
+14
-25
14 additions, 25 deletions
indra/newview/llfloaterconversationpreview.cpp
indra/newview/llfloaterconversationpreview.h
+2
-1
2 additions, 1 deletion
indra/newview/llfloaterconversationpreview.h
with
16 additions
and
26 deletions
indra/newview/llfloaterconversationpreview.cpp
+
14
−
25
View file @
e5597b83
...
@@ -43,14 +43,15 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i
...
@@ -43,14 +43,15 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i
mCurrentPage
(
0
),
mCurrentPage
(
0
),
mPageSize
(
gSavedSettings
.
getS32
(
"ConversationHistoryPageSize"
)),
mPageSize
(
gSavedSettings
.
getS32
(
"ConversationHistoryPageSize"
)),
mAccountName
(
session_id
[
LL_FCP_ACCOUNT_NAME
]),
mAccountName
(
session_id
[
LL_FCP_ACCOUNT_NAME
]),
mCompleteName
(
session_id
[
LL_FCP_COMPLETE_NAME
])
mCompleteName
(
session_id
[
LL_FCP_COMPLETE_NAME
]),
mMutex
(
NULL
)
{
{
}
}
BOOL
LLFloaterConversationPreview
::
postBuild
()
BOOL
LLFloaterConversationPreview
::
postBuild
()
{
{
mChatHistory
=
getChild
<
LLChatHistory
>
(
"chat_history"
);
mChatHistory
=
getChild
<
LLChatHistory
>
(
"chat_history"
);
LLLoadHistoryThread
::
setLoadEndSignal
(
boost
::
bind
(
&
LLFloaterConversationPreview
::
S
etPages
,
this
,
_1
,
_2
));
LLLoadHistoryThread
::
setLoadEndSignal
(
boost
::
bind
(
&
LLFloaterConversationPreview
::
s
etPages
,
this
,
_1
,
_2
));
const
LLConversation
*
conv
=
LLConversationLog
::
instance
().
getConversation
(
mSessionID
);
const
LLConversation
*
conv
=
LLConversationLog
::
instance
().
getConversation
(
mSessionID
);
std
::
string
name
;
std
::
string
name
;
...
@@ -95,14 +96,15 @@ BOOL LLFloaterConversationPreview::postBuild()
...
@@ -95,14 +96,15 @@ BOOL LLFloaterConversationPreview::postBuild()
return
LLFloater
::
postBuild
();
return
LLFloater
::
postBuild
();
}
}
void
LLFloaterConversationPreview
::
S
etPages
(
std
::
list
<
LLSD
>&
messages
,
const
std
::
string
&
file_name
)
void
LLFloaterConversationPreview
::
s
etPages
(
std
::
list
<
LLSD
>&
messages
,
const
std
::
string
&
file_name
)
{
{
if
(
file_name
==
mChatHistoryFileName
)
if
(
file_name
==
mChatHistoryFileName
)
{
{
// additional protection to avoid changes of mMessages in setPages()
LLMutexLock
lock
(
&
mMutex
);
mMessages
=
messages
;
mMessages
=
messages
;
mCurrentPage
=
(
mMessages
.
size
()
?
(
mMessages
.
size
()
-
1
)
/
mPageSize
:
0
);
mCurrentPage
=
mMessages
.
size
()
/
mPageSize
;
mPageSpinner
->
setEnabled
(
true
);
mPageSpinner
->
setEnabled
(
true
);
mPageSpinner
->
setMaxValue
(
mCurrentPage
+
1
);
mPageSpinner
->
setMaxValue
(
mCurrentPage
+
1
);
mPageSpinner
->
set
(
mCurrentPage
+
1
);
mPageSpinner
->
set
(
mCurrentPage
+
1
);
...
@@ -110,10 +112,9 @@ void LLFloaterConversationPreview::SetPages(std::list<LLSD>& messages, const std
...
@@ -110,10 +112,9 @@ void LLFloaterConversationPreview::SetPages(std::list<LLSD>& messages, const std
std
::
string
total_page_num
=
llformat
(
"/ %d"
,
mCurrentPage
+
1
);
std
::
string
total_page_num
=
llformat
(
"/ %d"
,
mCurrentPage
+
1
);
getChild
<
LLTextBox
>
(
"page_num_label"
)
->
setValue
(
total_page_num
);
getChild
<
LLTextBox
>
(
"page_num_label"
)
->
setValue
(
total_page_num
);
mChatHistoryLoaded
=
true
;
mChatHistoryLoaded
=
true
;
}
}
}
}
void
LLFloaterConversationPreview
::
draw
()
void
LLFloaterConversationPreview
::
draw
()
{
{
if
(
mChatHistoryLoaded
)
if
(
mChatHistoryLoaded
)
...
@@ -131,32 +132,21 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key)
...
@@ -131,32 +132,21 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key)
void
LLFloaterConversationPreview
::
showHistory
()
void
LLFloaterConversationPreview
::
showHistory
()
{
{
if
(
!
mMessages
.
size
())
// additional protection to avoid changes of mMessages in setPages()
LLMutexLock
lock
(
&
mMutex
);
if
(
!
mMessages
.
size
()
||
mCurrentPage
*
mPageSize
>=
mMessages
.
size
())
{
{
return
;
return
;
}
}
mChatHistory
->
clear
();
mChatHistory
->
clear
();
std
::
ostringstream
message
;
std
::
ostringstream
message
;
std
::
list
<
LLSD
>::
const_iterator
iter
=
mMessages
.
begin
();
std
::
list
<
LLSD
>::
const_iterator
iter
=
mMessages
.
begin
();
std
::
advance
(
iter
,
mCurrentPage
*
mPageSize
);
int
delta
=
0
;
for
(
int
msg_num
=
0
;
iter
!=
mMessages
.
end
()
&&
msg_num
<
mPageSize
;
++
iter
,
++
msg_num
)
if
(
mCurrentPage
)
{
int
remainder
=
mMessages
.
size
()
%
mPageSize
;
delta
=
(
remainder
==
0
)
?
0
:
(
mPageSize
-
remainder
);
}
std
::
advance
(
iter
,
(
mCurrentPage
*
mPageSize
)
-
delta
);
for
(
int
msg_num
=
0
;
(
iter
!=
mMessages
.
end
()
&&
msg_num
<
mPageSize
);
++
iter
,
++
msg_num
)
{
{
if
(
iter
->
size
()
==
0
)
{
continue
;
}
LLSD
msg
=
*
iter
;
LLSD
msg
=
*
iter
;
LLUUID
from_id
=
LLUUID
::
null
;
LLUUID
from_id
=
LLUUID
::
null
;
...
@@ -200,7 +190,6 @@ void LLFloaterConversationPreview::showHistory()
...
@@ -200,7 +190,6 @@ void LLFloaterConversationPreview::showHistory()
mChatHistory
->
appendMessage
(
chat
,
chat_args
);
mChatHistory
->
appendMessage
(
chat
,
chat_args
);
}
}
}
}
void
LLFloaterConversationPreview
::
onMoreHistoryBtnClick
()
void
LLFloaterConversationPreview
::
onMoreHistoryBtnClick
()
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llfloaterconversationpreview.h
+
2
−
1
View file @
e5597b83
...
@@ -42,7 +42,7 @@ class LLFloaterConversationPreview : public LLFloater
...
@@ -42,7 +42,7 @@ class LLFloaterConversationPreview : public LLFloater
virtual
~
LLFloaterConversationPreview
(){};
virtual
~
LLFloaterConversationPreview
(){};
virtual
BOOL
postBuild
();
virtual
BOOL
postBuild
();
void
S
etPages
(
std
::
list
<
LLSD
>&
messages
,
const
std
::
string
&
file_name
);
void
s
etPages
(
std
::
list
<
LLSD
>&
messages
,
const
std
::
string
&
file_name
);
virtual
void
draw
();
virtual
void
draw
();
virtual
void
onOpen
(
const
LLSD
&
key
);
virtual
void
onOpen
(
const
LLSD
&
key
);
...
@@ -51,6 +51,7 @@ class LLFloaterConversationPreview : public LLFloater
...
@@ -51,6 +51,7 @@ class LLFloaterConversationPreview : public LLFloater
void
onMoreHistoryBtnClick
();
void
onMoreHistoryBtnClick
();
void
showHistory
();
void
showHistory
();
LLMutex
mMutex
;
LLSpinCtrl
*
mPageSpinner
;
LLSpinCtrl
*
mPageSpinner
;
LLChatHistory
*
mChatHistory
;
LLChatHistory
*
mChatHistory
;
LLUUID
mSessionID
;
LLUUID
mSessionID
;
...
...
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