Rename KShared

pull/1/head
Timothy Pearson 11 years ago
parent 71a8a17d6f
commit 57443681e9

@ -19,11 +19,11 @@ using Tellico::Data::Loan;
using Tellico::Data::Borrower;
Loan::Loan(Data::EntryPtr entry, const TQDate& loanDate, const TQDate& dueDate, const TQString& note)
: KShared(), m_uid(Tellico::uid()), m_borrower(0), m_entry(entry), m_loanDate(loanDate), m_dueDate(dueDate),
: TDEShared(), m_uid(Tellico::uid()), m_borrower(0), m_entry(entry), m_loanDate(loanDate), m_dueDate(dueDate),
m_note(note), m_inCalendar(false) {
}
Loan::Loan(const Loan& other) : KShared(other), m_uid(Tellico::uid()), m_borrower(other.m_borrower),
Loan::Loan(const Loan& other) : TDEShared(other), m_uid(Tellico::uid()), m_borrower(other.m_borrower),
m_entry(other.m_entry), m_loanDate(other.m_loanDate), m_dueDate(other.m_dueDate),
m_note(other.m_note), m_inCalendar(false) {
}
@ -37,17 +37,17 @@ Tellico::Data::EntryPtr Loan::entry() const {
}
Borrower::Borrower(const TQString& name_, const TQString& uid_)
: KShared(), m_name(name_), m_uid(uid_) {
: TDEShared(), m_name(name_), m_uid(uid_) {
}
Borrower::Borrower(const Borrower& b)
: KShared(b), m_name(b.m_name), m_uid(b.m_uid), m_loans(b.m_loans) {
: TDEShared(b), m_name(b.m_name), m_uid(b.m_uid), m_loans(b.m_loans) {
}
Borrower& Borrower::operator=(const Borrower& other_) {
if(this == &other_) return *this;
static_cast<KShared&>(*this) = static_cast<const KShared&>(other_);
static_cast<TDEShared&>(*this) = static_cast<const TDEShared&>(other_);
m_name = other_.m_name;
m_uid = other_.m_uid;
m_loans = other_.m_loans;

@ -23,7 +23,7 @@
namespace Tellico {
namespace Data {
class Loan : public KShared {
class Loan : public TDEShared {
public:
Loan(Data::EntryPtr entry, const TQDate& loanDate, const TQDate& dueDate, const TQString& note);
@ -60,14 +60,14 @@ private:
bool m_inCalendar;
};
typedef KSharedPtr<Loan> LoanPtr;
typedef TDESharedPtr<Loan> LoanPtr;
typedef Vector<Loan> LoanVec;
typedef LoanVec::Iterator LoanVecIt;
/**
* @author Robby Stephenson
*/
class Borrower : public KShared {
class Borrower : public TDEShared {
public:
Borrower(const TQString& name, const TQString& uid);

@ -33,7 +33,7 @@ const char* Collection::s_emptyGroupTitle = I18N_NOOP("(Empty)");
const TQString Collection::s_peopleGroupName = TQString::fromLatin1("_people");
Collection::Collection(const TQString& title_)
: TQObject(), KShared(), m_nextEntryId(0), m_title(title_), m_entryIdDict(997)
: TQObject(), TDEShared(), m_nextEntryId(0), m_title(title_), m_entryIdDict(997)
, m_trackGroups(false) {
m_entryGroupDicts.setAutoDelete(true);

@ -47,7 +47,7 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
class Collection : public TQObject, public KShared {
class Collection : public TQObject, public TDEShared {
Q_OBJECT

@ -438,7 +438,7 @@ void CollectionFieldsDialog::slotDelete() {
m_fieldsBox->removeItem(m_fieldsBox->currentItem());
m_fieldsBox->setSelected(m_fieldsBox->currentItem(), true);
m_fieldsBox->ensureCurrentVisible();
m_currentField = static_cast<FieldListBox*>(m_fieldsBox->selectedItem())->field(); // KShared gets auto-deleted
m_currentField = static_cast<FieldListBox*>(m_fieldsBox->selectedItem())->field(); // TDEShared gets auto-deleted
return;
}

@ -317,7 +317,7 @@ int BibtexCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_)
// static
Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) {
const TQString bibtex = TQString::fromLatin1("bibtex");
KSharedPtr<BibtexCollection> coll = new BibtexCollection(false, coll_->title());
TDESharedPtr<BibtexCollection> coll = new BibtexCollection(false, coll_->title());
FieldVec fields = coll_->fields();
for(FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
FieldPtr field = new Data::Field(*fIt);

@ -25,25 +25,25 @@ namespace Tellico {
typedef TQMap<TQString, TQString> StringMap;
class Filter;
typedef KSharedPtr<Filter> FilterPtr;
typedef TDESharedPtr<Filter> FilterPtr;
typedef Vector<Filter> FilterVec;
namespace Data {
class Collection;
typedef KSharedPtr<Collection> CollPtr;
typedef KSharedPtr<const Collection> ConstCollPtr;
typedef TDESharedPtr<Collection> CollPtr;
typedef TDESharedPtr<const Collection> ConstCollPtr;
typedef Vector<Collection> CollVec;
class Field;
typedef KSharedPtr<Field> FieldPtr;
typedef KSharedPtr<const Field> ConstFieldPtr;
typedef TDESharedPtr<Field> FieldPtr;
typedef TDESharedPtr<const Field> ConstFieldPtr;
typedef Vector<Field> FieldVec;
typedef FieldVec::Iterator FieldVecIt;
// typedef Vector<ConstFieldPtr> ConstFieldVec;
class Entry;
typedef KSharedPtr<Entry> EntryPtr;
typedef KSharedPtr<const Entry> ConstEntryPtr;
typedef TDESharedPtr<Entry> EntryPtr;
typedef TDESharedPtr<const Entry> ConstEntryPtr;
typedef Vector<Entry> EntryVec;
typedef EntryVec::Iterator EntryVecIt;
typedef Vector<const Entry> ConstEntryVec;
@ -55,7 +55,7 @@ namespace Tellico {
typedef TQPair<Data::EntryVec, PairVector> MergePair;
class Borrower;
typedef KSharedPtr<Borrower> BorrowerPtr;
typedef TDESharedPtr<Borrower> BorrowerPtr;
typedef Vector<Borrower> BorrowerVec;
}
}

@ -260,7 +260,7 @@ void Document::deleteContents() {
if(m_coll) {
m_coll->clear();
}
m_coll = 0; // old collection gets deleted as a KSharedPtr
m_coll = 0; // old collection gets deleted as a TDESharedPtr
m_cancelImageWriting = true;
}

@ -73,7 +73,7 @@ bool Entry::operator==(const Entry& e1) {
return true;
}
Entry::Entry(CollPtr coll_) : KShared(), m_coll(coll_), m_id(-1) {
Entry::Entry(CollPtr coll_) : TDEShared(), m_coll(coll_), m_id(-1) {
#ifndef NDEBUG
if(!coll_) {
kdWarning() << "Entry() - null collection pointer!" << endl;
@ -81,7 +81,7 @@ Entry::Entry(CollPtr coll_) : KShared(), m_coll(coll_), m_id(-1) {
#endif
}
Entry::Entry(CollPtr coll_, int id_) : KShared(), m_coll(coll_), m_id(id_) {
Entry::Entry(CollPtr coll_, int id_) : TDEShared(), m_coll(coll_), m_id(id_) {
#ifndef NDEBUG
if(!coll_) {
kdWarning() << "Entry() - null collection pointer!" << endl;
@ -90,7 +90,7 @@ Entry::Entry(CollPtr coll_, int id_) : KShared(), m_coll(coll_), m_id(id_) {
}
Entry::Entry(const Entry& entry_) :
KShared(entry_),
TDEShared(entry_),
m_coll(entry_.m_coll),
m_id(-1),
m_fields(entry_.m_fields),
@ -101,7 +101,7 @@ Entry& Entry::operator=(const Entry& other_) {
if(this == &other_) return *this;
// myDebug() << "Entry::operator=()" << endl;
static_cast<KShared&>(*this) = static_cast<const KShared&>(other_);
static_cast<TDEShared&>(*this) = static_cast<const TDEShared&>(other_);
m_coll = other_.m_coll;
m_id = other_.m_id;
m_fields = other_.m_fields;

@ -65,7 +65,7 @@ private:
*
* @author Robby Stephenson
*/
class Entry : public KShared {
class Entry : public TDEShared {
public:
/**

@ -35,17 +35,17 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
class Fetcher : public TQObject, public KShared {
class Fetcher : public TQObject, public TDEShared {
Q_OBJECT
public:
typedef KSharedPtr<Fetcher> Ptr;
typedef KSharedPtr<const Fetcher> CPtr;
typedef TDESharedPtr<Fetcher> Ptr;
typedef TDESharedPtr<const Fetcher> CPtr;
/**
*/
Fetcher(TQObject* parent, const char* name = 0) : TQObject(parent, name), KShared(),
Fetcher(TQObject* parent, const char* name = 0) : TQObject(parent, name), TDEShared(),
m_updateOverwrite(false), m_hasMoreResults(false),
m_messager(0) {}
/**

@ -130,7 +130,7 @@ Tellico::Fetch::KeyMap Manager::keyMap(const TQString& source_) const {
}
// assume there's only one fetcher match
KSharedPtr<const Fetcher> f = 0;
TDESharedPtr<const Fetcher> f = 0;
for(FetcherVec::ConstIterator it = m_fetchers.constBegin(); it != m_fetchers.constEnd(); ++it) {
if(source_ == it->source()) {
f = it.data();

@ -102,7 +102,7 @@ private:
bool m_connected;
bool m_aborted;
KSharedPtr<Z3950Fetcher> m_fetcher;
TDESharedPtr<Z3950Fetcher> m_fetcher;
TQString m_host;
uint m_port;
TQString m_dbname;

@ -37,7 +37,7 @@ TQRegExp Field::s_delimiter = TQRegExp(TQString::fromLatin1("\\s*;\\s*"));
// this constructor is for anything but Choice type
Field::Field(const TQString& name_, const TQString& title_, Type type_/*=Line*/)
: KShared(), m_name(name_), m_title(title_), m_category(i18n("General")), m_desc(title_),
: TDEShared(), m_name(name_), m_title(title_), m_category(i18n("General")), m_desc(title_),
m_type(type_), m_flags(0), m_formatFlag(FormatNone) {
#ifndef NDEBUG
@ -69,13 +69,13 @@ Field::Field(const TQString& name_, const TQString& title_, Type type_/*=Line*/)
// if this constructor is called, the type is necessarily Choice
Field::Field(const TQString& name_, const TQString& title_, const TQStringList& allowed_)
: KShared(), m_name(name_), m_title(title_), m_category(i18n("General")), m_desc(title_),
: TDEShared(), m_name(name_), m_title(title_), m_category(i18n("General")), m_desc(title_),
m_type(Field::Choice), m_allowed(allowed_), m_flags(0), m_formatFlag(FormatNone) {
m_id = getID();
}
Field::Field(const Field& field_)
: KShared(field_), m_name(field_.name()), m_title(field_.title()), m_category(field_.category()),
: TDEShared(field_), m_name(field_.name()), m_title(field_.title()), m_category(field_.category()),
m_desc(field_.description()), m_type(field_.type()),
m_flags(field_.flags()), m_formatFlag(field_.formatFlag()),
m_properties(field_.propertyList()) {
@ -91,7 +91,7 @@ Field::Field(const Field& field_)
Field& Field::operator=(const Field& field_) {
if(this == &field_) return *this;
static_cast<KShared&>(*this) = static_cast<const KShared&>(field_);
static_cast<TDEShared&>(*this) = static_cast<const TDEShared&>(field_);
m_name = field_.name();
m_title = field_.title();
m_category = field_.category();

@ -31,7 +31,7 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
class Field : public KShared {
class Field : public TDEShared {
public:
/**
* The possible field types. A Line is represented by a KLineEdit,

@ -106,7 +106,7 @@ bool FilterRule::matchesRegExp(Data::EntryPtr entry_) const {
/*******************************************************/
Filter::Filter(const Filter& other_) : TQPtrList<FilterRule>(), KShared(), m_op(other_.op()), m_name(other_.name()) {
Filter::Filter(const Filter& other_) : TQPtrList<FilterRule>(), TDEShared(), m_op(other_.op()), m_name(other_.name()) {
for(TQPtrListIterator<FilterRule> it(other_); it.current(); ++it) {
append(new FilterRule(*it.current()));
}

@ -98,14 +98,14 @@ private:
*
* @author Robby Stephenson
*/
class Filter : public TQPtrList<FilterRule>, public KShared {
class Filter : public TQPtrList<FilterRule>, public TDEShared {
public:
enum FilterOp {
MatchAny,
MatchAll
};
typedef KSharedPtr<Filter> Ptr;
typedef TDESharedPtr<Filter> Ptr;
Filter(FilterOp op) : TQPtrList<FilterRule>(), m_op(op) { setAutoDelete(true); }
Filter(const Filter& other);

@ -37,7 +37,7 @@ public:
VectorIterator(const VectorIterator<T>& other) : m_vector(other.m_vector), m_index(other.m_index) {}
// operator T*() { return m_vector->at(m_index).data(); }
operator KSharedPtr<T>() { return m_vector->at(m_index); }
operator TDESharedPtr<T>() { return m_vector->at(m_index); }
T* operator->() { return m_vector->at(m_index).data(); }
T& operator*() { return *m_vector->at(m_index); }
T* data() { return m_vector->at(m_index).data(); }
@ -66,7 +66,7 @@ public:
VectorConstIterator(const VectorIterator<T>& other) : m_vector(other.m_vector), m_index(other.m_index) {}
// operator const T*() { return m_vector->at(m_index).data(); }
operator KSharedPtr<const T>() { return m_vector->at(m_index); }
operator TDESharedPtr<const T>() { return m_vector->at(m_index); }
const T* operator->() const { return m_vector->at(m_index).data(); }
const T& operator*() const { return *m_vector->at(m_index); }
const T* data() const { return m_vector->at(m_index).data(); }
@ -90,7 +90,7 @@ private:
template <class T>
class Vector {
public:
typedef KSharedPtr<T> Ptr;
typedef TDESharedPtr<T> Ptr;
typedef VectorIterator<T> Iterator;
typedef VectorConstIterator<T> ConstIterator;

Loading…
Cancel
Save