summaryrefslogtreecommitdiff
path: root/plugins/FTPFileYM/src/job_delete.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-26 17:25:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-26 17:25:14 +0000
commit6a1a045e620dba38a7a64070af59d1a91b104921 (patch)
treea883339faf5d30db219509d86acb090eae77e2b6 /plugins/FTPFileYM/src/job_delete.cpp
parent1c023b4c677e8dcf0a776b07d8679a6464d2ee61 (diff)
massive code cleaning due to numerous name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@15036 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FTPFileYM/src/job_delete.cpp')
-rw-r--r--plugins/FTPFileYM/src/job_delete.cpp66
1 files changed, 32 insertions, 34 deletions
diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp
index 7ba1f76b30..19d6aff7ad 100644
--- a/plugins/FTPFileYM/src/job_delete.cpp
+++ b/plugins/FTPFileYM/src/job_delete.cpp
@@ -26,24 +26,25 @@ int DeleteJob::iRunningJobCount = 0;
extern ServerList &ftpList;
extern Manager *manDlg;
-DeleteJob::DeleteJob(DBEntry *_entry, Manager::TreeItem *_item)
-:entry(_entry),treeItem(_item),ftp(ftpList[entry->iFtpNum])
-{ }
+DeleteJob::DeleteJob(DBEntry *entry, Manager::TreeItem *item) :
+ m_entry(entry),
+ m_treeItem(item),
+ m_ftp(ftpList[m_entry->m_iFtpNum])
+{
+}
DeleteJob::~DeleteJob()
{
- delete this->entry;
+ delete m_entry;
}
-void DeleteJob::waitingThread(void *arg)
+void DeleteJob::waitingThread(void *arg)
{
DeleteJob *job = (DeleteJob *)arg;
- while(!Miranda_Terminated())
- {
+ while (!Miranda_Terminated()) {
mir_cslockfull lock(mutexJobCount);
- if (iRunningJobCount < MAX_RUNNING_JOBS)
- {
+ if (iRunningJobCount < MAX_RUNNING_JOBS) {
iRunningJobCount++;
lock.unlock();
job->run();
@@ -74,50 +75,47 @@ void DeleteJob::run()
char szError[1024];
CURL *hCurl = curl_easy_init();
- if (hCurl)
- {
+ if (hCurl) {
struct curl_slist *headerList = NULL;
headerList = curl_slist_append(headerList, getDelFileString());
- Utils::curlSetOpt(hCurl, this->ftp, getDelUrlString(), headerList, szError);
+ Utils::curlSetOpt(hCurl, m_ftp, getDelUrlString(), headerList, szError);
int result = curl_easy_perform(hCurl);
- if (result == CURLE_OK)
- {
- if (manDlg != NULL && this->treeItem)
- this->treeItem->remove();
+ if (result == CURLE_OK) {
+ if (manDlg != NULL && m_treeItem)
+ m_treeItem->remove();
else
- DBEntry::remove(entry->fileID);
+ DBEntry::remove(m_entry->m_fileID);
}
- else if (manDlg != NULL && this->treeItem)
- {
+ else if (manDlg != NULL && m_treeItem) {
TCHAR *error = mir_a2t(szError);
- mir_tstrcpy(this->treeItem->stzToolTip, error);
- this->treeItem->setState(Manager::TreeItem::_ERROR());
+ mir_tstrcpy(m_treeItem->m_tszToolTip, error);
+ m_treeItem->setState(Manager::TreeItem::_ERROR());
FREE(error);
- }
+ }
curl_slist_free_all(headerList);
curl_easy_cleanup(hCurl);
}
}
-char *DeleteJob::getDelFileString()
+char* DeleteJob::getDelFileString()
{
- if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, "rm \"%s/%s\"", ftp->szDir, entry->szFileName);
+ if (m_ftp->m_ftpProto == ServerList::FTP::FT_SSH)
+ mir_snprintf(m_buff, "rm \"%s/%s\"", m_ftp->m_szDir, m_entry->m_szFileName);
else
- mir_snprintf(buff, "DELE %s", entry->szFileName);
+ mir_snprintf(m_buff, "DELE %s", m_entry->m_szFileName);
- return buff;
+ return m_buff;
}
-char *DeleteJob::getDelUrlString()
-{
- if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH)
- mir_snprintf(buff, "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
+char* DeleteJob::getDelUrlString()
+{
+ if (m_ftp->m_szDir[0] && m_ftp->m_ftpProto != ServerList::FTP::FT_SSH)
+ mir_snprintf(m_buff, "%s%s/%s/", m_ftp->getProtoString(), m_ftp->m_szServer, m_ftp->m_szDir);
else
- mir_snprintf(buff, "%s%s/", ftp->getProtoString(), ftp->szServer);
+ mir_snprintf(m_buff, "%s%s/", m_ftp->getProtoString(), m_ftp->m_szServer);
- return buff;
-} \ No newline at end of file
+ return m_buff;
+}