summaryrefslogtreecommitdiffstats
path: root/ksig
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /ksig
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksig')
-rw-r--r--ksig/ksig.cpp50
-rw-r--r--ksig/ksig.h12
-rw-r--r--ksig/main.cpp2
-rw-r--r--ksig/siggenerator.cpp26
-rw-r--r--ksig/siggenerator.h18
-rw-r--r--ksig/siglistview.cpp16
-rw-r--r--ksig/siglistview.h14
-rw-r--r--ksig/siglistviewitem.cpp22
-rw-r--r--ksig/siglistviewitem.h18
-rw-r--r--ksig/standardtext.cpp10
-rw-r--r--ksig/standardtext.h8
11 files changed, 98 insertions, 98 deletions
diff --git a/ksig/ksig.cpp b/ksig/ksig.cpp
index 801b18c..4ac8e9c 100644
--- a/ksig/ksig.cpp
+++ b/ksig/ksig.cpp
@@ -26,7 +26,7 @@
#include <klistviewsearchline.h>
#include <klocale.h>
-#include <qsplitter.h>
+#include <tqsplitter.h>
#include "ksig.h"
#include "siglistviewitem.h"
@@ -36,7 +36,7 @@
// public methods
////////////////////////////////////////////////////////////////////////////////
-KSig::KSig(QWidget *parent, const char *name) : KMainWindow(parent, name),
+KSig::KSig(TQWidget *parent, const char *name) : KMainWindow(parent, name),
changed(false)
{
setupActions();
@@ -63,23 +63,23 @@ KSig::~KSig()
void KSig::setupActions()
{
- KStdAction::openNew(this, SLOT(add()), actionCollection());
- new KAction(i18n("Remove"), "editdelete", 0, this, SLOT(remove()), actionCollection(), "remove");
- KStdAction::save(this, SLOT(save()), actionCollection());
- KStdAction::quit(this, SLOT(quit()), actionCollection());
-
- KStdAction::cut(kapp, SLOT(cut()), actionCollection());
- KStdAction::copy(kapp, SLOT(copy()), actionCollection());
- KStdAction::paste(kapp, SLOT(paste()), actionCollection());
- new KAction(i18n("C&lear"), "editclear", 0, kapp, SLOT(clear()), actionCollection(), "clear");
-
- new KAction(i18n("Edit Standard Header"), 0, 0, this, SLOT(editHeader()), actionCollection(), "editHeader");
- new KAction(i18n("Edit Standard Footer"), 0, 0, this, SLOT(editFooter()), actionCollection(), "editFooter");
+ KStdAction::openNew(this, TQT_SLOT(add()), actionCollection());
+ new KAction(i18n("Remove"), "editdelete", 0, this, TQT_SLOT(remove()), actionCollection(), "remove");
+ KStdAction::save(this, TQT_SLOT(save()), actionCollection());
+ KStdAction::quit(this, TQT_SLOT(quit()), actionCollection());
+
+ KStdAction::cut(kapp, TQT_SLOT(cut()), actionCollection());
+ KStdAction::copy(kapp, TQT_SLOT(copy()), actionCollection());
+ KStdAction::paste(kapp, TQT_SLOT(paste()), actionCollection());
+ new KAction(i18n("C&lear"), "editclear", 0, kapp, TQT_SLOT(clear()), actionCollection(), "clear");
+
+ new KAction(i18n("Edit Standard Header"), 0, 0, this, TQT_SLOT(editHeader()), actionCollection(), "editHeader");
+ new KAction(i18n("Edit Standard Footer"), 0, 0, this, TQT_SLOT(editFooter()), actionCollection(), "editFooter");
}
void KSig::setupLayout()
{
- splitter = new QSplitter(Qt::Vertical, this);
+ splitter = new TQSplitter(Qt::Vertical, this);
setCentralWidget(splitter);
@@ -96,9 +96,9 @@ void KSig::setupLayout()
statusBar()->show();
updateListLock = false;
- connect(sigEdit, SIGNAL(textChanged()), this, SLOT(updateList()));
- connect(sigList, SIGNAL(selectionChanged()), this, SLOT(updateEdit()));
- connect(sigEdit, SIGNAL(cursorPositionChanged(int,int)), this, SLOT(updateStatus(int,int)));
+ connect(sigEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(updateList()));
+ connect(sigList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(updateEdit()));
+ connect(sigEdit, TQT_SIGNAL(cursorPositionChanged(int,int)), this, TQT_SLOT(updateStatus(int,int)));
}
void KSig::setupSearchLine()
@@ -132,7 +132,7 @@ void KSig::readConfig()
{
KConfigGroupSaver saver(config, "Settings");
if(splitter) {
- QValueList<int> sizes;
+ TQValueList<int> sizes;
sizes.append(config->readNumEntry("ListSize", -1));
sizes.append(config->readNumEntry("EditSize", -1));
@@ -152,7 +152,7 @@ void KSig::writeConfig()
{
KConfigGroupSaver saver(config, "Settings");
if(splitter) {
- QValueList<int> sizes = splitter->sizes();
+ TQValueList<int> sizes = splitter->sizes();
config->writeEntry("ListSize", sizes[0]);
config->writeEntry("EditSize", sizes[1]);
@@ -167,7 +167,7 @@ void KSig::writeConfig()
bool KSig::queryClose()
{
if(changed) {
- int saveChanges = KMessageBox::questionYesNoCancel(this, i18n("Do you want to save your changes before exiting?"),QString::null,KStdGuiItem::save(),KStdGuiItem::discard());
+ int saveChanges = KMessageBox::questionYesNoCancel(this, i18n("Do you want to save your changes before exiting?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::discard());
if(saveChanges == KMessageBox::Cancel)
return(false);
else if(saveChanges == KMessageBox::Yes)
@@ -211,9 +211,9 @@ void KSig::setDataChanged(bool value)
changed = value;
if(changed)
- setCaption(kapp->makeStdCaption(QString::null, true, true));
+ setCaption(kapp->makeStdCaption(TQString::null, true, true));
else
- setCaption(kapp->makeStdCaption(QString::null, true, false));
+ setCaption(kapp->makeStdCaption(TQString::null, true, false));
}
void KSig::editHeader()
@@ -222,7 +222,7 @@ void KSig::editHeader()
t->setLabel(i18n("Standard signature header:"));
t->setText(header);
- connect(t, SIGNAL(textUpdated(const QString &)), this, SLOT(setHeader(const QString &)));
+ connect(t, TQT_SIGNAL(textUpdated(const TQString &)), this, TQT_SLOT(setHeader(const TQString &)));
t->exec();
}
@@ -233,7 +233,7 @@ void KSig::editFooter()
t->setLabel(i18n("Standard signature footer:"));
t->setText(footer);
- connect(t, SIGNAL(textUpdated(const QString &)), this, SLOT(setFooter(const QString &)));
+ connect(t, TQT_SIGNAL(textUpdated(const TQString &)), this, TQT_SLOT(setFooter(const TQString &)));
t->exec();
}
diff --git a/ksig/ksig.h b/ksig/ksig.h
index 0598f10..7729ffa 100644
--- a/ksig/ksig.h
+++ b/ksig/ksig.h
@@ -30,7 +30,7 @@ class KSig : public KMainWindow
Q_OBJECT
public:
- KSig(QWidget *parent = 0, const char *name = 0);
+ KSig(TQWidget *parent = 0, const char *name = 0);
virtual ~KSig();
private:
@@ -54,18 +54,18 @@ private slots:
void editHeader();
void editFooter();
- void setHeader(const QString &text) { header = text; writeConfig(); }
- void setFooter(const QString &text) { footer = text; writeConfig(); }
+ void setHeader(const TQString &text) { header = text; writeConfig(); }
+ void setFooter(const TQString &text) { footer = text; writeConfig(); }
void updateList();
void updateEdit();
void updateStatus(int line, int column);
private:
- QString header;
- QString footer;
+ TQString header;
+ TQString footer;
- QSplitter *splitter;
+ TQSplitter *splitter;
SigListView *sigList;
KTextEdit *sigEdit;
bool updateListLock;
diff --git a/ksig/main.cpp b/ksig/main.cpp
index 0017f00..96aae13 100644
--- a/ksig/main.cpp
+++ b/ksig/main.cpp
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
KApplication a(false, false);
SigGenerator generator;
- QTextStream output(stdout, IO_WriteOnly);
+ TQTextStream output(stdout, IO_WriteOnly);
if(args->isSet("random"))
output << generator.random();
else if(args->isSet("daily"))
diff --git a/ksig/siggenerator.cpp b/ksig/siggenerator.cpp
index b232cb3..abd2430 100644
--- a/ksig/siggenerator.cpp
+++ b/ksig/siggenerator.cpp
@@ -23,13 +23,13 @@
#include <kconfig.h>
#include <kdebug.h>
-#include <qfile.h>
-#include <qdatetime.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
SigGenerator::SigGenerator()
{
- QString dir = KGlobal::dirs()->saveLocation("appdata");
- QFile file(dir + "sigs.sigml");
+ TQString dir = KGlobal::dirs()->saveLocation("appdata");
+ TQFile file(dir + "sigs.sigml");
if(file.open(IO_ReadOnly) && doc.setContent(&file)) {
signatures = doc.elementsByTagName("signature");
@@ -50,33 +50,33 @@ SigGenerator::~SigGenerator()
}
-QString SigGenerator::random() const
+TQString SigGenerator::random() const
{
if(signatures.count() <= 0)
- return(QString::null);
+ return(TQString::null);
int i = KApplication::random() % signatures.count();
- QString text;
+ TQString text;
SigListViewItem::nodeToText(signatures.item(i), text);
return attachStandard(text);
}
-QString SigGenerator::daily() const
+TQString SigGenerator::daily() const
{
if(signatures.count() <= 0)
- return(QString::null);
+ return(TQString::null);
- QDate date;
+ TQDate date;
int i = date.dayOfYear() % signatures.count();
- QString text;
+ TQString text;
SigListViewItem::nodeToText(signatures.item(i), text);
return attachStandard(text);
}
-QString SigGenerator::attachStandard(const QString &text) const
+TQString SigGenerator::attachStandard(const TQString &text) const
{
- QString s = text;
+ TQString s = text;
if(!header.isEmpty())
s = header + "\n" + s;
diff --git a/ksig/siggenerator.h b/ksig/siggenerator.h
index a2c429d..a5cb707 100644
--- a/ksig/siggenerator.h
+++ b/ksig/siggenerator.h
@@ -18,8 +18,8 @@
#ifndef SIGGENERATOR_H
#define SIGGENERATOR_H
-#include <qstring.h>
-#include <qdom.h>
+#include <tqstring.h>
+#include <tqdom.h>
class SigGenerator
{
@@ -27,17 +27,17 @@ public:
SigGenerator();
~SigGenerator();
- QString random() const;
- QString daily() const;
+ TQString random() const;
+ TQString daily() const;
private:
- QString attachStandard(const QString &text) const;
+ TQString attachStandard(const TQString &text) const;
- QDomDocument doc;
- QDomNodeList signatures;
- QString header;
- QString footer;
+ TQDomDocument doc;
+ TQDomNodeList signatures;
+ TQString header;
+ TQString footer;
};
#endif
diff --git a/ksig/siglistview.cpp b/ksig/siglistview.cpp
index d212478..4bbc693 100644
--- a/ksig/siglistview.cpp
+++ b/ksig/siglistview.cpp
@@ -29,7 +29,7 @@ SigListView *SigListView::listView = 0;
// public members
////////////////////////////////////////////////////////////////////////////////
-SigListView *SigListView::instance(QWidget *parent, const char *name)
+SigListView *SigListView::instance(TQWidget *parent, const char *name)
{
if(!listView)
listView = new SigListView(parent, name);
@@ -41,7 +41,7 @@ void SigListView::load()
if(file.open(IO_ReadOnly) && doc.setContent(&file)) {
// find the root element
- QDomNodeList topLevelElements = doc.childNodes();
+ TQDomNodeList topLevelElements = doc.childNodes();
uint i = 0;
while(topLevelElements.item(i).toElement().tagName() != "SigML" && i < topLevelElements.count())
i++;
@@ -55,7 +55,7 @@ void SigListView::load()
doc.appendChild(rootElement);
}
- QDomNodeList signatures = doc.elementsByTagName("signature");
+ TQDomNodeList signatures = doc.elementsByTagName("signature");
for(i = 0; i < signatures.count(); i++)
(void) new SigListViewItem(this, doc, signatures.item(i).toElement());
@@ -70,7 +70,7 @@ void SigListView::load()
void SigListView::save()
{
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
while(it.current()) {
SigListViewItem *item = dynamic_cast<SigListViewItem *>(it.current());
if(item)
@@ -79,7 +79,7 @@ void SigListView::save()
}
if(file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
+ TQTextStream stream(&file);
stream << doc;
file.close();
}
@@ -87,7 +87,7 @@ void SigListView::save()
SigListViewItem *SigListView::createItem()
{
- QDomElement element = doc.createElement("signature");
+ TQDomElement element = doc.createElement("signature");
rootElement.appendChild(element);
SigListViewItem *item = new SigListViewItem(this, doc, element);
@@ -108,11 +108,11 @@ const SigListViewItem *SigListView::currentItem() const
// protected members
////////////////////////////////////////////////////////////////////////////////
-SigListView::SigListView(QWidget *parent, const char *name) : KListView(parent, name)
+SigListView::SigListView(TQWidget *parent, const char *name) : KListView(parent, name)
{
addColumn(i18n("Signatures"));
- QString dir = KGlobal::dirs()->saveLocation("appdata");
+ TQString dir = KGlobal::dirs()->saveLocation("appdata");
if(!dir.isNull())
file.setName(dir + "sigs.sigml");
load();
diff --git a/ksig/siglistview.h b/ksig/siglistview.h
index 553d86c..9e03c5e 100644
--- a/ksig/siglistview.h
+++ b/ksig/siglistview.h
@@ -21,8 +21,8 @@
#include <klistview.h>
#include <kdebug.h>
-#include <qfile.h>
-#include <qdom.h>
+#include <tqfile.h>
+#include <tqdom.h>
class SigListViewItem;
@@ -38,7 +38,7 @@ class SigListView : public KListView
{
Q_OBJECT
public:
- static SigListView *instance(QWidget *parent = 0, const char *name = 0);
+ static SigListView *instance(TQWidget *parent = 0, const char *name = 0);
void load();
void save();
@@ -57,15 +57,15 @@ public slots:
void clear() {}
protected:
- SigListView(QWidget *parent = 0, const char *name = 0);
+ SigListView(TQWidget *parent = 0, const char *name = 0);
virtual ~SigListView();
private:
static SigListView *listView;
- QFile file;
- QDomDocument doc;
- QDomElement rootElement;
+ TQFile file;
+ TQDomDocument doc;
+ TQDomElement rootElement;
};
#endif
diff --git a/ksig/siglistviewitem.cpp b/ksig/siglistviewitem.cpp
index 6744f87..0442c2e 100644
--- a/ksig/siglistviewitem.cpp
+++ b/ksig/siglistviewitem.cpp
@@ -20,7 +20,7 @@
#include <klocale.h>
#include <kdebug.h>
-#include <qregexp.h>
+#include <tqregexp.h>
////////////////////////////////////////////////////////////////////////////////
// public members
@@ -32,12 +32,12 @@ SigListViewItem::~SigListViewItem()
element.parentNode().removeChild(element);
}
-QString SigListViewItem::text() const
+TQString SigListViewItem::text() const
{
return(elementText);
}
-void SigListViewItem::setText(const QString &t)
+void SigListViewItem::setText(const TQString &t)
{
if(t != elementText) {
elementText = t;
@@ -54,9 +54,9 @@ void SigListViewItem::refreshText()
KListViewItem::setText(0, emptySigString);
}
-void SigListViewItem::nodeToText(const QDomNode &n, QString &s)
+void SigListViewItem::nodeToText(const TQDomNode &n, TQString &s)
{
- QDomNodeList children = n.childNodes();
+ TQDomNodeList children = n.childNodes();
for(uint i = 0; i < children.count(); i++) {
if(children.item(i).isText())
@@ -74,14 +74,14 @@ void SigListViewItem::nodeToText(const QDomNode &n, QString &s)
// private members
////////////////////////////////////////////////////////////////////////////////
-SigListViewItem::SigListViewItem(QListView *parent, QDomDocument document, QDomElement signatureElement) : KListViewItem(parent)
+SigListViewItem::SigListViewItem(TQListView *parent, TQDomDocument document, TQDomElement signatureElement) : KListViewItem(parent)
{
emptySigString = i18n("<empty signature>");
doc = document;
element = signatureElement;
nodeToText(element, elementText);
- elementText.replace(QRegExp("\n$"), "");
+ elementText.replace(TQRegExp("\n$"), "");
dirty = false;
refreshText();
@@ -90,16 +90,16 @@ SigListViewItem::SigListViewItem(QListView *parent, QDomDocument document, QDomE
void SigListViewItem::render()
{
if(dirty) {
- QDomNodeList children = element.childNodes();
+ TQDomNodeList children = element.childNodes();
while(!element.firstChild().isNull())
element.removeChild(element.firstChild());
// create new children
- QStringList lines = QStringList::split("\n", elementText, true);
+ TQStringList lines = TQStringList::split("\n", elementText, true);
- for(QStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
- QDomElement p = doc.createElement("p");
+ for(TQStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
+ TQDomElement p = doc.createElement("p");
element.appendChild(p);
p.appendChild(doc.createTextNode(*it));
}
diff --git a/ksig/siglistviewitem.h b/ksig/siglistviewitem.h
index f3a6814..2b51edd 100644
--- a/ksig/siglistviewitem.h
+++ b/ksig/siglistviewitem.h
@@ -20,18 +20,18 @@
#include "siglistview.h"
-#include <qdom.h>
+#include <tqdom.h>
class SigListViewItem : public KListViewItem
{
friend class SigListView;
public:
virtual ~SigListViewItem();
- void setText(const QString &t);
- QString text() const;
+ void setText(const TQString &t);
+ TQString text() const;
void refreshText();
- static void nodeToText(const QDomNode &n, QString &s);
+ static void nodeToText(const TQDomNode &n, TQString &s);
private:
/**
@@ -39,18 +39,18 @@ private:
* created using SigListView::createItem(). This is accessible to
* SigListView because SigListView is a friend class.
*/
- SigListViewItem(QListView *parent, QDomDocument document, QDomElement signatureElement);
+ SigListViewItem(TQListView *parent, TQDomDocument document, TQDomElement signatureElement);
/**
* Renders the data back to the DOM element.
*/
void render();
- QString emptySigString;
+ TQString emptySigString;
- QDomDocument doc;
- QDomElement element;
- QString elementText;
+ TQDomDocument doc;
+ TQDomElement element;
+ TQString elementText;
bool dirty;
};
diff --git a/ksig/standardtext.cpp b/ksig/standardtext.cpp
index 7c21e67..3800eef 100644
--- a/ksig/standardtext.cpp
+++ b/ksig/standardtext.cpp
@@ -16,11 +16,11 @@
#include <ktextedit.h>
-#include <qlabel.h>
+#include <tqlabel.h>
#include "standardtext.h"
-StandardText::StandardText(QWidget *parent, const char *name, bool modal, WFlags fl) : StandardTextBase(parent, name, modal, fl)
+StandardText::StandardText(TQWidget *parent, const char *name, bool modal, WFlags fl) : StandardTextBase(parent, name, modal, fl)
{
}
@@ -30,19 +30,19 @@ StandardText::~StandardText()
}
-void StandardText::setLabel(const QString &text)
+void StandardText::setLabel(const TQString &text)
{
label->setText(text);
}
-void StandardText::setText(const QString &text)
+void StandardText::setText(const TQString &text)
{
textEdit->setText(text);
}
void StandardText::done(int r)
{
- if(r == QDialog::Accepted)
+ if(r == TQDialog::Accepted)
emit textUpdated(textEdit->text());
StandardTextBase::done(r);
diff --git a/ksig/standardtext.h b/ksig/standardtext.h
index dfa8b8c..3ad2120 100644
--- a/ksig/standardtext.h
+++ b/ksig/standardtext.h
@@ -23,14 +23,14 @@ class StandardText : public StandardTextBase
{
Q_OBJECT
public:
- StandardText(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0);
+ StandardText(TQWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0);
virtual ~StandardText();
- void setLabel(const QString &text);
- void setText(const QString &text);
+ void setLabel(const TQString &text);
+ void setText(const TQString &text);
signals:
- void textUpdated(const QString &);
+ void textUpdated(const TQString &);
private slots:
virtual void done(int r);