diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-07-24 12:45:18 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-07-24 12:45:18 +0000 |
commit | 0cda0baab21d4d4bf40c9459f6f5a7e49aa92492 (patch) | |
tree | c1244d2f42e6d1728a81a18bd0fbd091904bf20c /plugins/YAPP/popup_history.cpp | |
parent | 171e81205e357e0d54283a63997ed58ff97d54a9 (diff) |
VersionInfo, W7UI, WhoUsesMyFiles, YAPP, ZeroNotification: changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1161 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAPP/popup_history.cpp')
-rw-r--r-- | plugins/YAPP/popup_history.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/plugins/YAPP/popup_history.cpp b/plugins/YAPP/popup_history.cpp deleted file mode 100644 index db0c53fa3a..0000000000 --- a/plugins/YAPP/popup_history.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "common.h" -#include "popup_history.h" - -PopupHistoryList::PopupHistoryList(int renderer) -{ - this->renderer = renderer; - size = HISTORY_SIZE; //fixed size (at least for now) - historyData = (PopupHistoryData *) malloc(size * sizeof(PopupHistoryData)); //alloc space for data - count = 0; -} - -PopupHistoryList::~PopupHistoryList() -{ - Clear(); //clear the data strings - free(historyData); //deallocate the data list -} - -void PopupHistoryList::Clear() -{ - int i; - for (i = 0; i < count; i++) - { - DeleteData(i); - } - count = 0; -} - -void PopupHistoryList::RemoveItem(int index) -{ - int i; - DeleteData(index); //free the mem for that particular item - for (i = index + 1; i < count; i++) - { - historyData[i - 1] = historyData[i]; //shift all items to the left - } -} - -void PopupHistoryList::DeleteData(int index) -{ - PopupHistoryData *item = &historyData[index]; - mir_free(item->titleT); - mir_free(item->messageT); - item->timestamp = 0; //invalidate item - item->title = NULL; - item->message = NULL; - item->flags = 0; -} - -void PopupHistoryList::AddItem(PopupHistoryData item) -{ - if (count >= size) - { - RemoveItem(0); //remove first element - the oldest - count--; //it will be inc'ed later - } - historyData[count++] = item; //item has it's relevant strings dupped() - RefreshPopupHistory(hHistoryWindow, GetRenderer()); -} - -void PopupHistoryList::Add(char *title, char *message, time_t timestamp) -{ - PopupHistoryData item = {0}; //create a history item - item.timestamp = timestamp; - item.title = mir_strdup(title); - item.message = mir_strdup(message); - AddItem(item); //add it (flags = 0) -} - -void PopupHistoryList::Add(wchar_t *title, wchar_t *message, time_t timestamp) -{ - PopupHistoryData item = {0}; //create an unicode history item - item.flags = PHDF_UNICODE; //mark it as unicode - item.timestamp = timestamp; - item.titleT = mir_u2t(title); - item.messageT = mir_u2t(message); - AddItem(item); //add it -} - -PopupHistoryData *PopupHistoryList::Get(int index) -{ - if ((index < 0) || (index >= count)) //a bit of sanity check - { - return NULL; - } - - return &historyData[index]; -} |