summaryrefslogtreecommitdiffstats
path: root/src/entryupdater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/entryupdater.cpp')
-rw-r--r--src/entryupdater.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/entryupdater.cpp b/src/entryupdater.cpp
index 5c3ba2d..f95ad11 100644
--- a/src/entryupdater.cpp
+++ b/src/entryupdater.cpp
@@ -26,8 +26,8 @@
#include <klistview.h>
#include <kiconloader.h>
-#include <qvbox.h>
-#include <qtimer.h>
+#include <tqvbox.h>
+#include <tqtimer.h>
namespace {
static const int CHECK_COLLECTION_IMAGES_STEP_SIZE = 10;
@@ -37,21 +37,21 @@ using Tellico::EntryUpdater;
// for each entry, we loop over all available fetchers
// then we loop over all entries
-EntryUpdater::EntryUpdater(Data::CollPtr coll_, Data::EntryVec entries_, QObject* parent_)
- : QObject(parent_), m_coll(coll_), m_entriesToUpdate(entries_), m_cancelled(false) {
+EntryUpdater::EntryUpdater(Data::CollPtr coll_, Data::EntryVec entries_, TQObject* tqparent_)
+ : TQObject(tqparent_), m_coll(coll_), m_entriesToUpdate(entries_), m_cancelled(false) {
// for now, we're assuming all entries are same collection type
m_fetchers = Fetch::Manager::self()->createUpdateFetchers(m_coll->type());
for(Fetch::FetcherVec::Iterator it = m_fetchers.begin(); it != m_fetchers.end(); ++it) {
- connect(it.data(), SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SLOT(slotResult(Tellico::Fetch::SearchResult*)));
- connect(it.data(), SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
- SLOT(slotDone()));
+ connect(it.data(), TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SLOT(slotResult(Tellico::Fetch::SearchResult*)));
+ connect(it.data(), TQT_SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
+ TQT_SLOT(slotDone()));
}
init();
}
-EntryUpdater::EntryUpdater(const QString& source_, Data::CollPtr coll_, Data::EntryVec entries_, QObject* parent_)
- : QObject(parent_)
+EntryUpdater::EntryUpdater(const TQString& source_, Data::CollPtr coll_, Data::EntryVec entries_, TQObject* tqparent_)
+ : TQObject(tqparent_)
, m_coll(coll_)
, m_entriesToUpdate(entries_)
, m_cancelled(false) {
@@ -59,10 +59,10 @@ EntryUpdater::EntryUpdater(const QString& source_, Data::CollPtr coll_, Data::En
Fetch::Fetcher::Ptr f = Fetch::Manager::self()->createUpdateFetcher(m_coll->type(), source_);
if(f) {
m_fetchers.append(f);
- connect(f, SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SLOT(slotResult(Tellico::Fetch::SearchResult*)));
- connect(f, SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
- SLOT(slotDone()));
+ connect(f, TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SLOT(slotResult(Tellico::Fetch::SearchResult*)));
+ connect(f, TQT_SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
+ TQT_SLOT(slotDone()));
}
init();
}
@@ -76,27 +76,27 @@ EntryUpdater::~EntryUpdater() {
void EntryUpdater::init() {
m_fetchIndex = 0;
m_origEntryCount = m_entriesToUpdate.count();
- QString label;
+ TQString label;
if(m_entriesToUpdate.count() == 1) {
- label = i18n("Updating %1...").arg(m_entriesToUpdate.front()->title());
+ label = i18n("Updating %1...").tqarg(m_entriesToUpdate.front()->title());
} else {
label = i18n("Updating entries...");
}
Kernel::self()->beginCommandGroup(i18n("Update Entries"));
ProgressItem& item = ProgressManager::self()->newProgressItem(this, label, true /*canCancel*/);
item.setTotalSteps(m_fetchers.count() * m_origEntryCount);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
// done if no fetchers available
if(m_fetchers.isEmpty()) {
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
} else {
slotStartNext(); // starts fetching
}
}
void EntryUpdater::slotStartNext() {
- StatusBar::self()->setStatus(i18n("Updating <b>%1</b>...").arg(m_entriesToUpdate.front()->title()));
+ StatusBar::self()->settqStatus(i18n("Updating <b>%1</b>...").tqarg(m_entriesToUpdate.front()->title()));
ProgressManager::self()->setProgress(this, m_fetchers.count() * (m_origEntryCount - m_entriesToUpdate.count()) + m_fetchIndex);
Fetch::Fetcher::Ptr f = m_fetchers[m_fetchIndex];
@@ -107,7 +107,7 @@ void EntryUpdater::slotStartNext() {
void EntryUpdater::slotDone() {
if(m_cancelled) {
myLog() << "EntryUpdater::slotDone() - cancelled" << endl;
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
return;
}
@@ -125,13 +125,13 @@ void EntryUpdater::slotDone() {
m_entriesToUpdate.remove(m_entriesToUpdate.begin());
// if there are no more entries, and this is the last fetcher, time to delete
if(m_entriesToUpdate.isEmpty()) {
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
return;
}
}
kapp->processEvents();
// so the entry updater can clean up a bit
- QTimer::singleShot(500, this, SLOT(slotStartNext()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotStartNext()));
}
void EntryUpdater::slotResult(Fetch::SearchResult* result_) {
@@ -207,34 +207,34 @@ void EntryUpdater::handleResults() {
Tellico::EntryUpdater::UpdateResult EntryUpdater::askUser(ResultList results) {
KDialogBase dlg(Kernel::self()->widget(), "entry updater dialog",
true, i18n("Select Match"), KDialogBase::Ok|KDialogBase::Cancel);
- QVBox* box = new QVBox(&dlg);
+ TQVBox* box = new TQVBox(&dlg);
box->setSpacing(10);
- QHBox* hbox = new QHBox(box);
+ TQHBox* hbox = new TQHBox(box);
hbox->setSpacing(10);
- QLabel* icon = new QLabel(hbox);
- icon->setPixmap(KGlobal::iconLoader()->loadIcon(QString::fromLatin1("network"), KIcon::Panel, 64));
- QString s = i18n("<qt><b>%1</b> returned multiple results which could match <b>%2</b>, "
+ TQLabel* icon = new TQLabel(hbox);
+ icon->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("network"), KIcon::Panel, 64));
+ TQString s = i18n("<qt><b>%1</b> returned multiple results which could match <b>%2</b>, "
"the entry currently in the collection. Please select the correct match.</qt>")
- .arg(m_fetchers[m_fetchIndex]->source())
- .arg(m_entriesToUpdate.front()->field(QString::fromLatin1("title")));
+ .tqarg(m_fetchers[m_fetchIndex]->source())
+ .tqarg(m_entriesToUpdate.front()->field(TQString::tqfromLatin1("title")));
GUI::RichTextLabel* l = new GUI::RichTextLabel(s, hbox);
hbox->setStretchFactor(l, 100);
KListView* view = new KListView(box);
view->setShowSortIndicator(true);
view->setAllColumnsShowFocus(true);
- view->setResizeMode(QListView::AllColumns);
+ view->setResizeMode(TQListView::AllColumns);
view->setMinimumWidth(640);
view->addColumn(i18n("Title"));
view->addColumn(i18n("Description"));
- QMap<KListViewItem*, UpdateResult> map;
+ TQMap<KListViewItem*, UpdateResult> map;
for(ResultList::Iterator res = results.begin(); res != results.end(); ++res) {
map.insert(new KListViewItem(view, (*res).first->fetchEntry()->title(), (*res).first->desc), *res);
}
dlg.setMainWidget(box);
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return UpdateResult(0, false);
}
KListViewItem* item = static_cast<KListViewItem*>(view->selectedItem());
@@ -264,7 +264,7 @@ void EntryUpdater::mergeCurrent(Data::EntryPtr entry_, bool overWrite_) {
}
void EntryUpdater::slotCleanup() {
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
ProgressManager::self()->setDone(this);
Kernel::self()->endCommandGroup();
deleteLater();