diff options
author | Merov Linden <merov@lindenlab.com> | 2012-03-01 23:10:06 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-03-01 23:10:06 -0800 |
commit | a41507eef0a79731d1894ccf3179da6165f310ab (patch) | |
tree | ef018a341a4a7326348ec5bf5907df175a849ed9 /indra/llui | |
parent | 44c66e11ccee4f8370dc9cf2a87c44e323c9c68d (diff) |
EXP-1841 : change mState to mGeneration in LLClipboard.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llclipboard.cpp | 10 | ||||
-rw-r--r-- | indra/llui/llclipboard.h | 9 |
2 files changed, 9 insertions, 10 deletions
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 037b9cb254..75c197463c 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -35,7 +35,7 @@ #include "llwindow.h" LLClipboard::LLClipboard() : - mState(0) + mGeneration(0) { reset(); } @@ -47,8 +47,8 @@ LLClipboard::~LLClipboard() void LLClipboard::reset() { - // Increment the clipboard state - mState++; + // Increment the clipboard count + mGeneration++; // Call the cleanup function (if any) before releasing the object list if (mCutMode && mCleanupCallback) { @@ -84,7 +84,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ if (res) { mObjects.push_back(src); - mState++; + mGeneration++; } } return res; @@ -138,7 +138,7 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us { mString = mString + sep + src.substr(pos, len); } - mState++; + mGeneration++; return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index 50b4c7cd77..8b5a2260ae 100644 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -54,7 +54,7 @@ public: // Clears the clipboard void reset(); // Returns the state of the clipboard so client can know if it has been modified (comparing with tracked state) - int getState() const { return mState; } + int getGeneration() const { return mGeneration; } // Text strings management: // ------------------------ @@ -80,15 +80,14 @@ public: bool isOnClipboard(const LLUUID& object) const; // True if the input object uuid is on the clipboard bool isCutMode() const { return mCutMode; } - void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mState++; } + void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mGeneration++; } private: - std::vector<LLUUID> mObjects; // Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat) + std::vector<LLUUID> mObjects; // Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat) LLWString mString; // The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment). bool mCutMode; // This is a convenience flag for the viewer. Will determine if mCleanupCallback() needs to be called. cleanup_callback_t mCleanupCallback;// Function to call when the cut clipboard is being wiped out. Can be set to NULL (nothing done then). - int mState; // Incremented when the clipboard change so that interested parties can check its state. - + int mGeneration; // Incremented when the clipboard changes so that interested parties can check for changes on the clipboard. }; #endif // LL_LLCLIPBOARD_H |