summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-06-06 00:09:59 +0100
committerCho <cho@lindenlab.com>2013-06-06 00:09:59 +0100
commit9232d919c8571743d9f5c899b80e2807f131f4d3 (patch)
tree009581aefa54cdf23391ecd3f557baf9967b49da /indra
parent0e6306e70dd5484cbb5c467a6ffc5f520f511489 (diff)
removed unnecessary passing of image caption
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llpanelsnapshotfacebook.cpp6
-rwxr-xr-xindra/newview/llwebprofile.cpp27
-rwxr-xr-xindra/newview/llwebprofile.h4
3 files changed, 17 insertions, 20 deletions
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 954941274a..9bea5aa796 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -64,7 +64,7 @@ private:
/*virtual*/ void updateControls(const LLSD& info);
void onSend();
- void onImageUploaded(const std::string& image_url, const std::string& caption);
+ void onImageUploaded(const std::string& caption, const std::string& image_url);
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotFacebook> panel_class("llpanelsnapshotfacebook");
@@ -99,14 +99,14 @@ void LLPanelSnapshotFacebook::onSend()
std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
- LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2));
+ LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
LLFloaterSnapshot::postSave();
// test with a placeholder image, until we can figure out a way to grab the uploaded image url
//LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
}
-void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption)
+void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url)
{
if (!image_url.empty())
{
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 4bc4724753..6923724de2 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder
LOG_CLASS(LLWebProfileResponders::ConfigResponder);
public:
- ConfigResponder(LLPointer<LLImageFormatted> imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb)
- : mImagep(imagep), mImageCaption(caption), mImageCallback(cb)
+ ConfigResponder(LLPointer<LLImageFormatted> imagep, LLWebProfile::image_url_callback_t cb)
+ : mImagep(imagep), mImageCallback(cb)
{
}
@@ -113,12 +113,11 @@ public:
// Do the actual image upload using the configuration.
LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
- LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback);
+ LLWebProfile::post(mImagep, config, upload_url, mImageCallback);
}
private:
LLPointer<LLImageFormatted> mImagep;
- std::string mImageCaption;
LLWebProfile::image_url_callback_t mImageCallback;
};
@@ -129,8 +128,8 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder);
public:
- PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb)
- : mImageCaption(caption), mImageCallback(cb)
+ PostImageRedirectResponder(LLWebProfile::image_url_callback_t cb)
+ : mImageCallback(cb)
{
}
@@ -141,7 +140,7 @@ public:
std::string image_url = content.get("Location");
llinfos << "Image uploaded to " << image_url << llendl;
if (!mImageCallback.empty() && !image_url.empty())
- mImageCallback(image_url, mImageCaption);
+ mImageCallback(image_url);
}
}
@@ -168,7 +167,6 @@ public:
}
private:
- std::string mImageCaption;
LLWebProfile::image_url_callback_t mImageCallback;
};
@@ -180,8 +178,8 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
LOG_CLASS(LLWebProfileResponders::PostImageResponder);
public:
- PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb)
- : mImageCaption(caption), mImageCallback(cb)
+ PostImageResponder(LLWebProfile::image_url_callback_t cb)
+ : mImageCallback(cb)
{
}
@@ -196,7 +194,7 @@ public:
headers["Cookie"] = LLWebProfile::getAuthCookie();
const std::string& redir_url = content["location"];
LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl;
- LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers);
+ LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCallback), headers);
}
else
{
@@ -214,7 +212,6 @@ public:
}
private:
- std::string mImageCaption;
LLWebProfile::image_url_callback_t mImageCallback;
};
@@ -235,7 +232,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
LLSD headers = LLViewerMedia::getHeaders();
headers["Cookie"] = getAuthCookie();
- LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers);
+ LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, cb), headers);
}
// static
@@ -246,7 +243,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie)
}
// static
-void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb)
+void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, LLWebProfile::image_url_callback_t cb)
{
if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
{
@@ -312,7 +309,7 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
memcpy(data, body.str().data(), size);
// Send request, successful upload will trigger posting metadata.
- LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers);
+ LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(cb), headers);
}
// static
diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h
index c1c0c23540..63dccf80af 100755
--- a/indra/newview/llwebprofile.h
+++ b/indra/newview/llwebprofile.h
@@ -48,7 +48,7 @@ class LLWebProfile
public:
typedef boost::function<void(bool ok)> status_callback_t;
- typedef boost::function<void(const std::string& image_url, const std::string& caption)> image_url_callback_t;
+ typedef boost::function<void(const std::string& image_url)> image_url_callback_t;
static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t());
static void setAuthCookie(const std::string& cookie);
@@ -59,7 +59,7 @@ private:
friend class LLWebProfileResponders::PostImageResponder;
friend class LLWebProfileResponders::PostImageRedirectResponder;
- static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb);
+ static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, image_url_callback_t cb);
static void reportImageUploadStatus(bool ok);
static std::string getAuthCookie();