|
|
@ -48,7 +48,8 @@ RssManager::RssManager(): |
|
|
|
m_refreshTimer.start(m_refreshInterval*60000); |
|
|
|
m_refreshTimer.start(m_refreshInterval*60000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RssManager::~RssManager() { |
|
|
|
RssManager::~RssManager() |
|
|
|
|
|
|
|
{ |
|
|
|
qDebug("Deleting RSSManager..."); |
|
|
|
qDebug("Deleting RSSManager..."); |
|
|
|
delete m_downloadRules; |
|
|
|
delete m_downloadRules; |
|
|
|
delete m_rssParser; |
|
|
|
delete m_rssParser; |
|
|
@ -67,7 +68,8 @@ RssParser* RssManager::rssParser() const |
|
|
|
return m_rssParser; |
|
|
|
return m_rssParser; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RssManager::updateRefreshInterval(uint val) { |
|
|
|
void RssManager::updateRefreshInterval(uint val) |
|
|
|
|
|
|
|
{ |
|
|
|
if (m_refreshInterval != val) { |
|
|
|
if (m_refreshInterval != val) { |
|
|
|
m_refreshInterval = val; |
|
|
|
m_refreshInterval = val; |
|
|
|
m_refreshTimer.start(m_refreshInterval*60000); |
|
|
|
m_refreshTimer.start(m_refreshInterval*60000); |
|
|
@ -75,7 +77,8 @@ void RssManager::updateRefreshInterval(uint val) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RssManager::loadStreamList() { |
|
|
|
void RssManager::loadStreamList() |
|
|
|
|
|
|
|
{ |
|
|
|
RssSettings settings; |
|
|
|
RssSettings settings; |
|
|
|
const QStringList streamsUrl = settings.getRssFeedsUrls(); |
|
|
|
const QStringList streamsUrl = settings.getRssFeedsUrls(); |
|
|
|
const QStringList aliases = settings.getRssFeedsAliases(); |
|
|
|
const QStringList aliases = settings.getRssFeedsAliases(); |
|
|
@ -113,35 +116,38 @@ void RssManager::forwardFeedContentChanged(const QString& url) |
|
|
|
emit feedContentChanged(url); |
|
|
|
emit feedContentChanged(url); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RssManager::forwardFeedInfosChanged(const QString &url, const QString &display_name, uint nbUnread) { |
|
|
|
void RssManager::forwardFeedInfosChanged(const QString& url, const QString& displayName, uint unreadCount) |
|
|
|
emit feedInfosChanged(url, display_name, nbUnread); |
|
|
|
{ |
|
|
|
|
|
|
|
emit feedInfosChanged(url, displayName, unreadCount); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RssManager::forwardFeedIconChanged(const QString &url, const QString &icon_path) { |
|
|
|
void RssManager::forwardFeedIconChanged(const QString& url, const QString& iconPath) |
|
|
|
emit feedIconChanged(url, icon_path); |
|
|
|
{ |
|
|
|
|
|
|
|
emit feedIconChanged(url, iconPath); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RssManager::moveFile(const RssFilePtr& file, const RssFolderPtr& dest_folder) { |
|
|
|
void RssManager::moveFile(const RssFilePtr& file, const RssFolderPtr& destinationFolder) |
|
|
|
|
|
|
|
{ |
|
|
|
RssFolder* src_folder = file->parent(); |
|
|
|
RssFolder* src_folder = file->parent(); |
|
|
|
if (dest_folder != src_folder) { |
|
|
|
if (destinationFolder != src_folder) { |
|
|
|
// Remove reference in old folder
|
|
|
|
// Remove reference in old folder
|
|
|
|
src_folder->takeChild(file->id()); |
|
|
|
src_folder->takeChild(file->id()); |
|
|
|
// add to new Folder
|
|
|
|
// add to new Folder
|
|
|
|
dest_folder->addFile(file); |
|
|
|
destinationFolder->addFile(file); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
qDebug("Nothing to move, same destination folder"); |
|
|
|
qDebug("Nothing to move, same destination folder"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RssManager::saveStreamList() const { |
|
|
|
void RssManager::saveStreamList() const |
|
|
|
|
|
|
|
{ |
|
|
|
QStringList streamsUrl; |
|
|
|
QStringList streamsUrl; |
|
|
|
QStringList aliases; |
|
|
|
QStringList aliases; |
|
|
|
RssFeedList streams = getAllFeeds(); |
|
|
|
RssFeedList streams = getAllFeeds(); |
|
|
|
foreach (const RssFeedPtr& stream, streams) { |
|
|
|
foreach (const RssFeedPtr& stream, streams) { |
|
|
|
QString stream_path = stream->pathHierarchy().join("\\"); |
|
|
|
QString stream_path = stream->pathHierarchy().join("\\"); |
|
|
|
if (stream_path.isNull()) { |
|
|
|
if (stream_path.isNull()) |
|
|
|
stream_path = ""; |
|
|
|
stream_path = ""; |
|
|
|
} |
|
|
|
|
|
|
|
qDebug("Saving stream path: %s", qPrintable(stream_path)); |
|
|
|
qDebug("Saving stream path: %s", qPrintable(stream_path)); |
|
|
|
streamsUrl << stream_path; |
|
|
|
streamsUrl << stream_path; |
|
|
|
aliases << stream->displayName(); |
|
|
|
aliases << stream->displayName(); |
|
|
@ -151,7 +157,7 @@ void RssManager::saveStreamList() const { |
|
|
|
settings.setRssFeedsAliases(aliases); |
|
|
|
settings.setRssFeedsAliases(aliases); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RssDownloadRuleList *RssManager::downloadRules() const |
|
|
|
RssDownloadRuleList* RssManager::downloadRules() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_ASSERT(m_downloadRules); |
|
|
|
Q_ASSERT(m_downloadRules); |
|
|
|
return m_downloadRules; |
|
|
|
return m_downloadRules; |
|
|
|