diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /akregator/src/folder.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'akregator/src/folder.cpp')
-rw-r--r-- | akregator/src/folder.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/akregator/src/folder.cpp b/akregator/src/folder.cpp index fac9bd2e7..78612ec79 100644 --- a/akregator/src/folder.cpp +++ b/akregator/src/folder.cpp @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program - with any edition of Qt, and distribute the resulting executable, - without including the source code for Qt in the source distribution. + with any edition of TQt, and distribute the resulting executable, + without including the source code for TQt in the source distribution. */ #include "article.h" #include "folder.h" @@ -39,9 +39,9 @@ namespace Akregator { class Folder::FolderPrivate { public: - /** List of children */ - TQValueList<TreeNode*> children; - /** caching unread count of children */ + /** List of tqchildren */ + TQValueList<TreeNode*> tqchildren; + /** caching unread count of tqchildren */ int unread; /** whether or not the folder is expanded */ bool open; @@ -77,7 +77,7 @@ Folder::Folder(const TQString& title) : TreeNode(), d(new FolderPrivate) Folder::~Folder() { TreeNode* tmp = 0; - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != d->children.end(); ++it) + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != d->tqchildren.end(); ++it) { delete tmp; tmp = *it; @@ -93,10 +93,10 @@ Folder::~Folder() TQStringList Folder::tags() const { TQStringList t; - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) { - // intersect tag sets instead of appending lists, to avoid dupes. This sucks. Definitely. I want QSet. Now. + // intersect tag sets instead of appending lists, to avoid dupes. This sucks. Definitely. I want TQSet. Now. TQStringList t2 = (*it)->tags(); for (TQStringList::ConstIterator it2 = t2.begin(); it2 != t2.end(); ++it2) if (!t.tqcontains(*it2)) @@ -108,36 +108,36 @@ TQStringList Folder::tags() const TQValueList<Article> Folder::articles(const TQString& tag) { TQValueList<Article> seq; - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) seq += (*it)->articles(tag); return seq; } -TQDomElement Folder::toOPML( TQDomElement parent, TQDomDocument document ) const +TQDomElement Folder::toOPML( TQDomElement tqparent, TQDomDocument document ) const { TQDomElement el = document.createElement( "outline" ); el.setAttribute( "text", title() ); - parent.appendChild( el ); + tqparent.appendChild( el ); el.setAttribute("isOpen", d->open ? "true" : "false"); el.setAttribute( "id", TQString::number(id()) ); - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) el.appendChild( (*it)->toOPML(el, document) ); return el; } -TQValueList<TreeNode*> Folder::children() const +TQValueList<TreeNode*> Folder::tqchildren() const { - return d->children; + return d->tqchildren; } void Folder::insertChild(TreeNode* node, TreeNode* after) { - int pos = d->children.findIndex(after); + int pos = d->tqchildren.findIndex(after); if (pos < 0) prependChild(node); @@ -150,10 +150,10 @@ void Folder::insertChild(uint index, TreeNode* node) // kdDebug() << "enter Folder::insertChild(int, node) " << node->title() << endl; if (node) { - if (index >= d->children.size()) - d->children.append(node); + if (index >= d->tqchildren.size()) + d->tqchildren.append(node); else - d->children.insert(d->children.at(index), node); + d->tqchildren.insert(d->tqchildren.at(index), node); node->setParent(this); connectToNode(node); updateUnreadCount(); @@ -170,7 +170,7 @@ void Folder::appendChild(TreeNode* node) // kdDebug() << "enter Folder::appendChild() " << node->title() << endl; if (node) { - d->children.append(node); + d->tqchildren.append(node); node->setParent(this); connectToNode(node); updateUnreadCount(); @@ -187,7 +187,7 @@ void Folder::prependChild(TreeNode* node) // kdDebug() << "enter Folder::prependChild() " << node->title() << endl; if (node) { - d->children.prepend(node); + d->tqchildren.prepend(node); node->setParent(this); connectToNode(node); updateUnreadCount(); @@ -202,10 +202,10 @@ void Folder::prependChild(TreeNode* node) void Folder::removeChild(TreeNode* node) { // kdDebug() << "enter Folder::removeChild() node:" << (node ? node->title() : "null") << endl; - if (node && d->children.tqcontains(node)) + if (node && d->tqchildren.tqcontains(node)) { node->setParent(0); - d->children.remove(node); + d->tqchildren.remove(node); disconnectFromNode(node); updateUnreadCount(); emit signalChildRemoved(this, node); @@ -219,12 +219,12 @@ void Folder::removeChild(TreeNode* node) TreeNode* Folder::firstChild() { - return d->children.isEmpty() ? 0 : d->children.first(); + return d->tqchildren.isEmpty() ? 0 : d->tqchildren.first(); } TreeNode* Folder::lastChild() { - return d->children.isEmpty() ? 0 : d->children.last(); + return d->tqchildren.isEmpty() ? 0 : d->tqchildren.last(); } bool Folder::isOpen() const @@ -246,8 +246,8 @@ int Folder::totalCount() const { int totalCount = 0; - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) totalCount += (*it)->totalCount(); return totalCount; @@ -257,8 +257,8 @@ void Folder::updateUnreadCount() { int unread = 0; - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) unread += (*it)->unread(); d->unread = unread; @@ -267,8 +267,8 @@ void Folder::updateUnreadCount() void Folder::slotMarkAllArticlesAsRead() { setNotificationMode(false); - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) (*it)->slotMarkAllArticlesAsRead(); setNotificationMode(true, true); } @@ -281,7 +281,7 @@ void Folder::slotChildChanged(TreeNode* /*node*/) void Folder::slotChildDestroyed(TreeNode* node) { - d->children.remove(node); + d->tqchildren.remove(node); updateUnreadCount(); nodeModified(); } @@ -289,16 +289,16 @@ void Folder::slotChildDestroyed(TreeNode* node) void Folder::slotDeleteExpiredArticles() { setNotificationMode(false); - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) (*it)->slotDeleteExpiredArticles(); setNotificationMode(true, true); } void Folder::slotAddToFetchQueue(FetchQueue* queue, bool intervalFetchOnly) { - TQValueList<TreeNode*>::ConstIterator en = d->children.end(); - for (TQValueList<TreeNode*>::ConstIterator it = d->children.begin(); it != en; ++it) + TQValueList<TreeNode*>::ConstIterator en = d->tqchildren.end(); + for (TQValueList<TreeNode*>::ConstIterator it = d->tqchildren.begin(); it != en; ++it) (*it)->slotAddToFetchQueue(queue, intervalFetchOnly); } @@ -332,13 +332,13 @@ TreeNode* Folder::next() if ( nextSibling() ) return nextSibling(); - Folder* p = parent(); + Folder* p = tqparent(); while (p) { if ( p->nextSibling() ) return p->nextSibling(); else - p = p->parent(); + p = p->tqparent(); } return 0; } |