diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /knode/kngroupmanager.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/kngroupmanager.cpp')
-rw-r--r-- | knode/kngroupmanager.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/knode/kngroupmanager.cpp b/knode/kngroupmanager.cpp index 584896091..429b93bc5 100644 --- a/knode/kngroupmanager.cpp +++ b/knode/kngroupmanager.cpp @@ -14,7 +14,7 @@ #include <stdio.h> #include <stdlib.h> -#include <qdir.h> +#include <tqdir.h> #include <klocale.h> #include <kmessagebox.h> @@ -51,7 +51,7 @@ KNGroupInfo::KNGroupInfo() } -KNGroupInfo::KNGroupInfo(const QString &n_ame, const QString &d_escription, bool n_ewGroup, bool s_ubscribed, KNGroup::Status s_tatus) +KNGroupInfo::KNGroupInfo(const TQString &n_ame, const TQString &d_escription, bool n_ewGroup, bool s_ubscribed, KNGroup::Status s_tatus) : name(n_ame), description(d_escription), newGroup(n_ewGroup), subscribed(s_ubscribed), status(s_tatus) { @@ -81,7 +81,7 @@ bool KNGroupInfo::operator< (const KNGroupInfo &gi2) KNGroupListData::KNGroupListData() : codecForDescriptions(0) { - groups = new QSortedList<KNGroupInfo>; + groups = new TQSortedList<KNGroupInfo>; groups->setAutoDelete(true); } @@ -97,12 +97,12 @@ KNGroupListData::~KNGroupListData() bool KNGroupListData::readIn(KNProtocolClient *client) { KNFile f(path+"groups"); - QCString line; + TQCString line; int sepPos1,sepPos2; - QString name,description; + TQString name,description; bool sub; KNGroup::Status status=KNGroup::unknown; - QTime timer; + TQTime timer; uint size=f.size()+2; timer.start(); @@ -114,18 +114,18 @@ bool KNGroupListData::readIn(KNProtocolClient *client) sepPos1 = line.find(' '); if (sepPos1==-1) { // no description - name = QString::fromUtf8(line); - description = QString::null; + name = TQString::fromUtf8(line); + description = TQString::null; status = KNGroup::unknown; } else { - name = QString::fromUtf8(line.left(sepPos1)); + name = TQString::fromUtf8(line.left(sepPos1)); sepPos2 = line.find(' ',sepPos1+1); if (sepPos2==-1) { // no status - description = QString::fromUtf8(line.right(line.length()-sepPos1-1)); + description = TQString::fromUtf8(line.right(line.length()-sepPos1-1)); status = KNGroup::unknown; } else { - description = QString::fromUtf8(line.right(line.length()-sepPos2-1)); + description = TQString::fromUtf8(line.right(line.length()-sepPos2-1)); switch (line[sepPos1+1]) { case 'u': status = KNGroup::unknown; break; @@ -165,8 +165,8 @@ bool KNGroupListData::readIn(KNProtocolClient *client) bool KNGroupListData::writeOut() { - QFile f(path+"groups"); - QCString temp; + TQFile f(path+"groups"); + TQCString temp; if(f.open(IO_WriteOnly)) { for (KNGroupInfo *i=groups->first(); i; i=groups->next()) { @@ -196,7 +196,7 @@ bool KNGroupListData::writeOut() // merge in new groups, we want to preserve the "subscribed"-flag // of the loaded groups and the "new"-flag of the new groups. -void KNGroupListData::merge(QSortedList<KNGroupInfo>* newGroups) +void KNGroupListData::merge(TQSortedList<KNGroupInfo>* newGroups) { bool subscribed; @@ -213,9 +213,9 @@ void KNGroupListData::merge(QSortedList<KNGroupInfo>* newGroups) } -QSortedList<KNGroupInfo>* KNGroupListData::extractList() +TQSortedList<KNGroupInfo>* KNGroupListData::extractList() { - QSortedList<KNGroupInfo>* temp = groups; + TQSortedList<KNGroupInfo>* temp = groups; groups = 0; return temp; } @@ -224,8 +224,8 @@ QSortedList<KNGroupInfo>* KNGroupListData::extractList() //=============================================================================== -KNGroupManager::KNGroupManager(QObject * parent, const char * name) - : QObject(parent,name) +KNGroupManager::KNGroupManager(TQObject * parent, const char * name) + : TQObject(parent,name) { c_urrentGroup=0; a_rticleMgr = knGlobals.articleManager(); @@ -234,14 +234,14 @@ KNGroupManager::KNGroupManager(QObject * parent, const char * name) KNGroupManager::~KNGroupManager() { - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) delete (*it); } void KNGroupManager::syncGroups() { - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { (*it)->syncDynamicData(); (*it)->saveInfo(); } @@ -252,13 +252,13 @@ void KNGroupManager::loadGroups(KNNntpAccount *a) { KNGroup *group; - QString dir(a->path()); + TQString dir(a->path()); if (dir.isNull()) return; - QDir d(dir); + TQDir d(dir); - QStringList entries(d.entryList("*.grpinfo")); - for(QStringList::Iterator it=entries.begin(); it != entries.end(); ++it) { + TQStringList entries(d.entryList("*.grpinfo")); + for(TQStringList::Iterator it=entries.begin(); it != entries.end(); ++it) { group=new KNGroup(a); if (group->readInfo(dir+(*it))) { mGroupList.append( group ); @@ -271,19 +271,19 @@ void KNGroupManager::loadGroups(KNNntpAccount *a) } -void KNGroupManager::getSubscribed(KNNntpAccount *a, QStringList &l) +void KNGroupManager::getSubscribed(KNNntpAccount *a, TQStringList &l) { l.clear(); - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) if ( (*it)->account() == a ) l.append( (*it)->groupname() ); } -QValueList<KNGroup*> KNGroupManager::groupsOfAccount( KNNntpAccount *a ) +TQValueList<KNGroup*> KNGroupManager::groupsOfAccount( KNNntpAccount *a ) { - QValueList<KNGroup*> ret; - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) + TQValueList<KNGroup*> ret; + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) if ( (*it)->account() == a ) ret.append( (*it) ); return ret; @@ -330,9 +330,9 @@ bool KNGroupManager::unloadHeaders(KNGroup *g, bool force) } -KNGroup* KNGroupManager::group(const QString &gName, const KNServerInfo *s) +KNGroup* KNGroupManager::group(const TQString &gName, const KNServerInfo *s) { - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) if ( (*it)->account() == s && (*it)->groupname() == gName ) return (*it); @@ -342,7 +342,7 @@ KNGroup* KNGroupManager::group(const QString &gName, const KNServerInfo *s) KNGroup* KNGroupManager::firstGroupOfAccount(const KNServerInfo *s) { - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) if ( (*it)->account() == s ) return (*it); @@ -352,7 +352,7 @@ KNGroup* KNGroupManager::firstGroupOfAccount(const KNServerInfo *s) void KNGroupManager::expireAll(KNCleanUp *cup) { - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { if( (*it)->isLocked() || (*it)->lockedArticles() > 0 ) continue; if ( !(*it)->activeCleanupConfig()->expireToday() ) @@ -366,7 +366,7 @@ void KNGroupManager::expireAll(KNNntpAccount *a) { KNCleanUp *cup = new KNCleanUp(); - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { if( (*it)->account() != a || (*it)->isLocked() || (*it)->lockedArticles() > 0 ) continue; @@ -376,7 +376,7 @@ void KNGroupManager::expireAll(KNNntpAccount *a) cup->start(); - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { if( (*it)->account() != a || (*it)->isLocked() || (*it)->lockedArticles() > 0 ) continue; @@ -393,31 +393,31 @@ void KNGroupManager::expireAll(KNNntpAccount *a) } -void KNGroupManager::showGroupDialog(KNNntpAccount *a, QWidget *parent) +void KNGroupManager::showGroupDialog(KNNntpAccount *a, TQWidget *parent) { KNGroupDialog* gDialog=new KNGroupDialog((parent!=0)? parent:knGlobals.topWidget, a); - connect(gDialog, SIGNAL(loadList(KNNntpAccount*)), this, SLOT(slotLoadGroupList(KNNntpAccount*))); - connect(gDialog, SIGNAL(fetchList(KNNntpAccount*)), this, SLOT(slotFetchGroupList(KNNntpAccount*))); - connect(gDialog, SIGNAL(checkNew(KNNntpAccount*,QDate)), this, SLOT(slotCheckForNewGroups(KNNntpAccount*,QDate))); - connect(this, SIGNAL(newListReady(KNGroupListData*)), gDialog, SLOT(slotReceiveList(KNGroupListData*))); + connect(gDialog, TQT_SIGNAL(loadList(KNNntpAccount*)), this, TQT_SLOT(slotLoadGroupList(KNNntpAccount*))); + connect(gDialog, TQT_SIGNAL(fetchList(KNNntpAccount*)), this, TQT_SLOT(slotFetchGroupList(KNNntpAccount*))); + connect(gDialog, TQT_SIGNAL(checkNew(KNNntpAccount*,TQDate)), this, TQT_SLOT(slotCheckForNewGroups(KNNntpAccount*,TQDate))); + connect(this, TQT_SIGNAL(newListReady(KNGroupListData*)), gDialog, TQT_SLOT(slotReceiveList(KNGroupListData*))); if(gDialog->exec()) { KNGroup *g=0; - QStringList lst; + TQStringList lst; gDialog->toUnsubscribe(&lst); if (lst.count()>0) { if (KMessageBox::Yes == KMessageBox::questionYesNoList((parent!=0)? parent:knGlobals.topWidget,i18n("Do you really want to unsubscribe\nfrom these groups?"), - lst, QString::null, i18n("Unsubscribe"), KStdGuiItem::cancel())) { - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + lst, TQString::null, i18n("Unsubscribe"), KStdGuiItem::cancel())) { + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { if((g=group(*it, a))) unsubscribeGroup(g); } } } - QSortedList<KNGroupInfo> lst2; + TQSortedList<KNGroupInfo> lst2; gDialog->toSubscribe(&lst2); for(KNGroupInfo *var=lst2.first(); var; var=lst2.next()) { subscribeGroup(var, a); @@ -458,7 +458,7 @@ bool KNGroupManager::unsubscribeGroup(KNGroup *g) acc=g->account(); - QDir dir(acc->path(),g->groupname()+"*"); + TQDir dir(acc->path(),g->groupname()+"*"); if (dir.exists()) { if (unloadHeaders(g, true)) { if(c_urrentGroup==g) { @@ -570,7 +570,7 @@ void KNGroupManager::checkAll(KNNntpAccount *a, bool silent) { if(!a) return; - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { if ( (*it)->account() == a ) { (*it)->setMaxFetch( knGlobals.configManager()->readNewsGeneral()->maxToFetch() ); if ( silent ) @@ -591,7 +591,7 @@ void KNGroupManager::processJob(KNJobData *j) if (j->success()) { if ((j->type()==KNJobData::JTFetchGroups)||(j->type()==KNJobData::JTCheckNewGroups)) { // update the descriptions of the subscribed groups - for ( QValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { + for ( TQValueList<KNGroup*>::Iterator it = mGroupList.begin(); it != mGroupList.end(); ++it ) { if ( (*it)->account() == j->account() ) { for ( KNGroupInfo* inf = d->groups->first(); inf; inf = d->groups->next() ) if ( inf->name == (*it)->groupname() ) { @@ -651,8 +651,8 @@ void KNGroupManager::slotLoadGroupList(KNNntpAccount *a) KNGroupListData *d = new KNGroupListData(); d->path = a->path(); - if(!QFileInfo(d->path+"groups").exists()) { - if (KMessageBox::Yes==KMessageBox::questionYesNo(knGlobals.topWidget,i18n("You do not have any groups for this account;\ndo you want to fetch a current list?"), QString::null, i18n("Fetch List"), i18n("Do Not Fetch"))) { + if(!TQFileInfo(d->path+"groups").exists()) { + if (KMessageBox::Yes==KMessageBox::questionYesNo(knGlobals.topWidget,i18n("You do not have any groups for this account;\ndo you want to fetch a current list?"), TQString::null, i18n("Fetch List"), i18n("Do Not Fetch"))) { delete d; slotFetchGroupList(a); return; @@ -684,7 +684,7 @@ void KNGroupManager::slotFetchGroupList(KNNntpAccount *a) // check for new groups (created after the given date) -void KNGroupManager::slotCheckForNewGroups(KNNntpAccount *a, QDate date) +void KNGroupManager::slotCheckForNewGroups(KNNntpAccount *a, TQDate date) { KNGroupListData *d = new KNGroupListData(); d->path = a->path(); |