Merge branch 'master' of https://github.com/siana/SingularityViewer
This commit is contained in:
@@ -113,7 +113,7 @@ if (WINDOWS)
|
||||
|
||||
endif (WINDOWS)
|
||||
|
||||
set (GCC_EXTRA_OPTIMIZATION "-ffast-math -frounding-math")
|
||||
set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math -frounding-math")
|
||||
|
||||
if (LINUX)
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
@@ -182,53 +182,29 @@ if (LINUX)
|
||||
-pthread
|
||||
)
|
||||
|
||||
if (SERVER)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-60")
|
||||
if (EXISTS /etc/debian_version)
|
||||
FILE(READ /etc/debian_version DEBIAN_VERSION)
|
||||
else (EXISTS /etc/debian_version)
|
||||
set(DEBIAN_VERSION "")
|
||||
endif (EXISTS /etc/debian_version)
|
||||
|
||||
if (NOT DEBIAN_VERSION STREQUAL "3.1")
|
||||
add_definitions(-DCTYPE_WORKAROUND)
|
||||
endif (NOT DEBIAN_VERSION STREQUAL "3.1")
|
||||
|
||||
if (EXISTS /usr/lib/mysql4/mysql)
|
||||
link_directories(/usr/lib/mysql4/mysql)
|
||||
endif (EXISTS /usr/lib/mysql4/mysql)
|
||||
|
||||
add_definitions(
|
||||
-msse2
|
||||
-mfpmath=sse
|
||||
)
|
||||
endif (SERVER)
|
||||
|
||||
if (VIEWER)
|
||||
add_definitions(-DAPPID=secondlife)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
# don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway.
|
||||
add_definitions(-DLL_IGNORE_SIGCHLD)
|
||||
add_definitions(-DAPPID=secondlife)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
# don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway.
|
||||
add_definitions(-DLL_IGNORE_SIGCHLD)
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
endif (NOT STANDALONE)
|
||||
if (${ARCH} STREQUAL "x86_64")
|
||||
add_definitions(-DLINUX64=1 -pipe)
|
||||
set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
else (${ARCH} STREQUAL "x86_64")
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
set(MARCH_FLAG " -march=pentium4")
|
||||
endif (NOT STANDALONE)
|
||||
if (${ARCH} STREQUAL "x86_64")
|
||||
add_definitions(-DLINUX64=1 -pipe)
|
||||
set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
else (${ARCH} STREQUAL "x86_64")
|
||||
if (NOT STANDALONE)
|
||||
set(MARCH_FLAG " -march=pentium4")
|
||||
endif (NOT STANDALONE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 "${GCC_EXTRA_OPTIMIZATIONS})
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 "${GCC_EXTRA_OPTIMIZATIONS})
|
||||
endif (${ARCH} STREQUAL "x86_64")
|
||||
endif (VIEWER)
|
||||
set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 "${GCC_EXTRA_OPTIMIZATIONS})
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
endif (${ARCH} STREQUAL "x86_64")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG} -msse2")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
|
||||
@@ -6,6 +6,11 @@ set(DB_FIND_REQUIRED ON)
|
||||
if (STANDALONE)
|
||||
include(FindBerkeleyDB)
|
||||
else (STANDALONE)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
if (LINUX)
|
||||
# Need to add dependency pthread explicitely to support ld.gold.
|
||||
set(DB_LIBRARIES db-4.2 pthread)
|
||||
else (LINUX)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
endif (LINUX)
|
||||
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -18,7 +18,14 @@ set(LLCOMMON_INCLUDE_DIRS
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llcommon uses.
|
||||
# llcommon uses `clock_gettime' which is provided by librt on linux.
|
||||
set(LLCOMMON_LIBRARIES llcommon rt)
|
||||
else (LINUX)
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
endif (LINUX)
|
||||
|
||||
set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
|
||||
@@ -5,4 +5,10 @@ set(LLPLUGIN_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llplugin
|
||||
)
|
||||
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llplugin uses.
|
||||
set(LLPLUGIN_LIBRARIES llplugin pthread)
|
||||
else (LINUX)
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
endif (LINUX)
|
||||
|
||||
@@ -1,105 +1,96 @@
|
||||
# Main CMakeLists.txt to build the OpenJPEG project using CMake (www.cmake.org)
|
||||
# Written by Mathieu Malaterre
|
||||
# -*- cmake -*-
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
project(openjpeg)
|
||||
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
include(00-Common)
|
||||
|
||||
PROJECT(openjpeg)
|
||||
|
||||
# Do full dependency headers.
|
||||
INCLUDE_REGULAR_EXPRESSION("^.*$")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OPENJPEG version number, useful for packaging and doxygen doc:
|
||||
SET(OPENJPEG_VERSION_MAJOR 1)
|
||||
SET(OPENJPEG_VERSION_MINOR 4)
|
||||
SET(OPENJPEG_VERSION_BUILD 0)
|
||||
SET(OPENJPEG_VERSION
|
||||
set(OPENJPEG_VERSION_MAJOR 1)
|
||||
set(OPENJPEG_VERSION_MINOR 4)
|
||||
set(OPENJPEG_VERSION_BUILD 0)
|
||||
set(OPENJPEG_VERSION
|
||||
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||
|
||||
set(openjpeg_SOURCE_FILES
|
||||
bio.c
|
||||
cio.c
|
||||
dwt.c
|
||||
event.c
|
||||
image.c
|
||||
j2k.c
|
||||
j2k_lib.c
|
||||
jp2.c
|
||||
jpt.c
|
||||
mct.c
|
||||
mqc.c
|
||||
openjpeg.c
|
||||
pi.c
|
||||
raw.c
|
||||
t1.c
|
||||
t2.c
|
||||
tcd.c
|
||||
tgt.c
|
||||
)
|
||||
|
||||
set(openjpeg_HEADER_FILES
|
||||
bio.h
|
||||
cio.h
|
||||
dwt.h
|
||||
event.h
|
||||
fix.h
|
||||
image.h
|
||||
int.h
|
||||
j2k.h
|
||||
j2k_lib.h
|
||||
jp2.h
|
||||
jpt.h
|
||||
mct.h
|
||||
mqc.h
|
||||
openjpeg.h
|
||||
opj_includes.h
|
||||
opj_malloc.h
|
||||
pi.h
|
||||
raw.h
|
||||
t1.h
|
||||
t1_luts.h
|
||||
t2.h
|
||||
tcd.h
|
||||
tgt.h
|
||||
)
|
||||
|
||||
IF(WINDOWS)
|
||||
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security warnings
|
||||
add_definitions(
|
||||
-d_crt_far_mappings_no_deprecate
|
||||
-d_crt_is_wctype_no_deprecate
|
||||
-d_crt_managed_fp_no_deprecate
|
||||
-d_crt_nonstdc_no_deprecate
|
||||
-d_crt_secure_no_deprecate
|
||||
-d_crt_secure_no_deprecate_globals
|
||||
-d_crt_seterrormode_beep_sleep_no_deprecate
|
||||
-d_crt_time_functions_no_deprecate
|
||||
-d_crt_vcclrit_no_deprecate
|
||||
-d_scl_secure_no_deprecate
|
||||
)
|
||||
add_definitions(-DOPJ_STATIC)
|
||||
ENDIF(WINDOWS)
|
||||
|
||||
|
||||
set_source_files_properties(${openjpeg_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
list(APPEND openjpeg_SOURCE_FILES ${openjpeg_HEADER_FILES})
|
||||
|
||||
add_library (openjpeg ${openjpeg_SOURCE_FILES})
|
||||
|
||||
# This setting of SOVERSION assumes that any API change
|
||||
# will increment either the minor or major version number of openjpeg
|
||||
SET(OPENJPEG_LIBRARY_PROPERTIES
|
||||
set(OPENJPEG_LIBRARY_PROPERTIES
|
||||
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
|
||||
SOVERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}"
|
||||
)
|
||||
|
||||
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
|
||||
# warnings
|
||||
IF(WIN32)
|
||||
IF(NOT BORLAND)
|
||||
IF(NOT CYGWIN)
|
||||
IF(NOT MINGW)
|
||||
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
||||
ADD_DEFINITIONS(
|
||||
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
|
||||
-D_CRT_IS_WCTYPE_NO_DEPRECATE
|
||||
-D_CRT_MANAGED_FP_NO_DEPRECATE
|
||||
-D_CRT_NONSTDC_NO_DEPRECATE
|
||||
-D_CRT_SECURE_NO_DEPRECATE
|
||||
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS
|
||||
-D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE
|
||||
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
|
||||
-D_CRT_VCCLRIT_NO_DEPRECATE
|
||||
-D_SCL_SECURE_NO_DEPRECATE
|
||||
)
|
||||
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
||||
ENDIF(NOT MINGW)
|
||||
ENDIF(NOT CYGWIN)
|
||||
ENDIF(NOT BORLAND)
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Test for some required system information.
|
||||
# INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityC.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Compiler specific flags:
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
# For all builds, make sure openjpeg is std99 compliant:
|
||||
# SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
|
||||
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# Defines the source code for the library
|
||||
SET(OPENJPEG_SRCS
|
||||
bio.c
|
||||
cio.c
|
||||
dwt.c
|
||||
event.c
|
||||
image.c
|
||||
j2k.c
|
||||
j2k_lib.c
|
||||
jp2.c
|
||||
jpt.c
|
||||
mct.c
|
||||
mqc.c
|
||||
openjpeg.c
|
||||
pi.c
|
||||
raw.c
|
||||
t1.c
|
||||
t2.c
|
||||
tcd.c
|
||||
tgt.c
|
||||
)
|
||||
|
||||
# Pass proper definition to preprocessor to generate shared lib
|
||||
IF(WIN32)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Create the library
|
||||
ADD_LIBRARY(openjpeg ${OPENJPEG_SRCS})
|
||||
SET_TARGET_PROPERTIES(openjpeg PROPERTIES
|
||||
set_target_properties(openjpeg PROPERTIES
|
||||
${OPENJPEG_LIBRARY_PROPERTIES})
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ list(APPEND linux_crash_logger_SOURCE_FILES
|
||||
${linux_crash_logger_HEADER_FILES}
|
||||
)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt -lapr-1 -Wl,--as-needed")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
|
||||
|
||||
add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES})
|
||||
|
||||
@@ -47,11 +47,18 @@ target_link_libraries(linux-crash-logger
|
||||
${LLVFS_LIBRARIES}
|
||||
${LLXML_LIBRARIES}
|
||||
${LLMESSAGE_LIBRARIES}
|
||||
${LLUI_LIBRARIES}
|
||||
${LLVFS_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${UI_LIBRARIES}
|
||||
${DB_LIBRARIES}
|
||||
${XMLRPCEPI_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${APR_LIBRARIES}
|
||||
${APRUTIL_LIBRARIES}
|
||||
${CRYPTO_LIBRARIES}
|
||||
rt
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
|
||||
@@ -82,10 +82,6 @@ if (DARWIN)
|
||||
)
|
||||
endif (DARWIN)
|
||||
|
||||
if (LINUX)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt")
|
||||
endif (LINUX)
|
||||
|
||||
if (WINDOWS)
|
||||
set_target_properties(SLPlugin
|
||||
PROPERTIES
|
||||
|
||||
@@ -1071,7 +1071,7 @@ endif (DARWIN)
|
||||
if (LINUX)
|
||||
LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp)
|
||||
LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -luuid -lrt -laprutil-1 -lfontconfig -Wl,--as-needed")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
|
||||
|
||||
set(viewer_LIBRARIES
|
||||
Xinerama
|
||||
|
||||
@@ -1622,118 +1622,144 @@ void LLInventoryPanel::modelChanged(U32 mask)
|
||||
LLFastTimer t2(LLFastTimer::FTM_REFRESH);
|
||||
|
||||
bool handled = false;
|
||||
if(mask & LLInventoryObserver::LABEL)
|
||||
|
||||
//if (!mViewsInitialized) return;
|
||||
|
||||
const LLInventoryModel* model = getModel();
|
||||
if (!model) return;
|
||||
|
||||
const LLInventoryModel::changed_items_t& changed_items = model->getChangedIDs();
|
||||
if (changed_items.empty()) return;
|
||||
|
||||
for (LLInventoryModel::changed_items_t::const_iterator items_iter = changed_items.begin();
|
||||
items_iter != changed_items.end();
|
||||
++items_iter)
|
||||
{
|
||||
handled = true;
|
||||
// label change - empty out the display name for each object
|
||||
// in this change set.
|
||||
const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
|
||||
std::set<LLUUID>::const_iterator id_it = changed_items.begin();
|
||||
std::set<LLUUID>::const_iterator id_end = changed_items.end();
|
||||
LLFolderViewItem* view = NULL;
|
||||
LLInvFVBridge* bridge = NULL;
|
||||
for (;id_it != id_end; ++id_it)
|
||||
const LLUUID& item_id = (*items_iter);
|
||||
const LLInventoryObject* model_item = model->getObject(item_id);
|
||||
LLFolderViewItem* view_item = getRootFolder()->getItemByID(item_id);
|
||||
|
||||
// LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item
|
||||
// to folder is the fast way to get a folder without searching through folders tree.
|
||||
//LLFolderViewFolder* view_folder = dynamic_cast<LLFolderViewFolder*>(view_item);
|
||||
|
||||
//////////////////////////////
|
||||
// LABEL Operation
|
||||
// Empty out the display name for relabel.
|
||||
if (mask & LLInventoryObserver::LABEL)
|
||||
{
|
||||
view = mFolders->getItemByID(*id_it);
|
||||
if(view)
|
||||
handled = true;
|
||||
if (view_item)
|
||||
{
|
||||
// request refresh on this item (also flags for filtering)
|
||||
bridge = (LLInvFVBridge*)view->getListener();
|
||||
// Request refresh on this item (also flags for filtering)
|
||||
LLInvFVBridge* bridge = (LLInvFVBridge*)view_item->getListener();
|
||||
if(bridge)
|
||||
{ // Clear the display name first, so it gets properly re-built during refresh()
|
||||
bridge->clearDisplayName();
|
||||
|
||||
view_item->refresh();
|
||||
}
|
||||
view->refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
if((mask & (LLInventoryObserver::STRUCTURE
|
||||
| LLInventoryObserver::ADD
|
||||
| LLInventoryObserver::REMOVE)) != 0)
|
||||
{
|
||||
handled = true;
|
||||
// Record which folders are open by uuid.
|
||||
LLInventoryModel* model = getModel();
|
||||
if (model)
|
||||
|
||||
//////////////////////////////
|
||||
// REBUILD Operation
|
||||
// Destroy and regenerate the UI.
|
||||
/*if (mask & LLInventoryObserver::REBUILD)
|
||||
{
|
||||
const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
|
||||
|
||||
std::set<LLUUID>::const_iterator id_it = changed_items.begin();
|
||||
std::set<LLUUID>::const_iterator id_end = changed_items.end();
|
||||
for (;id_it != id_end; ++id_it)
|
||||
handled = true;
|
||||
if (model_item && view_item)
|
||||
{
|
||||
// sync view with model
|
||||
LLInventoryObject* model_item = model->getObject(*id_it);
|
||||
LLFolderViewItem* view_item = mFolders->getItemByID(*id_it);
|
||||
view_item->destroyView();
|
||||
}
|
||||
view_item = buildNewViews(item_id);
|
||||
view_folder = dynamic_cast<LLFolderViewFolder *>(view_item);
|
||||
}*/
|
||||
|
||||
if (model_item)
|
||||
//////////////////////////////
|
||||
// INTERNAL Operation
|
||||
// This could be anything. For now, just refresh the item.
|
||||
if (mask & LLInventoryObserver::INTERNAL)
|
||||
{
|
||||
if (view_item)
|
||||
{
|
||||
view_item->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
// SORT Operation
|
||||
// Sort the folder.
|
||||
/*if (mask & LLInventoryObserver::SORT)
|
||||
{
|
||||
if (view_folder)
|
||||
{
|
||||
view_folder->requestSort();
|
||||
}
|
||||
}*/
|
||||
|
||||
// We don't typically care which of these masks the item is actually flagged with, since the masks
|
||||
// may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into
|
||||
// Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks
|
||||
// panel). What's relevant is that the item and UI are probably out of sync and thus need to be
|
||||
// resynchronized.
|
||||
if (mask & (LLInventoryObserver::STRUCTURE |
|
||||
LLInventoryObserver::ADD |
|
||||
LLInventoryObserver::REMOVE))
|
||||
{
|
||||
handled = true;
|
||||
|
||||
//////////////////////////////
|
||||
// ADD Operation
|
||||
// Item exists in memory but a UI element hasn't been created for it.
|
||||
if (model_item && !view_item)
|
||||
{
|
||||
// Add the UI element for this item.
|
||||
buildNewViews(item_id);
|
||||
// Select any newly created object that has the auto rename at top of folder root set.
|
||||
if(getRootFolder()->getRoot()->needsAutoRename())
|
||||
{
|
||||
if (!view_item)
|
||||
{
|
||||
// this object was just created, need to build a view for it
|
||||
if ((mask & LLInventoryObserver::ADD) != LLInventoryObserver::ADD)
|
||||
{
|
||||
llwarns << *id_it << " is in model but not in view, but ADD flag not set" << llendl;
|
||||
}
|
||||
buildNewViews(*id_it);
|
||||
|
||||
// select any newly created object
|
||||
// that has the auto rename at top of folder
|
||||
// root set
|
||||
if(mFolders->getRoot()->needsAutoRename())
|
||||
{
|
||||
setSelection(*id_it, FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// this object was probably moved, check its parent
|
||||
if ((mask & LLInventoryObserver::STRUCTURE) != LLInventoryObserver::STRUCTURE)
|
||||
{
|
||||
llwarns << *id_it << " is in model and in view, but STRUCTURE flag not set" << llendl;
|
||||
}
|
||||
setSelection(item_id, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID());
|
||||
if (new_parent)
|
||||
{
|
||||
if (view_item->getParentFolder() != new_parent)
|
||||
//////////////////////////////
|
||||
// STRUCTURE Operation
|
||||
// This item already exists in both memory and UI. It was probably reparented.
|
||||
else if (model_item && view_item)
|
||||
{
|
||||
// Don't process the item if it is the root
|
||||
if (view_item->getRoot() != view_item)
|
||||
{
|
||||
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getRootFolder()->getItemByID(model_item->getParentUUID());
|
||||
// Item has been moved.
|
||||
if (view_item->getParentFolder() != new_parent)
|
||||
{
|
||||
if (new_parent != NULL)
|
||||
{
|
||||
// Item is to be moved and we found its new parent in the panel's directory, so move the item's UI.
|
||||
view_item->getParentFolder()->extractItem(view_item);
|
||||
view_item->addToFolder(new_parent, mFolders);
|
||||
view_item->addToFolder(new_parent, getRootFolder());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << model_item->getParentUUID() << ": parent folder gone !" << llendl;
|
||||
// Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that
|
||||
// doesn't include trash). Just remove the item's UI.
|
||||
view_item->destroyView();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (view_item)
|
||||
{
|
||||
if ((mask & LLInventoryObserver::REMOVE) != LLInventoryObserver::REMOVE)
|
||||
{
|
||||
llwarns << *id_it << " is not in model but in view, but REMOVE flag not set" << llendl;
|
||||
}
|
||||
// item in view but not model, need to delete view
|
||||
view_item->destroyView();
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << *id_it << ": Item does not exist in either view or model, but notification triggered" << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!handled)
|
||||
{
|
||||
// it's a small change that only requires a refresh.
|
||||
// *TODO: figure out a more efficient way to do the refresh
|
||||
// since it is expensive on large inventories
|
||||
mFolders->refresh();
|
||||
//////////////////////////////
|
||||
// REMOVE Operation
|
||||
// This item has been removed from memory, but its associated UI element still exists.
|
||||
else if (!model_item && view_item)
|
||||
{
|
||||
// Remove the item's UI.
|
||||
view_item->destroyView();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1613,6 +1613,57 @@ bool goto_url_callback(const LLSD& notification, const LLSD& response)
|
||||
}
|
||||
static LLNotificationFunctorRegistration goto_url_callback_reg("GotoURL", goto_url_callback);
|
||||
|
||||
// Strip out "Resident" for display, but only if the message came from a user
|
||||
// (rather than a script)
|
||||
static std::string clean_name_from_im(const std::string& name, EInstantMessage type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case IM_NOTHING_SPECIAL:
|
||||
case IM_MESSAGEBOX:
|
||||
case IM_GROUP_INVITATION:
|
||||
case IM_INVENTORY_OFFERED:
|
||||
case IM_INVENTORY_ACCEPTED:
|
||||
case IM_INVENTORY_DECLINED:
|
||||
case IM_GROUP_VOTE:
|
||||
case IM_GROUP_MESSAGE_DEPRECATED:
|
||||
//IM_TASK_INVENTORY_OFFERED
|
||||
//IM_TASK_INVENTORY_ACCEPTED
|
||||
//IM_TASK_INVENTORY_DECLINED
|
||||
case IM_NEW_USER_DEFAULT:
|
||||
case IM_SESSION_INVITE:
|
||||
case IM_SESSION_P2P_INVITE:
|
||||
case IM_SESSION_GROUP_START:
|
||||
case IM_SESSION_CONFERENCE_START:
|
||||
case IM_SESSION_SEND:
|
||||
case IM_SESSION_LEAVE:
|
||||
//IM_FROM_TASK
|
||||
case IM_BUSY_AUTO_RESPONSE:
|
||||
case IM_CONSOLE_AND_CHAT_HISTORY:
|
||||
case IM_LURE_USER:
|
||||
case IM_LURE_ACCEPTED:
|
||||
case IM_LURE_DECLINED:
|
||||
case IM_GODLIKE_LURE_USER:
|
||||
case IM_YET_TO_BE_USED:
|
||||
case IM_GROUP_ELECTION_DEPRECATED:
|
||||
//IM_GOTO_URL
|
||||
//IM_FROM_TASK_AS_ALERT
|
||||
case IM_GROUP_NOTICE:
|
||||
case IM_GROUP_NOTICE_INVENTORY_ACCEPTED:
|
||||
case IM_GROUP_NOTICE_INVENTORY_DECLINED:
|
||||
case IM_GROUP_INVITATION_ACCEPT:
|
||||
case IM_GROUP_INVITATION_DECLINE:
|
||||
case IM_GROUP_NOTICE_REQUESTED:
|
||||
case IM_FRIENDSHIP_OFFERED:
|
||||
case IM_FRIENDSHIP_ACCEPTED:
|
||||
case IM_FRIENDSHIP_DECLINED_DEPRECATED:
|
||||
//IM_TYPING_START
|
||||
//IM_TYPING_STOP
|
||||
return LLCacheName::cleanFullName(name);
|
||||
default:
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
void process_improved_im(LLMessageSystem *msg, void **user_data)
|
||||
{
|
||||
@@ -1655,6 +1706,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
||||
binary_bucket_size = msg->getSizeFast(_PREHASH_MessageBlock, _PREHASH_BinaryBucket);
|
||||
EInstantMessage dialog = (EInstantMessage)d;
|
||||
|
||||
// make sure that we don't have an empty or all-whitespace name
|
||||
LLStringUtil::trim(name);
|
||||
if (name.empty())
|
||||
{
|
||||
name = LLTrans::getString("Unnamed");
|
||||
}
|
||||
// IDEVO convert new-style "Resident" names for display
|
||||
name = clean_name_from_im(name, dialog);
|
||||
|
||||
// <edit>
|
||||
llinfos << "RegionID: " << region_id.asString() << llendl;
|
||||
// </edit>
|
||||
@@ -2997,8 +3057,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
|
||||
{
|
||||
from_name = "(no name)";
|
||||
}
|
||||
chat.mFromName = from_name;
|
||||
|
||||
|
||||
msg->getUUID("ChatData", "SourceID", from_id);
|
||||
chat.mFromID = from_id;
|
||||
|
||||
@@ -3026,6 +3085,27 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
|
||||
|
||||
chat.mTime = LLFrameTimer::getElapsedSeconds();
|
||||
|
||||
// IDEVO Correct for new-style "Resident" names
|
||||
if (chat.mSourceType == CHAT_SOURCE_AGENT)
|
||||
{
|
||||
// I don't know if it's OK to change this here, if
|
||||
// anything downstream does lookups by name, for instance
|
||||
|
||||
LLAvatarName av_name;
|
||||
if (LLAvatarNameCache::get(from_id, &av_name))
|
||||
{
|
||||
chat.mFromName = av_name.mDisplayName;
|
||||
}
|
||||
else
|
||||
{
|
||||
chat.mFromName = LLCacheName::cleanFullName(from_name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chat.mFromName = from_name;
|
||||
}
|
||||
|
||||
BOOL is_busy = gAgent.getBusy();
|
||||
|
||||
BOOL is_muted = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user