summaryrefslogtreecommitdiffstats
path: root/ksig
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
commit395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch)
tree9829cadb79d2cc7c29a940627fadb28b11e54150 /ksig
parent399f47c376fdf4d19192732a701ea9578d11619d (diff)
downloadtdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz
tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksig')
-rw-r--r--ksig/ksig.cpp54
-rw-r--r--ksig/ksig.h5
-rw-r--r--ksig/ksig.spec4
-rw-r--r--ksig/siggenerator.cpp4
-rw-r--r--ksig/siglistview.cpp6
-rw-r--r--ksig/siglistview.h5
-rw-r--r--ksig/siglistviewitem.cpp22
-rw-r--r--ksig/siglistviewitem.h2
-rw-r--r--ksig/standardtext.cpp2
-rw-r--r--ksig/standardtext.h3
-rw-r--r--ksig/standardtextbase.ui16
11 files changed, 63 insertions, 60 deletions
diff --git a/ksig/ksig.cpp b/ksig/ksig.cpp
index 4ac8e9c..422e985 100644
--- a/ksig/ksig.cpp
+++ b/ksig/ksig.cpp
@@ -36,7 +36,7 @@
// public methods
////////////////////////////////////////////////////////////////////////////////
-KSig::KSig(TQWidget *parent, const char *name) : KMainWindow(parent, name),
+KSig::KSig(TQWidget *tqparent, const char *name) : KMainWindow(tqparent, name),
changed(false)
{
setupActions();
@@ -63,18 +63,18 @@ KSig::~KSig()
void KSig::setupActions()
{
- 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");
+ KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(add()), actionCollection());
+ new KAction(i18n("Remove"), "editdelete", 0, TQT_TQOBJECT(this), TQT_SLOT(remove()), actionCollection(), "remove");
+ KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection());
+ KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(quit()), actionCollection());
+
+ KStdAction::cut(TQT_TQOBJECT(kapp), TQT_SLOT(cut()), actionCollection());
+ KStdAction::copy(TQT_TQOBJECT(kapp), TQT_SLOT(copy()), actionCollection());
+ KStdAction::paste(TQT_TQOBJECT(kapp), TQT_SLOT(paste()), actionCollection());
+ new KAction(i18n("C&lear"), "editclear", 0, TQT_TQOBJECT(kapp), TQT_SLOT(clear()), actionCollection(), "clear");
+
+ new KAction(i18n("Edit Standard Header"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(editHeader()), actionCollection(), "editHeader");
+ new KAction(i18n("Edit Standard Footer"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(editFooter()), actionCollection(), "editFooter");
}
void KSig::setupLayout()
@@ -86,19 +86,19 @@ void KSig::setupLayout()
sigList = SigListView::instance(splitter, "sigList");
sigEdit = new KTextEdit(splitter, "sigEdit");
- sigEdit->setTextFormat(Qt::PlainText);
+ sigEdit->setTextFormat(TQt::PlainText);
sigEdit->setFont(KGlobalSettings::fixedFont());
sigEdit->setEnabled(false);
sigEdit->setCheckSpellingEnabled(true);
- statusBar()->insertItem(i18n(" Line: %1 ").arg(0), LineNumber, 0, true);
- statusBar()->insertItem(i18n(" Col: %1 ").arg(0), ColumnNumber, 0, true);
+ statusBar()->insertItem(i18n(" Line: %1 ").tqarg(0), LineNumber, 0, true);
+ statusBar()->insertItem(i18n(" Col: %1 ").tqarg(0), ColumnNumber, 0, true);
statusBar()->show();
updateListLock = false;
- 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)));
+ connect(sigEdit, TQT_SIGNAL(textChanged()), TQT_TQOBJECT(this), TQT_SLOT(updateList()));
+ connect(sigList, TQT_SIGNAL(selectionChanged()), TQT_TQOBJECT(this), TQT_SLOT(updateEdit()));
+ connect(sigEdit, TQT_SIGNAL(cursorPositionChanged(int,int)), TQT_TQOBJECT(this), TQT_SLOT(updatetqStatus(int,int)));
}
void KSig::setupSearchLine()
@@ -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?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::discard());
+ int saveChanges = KMessageBox::questionYesNoCancel(this, i18n("Do you want to save your changes before exiting?"),TQString(),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(TQString::null, true, true));
+ setCaption(kapp->makeStdCaption(TQString(), true, true));
else
- setCaption(kapp->makeStdCaption(TQString::null, true, false));
+ setCaption(kapp->makeStdCaption(TQString(), true, false));
}
void KSig::editHeader()
@@ -222,7 +222,7 @@ void KSig::editHeader()
t->setLabel(i18n("Standard signature header:"));
t->setText(header);
- connect(t, TQT_SIGNAL(textUpdated(const TQString &)), this, TQT_SLOT(setHeader(const TQString &)));
+ connect(t, TQT_SIGNAL(textUpdated(const TQString &)), TQT_TQOBJECT(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, TQT_SIGNAL(textUpdated(const TQString &)), this, TQT_SLOT(setFooter(const TQString &)));
+ connect(t, TQT_SIGNAL(textUpdated(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(setFooter(const TQString &)));
t->exec();
}
@@ -259,10 +259,10 @@ void KSig::updateEdit()
updateListLock = false;
}
-void KSig::updateStatus(int line, int column)
+void KSig::updatetqStatus(int line, int column)
{
- statusBar()->changeItem(i18n(" Line: %1 ").arg(line + 1), LineNumber);
- statusBar()->changeItem(i18n(" Col: %1 ").arg(column + 1), ColumnNumber);
+ statusBar()->changeItem(i18n(" Line: %1 ").tqarg(line + 1), LineNumber);
+ statusBar()->changeItem(i18n(" Col: %1 ").tqarg(column + 1), ColumnNumber);
}
void KSig::quit()
diff --git a/ksig/ksig.h b/ksig/ksig.h
index ece738d..b1c4ef1 100644
--- a/ksig/ksig.h
+++ b/ksig/ksig.h
@@ -28,9 +28,10 @@ class TQSplitter;
class KSig : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
- KSig(TQWidget *parent = 0, const char *name = 0);
+ KSig(TQWidget *tqparent = 0, const char *name = 0);
virtual ~KSig();
private:
@@ -59,7 +60,7 @@ private slots:
void updateList();
void updateEdit();
- void updateStatus(int line, int column);
+ void updatetqStatus(int line, int column);
private:
TQString header;
diff --git a/ksig/ksig.spec b/ksig/ksig.spec
index 19d77a3..8844a6a 100644
--- a/ksig/ksig.spec
+++ b/ksig/ksig.spec
@@ -33,8 +33,8 @@ make -j$numprocs
%install
make prefix=$RPM_BUILD_ROOT%{prefix} install
cd $RPM_BUILD_ROOT
-find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/%{name}-master.list
-find . -type f -o -type l | sed 's|^\.||' >> $RPM_BUILD_DIR/%{name}-master.list
+tqfind . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/%{name}-master.list
+tqfind . -type f -o -type l | sed 's|^\.||' >> $RPM_BUILD_DIR/%{name}-master.list
%clean
#rm -rf $RPM_BUILD_ROOT
diff --git a/ksig/siggenerator.cpp b/ksig/siggenerator.cpp
index abd2430..42f6141 100644
--- a/ksig/siggenerator.cpp
+++ b/ksig/siggenerator.cpp
@@ -53,7 +53,7 @@ SigGenerator::~SigGenerator()
TQString SigGenerator::random() const
{
if(signatures.count() <= 0)
- return(TQString::null);
+ return(TQString());
int i = KApplication::random() % signatures.count();
TQString text;
@@ -65,7 +65,7 @@ TQString SigGenerator::random() const
TQString SigGenerator::daily() const
{
if(signatures.count() <= 0)
- return(TQString::null);
+ return(TQString());
TQDate date;
int i = date.dayOfYear() % signatures.count();
diff --git a/ksig/siglistview.cpp b/ksig/siglistview.cpp
index 4bbc693..aaf6ec2 100644
--- a/ksig/siglistview.cpp
+++ b/ksig/siglistview.cpp
@@ -29,10 +29,10 @@ SigListView *SigListView::listView = 0;
// public members
////////////////////////////////////////////////////////////////////////////////
-SigListView *SigListView::instance(TQWidget *parent, const char *name)
+SigListView *SigListView::instance(TQWidget *tqparent, const char *name)
{
if(!listView)
- listView = new SigListView(parent, name);
+ listView = new SigListView(tqparent, name);
return(listView);
}
@@ -108,7 +108,7 @@ const SigListViewItem *SigListView::currentItem() const
// protected members
////////////////////////////////////////////////////////////////////////////////
-SigListView::SigListView(TQWidget *parent, const char *name) : KListView(parent, name)
+SigListView::SigListView(TQWidget *tqparent, const char *name) : KListView(tqparent, name)
{
addColumn(i18n("Signatures"));
diff --git a/ksig/siglistview.h b/ksig/siglistview.h
index 9e03c5e..be84e5f 100644
--- a/ksig/siglistview.h
+++ b/ksig/siglistview.h
@@ -37,8 +37,9 @@ class SigListViewItem;
class SigListView : public KListView
{
Q_OBJECT
+ TQ_OBJECT
public:
- static SigListView *instance(TQWidget *parent = 0, const char *name = 0);
+ static SigListView *instance(TQWidget *tqparent = 0, const char *name = 0);
void load();
void save();
@@ -57,7 +58,7 @@ public slots:
void clear() {}
protected:
- SigListView(TQWidget *parent = 0, const char *name = 0);
+ SigListView(TQWidget *tqparent = 0, const char *name = 0);
virtual ~SigListView();
private:
diff --git a/ksig/siglistviewitem.cpp b/ksig/siglistviewitem.cpp
index 0442c2e..a9f4f5e 100644
--- a/ksig/siglistviewitem.cpp
+++ b/ksig/siglistviewitem.cpp
@@ -29,7 +29,7 @@
SigListViewItem::~SigListViewItem()
{
// remove the element from the tree
- element.parentNode().removeChild(element);
+ element.tqparentNode().removeChild(element);
}
TQString SigListViewItem::text() const
@@ -56,14 +56,14 @@ void SigListViewItem::refreshText()
void SigListViewItem::nodeToText(const TQDomNode &n, TQString &s)
{
- TQDomNodeList children = n.childNodes();
+ TQDomNodeList tqchildren = n.childNodes();
- for(uint i = 0; i < children.count(); i++) {
- if(children.item(i).isText())
- s.append(children.item(i).toText().data());
+ for(uint i = 0; i < tqchildren.count(); i++) {
+ if(tqchildren.item(i).isText())
+ s.append(tqchildren.item(i).toText().data());
else {
- nodeToText(children.item(i), s);
- if(children.item(i).isElement() && children.item(i).toElement().tagName() == "p") {
+ nodeToText(tqchildren.item(i), s);
+ if(tqchildren.item(i).isElement() && tqchildren.item(i).toElement().tagName() == "p") {
s.append("\n");
}
}
@@ -74,14 +74,14 @@ void SigListViewItem::nodeToText(const TQDomNode &n, TQString &s)
// private members
////////////////////////////////////////////////////////////////////////////////
-SigListViewItem::SigListViewItem(TQListView *parent, TQDomDocument document, TQDomElement signatureElement) : KListViewItem(parent)
+SigListViewItem::SigListViewItem(TQListView *tqparent, TQDomDocument document, TQDomElement signatureElement) : KListViewItem(tqparent)
{
emptySigString = i18n("<empty signature>");
doc = document;
element = signatureElement;
nodeToText(element, elementText);
- elementText.replace(TQRegExp("\n$"), "");
+ elementText.tqreplace(TQRegExp("\n$"), "");
dirty = false;
refreshText();
@@ -90,12 +90,12 @@ SigListViewItem::SigListViewItem(TQListView *parent, TQDomDocument document, TQD
void SigListViewItem::render()
{
if(dirty) {
- TQDomNodeList children = element.childNodes();
+ TQDomNodeList tqchildren = element.childNodes();
while(!element.firstChild().isNull())
element.removeChild(element.firstChild());
- // create new children
+ // create new tqchildren
TQStringList lines = TQStringList::split("\n", elementText, true);
for(TQStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
diff --git a/ksig/siglistviewitem.h b/ksig/siglistviewitem.h
index 2b51edd..0641576 100644
--- a/ksig/siglistviewitem.h
+++ b/ksig/siglistviewitem.h
@@ -39,7 +39,7 @@ private:
* created using SigListView::createItem(). This is accessible to
* SigListView because SigListView is a friend class.
*/
- SigListViewItem(TQListView *parent, TQDomDocument document, TQDomElement signatureElement);
+ SigListViewItem(TQListView *tqparent, TQDomDocument document, TQDomElement signatureElement);
/**
* Renders the data back to the DOM element.
diff --git a/ksig/standardtext.cpp b/ksig/standardtext.cpp
index 3800eef..1788d7b 100644
--- a/ksig/standardtext.cpp
+++ b/ksig/standardtext.cpp
@@ -20,7 +20,7 @@
#include "standardtext.h"
-StandardText::StandardText(TQWidget *parent, const char *name, bool modal, WFlags fl) : StandardTextBase(parent, name, modal, fl)
+StandardText::StandardText(TQWidget *tqparent, const char *name, bool modal, WFlags fl) : StandardTextBase(tqparent, name, modal, fl)
{
}
diff --git a/ksig/standardtext.h b/ksig/standardtext.h
index 3ad2120..1ea3667 100644
--- a/ksig/standardtext.h
+++ b/ksig/standardtext.h
@@ -22,8 +22,9 @@
class StandardText : public StandardTextBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- StandardText(TQWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0);
+ StandardText(TQWidget *tqparent = 0, const char *name = 0, bool modal = false, WFlags fl = 0);
virtual ~StandardText();
void setLabel(const TQString &text);
diff --git a/ksig/standardtextbase.ui b/ksig/standardtextbase.ui
index d1050c2..f7373fd 100644
--- a/ksig/standardtextbase.ui
+++ b/ksig/standardtextbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>StandardTextBase</class>
-<widget class="QDialog">
+<widget class="TQDialog">
<property name="name">
<cstring>StandardTextBase</cstring>
</property>
@@ -19,7 +19,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>label</cstring>
</property>
@@ -32,9 +32,9 @@
<cstring>textEdit</cstring>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout</cstring>
+ <cstring>tqlayout</cstring>
</property>
<hbox>
<property name="name">
@@ -56,14 +56,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>buttonOk</cstring>
</property>
@@ -80,7 +80,7 @@
<bool>true</bool>
</property>
</widget>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>buttonCancel</cstring>
</property>
@@ -112,7 +112,7 @@
<slot>reject()</slot>
</connection>
</connections>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>ktextedit.h</includehint>
</includehints>