diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 19:17:32 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 19:17:32 +0000 |
commit | e38d2351b83fa65c66ccde443777647ef5cb6cff (patch) | |
tree | 1897fc20e9f73a81c520a5b9f76f8ed042124883 /src/fetch/fetcher.cpp | |
download | tellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.tar.gz tellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.zip |
Added KDE3 version of Tellico
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1097620 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/fetch/fetcher.cpp')
-rw-r--r-- | src/fetch/fetcher.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/fetch/fetcher.cpp b/src/fetch/fetcher.cpp new file mode 100644 index 0000000..3bc7749 --- /dev/null +++ b/src/fetch/fetcher.cpp @@ -0,0 +1,61 @@ +/*************************************************************************** + copyright : (C) 2005-2006 by Robby Stephenson + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of version 2 of the GNU General Public License as * + * published by the Free Software Foundation; * + * * + ***************************************************************************/ + +#include "fetcher.h" +#include "messagehandler.h" +#include "../entry.h" + +#include <kglobal.h> +#include <kconfig.h> + +using Tellico::Fetch::Fetcher; +using Tellico::Fetch::SearchResult; + +Fetcher::~Fetcher() { + KConfigGroup config(KGlobal::config(), m_configGroup); + saveConfigHook(config); +} + +void Fetcher::readConfig(const KConfigGroup& config_, const QString& groupName_) { + m_configGroup = groupName_; + + QString s = config_.readEntry("Name"); + if(!s.isEmpty()) { + m_name = s; + } + m_updateOverwrite = config_.readBoolEntry("UpdateOverwrite", false); + // be sure to read config for subclass + readConfigHook(config_); +} + +void Fetcher::message(const QString& message_, int type_) const { + if(m_messager) { + m_messager->send(message_, static_cast<MessageHandler::Type>(type_)); + } +} + +void Fetcher::infoList(const QString& message_, const QStringList& list_) const { + if(m_messager) { + m_messager->infoList(message_, list_); + } +} + +void Fetcher::updateEntry(Data::EntryPtr) { + emit signalDone(this); +} + +Tellico::Data::EntryPtr SearchResult::fetchEntry() { + return fetcher->fetchEntry(uid); +} + +#include "fetcher.moc" |