summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kaccounttemplateselector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/widgets/kaccounttemplateselector.cpp')
-rw-r--r--kmymoney2/widgets/kaccounttemplateselector.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/kmymoney2/widgets/kaccounttemplateselector.cpp b/kmymoney2/widgets/kaccounttemplateselector.cpp
index 8ba6f0a..1816fab 100644
--- a/kmymoney2/widgets/kaccounttemplateselector.cpp
+++ b/kmymoney2/widgets/kaccounttemplateselector.cpp
@@ -18,9 +18,9 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qdir.h>
-#include <qheader.h>
-#include <qtimer.h>
+#include <tqdir.h>
+#include <tqheader.h>
+#include <tqtimer.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -41,14 +41,14 @@
class KTemplateListItem : public KListViewItem
{
public:
- KTemplateListItem(QListViewItem* parent, const QString& text);
+ KTemplateListItem(TQListViewItem* tqparent, const TQString& text);
void setAvailable(void);
public:
bool m_isAvailable;
};
-KTemplateListItem::KTemplateListItem(QListViewItem* parent, const QString& text) :
- KListViewItem(parent, text),
+KTemplateListItem::KTemplateListItem(TQListViewItem* tqparent, const TQString& text) :
+ KListViewItem(tqparent, text),
m_isAvailable(false)
{
}
@@ -63,41 +63,41 @@ class KAccountTemplateSelector::Private
public:
Private(KAccountTemplateSelector* p) { m_parent = p; }
#ifndef KMM_DESIGNER
- QValueList<MyMoneyTemplate> selectedTemplates(void) const;
- QListViewItem* hierarchyItem(const QString& parent, const QString& name);
+ TQValueList<MyMoneyTemplate> selectedTemplates(void) const;
+ TQListViewItem* hierarchyItem(const TQString& tqparent, const TQString& name);
void loadHierarchy(void);
#endif
public:
KAccountTemplateSelector* m_parent;
- QMap<QString, QListViewItem*> m_templateHierarchy;
+ TQMap<TQString, TQListViewItem*> m_templateHierarchy;
#ifndef KMM_DESIGNER
- QMap<QString, MyMoneyTemplate> m_templates;
- QMap<QString, QString> countries;
- QMap<QString, QString>::iterator it_m;
- QStringList dirlist;
+ TQMap<TQString, MyMoneyTemplate> m_templates;
+ TQMap<TQString, TQString> countries;
+ TQMap<TQString, TQString>::iterator it_m;
+ TQStringList dirlist;
int id;
#endif
};
#ifndef KMM_DESIGNER
-QListViewItem* KAccountTemplateSelector::Private::hierarchyItem(const QString& parent, const QString& name)
+TQListViewItem* KAccountTemplateSelector::Private::hierarchyItem(const TQString& tqparent, const TQString& name)
{
- if(!m_templateHierarchy.contains(parent)
- || m_templateHierarchy[parent] == 0) {
- QRegExp exp("(.*):(.*)");
- if(exp.search(parent) != -1)
- m_templateHierarchy[parent] = hierarchyItem(exp.cap(1), exp.cap(2));
+ if(!m_templateHierarchy.tqcontains(tqparent)
+ || m_templateHierarchy[tqparent] == 0) {
+ TQRegExp exp("(.*):(.*)");
+ if(exp.search(tqparent) != -1)
+ m_templateHierarchy[tqparent] = hierarchyItem(exp.cap(1), exp.cap(2));
}
- return new KTemplateListItem(m_templateHierarchy[parent], name);
+ return new KTemplateListItem(m_templateHierarchy[tqparent], name);
}
void KAccountTemplateSelector::Private::loadHierarchy(void)
{
m_templateHierarchy.clear();
- QListViewItemIterator it(m_parent->m_groupList, QListViewItemIterator::Selected);
- QListViewItem* it_v;
+ TQListViewItemIterator it(m_parent->m_groupList, TQListViewItemIterator::Selected);
+ TQListViewItem* it_v;
while((it_v = it.current()) != 0) {
m_templates[it_v->text(2)].hierarchy(m_templateHierarchy);
++it;
@@ -109,8 +109,8 @@ void KAccountTemplateSelector::Private::loadHierarchy(void)
#if 0
// add the hierarchy from the MyMoneyFile object
- QValueList<MyMoneyAccount> aList;
- QValueList<MyMoneyAccount>::const_iterator it_a;
+ TQValueList<MyMoneyAccount> aList;
+ TQValueList<MyMoneyAccount>::const_iterator it_a;
MyMoneyFile* file = MyMoneyFile::instance();
file->accountList(aList);
if(aList.count() > 0) {
@@ -127,9 +127,9 @@ void KAccountTemplateSelector::Private::loadHierarchy(void)
#endif
m_parent->m_accountList->clear();
- QMap<QString, QListViewItem*>::iterator it_m;
+ TQMap<TQString, TQListViewItem*>::iterator it_m;
- QRegExp exp("(.*):(.*)");
+ TQRegExp exp("(.*):(.*)");
for(it_m = m_templateHierarchy.begin(); it_m != m_templateHierarchy.end(); ++it_m) {
if(exp.search(it_m.key()) == -1) {
(*it_m) = new KListViewItem(m_parent->m_accountList, it_m.key());
@@ -145,11 +145,11 @@ void KAccountTemplateSelector::Private::loadHierarchy(void)
}
}
-QValueList<MyMoneyTemplate> KAccountTemplateSelector::Private::selectedTemplates(void) const
+TQValueList<MyMoneyTemplate> KAccountTemplateSelector::Private::selectedTemplates(void) const
{
- QValueList<MyMoneyTemplate> list;
- QListViewItemIterator it(m_parent->m_groupList, QListViewItemIterator::Selected);
- QListViewItem* it_v;
+ TQValueList<MyMoneyTemplate> list;
+ TQListViewItemIterator it(m_parent->m_groupList, TQListViewItemIterator::Selected);
+ TQListViewItem* it_v;
while((it_v = it.current()) != 0) {
list << m_templates[it_v->text(2)];
++it;
@@ -159,15 +159,15 @@ QValueList<MyMoneyTemplate> KAccountTemplateSelector::Private::selectedTemplates
#endif
-KAccountTemplateSelector::KAccountTemplateSelector(QWidget* parent, const char* name) :
- KAccountTemplateSelectorDecl(parent, name),
+KAccountTemplateSelector::KAccountTemplateSelector(TQWidget* tqparent, const char* name) :
+ KAccountTemplateSelectorDecl(tqparent, name),
d(new Private(this))
{
m_accountList->header()->hide();
- connect(m_groupList, SIGNAL(selectionChanged()), this, SLOT(slotLoadHierarchy()));
+ connect(m_groupList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotLoadHierarchy()));
// kick off loading of account template data
- QTimer::singleShot(0, this, SLOT(slotLoadTemplateList()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotLoadTemplateList()));
}
KAccountTemplateSelector::~KAccountTemplateSelector()
@@ -178,40 +178,40 @@ KAccountTemplateSelector::~KAccountTemplateSelector()
void KAccountTemplateSelector::slotLoadTemplateList(void)
{
#ifndef KMM_DESIGNER
- QStringList dirs;
+ TQStringList dirs;
// get list of template subdirs and scan them for the list of subdirs
d->dirlist = KGlobal::dirs()->findDirs("appdata", "templates");
- QStringList::iterator it;
+ TQStringList::iterator it;
for(it = d->dirlist.begin(); it != d->dirlist.end(); ++it) {
- QDir dir(*it);
+ TQDir dir(*it);
// qDebug("Reading dir '%s' with %d entries", (*it).data(), dir.count());
- dirs = dir.entryList("*", QDir::Dirs);
- QStringList::iterator it_d;
+ dirs = dir.entryList("*", TQDir::Dirs);
+ TQStringList::iterator it_d;
for(it_d= dirs.begin(); it_d != dirs.end(); ++it_d) {
// we don't care about . and ..
if((*it_d) == ".." || (*it_d) == "." || (*it_d) == "C")
continue;
- QRegExp exp("(..)_(..)");
+ TQRegExp exp("(..)_(..)");
if(exp.search(*it_d) != -1) {
- QString country = KGlobal::locale()->twoAlphaToCountryName(exp.cap(2));
+ TQString country = KGlobal::locale()->twoAlphaToCountryName(exp.cap(2));
if(country.isEmpty())
country = exp.cap(2);
- QString lang = KGlobal::locale()->twoAlphaToLanguageName(exp.cap(1));
- if(d->countries.contains(country)) {
+ TQString lang = KGlobal::locale()->twoAlphaToLanguageName(exp.cap(1));
+ if(d->countries.tqcontains(country)) {
if(d->countries[country] != *it_d) {
- QString oName = d->countries[country];
+ TQString oName = d->countries[country];
exp.search(oName);
- QString oCountry = KGlobal::locale()->twoAlphaToCountryName(exp.cap(2));
- QString oLang = KGlobal::locale()->twoAlphaToLanguageName(exp.cap(1));
+ TQString oCountry = KGlobal::locale()->twoAlphaToCountryName(exp.cap(2));
+ TQString oLang = KGlobal::locale()->twoAlphaToLanguageName(exp.cap(1));
d->countries.remove(country);
- d->countries[QString("%1 (%2)").arg(oCountry).arg(oLang)] = oName;
- d->countries[QString("%1 (%2)").arg(country).arg(lang)] = *it_d;
+ d->countries[TQString("%1 (%2)").tqarg(oCountry).tqarg(oLang)] = oName;
+ d->countries[TQString("%1 (%2)").tqarg(country).tqarg(lang)] = *it_d;
}
} else {
d->countries[country] = *it_d;
}
} else if((*it_d).length() == 2) {
- QString country = KGlobal::locale()->twoAlphaToCountryName((*it_d).upper());
+ TQString country = KGlobal::locale()->twoAlphaToCountryName((*it_d).upper());
d->countries[country] = *it_d;
} else {
qDebug("'%s/%s' not scanned", (*it).data(), (*it_d).data());
@@ -225,7 +225,7 @@ void KAccountTemplateSelector::slotLoadTemplateList(void)
d->m_templates.clear();
d->it_m = d->countries.begin();
d->id = 1;
- QTimer::singleShot(0, this, SLOT(slotLoadCountry()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotLoadCountry()));
#endif
}
@@ -233,18 +233,18 @@ void KAccountTemplateSelector::slotLoadCountry(void)
{
#ifndef KMM_DESIGNER
- KListViewItem* parent = new KListViewItem(m_groupList, d->it_m.key());
- parent->setSelectable(false);
- QStringList::iterator it;
+ KListViewItem* tqparent = new KListViewItem(m_groupList, d->it_m.key());
+ tqparent->setSelectable(false);
+ TQStringList::iterator it;
for(it = d->dirlist.begin(); it != d->dirlist.end(); ++it) {
- QStringList::iterator it_f;
- QDir dir(QString("%1%2").arg(*it).arg(*(d->it_m)));
+ TQStringList::iterator it_f;
+ TQDir dir(TQString("%1%2").tqarg(*it).tqarg(*(d->it_m)));
if(dir.exists()) {
- QStringList files = dir.entryList("*", QDir::Files);
+ TQStringList files = dir.entryList("*", TQDir::Files);
for(it_f = files.begin(); it_f != files.end(); ++it_f) {
- MyMoneyTemplate templ(QString("%1/%2").arg(dir.canonicalPath()).arg(*it_f));
- d->m_templates[QString("%1").arg(d->id)] = templ;
- new KListViewItem(parent, templ.title(), templ.shortDescription(), QString("%1").arg(d->id));
+ MyMoneyTemplate templ(TQString("%1/%2").tqarg(dir.canonicalPath()).tqarg(*it_f));
+ d->m_templates[TQString("%1").tqarg(d->id)] = templ;
+ new KListViewItem(tqparent, templ.title(), templ.shortDescription(), TQString("%1").tqarg(d->id));
++d->id;
}
}
@@ -252,7 +252,7 @@ void KAccountTemplateSelector::slotLoadCountry(void)
++d->it_m;
if(d->it_m != d->countries.end())
- QTimer::singleShot(0, this, SLOT(slotLoadCountry()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotLoadCountry()));
else {
d->loadHierarchy();
}
@@ -267,12 +267,12 @@ void KAccountTemplateSelector::slotLoadHierarchy(void)
#endif
}
-QValueList<MyMoneyTemplate> KAccountTemplateSelector::selectedTemplates(void) const
+TQValueList<MyMoneyTemplate> KAccountTemplateSelector::selectedTemplates(void) const
{
#ifndef KMM_DESIGNER
return d->selectedTemplates();
#else
- return QValueList<MyMoneyTemplate>();
+ return TQValueList<MyMoneyTemplate>();
#endif
}