From 552c229a10b0b5e0584450f6f78eb438661e0478 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 13 Dec 2009 23:40:48 +0200 Subject: [PATCH] mainwnd: use new Util class functions for list manipulation. --- src/mainwnd.cpp | 49 ++++--------------------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/src/mainwnd.cpp b/src/mainwnd.cpp index b6e9334..e431b9a 100644 --- a/src/mainwnd.cpp +++ b/src/mainwnd.cpp @@ -546,13 +546,7 @@ MainWindow::onScan() { void MainWindow::onPasteURL() { - - QClipboard *cb = QApplication::clipboard(); - QStringList lst = cb->text().split("\n"); - const register _uint size = lst.size(); - - for (register _uint i=0; i sel = linksList->selectedItems(); - - if (sel.size() == 0) - return; - - if (QMessageBox::warning(this, QCoreApplication::applicationName(), - tr("Really remove the selected links?"), - QMessageBox::Yes|QMessageBox::No, QMessageBox::No) - == QMessageBox::No) - { - return; - } - - const register _uint size = sel.size(); - - for (register _uint i=0; irow(sel[i]); - delete linksList->takeItem(row); - } + Util::removeSelectedItems(this, linksList); } void MainWindow::onClear() { - - if (linksList->count() == 0) - return; - - if (QMessageBox::warning(this, QCoreApplication::applicationName(), - tr("Really clear list?"), - QMessageBox::Yes|QMessageBox::No, QMessageBox::No) - == QMessageBox::No) - { - return; - } - - linksList->clear(); + Util::clearItems(this, linksList); } void @@ -619,11 +582,7 @@ MainWindow::addPageLink(QString lnk) { return; } - QList found - = linksList->findItems(lnk, Qt::MatchExactly); - - if (found.size() == 0) - linksList->addItem(lnk); + Util::addItem(linksList, lnk); } void -- 2.11.4.GIT