summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/Main.cpp
diff options
context:
space:
mode:
authorRené Schümann <white06tiger@gmail.com>2014-04-03 02:35:29 +0000
committerRené Schümann <white06tiger@gmail.com>2014-04-03 02:35:29 +0000
commitcf2713fd362cfeeeda946ead18e6b88abdff9c93 (patch)
tree5c697c37b29aab31ea056d0ad94e0c05d816c506 /plugins/SendScreenshotPlus/src/Main.cpp
parentb87686ce677be209f6923fc8b2f11edcff7f98a0 (diff)
SendSS
!*+ re-factored CSend a bit, fixes some bugs and improved re-usability + CSend got a new dialog to display URL created if there's no target contact (used by ImageShack when called from main menu * m_bDeleteAfterSend is now m_bAsync * CSend::Send now returns 1 if sent (sync, caller deletes) and 0 if sending is in progress (class self deletes, async) * ImageShack got new method SendSilent() (we used m_SendSync before, now renamed to m_bSilent for internal use) ! fixed memory leaks and using "delete" on already deleted CSend which caused a crash ! fixed graphical issue with wrongly initialized state buttons (delete after send, add description etc) git-svn-id: http://svn.miranda-ng.org/main/trunk@8835 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus/src/Main.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/Main.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp
index 13135cebe8..e2cfc37f9a 100644
--- a/plugins/SendScreenshotPlus/src/Main.cpp
+++ b/plugins/SendScreenshotPlus/src/Main.cpp
@@ -277,19 +277,17 @@ INT_PTR service_EditBitmap(WPARAM wParam, LPARAM lParam) {
INT_PTR service_Send2ImageShack(WPARAM wParam, LPARAM lParam) {
char* result = NULL;
CSendImageShack* cSend = new CSendImageShack(NULL, lParam, false);
- cSend->m_pszFile = mir_a2t((char*)wParam);
- cSend->m_bDeleteAfterSend = FALSE;
+ cSend->m_bDeleteAfterSend = false;
+ cSend->SetFile((char*)wParam);
if (lParam != NULL) {
- cSend->Send();
- return 0;
+ if(cSend->Send()) delete cSend;
+ return NULL;
}
- cSend->SendSync(TRUE);
- cSend->Send();
+ cSend->SendSilent();
if (cSend->GetURL()) {
- result = mir_strdup(cSend->GetURL());
- }
- else {
- result = cSend->GetError();
+ result=mir_strdup(cSend->GetURL());
+ }else{
+ result=cSend->GetError();
}
delete cSend;
return (INT_PTR)result;