summaryrefslogtreecommitdiffstats
path: root/src/ksvnwidgets/logmsg_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ksvnwidgets/logmsg_impl.cpp')
-rw-r--r--src/ksvnwidgets/logmsg_impl.cpp186
1 files changed, 93 insertions, 93 deletions
diff --git a/src/ksvnwidgets/logmsg_impl.cpp b/src/ksvnwidgets/logmsg_impl.cpp
index f083d4c..0a10467 100644
--- a/src/ksvnwidgets/logmsg_impl.cpp
+++ b/src/ksvnwidgets/logmsg_impl.cpp
@@ -36,36 +36,36 @@
#include <kfile.h>
#include <kurlrequester.h>
-#include <qvbox.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlistview.h>
-#include <qlayout.h>
-#include <qwidget.h>
-#include <qpushbutton.h>
-#include <qfile.h>
+#include <tqvbox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlistview.h>
+#include <tqlayout.h>
+#include <tqwidget.h>
+#include <tqpushbutton.h>
+#include <tqfile.h>
#define MAX_MESSAGE_HISTORY 10
-QValueList<QString> Logmsg_impl::sLogHistory = QValueList<QString>();
-QString Logmsg_impl::sLastMessage=QString();
-const QString Logmsg_impl::groupName("logmsg_dlg_size");
+TQValueList<TQString> Logmsg_impl::sLogHistory = TQValueList<TQString>();
+TQString Logmsg_impl::sLastMessage=TQString();
+const TQString Logmsg_impl::groupName("logmsg_dlg_size");
unsigned int Logmsg_impl::smax_message_history = 0xFFFF;
-class SvnCheckListItem:public QCheckListItem
+class SvnCheckListItem:public TQCheckListItem
{
protected:
Logmsg_impl::logActionEntry m_Content;
public:
- SvnCheckListItem(QListView*,const Logmsg_impl::logActionEntry&);
+ SvnCheckListItem(TQListView*,const Logmsg_impl::logActionEntry&);
const Logmsg_impl::logActionEntry&data(){return m_Content;}
virtual int rtti()const{return 1000;}
- virtual int compare( QListViewItem* item, int col, bool ascending ) const;
+ virtual int compare( TQListViewItem* item, int col, bool ascending ) const;
};
-Logmsg_impl::Logmsg_impl(QWidget *parent, const char *name)
- :LogmessageData(parent, name)
+Logmsg_impl::Logmsg_impl(TQWidget *tqparent, const char *name)
+ :LogmessageData(tqparent, name)
{
m_LogEdit->setFocus();
m_Reviewlabel->hide();
@@ -81,8 +81,8 @@ Logmsg_impl::Logmsg_impl(QWidget *parent, const char *name)
m_DiffItem=0;
}
-Logmsg_impl::Logmsg_impl(const svn::CommitItemList&_items,QWidget *parent, const char *name)
- :LogmessageData(parent, name)
+Logmsg_impl::Logmsg_impl(const svn::CommitItemList&_items,TQWidget *tqparent, const char *name)
+ :LogmessageData(tqparent, name)
{
m_LogEdit->setFocus();
m_ReviewList->setColumnText(1,i18n("Items to commit"));
@@ -91,13 +91,13 @@ Logmsg_impl::Logmsg_impl(const svn::CommitItemList&_items,QWidget *parent, const
hideButtons(true);
if (_items.count()>0) {
for (unsigned i = 0;i<_items.count();++i) {
- QListViewItem*item = new QListViewItem(m_ReviewList);
+ TQListViewItem*item = new TQListViewItem(m_ReviewList);
if (_items[i].path().isEmpty()) {
item->setText(1,_items[i].url());
} else {
item->setText(1,_items[i].path());
}
- item->setText(0,QChar(_items[i].actionType()));
+ item->setText(0,TQChar(_items[i].actionType()));
}
m_hidden=false;
} else {
@@ -108,8 +108,8 @@ Logmsg_impl::Logmsg_impl(const svn::CommitItemList&_items,QWidget *parent, const
checkSplitterSize();
}
-Logmsg_impl::Logmsg_impl(const QMap<QString,QString>&_items,QWidget *parent, const char *name)
- :LogmessageData(parent, name)
+Logmsg_impl::Logmsg_impl(const TQMap<TQString,TQString>&_items,TQWidget *tqparent, const char *name)
+ :LogmessageData(tqparent, name)
{
m_LogEdit->setFocus();
m_ReviewList->setColumnText(1,i18n("Items to commit"));
@@ -117,9 +117,9 @@ Logmsg_impl::Logmsg_impl(const QMap<QString,QString>&_items,QWidget *parent, con
m_ReviewList->setSortColumn(1);
hideButtons(true);
if (_items.count()>0) {
- QMap<QString,QString>::ConstIterator it = _items.begin();
+ TQMap<TQString,TQString>::ConstIterator it = _items.begin();
for (;it!=_items.end();++it) {
- QListViewItem*item = new QListViewItem(m_ReviewList);
+ TQListViewItem*item = new TQListViewItem(m_ReviewList);
item->setText(1,it.key());
item->setText(0,it.data());
}
@@ -134,18 +134,18 @@ Logmsg_impl::Logmsg_impl(const QMap<QString,QString>&_items,QWidget *parent, con
Logmsg_impl::Logmsg_impl(const logActionEntries&_activatedList,
const logActionEntries&_notActivatedList,
- QWidget *parent, const char *name)
- :LogmessageData(parent, name)
+ TQWidget *tqparent, const char *name)
+ :LogmessageData(tqparent, name)
{
m_LogEdit->setFocus();
m_hidden=false;
for (unsigned j = 0; j<_activatedList.count();++j) {
SvnCheckListItem * item = new SvnCheckListItem(m_ReviewList,_activatedList[j]);
- item->setState(QCheckListItem::On);
+ item->setState(TQCheckListItem::On);
}
for (unsigned j = 0; j<_notActivatedList.count();++j) {
SvnCheckListItem * item = new SvnCheckListItem(m_ReviewList,_notActivatedList[j]);
- item->setState(QCheckListItem::Off);
+ item->setState(TQCheckListItem::Off);
}
m_HideNewItems->setOn(Kdesvnsettings::commit_hide_new());
checkSplitterSize();
@@ -153,7 +153,7 @@ Logmsg_impl::Logmsg_impl(const logActionEntries&_activatedList,
Logmsg_impl::~Logmsg_impl()
{
- QValueList<int> list = m_MainSplitter->sizes();
+ TQValueList<int> list = m_MainSplitter->sizes();
if (!m_hidden && list.count()==2) {
Kdesvnsettings::setCommit_splitter_height(list);
Kdesvnsettings::writeConfig();
@@ -161,12 +161,12 @@ Logmsg_impl::~Logmsg_impl()
for (unsigned int j=0; j<m_Hidden.size();++j) {
delete m_Hidden[j];
}
- Kdesvnsettings::setCommit_hide_new(m_HideNewItems->state()==QButton::On);
+ Kdesvnsettings::setCommit_hide_new(m_HideNewItems->state()==TQButton::On);
}
void Logmsg_impl::checkSplitterSize()
{
- QValueList<int> list = Kdesvnsettings::commit_splitter_height();
+ TQValueList<int> list = Kdesvnsettings::commit_splitter_height();
if (list.count()!=2) {
return;
}
@@ -191,7 +191,7 @@ void Logmsg_impl::slotHistoryActivated(int number)
/*!
\fn Logmsg_impl::getMessage()const
*/
-QString Logmsg_impl::getMessage()const
+TQString Logmsg_impl::getMessage()const
{
return m_LogEdit->text();
}
@@ -222,22 +222,22 @@ void Logmsg_impl::initHistory()
if (smax_message_history==0xFFFF) {
smax_message_history = Kdesvnsettings::max_log_messages();
KConfigGroup cs(Kdesvnsettings::self()->config(),"log_messages");
- QString s = QString::null;
+ TQString s = TQString();
unsigned int current = 0;
- QString key = QString("log_%0").arg(current);
- s = cs.readEntry(key,QString::null);
- while (s!=QString::null) {
+ TQString key = TQString("log_%0").tqarg(current);
+ s = cs.readEntry(key,TQString());
+ while (s!=TQString()) {
if (current<smax_message_history) {
sLogHistory.push_back(s);
} else {
cs.deleteEntry(key);
}
++current;
- key = QString("log_%0").arg(current);
- s = cs.readEntry(key,QString::null);
+ key = TQString("log_%0").tqarg(current);
+ s = cs.readEntry(key,TQString());
}
}
- QValueList<QString>::const_iterator it;
+ TQValueList<TQString>::const_iterator it;
for (it=sLogHistory.begin();it!=sLogHistory.end();++it) {
if ((*it).length()<=40) {
m_LogHistory->insertItem((*it));
@@ -247,7 +247,7 @@ void Logmsg_impl::initHistory()
}
if (sLastMessage.length()>0) {
m_LogEdit->setText(sLastMessage);
- sLastMessage=QString();
+ sLastMessage=TQString();
}
}
@@ -260,8 +260,8 @@ void Logmsg_impl::saveHistory(bool canceld)
if (m_LogEdit->text().length()==0||m_LogEdit->text().length()>512) return;
/// @todo make static threadsafe
if (!canceld) {
- QValueList<QString>::iterator it;
- if ( (it=sLogHistory.find(m_LogEdit->text()))!=sLogHistory.end()) {
+ TQValueList<TQString>::iterator it;
+ if ( (it=sLogHistory.tqfind(m_LogEdit->text()))!=sLogHistory.end()) {
sLogHistory.erase(it);
}
sLogHistory.push_front(m_LogEdit->text());
@@ -270,7 +270,7 @@ void Logmsg_impl::saveHistory(bool canceld)
}
KConfigGroup cs(Kdesvnsettings::self()->config(),"log_messages");
for (unsigned int i = 0; i < sLogHistory.size();++i) {
- cs.writeEntry(QString("log_%0").arg(i),sLogHistory[i]);
+ cs.writeEntry(TQString("log_%0").tqarg(i),sLogHistory[i]);
}
cs.sync();
} else {
@@ -278,17 +278,17 @@ void Logmsg_impl::saveHistory(bool canceld)
}
}
-QString Logmsg_impl::getLogmessage(bool*ok,svn::Depth*rec,bool*keep_locks,QWidget*parent,const char*name)
+TQString Logmsg_impl::getLogmessage(bool*ok,svn::Depth*rec,bool*keep_locks,TQWidget*tqparent,const char*name)
{
bool _ok,_keep_locks;
svn::Depth _depth = svn::DepthUnknown;
- QString msg("");
+ TQString msg("");
Logmsg_impl*ptr=0;
- KDialogBase dlg(parent,name,true,i18n("Commit log"),
+ KDialogBase dlg(tqparent,name,true,i18n("Commit log"),
KDialogBase::Ok|KDialogBase::Cancel,
KDialogBase::Ok,true);
- QWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
+ TQWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
ptr = new Logmsg_impl(Dialog1Layout);
if (!rec) {
@@ -299,7 +299,7 @@ QString Logmsg_impl::getLogmessage(bool*ok,svn::Depth*rec,bool*keep_locks,QWidge
}
ptr->initHistory();
dlg.resize(dlg.configDialogSize(*(Kdesvnsettings::self()->config()),groupName));
- if (dlg.exec()!=QDialog::Accepted) {
+ if (dlg.exec()!=TQDialog::Accepted) {
_ok = false;
/* avoid compiler warnings */
_keep_locks = false;
@@ -317,17 +317,17 @@ QString Logmsg_impl::getLogmessage(bool*ok,svn::Depth*rec,bool*keep_locks,QWidge
return msg;
}
-QString Logmsg_impl::getLogmessage(const svn::CommitItemList&items,bool*ok,svn::Depth*rec,bool*keep_locks,QWidget*parent,const char*name)
+TQString Logmsg_impl::getLogmessage(const svn::CommitItemList&items,bool*ok,svn::Depth*rec,bool*keep_locks,TQWidget*tqparent,const char*name)
{
bool _ok,_keep_locks;
svn::Depth _depth = svn::DepthUnknown;
- QString msg("");
+ TQString msg("");
Logmsg_impl*ptr=0;
- KDialogBase dlg(parent,name,true,i18n("Commit log"),
+ KDialogBase dlg(tqparent,name,true,i18n("Commit log"),
KDialogBase::Ok|KDialogBase::Cancel,
KDialogBase::Ok,true);
- QWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
+ TQWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
ptr = new Logmsg_impl(items,Dialog1Layout);
if (!rec) {
@@ -339,7 +339,7 @@ QString Logmsg_impl::getLogmessage(const svn::CommitItemList&items,bool*ok,svn::
ptr->initHistory();
dlg.resize(dlg.configDialogSize(*(Kdesvnsettings::self()->config()),groupName));
- if (dlg.exec()!=QDialog::Accepted) {
+ if (dlg.exec()!=TQDialog::Accepted) {
_ok = false;
/* avoid compiler warnings */
_keep_locks = false;
@@ -358,18 +358,18 @@ QString Logmsg_impl::getLogmessage(const svn::CommitItemList&items,bool*ok,svn::
return msg;
}
-QString Logmsg_impl::getLogmessage(const QMap<QString,QString>&items,
- bool*ok,svn::Depth*rec,bool*keep_locks,QWidget*parent,const char*name)
+TQString Logmsg_impl::getLogmessage(const TQMap<TQString,TQString>&items,
+ bool*ok,svn::Depth*rec,bool*keep_locks,TQWidget*tqparent,const char*name)
{
bool _ok,_rec,_keep_locks;
svn::Depth _depth = svn::DepthUnknown;
- QString msg("");
+ TQString msg("");
Logmsg_impl*ptr=0;
- KDialogBase dlg(parent,name,true,i18n("Commit log"),
+ KDialogBase dlg(tqparent,name,true,i18n("Commit log"),
KDialogBase::Ok|KDialogBase::Cancel,
KDialogBase::Ok,true);
- QWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
+ TQWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
ptr = new Logmsg_impl(items,Dialog1Layout);
if (!rec) {
@@ -380,7 +380,7 @@ QString Logmsg_impl::getLogmessage(const QMap<QString,QString>&items,
}
ptr->initHistory();
dlg.resize(dlg.configDialogSize(*(Kdesvnsettings::self()->config()),groupName));
- if (dlg.exec()!=QDialog::Accepted) {
+ if (dlg.exec()!=TQDialog::Accepted) {
_ok = false;
/* avoid compiler warnings */
_rec = false;
@@ -400,20 +400,20 @@ QString Logmsg_impl::getLogmessage(const QMap<QString,QString>&items,
return msg;
}
-QString Logmsg_impl::getLogmessage(const logActionEntries&_on,
+TQString Logmsg_impl::getLogmessage(const logActionEntries&_on,
const logActionEntries&_off,
- QObject*callback,
+ TQObject*callback,
logActionEntries&_result,
- bool*ok,bool*keep_locks,QWidget*parent,const char*name)
+ bool*ok,bool*keep_locks,TQWidget*tqparent,const char*name)
{
bool _ok,_keep_locks;
- QString msg("");
+ TQString msg("");
Logmsg_impl*ptr=0;
- KDialogBase dlg(parent,name,true,i18n("Commit log"),
+ KDialogBase dlg(tqparent,name,true,i18n("Commit log"),
KDialogBase::Ok|KDialogBase::Cancel,
KDialogBase::Ok,true);
- QWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
+ TQWidget* Dialog1Layout = dlg.makeVBoxMainWidget();
ptr = new Logmsg_impl(_on,_off,Dialog1Layout);
ptr->m_DepthSelector->hide();
if (!keep_locks) {
@@ -422,11 +422,11 @@ QString Logmsg_impl::getLogmessage(const logActionEntries&_on,
ptr->initHistory();
if (callback)
{
- connect(ptr,SIGNAL(makeDiff(const QString&,const svn::Revision&,const QString&,const svn::Revision&,QWidget*)),
- callback,SLOT(makeDiff(const QString&,const svn::Revision&,const QString&,const svn::Revision&,QWidget*)));
+ connect(ptr,TQT_SIGNAL(makeDiff(const TQString&,const svn::Revision&,const TQString&,const svn::Revision&,TQWidget*)),
+ callback,TQT_SLOT(makeDiff(const TQString&,const svn::Revision&,const TQString&,const svn::Revision&,TQWidget*)));
}
dlg.resize(dlg.configDialogSize(*(Kdesvnsettings::self()->config()),groupName));
- if (dlg.exec()!=QDialog::Accepted) {
+ if (dlg.exec()!=TQDialog::Accepted) {
_ok = false;
/* avoid compiler warnings */
_keep_locks=false;
@@ -444,23 +444,23 @@ QString Logmsg_impl::getLogmessage(const logActionEntries&_on,
}
/*!
- \fn Logmsg_impl::setRecCheckboxtext(const QString&what)
+ \fn Logmsg_impl::setRecCheckboxtext(const TQString&what)
*/
-void Logmsg_impl::addItemWidget(QWidget*aWidget)
+void Logmsg_impl::addItemWidget(TQWidget*aWidget)
{
m_DepthSelector->addItemWidget(aWidget);
-/* aWidget->reparent(this,geometry().topLeft());
+/* aWidget->reparent(this,tqgeometry().topLeft());
m_ItemsLayout->addWidget(aWidget);
- kdDebug()<<"SizeHint: "<<aWidget->minimumSizeHint()<< endl;
- aWidget->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
- setMinimumHeight(minimumSizeHint().height());*/
+ kdDebug()<<"SizeHint: "<<aWidget->tqminimumSizeHint()<< endl;
+ aWidget->tqsetSizePolicy(TQSizePolicy::Fixed,TQSizePolicy::Fixed);
+ setMinimumHeight(tqminimumSizeHint().height());*/
}
Logmsg_impl::logActionEntries Logmsg_impl::selectedEntries()
{
logActionEntries _result;
if (m_ReviewList) {
- QListViewItemIterator it( m_ReviewList );
+ TQListViewItemIterator it( m_ReviewList );
while ( it.current() ) {
if (it.current()->rtti()==1000) {
SvnCheckListItem *item = static_cast<SvnCheckListItem*>(it.current());
@@ -474,7 +474,7 @@ Logmsg_impl::logActionEntries Logmsg_impl::selectedEntries()
return _result;
}
-Logmsg_impl::logActionEntry::logActionEntry(const QString&name,const QString&action,ACTION_TYPE kind)
+Logmsg_impl::logActionEntry::logActionEntry(const TQString&name,const TQString&action,ACTION_TYPE kind)
: _name(name),_actionDesc(action),_kind(kind)
{
}
@@ -484,8 +484,8 @@ Logmsg_impl::logActionEntry::logActionEntry()
{
}
-SvnCheckListItem::SvnCheckListItem(QListView*parent,const Logmsg_impl::logActionEntry&content)
- :QCheckListItem(parent,content._name,QCheckListItem::CheckBox),m_Content(content)
+SvnCheckListItem::SvnCheckListItem(TQListView*tqparent,const Logmsg_impl::logActionEntry&content)
+ :TQCheckListItem(tqparent,content._name,TQCheckListItem::CheckBox),m_Content(content)
{
setTristate(FALSE);
setText(1,m_Content._actionDesc);
@@ -494,10 +494,10 @@ SvnCheckListItem::SvnCheckListItem(QListView*parent,const Logmsg_impl::logAction
}
}
-int SvnCheckListItem::compare( QListViewItem* item, int col, bool ascending ) const
+int SvnCheckListItem::compare( TQListViewItem* item, int col, bool ascending ) const
{
if (item->rtti()!=1000 || col>0) {
- return QCheckListItem::compare(item,col,ascending);
+ return TQCheckListItem::compare(item,col,ascending);
}
SvnCheckListItem* k = static_cast<SvnCheckListItem*>( item );
if (Kdesvnsettings::case_sensitive_sort()) {
@@ -522,7 +522,7 @@ void Logmsg_impl::slotMarkUnversioned()
void Logmsg_impl::slotDiffSelected()
{
- QListViewItem * it=0;
+ TQListViewItem * it=0;
if (!m_ReviewList || !(it=m_ReviewList->selectedItem()))
{
return;
@@ -530,8 +530,8 @@ void Logmsg_impl::slotDiffSelected()
if (it->rtti()==1000)
{
SvnCheckListItem *item = static_cast<SvnCheckListItem*>(it);
- QString what = item->data()._name;
- emit makeDiff(what,svn::Revision::BASE,what,svn::Revision::WORKING,parentWidget());
+ TQString what = item->data()._name;
+ emit makeDiff(what,svn::Revision::BASE,what,svn::Revision::WORKING,tqparentWidget());
}
}
@@ -560,7 +560,7 @@ void Logmsg_impl::hideButtons(bool how)
void Logmsg_impl::markUnversioned(bool mark)
{
if (!m_ReviewList)return;
- QListViewItemIterator it( m_ReviewList );
+ TQListViewItemIterator it( m_ReviewList );
while ( it.current() ) {
if (it.current()->rtti()==1000) {
SvnCheckListItem *item = static_cast<SvnCheckListItem*>(it.current());
@@ -577,7 +577,7 @@ void Logmsg_impl::hideNewItems(bool how)
if (!m_ReviewList)return;
if (how) {
- QListViewItemIterator it( m_ReviewList );
+ TQListViewItemIterator it( m_ReviewList );
while ( it.current() ) {
if (it.current()->rtti()==1000) {
SvnCheckListItem *item = static_cast<SvnCheckListItem*>(it.current());
@@ -609,12 +609,12 @@ void Logmsg_impl::hideDepth(bool ahide)
// else m_DepthSelector->show();
}
-void Logmsg_impl::insertFile(const QString&fname)
+void Logmsg_impl::insertFile(const TQString&fname)
{
- QFile ifs(fname);
+ TQFile ifs(fname);
if (ifs.open(IO_ReadOnly)) {
- QTextStream ts(&ifs);
- QString _content = ts.read();
+ TQTextStream ts(&ifs);
+ TQString _content = ts.read();
int para,index;
m_LogEdit->getCursorPosition(&para,&index);
m_LogEdit->insertAt(_content,para,index);
@@ -623,14 +623,14 @@ void Logmsg_impl::insertFile(const QString&fname)
void Logmsg_impl::insertFile()
{
- QString head = i18n("Select textfile for insert");
- KURLRequesterDlg dlg(QString::null,this,head);
+ TQString head = i18n("Select textfile for insert");
+ KURLRequesterDlg dlg(TQString(),this,head);
dlg.setCaption(head);
KFile::Mode mode = static_cast<KFile::Mode>(KFile::File);
dlg.urlRequester()->setMode(mode);
dlg.urlRequester()->setCaption(head);
- if (dlg.exec()!=QDialog::Accepted) {
+ if (dlg.exec()!=TQDialog::Accepted) {
return;
}
KURL _url = dlg.selectedURL();
@@ -640,7 +640,7 @@ void Logmsg_impl::insertFile()
if (_url.isLocalFile()) {
insertFile(_url.path());
} else {
- QString tmpFile;
+ TQString tmpFile;
if( KIO::NetAccess::download(_url, tmpFile, this) ) {
insertFile( tmpFile );
KIO::NetAccess::removeTempFile( tmpFile );