summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-03-01 21:35:05 -0800
committerMerov Linden <merov@lindenlab.com>2012-03-01 21:35:05 -0800
commitf0a1b43f2270cb8424409babf5ae88233cdd8f6c (patch)
treefc67305db3f0f1242b95616344c802d07a42bab3 /indra/newview
parent24789f11cc58cf7c03283a8e9648085a5cb9d7d8 (diff)
EXP-1841 : Use instance instead of getInstance on LLClipboard singleton.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfavoritesbar.cpp10
-rw-r--r--indra/newview/llfloatergesture.cpp14
-rw-r--r--indra/newview/llfolderview.cpp10
-rw-r--r--indra/newview/llinventorybridge.cpp32
-rw-r--r--indra/newview/llinventoryfilter.cpp4
-rw-r--r--indra/newview/llinventorypanel.cpp8
-rw-r--r--indra/newview/llpanelteleporthistory.cpp2
-rw-r--r--indra/newview/llpaneltopinfobar.cpp2
-rw-r--r--indra/newview/llpanelwearing.cpp2
-rw-r--r--indra/newview/llurllineeditorctrl.cpp2
10 files changed, 43 insertions, 43 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index d4bce1e3a1..575b613ccf 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1118,7 +1118,7 @@ BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
}
void copy_slurl_to_clipboard_cb(std::string& slurl)
{
- LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
LLSD args;
args["SLURL"] = slurl;
@@ -1187,7 +1187,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
}
else if (action == "copy")
{
- LLClipboard::getInstance()->copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK);
+ LLClipboard::instance().copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK);
}
else if (action == "paste")
{
@@ -1211,13 +1211,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
{
- if (!LLClipboard::getInstance()->hasContents())
+ if (!LLClipboard::instance().hasContents())
{
return FALSE;
}
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
S32 count = objects.count();
for(S32 i = 0; i < count; i++)
{
@@ -1246,7 +1246,7 @@ void LLFavoritesBarCtrl::pastFromClipboard() const
{
LLInventoryItem* item = NULL;
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
S32 count = objects.count();
LLUUID parent_id(mFavoriteFolderId);
for(S32 i = 0; i < count; i++)
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 7791d4688b..56051ff684 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -397,11 +397,11 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command)
std::string command_name = command.asString();
if("paste" == command_name)
{
- if(!LLClipboard::getInstance()->hasContents())
+ if(!LLClipboard::instance().hasContents())
return false;
LLDynamicArray<LLUUID> ids;
- LLClipboard::getInstance()->pasteFromClipboard(ids);
+ LLClipboard::instance().pasteFromClipboard(ids);
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
@@ -502,20 +502,20 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
uuid_vec_t ids;
getSelectedIds(ids);
// Make sure the clipboard is empty
- LLClipboard::getInstance()->reset();
+ LLClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
- LLClipboard::getInstance()->addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
+ LLClipboard::instance().addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
}
}
}
else if ("paste" == command_name)
{
LLDynamicArray<LLUUID> ids;
- LLClipboard::getInstance()->pasteFromClipboard(ids);
+ LLClipboard::instance().pasteFromClipboard(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
@@ -535,11 +535,11 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
- LLClipboard::getInstance()->reset();
+ LLClipboard::instance().reset();
}
else if ("copy_uuid" == command_name)
{
- LLClipboard::getInstance()->copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
+ LLClipboard::instance().copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
}
}
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index c0db2e366c..d9c6f4d9ce 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1018,12 +1018,12 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector<LLFol
void LLFolderView::removeCutItems()
{
// There's no item in "cut" mode on the clipboard -> exit
- if (!LLClipboard::getInstance()->isCutMode())
+ if (!LLClipboard::instance().isCutMode())
return;
// Get the list of clipboard item uuids and iterate through them
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
iter != objects.end();
++iter)
@@ -1323,7 +1323,7 @@ BOOL LLFolderView::canCopy() const
void LLFolderView::copy()
{
// *NOTE: total hack to clear the inventory clipboard
- LLClipboard::getInstance()->reset();
+ LLClipboard::instance().reset();
S32 count = mSelectedItems.size();
if(getVisible() && getEnabled() && (count > 0))
{
@@ -1364,7 +1364,7 @@ BOOL LLFolderView::canCut() const
void LLFolderView::cut()
{
// clear the inventory clipboard
- LLClipboard::getInstance()->reset();
+ LLClipboard::instance().reset();
S32 count = mSelectedItems.size();
if(getVisible() && getEnabled() && (count > 0))
{
@@ -2141,7 +2141,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
if (("copy" == action) || ("cut" == action))
{
// Clear the clipboard before we start adding things on it
- LLClipboard::getInstance()->reset();
+ LLClipboard::instance().reset();
}
static const std::string change_folder_string = "change_folder_type_";
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d55fb6a089..3001a998aa 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -220,8 +220,8 @@ BOOL LLInvFVBridge::cutToClipboard() const
const LLInventoryObject* obj = gInventory.getObject(mUUID);
if (obj && isItemMovable() && isItemRemovable())
{
- LLClipboard::getInstance()->setCutMode(true, boost::bind(LLFolderView::removeCutItems));
- return LLClipboard::getInstance()->addToClipboard(mUUID);
+ LLClipboard::instance().setCutMode(true, boost::bind(LLFolderView::removeCutItems));
+ return LLClipboard::instance().addToClipboard(mUUID);
}
return FALSE;
}
@@ -231,7 +231,7 @@ BOOL LLInvFVBridge::copyToClipboard() const
const LLInventoryObject* obj = gInventory.getObject(mUUID);
if (obj && isItemCopyable())
{
- return LLClipboard::getInstance()->addToClipboard(mUUID);
+ return LLClipboard::instance().addToClipboard(mUUID);
}
return FALSE;
}
@@ -419,7 +419,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
BOOL LLInvFVBridge::isClipboardPasteable() const
{
- if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory())
+ if (!LLClipboard::instance().hasContents() || !isAgentInventory())
{
return FALSE;
}
@@ -430,7 +430,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
}
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
S32 count = objects.count();
for(S32 i = 0; i < count; i++)
{
@@ -457,7 +457,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
{
- if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory())
+ if (!LLClipboard::instance().hasContents() || !isAgentInventory())
{
return FALSE;
}
@@ -468,7 +468,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
}
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
S32 count = objects.count();
for(S32 i = 0; i < count; i++)
{
@@ -643,7 +643,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
items.push_back(std::string("Paste"));
}
- if ((!LLClipboard::getInstance()->isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
+ if ((!LLClipboard::instance().isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
{
disabled_items.push_back(std::string("Paste"));
}
@@ -1833,7 +1833,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const
}
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
const LLViewerInventoryCategory *current_cat = getCategory();
// Search for the direct descendent of current Friends subfolder among all pasted items,
@@ -1871,7 +1871,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat );
const LLUUID &current_cat_id = current_cat->getUUID();
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
S32 count = objects.count();
for(S32 i = 0; i < count; i++)
{
@@ -2910,7 +2910,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
void LLFolderBridge::pasteFromClipboard()
{
LLInventoryModel* model = getInventoryModel();
- if (model && (isClipboardPasteable() || LLClipboard::getInstance()->isCutMode()))
+ if (model && (isClipboardPasteable() || LLClipboard::instance().isCutMode()))
{
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
@@ -2920,7 +2920,7 @@ void LLFolderBridge::pasteFromClipboard()
const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
if (move_is_into_outbox)
{
@@ -2980,7 +2980,7 @@ void LLFolderBridge::pasteFromClipboard()
dropToOutfit(item, move_is_into_current_outfit);
}
}
- else if (LLClipboard::getInstance()->isCutMode())
+ else if (LLClipboard::instance().isCutMode())
{
// Do a move to "paste" a "cut"
// move_inventory_item() is not enough, as we have to update inventory locally too
@@ -3029,7 +3029,7 @@ void LLFolderBridge::pasteFromClipboard()
}
}
// Change mode to paste for next paste
- LLClipboard::getInstance()->setCutMode(false);
+ LLClipboard::instance().setCutMode(false);
}
}
@@ -3054,7 +3054,7 @@ void LLFolderBridge::pasteLinkFromClipboard()
const LLUUID parent_id(mUUID);
LLDynamicArray<LLUUID> objects;
- LLClipboard::getInstance()->pasteFromClipboard(objects);
+ LLClipboard::instance().pasteFromClipboard(objects);
for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
iter != objects.end();
++iter)
@@ -3093,7 +3093,7 @@ void LLFolderBridge::pasteLinkFromClipboard()
}
}
// Change mode to paste for next paste
- LLClipboard::getInstance()->setCutMode(false);
+ LLClipboard::instance().setCutMode(false);
}
}
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index c127d7ac88..ccb9e74a8e 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -322,13 +322,13 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
// is on the clipboard must be filtered out if the clipboard is in the "cut" mode.
bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const
{
- if (LLClipboard::getInstance()->isCutMode())
+ if (LLClipboard::instance().isCutMode())
{
LLUUID current_id = object_id;
LLInventoryObject *current_object = gInventory.getObject(object_id);
while (current_id.notNull() && current_object)
{
- if (LLClipboard::getInstance()->isOnClipboard(current_id))
+ if (LLClipboard::instance().isOnClipboard(current_id))
{
return false;
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index a1e17ffbf2..b7e2e8c67c 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -249,7 +249,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
}
// keep track of the clipboard state so that we avoid filtering too much
- mClipboardState = LLClipboard::getInstance()->getState();
+ mClipboardState = LLClipboard::instance().getState();
// Initialize base class params.
LLPanel::initFromParams(params);
@@ -283,10 +283,10 @@ void LLInventoryPanel::draw()
mFolderRoot->updateSelection();
// Nudge the filter if the clipboard state changed
- if (mClipboardState != LLClipboard::getInstance()->getState())
+ if (mClipboardState != LLClipboard::instance().getState())
{
- mClipboardState = LLClipboard::getInstance()->getState();
- getFilter()->setModified(LLClipboard::getInstance()->isCutMode() ? LLInventoryFilter::FILTER_MORE_RESTRICTIVE : LLInventoryFilter::FILTER_LESS_RESTRICTIVE);
+ mClipboardState = LLClipboard::instance().getState();
+ getFilter()->setModified(LLClipboard::instance().isCutMode() ? LLInventoryFilter::FILTER_MORE_RESTRICTIVE : LLInventoryFilter::FILTER_LESS_RESTRICTIVE);
}
LLPanel::draw();
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index f92fbf3220..c63d89fc98 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -358,7 +358,7 @@ void LLTeleportHistoryPanel::ContextMenu::onInfo()
//static
void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl)
{
- LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
}
void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 0ad207ef00..280cc11179 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -467,7 +467,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
LLAgentUI::buildSLURL(slurl, false);
LLUIString location_str(slurl.getSLURLString());
- LLClipboard::getInstance()->copyToClipboard(location_str,0,location_str.length());
+ LLClipboard::instance().copyToClipboard(location_str,0,location_str.length());
}
}
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 5199bcb6b1..3b9934d4be 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -302,6 +302,6 @@ void LLPanelWearing::copyToClipboard()
}
}
- LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(text),0,text.size());
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(text),0,text.size());
}
// EOF
diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp
index 3efebcade9..cad5769042 100644
--- a/indra/newview/llurllineeditorctrl.cpp
+++ b/indra/newview/llurllineeditorctrl.cpp
@@ -89,5 +89,5 @@ void LLURLLineEditor::copyEscapedURLToClipboard()
else // human-readable location
text_to_copy = utf8str_to_wstring(unescaped_text);
- LLClipboard::getInstance()->copyToClipboard(text_to_copy, 0, text_to_copy.size());
+ LLClipboard::instance().copyToClipboard(text_to_copy, 0, text_to_copy.size());
}