Drop Qt2's TQSemiModal and TQSortedList classes

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/77/head
Michele Calgaro 1 year ago
parent 6ffa01798d
commit fd0046c407
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -15,8 +15,6 @@
#ifndef KNCLEANUP_H #ifndef KNCLEANUP_H
#define KNCLEANUP_H #define KNCLEANUP_H
#include <tqsemimodal.h>
class TQProgressBar; class TQProgressBar;
class TQLabel; class TQLabel;

@ -41,9 +41,9 @@ KNGroupBrowser::KNGroupBrowser(TQWidget *parent, const TQString &caption, KNNntp
{ {
refilterTimer = new TQTimer(); refilterTimer = new TQTimer();
allList=new TQSortedList<KNGroupInfo>; allList=new TQPtrList<KNGroupInfo>;
allList->setAutoDelete(true); allList->setAutoDelete(true);
matchList=new TQSortedList<KNGroupInfo>; matchList=new TQPtrList<KNGroupInfo>;
matchList->setAutoDelete(false); matchList->setAutoDelete(false);
//create Widgets //create Widgets
@ -321,7 +321,7 @@ void KNGroupBrowser::slotFilter(const TQString &txt)
bool doIncrementalUpdate = (!isRegexp && incrementalFilter && (filtertxt.left(lastFilter.length())==lastFilter)); bool doIncrementalUpdate = (!isRegexp && incrementalFilter && (filtertxt.left(lastFilter.length())==lastFilter));
if (doIncrementalUpdate) { if (doIncrementalUpdate) {
TQSortedList<KNGroupInfo> *tempList = new TQSortedList<KNGroupInfo>(); TQPtrList<KNGroupInfo> *tempList = new TQPtrList<KNGroupInfo>();
tempList->setAutoDelete(false); tempList->setAutoDelete(false);
for(KNGroupInfo *g=matchList->first(); g; g=matchList->next()) { for(KNGroupInfo *g=matchList->first(); g; g=matchList->next()) {

@ -98,7 +98,7 @@ class KNGroupBrowser : public KDialogBase {
bool incrementalFilter; bool incrementalFilter;
KNNntpAccount *a_ccount; KNNntpAccount *a_ccount;
TQSortedList<KNGroupInfo> *allList, *matchList; TQPtrList<KNGroupInfo> *allList, *matchList;
protected slots: protected slots:
void slotLoadList(); void slotLoadList();

@ -121,7 +121,7 @@ void KNGroupDialog::updateItemState(CheckItem *it)
void KNGroupDialog::toSubscribe(TQSortedList<KNGroupInfo> *l) void KNGroupDialog::toSubscribe(TQPtrList<KNGroupInfo> *l)
{ {
KNGroupInfo *info; KNGroupInfo *info;
l->clear(); l->clear();

@ -29,7 +29,7 @@ class KNGroupDialog : public KNGroupBrowser {
KNGroupDialog(TQWidget *parent, KNNntpAccount *a); KNGroupDialog(TQWidget *parent, KNNntpAccount *a);
~KNGroupDialog(); ~KNGroupDialog();
void toSubscribe(TQSortedList<KNGroupInfo> *l); void toSubscribe(TQPtrList<KNGroupInfo> *l);
void toUnsubscribe(TQStringList *l); void toUnsubscribe(TQStringList *l);
protected: protected:

@ -81,7 +81,7 @@ bool KNGroupInfo::operator< (const KNGroupInfo &gi2)
KNGroupListData::KNGroupListData() KNGroupListData::KNGroupListData()
: codecForDescriptions(0) : codecForDescriptions(0)
{ {
groups = new TQSortedList<KNGroupInfo>; groups = new TQPtrList<KNGroupInfo>;
groups->setAutoDelete(true); groups->setAutoDelete(true);
} }
@ -196,7 +196,7 @@ bool KNGroupListData::writeOut()
// merge in new groups, we want to preserve the "subscribed"-flag // merge in new groups, we want to preserve the "subscribed"-flag
// of the loaded groups and the "new"-flag of the new groups. // of the loaded groups and the "new"-flag of the new groups.
void KNGroupListData::merge(TQSortedList<KNGroupInfo>* newGroups) void KNGroupListData::merge(TQPtrList<KNGroupInfo>* newGroups)
{ {
bool subscribed; bool subscribed;
@ -213,9 +213,9 @@ void KNGroupListData::merge(TQSortedList<KNGroupInfo>* newGroups)
} }
TQSortedList<KNGroupInfo>* KNGroupListData::extractList() TQPtrList<KNGroupInfo>* KNGroupListData::extractList()
{ {
TQSortedList<KNGroupInfo>* temp = groups; TQPtrList<KNGroupInfo>* temp = groups;
groups = 0; groups = 0;
return temp; return temp;
} }
@ -417,7 +417,7 @@ void KNGroupManager::showGroupDialog(KNNntpAccount *a, TQWidget *parent)
} }
} }
TQSortedList<KNGroupInfo> lst2; TQPtrList<KNGroupInfo> lst2;
gDialog->toSubscribe(&lst2); gDialog->toSubscribe(&lst2);
for(KNGroupInfo *var=lst2.first(); var; var=lst2.next()) { for(KNGroupInfo *var=lst2.first(); var; var=lst2.next()) {
subscribeGroup(var, a); subscribeGroup(var, a);

@ -16,7 +16,7 @@
#define KNGROUPMANAGER_H #define KNGROUPMANAGER_H
#include <tqobject.h> #include <tqobject.h>
#include <tqsortedlist.h> #include <tqptrlist.h>
#include "knjobdata.h" #include "knjobdata.h"
#include "kngroup.h" #include "kngroup.h"
@ -59,13 +59,13 @@ class KNGroupListData : public KNJobItem {
bool readIn(KNProtocolClient *client=0); bool readIn(KNProtocolClient *client=0);
bool writeOut(); bool writeOut();
void merge(TQSortedList<KNGroupInfo>* newGroups); void merge(TQPtrList<KNGroupInfo>* newGroups);
TQSortedList<KNGroupInfo>* extractList(); TQPtrList<KNGroupInfo>* extractList();
TQStringList subscribed; TQStringList subscribed;
TQString path; TQString path;
TQSortedList<KNGroupInfo> *groups; TQPtrList<KNGroupInfo> *groups;
TQDate fetchSince; TQDate fetchSince;
bool getDescriptions; bool getDescriptions;
TQTextCodec *codecForDescriptions; TQTextCodec *codecForDescriptions;

@ -140,7 +140,7 @@ void KNNntpClient::doFetchGroups()
if (!job->success() || job->canceled()) if (!job->success() || job->canceled())
return; // stopped... return; // stopped...
TQSortedVector<KNGroupInfo> tempVector; TQPtrVector<KNGroupInfo> tempVector;
target->groups->toVector(&tempVector); target->groups->toVector(&tempVector);
tempVector.sort(); tempVector.sort();
@ -229,7 +229,7 @@ void KNNntpClient::doCheckNewGroups()
char *s, *line; char *s, *line;
TQString name; TQString name;
KNGroup::Status status; KNGroup::Status status;
TQSortedList<KNGroupInfo> tmpList; TQPtrList<KNGroupInfo> tmpList;
tmpList.setAutoDelete(true); tmpList.setAutoDelete(true);
while (getNextLine()) { while (getNextLine()) {

@ -36,25 +36,6 @@ class KTempFile;
// utility classes // utility classes
//***************************************************************************** //*****************************************************************************
/** clone of TQSortedList... */
template<class type> class TQ_EXPORT TQSortedVector : public TQPtrVector<type>
{
public:
TQSortedVector() {}
TQSortedVector ( uint size ) : TQPtrVector<type>(size) {}
TQSortedVector( const TQSortedVector<type> &l ) : TQPtrVector<type>(l) {}
~TQSortedVector() { TQPtrVector<type>::clear(); }
TQSortedVector<type> &operator=(const TQSortedVector<type> &l)
{ return (TQSortedVector<type>&)TQPtrList<type>::operator=(l); }
virtual int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 )
{ if ( *((type*)s1) == *((type*)s2) ) return 0; return ( *((type*)s1) < *((type*)s2) ? -1 : 1 ); }
};
//==============================================================================
class KNFile : public TQFile { class KNFile : public TQFile {
public: public:

Loading…
Cancel
Save