Browse Source

- RSS feed parent was not updated after being moved to another folder

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
725700420c
  1. 4
      src/rss.cpp
  2. 9
      src/rss.h

4
src/rss.cpp

@ -317,6 +317,8 @@ void RssFolder::addFile(RssFile * item) { @@ -317,6 +317,8 @@ void RssFolder::addFile(RssFile * item) {
(*this)[((RssFolder*)item)->getName()] = item;
qDebug("Added folder %s to folder ./%s", ((RssFolder*)item)->getName().toLocal8Bit().data(), name.toLocal8Bit().data());
}
// Update parent
item->setParent(this);
}
/** RssManager **/
@ -371,7 +373,9 @@ void RssManager::moveFile(QStringList old_path, QStringList new_path) { @@ -371,7 +373,9 @@ void RssManager::moveFile(QStringList old_path, QStringList new_path) {
QString new_name = new_path.takeLast();
RssFolder* dest_folder = (RssFolder*)getFile(new_path);
if(dest_folder != src_folder) {
// Copy to new Folder
dest_folder->addFile(item);
// Remove reference in old folder
src_folder->removeFileRef(item);
} else {
qDebug("Nothing to move, same destination folder");

9
src/rss.h

@ -91,7 +91,8 @@ public: @@ -91,7 +91,8 @@ public:
virtual QString getName() const = 0;
virtual void rename(QStringList path, QString new_name) = 0;
virtual void markAllAsRead() = 0;
virtual RssFolder* getParent() = 0;
virtual RssFolder* getParent() const = 0;
virtual void setParent(RssFolder*) = 0;
};
// Item of a rss stream, single information
@ -389,7 +390,8 @@ public slots: @@ -389,7 +390,8 @@ public slots:
public:
RssStream(RssFolder* parent, RssManager *rssmanager, bittorrent *BTSession, QString _url);
~RssStream();
RssFolder* getParent() { return parent; }
RssFolder* getParent() const { return parent; }
void setParent(RssFolder* _parent) { parent = _parent; }
FileType getType() const;
void refresh();
QStringList getPath() const;
@ -436,7 +438,8 @@ private: @@ -436,7 +438,8 @@ private:
public:
RssFolder(RssFolder *parent, RssManager *rssmanager, bittorrent *BTSession, QString name);
~RssFolder();
RssFolder* getParent() { return parent; }
RssFolder* getParent() const { return parent; }
void setParent(RssFolder* _parent) { parent = _parent; }
unsigned int getNbUnRead() const;
FileType getType() const;
RssStream* addStream(QStringList full_path);

Loading…
Cancel
Save