summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src/ExportImport.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-08-01 13:27:40 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-08-01 13:27:40 +0000
commitf8525a5432212fd0e6593bb632743832550f3463 (patch)
treec768303e672337c5e49d7486b30e32f9a68ef395 /plugins/NewsAggregator/Src/ExportImport.cpp
parent41872c8fb1e0130a80830b9013e42579ba29593f (diff)
don't import duplicates
git-svn-id: http://svn.miranda-ng.org/main/trunk@5547 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src/ExportImport.cpp')
-rw-r--r--plugins/NewsAggregator/Src/ExportImport.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp
index 39ed12e99f..13ecd075aa 100644
--- a/plugins/NewsAggregator/Src/ExportImport.cpp
+++ b/plugins/NewsAggregator/Src/ExportImport.cpp
@@ -50,6 +50,8 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
HXML node = xi.getChildByPath(hXml, _T("opml/body/outline"), 0);
if ( !node)
node = xi.getChildByPath(hXml, _T("body/outline"), 0);
+ int count = SendMessage(FeedsImportList, LB_GETCOUNT, 0, 0);
+ int DUPES = 0;
if (node) {
while (node) {
int outlineAttr = xi.getAttrCount(node);
@@ -83,7 +85,6 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
} else
isTitleUTF = 1;
- int count = SendMessage(FeedsImportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
TCHAR item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, i, (LPARAM)item);
@@ -101,6 +102,10 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
url = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i));
} else
isURLUTF = 1;
+ if (GetContactByURL(url) && NeedToImport) {
+ NeedToImport = FALSE;
+ DUPES += 1;
+ }
continue;
}
if (!lstrcmpi(xi.getAttrName(node, i), _T("htmlUrl"))) {
@@ -201,6 +206,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
DeleteAllItems(hwndList);
UpdateList(hwndList);
}
+ TCHAR mes[MAX_PATH];
+ if (DUPES)
+ mir_sntprintf(mes, SIZEOF(mes), TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
+ else
+ mir_sntprintf(mes, SIZEOF(mes), TranslateT("Imported %d feed(s)."), count);
+ MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
}
}