diff options
Diffstat (limited to 'src/svnfrontend/commandexec.cpp')
-rw-r--r-- | src/svnfrontend/commandexec.cpp | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/src/svnfrontend/commandexec.cpp b/src/svnfrontend/commandexec.cpp index 86638de..daeab29 100644 --- a/src/svnfrontend/commandexec.cpp +++ b/src/svnfrontend/commandexec.cpp @@ -39,10 +39,10 @@ #include <kdialogbase.h> #include <ktextbrowser.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qvaluelist.h> -#include <qvbox.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqvaluelist.h> +#include <tqvbox.h> class pCPart { @@ -50,8 +50,8 @@ public: pCPart(); ~pCPart(); - QString cmd; - QStringList url; + TQString cmd; + TQStringList url; bool ask_revision; bool rev_set; bool outfile_set; @@ -63,12 +63,12 @@ public: svn::Revision start,end; // for output - QFile toStdout,toStderr; - QString outfile; - QTextStream Stdout,Stderr; + TQFile toStdout,toStderr; + TQString outfile; + TQTextStream Stdout,Stderr; DummyDisplay * disp; - QMap<int,svn::Revision> extraRevisions; - QMap<int,QString> baseUrls; + TQMap<int,svn::Revision> extraRevisions; + TQMap<int,TQString> baseUrls; }; pCPart::pCPart() @@ -79,8 +79,8 @@ pCPart::pCPart() end = svn::Revision::UNDEFINED; toStdout.open(IO_WriteOnly, stdout); toStderr.open(IO_WriteOnly, stderr); - Stdout.setDevice(&toStdout); - Stderr.setDevice(&toStderr); + Stdout.setDevice(TQT_TQIODEVICE(&toStdout)); + Stderr.setDevice(TQT_TQIODEVICE(&toStderr)); disp = new DummyDisplay(); m_SvnWrapper = new SvnActions(disp,0,true); } @@ -91,16 +91,16 @@ pCPart::~pCPart() delete disp; } -CommandExec::CommandExec(QObject*parent, const char *name,KCmdLineArgs *args) - : QObject(parent,name) +CommandExec::CommandExec(TQObject*tqparent, const char *name,KCmdLineArgs *args) + : TQObject(tqparent,name) { m_pCPart = new pCPart; m_pCPart->args = args; SshAgent ag; ag.querySshAgent(); - connect(m_pCPart->m_SvnWrapper,SIGNAL(clientException(const QString&)),this,SLOT(clientException(const QString&))); - connect(m_pCPart->m_SvnWrapper,SIGNAL(sendNotify(const QString&)),this,SLOT(slotNotifyMessage(const QString&))); + connect(m_pCPart->m_SvnWrapper,TQT_SIGNAL(clientException(const TQString&)),this,TQT_SLOT(clientException(const TQString&))); + connect(m_pCPart->m_SvnWrapper,TQT_SIGNAL(sendNotify(const TQString&)),this,TQT_SLOT(slotNotifyMessage(const TQString&))); m_pCPart->m_SvnWrapper->reInitClient(); } @@ -128,111 +128,111 @@ int CommandExec::exec() m_pCPart->cmd=m_pCPart->args->arg(1); m_pCPart->cmd=m_pCPart->cmd.lower(); } - QString slotCmd; - if (!QString::compare(m_pCPart->cmd,"log")) { - slotCmd=SLOT(slotCmd_log()); - } else if (!QString::compare(m_pCPart->cmd,"cat")) { - slotCmd=SLOT(slotCmd_cat()); + TQString slotCmd; + if (!TQString::compare(m_pCPart->cmd,"log")) { + slotCmd=TQT_SLOT(slotCmd_log()); + } else if (!TQString::compare(m_pCPart->cmd,"cat")) { + slotCmd=TQT_SLOT(slotCmd_cat()); m_pCPart->single_revision=true; - } else if (!QString::compare(m_pCPart->cmd,"get")) { - slotCmd=SLOT(slotCmd_get()); + } else if (!TQString::compare(m_pCPart->cmd,"get")) { + slotCmd=TQT_SLOT(slotCmd_get()); m_pCPart->single_revision=true; - } else if (!QString::compare(m_pCPart->cmd,"help")) { - slotCmd=SLOT(slotCmd_help()); - } else if (!QString::compare(m_pCPart->cmd,"blame")|| - !QString::compare(m_pCPart->cmd,"annotate")) { - slotCmd=SLOT(slotCmd_blame()); - } else if (!QString::compare(m_pCPart->cmd,"update")) { - slotCmd=SLOT(slotCmd_update()); + } else if (!TQString::compare(m_pCPart->cmd,"help")) { + slotCmd=TQT_SLOT(slotCmd_help()); + } else if (!TQString::compare(m_pCPart->cmd,"blame")|| + !TQString::compare(m_pCPart->cmd,"annotate")) { + slotCmd=TQT_SLOT(slotCmd_blame()); + } else if (!TQString::compare(m_pCPart->cmd,"update")) { + slotCmd=TQT_SLOT(slotCmd_update()); m_pCPart->single_revision=true; - } else if (!QString::compare(m_pCPart->cmd,"diff")) { + } else if (!TQString::compare(m_pCPart->cmd,"diff")) { m_pCPart->start = svn::Revision::WORKING; - slotCmd=SLOT(slotCmd_diff()); - } else if (!QString::compare(m_pCPart->cmd,"info")) { - slotCmd=SLOT(slotCmd_info()); + slotCmd=TQT_SLOT(slotCmd_diff()); + } else if (!TQString::compare(m_pCPart->cmd,"info")) { + slotCmd=TQT_SLOT(slotCmd_info()); m_pCPart->single_revision=true; - } else if (!QString::compare(m_pCPart->cmd,"commit")|| - !QString::compare(m_pCPart->cmd,"ci")) { - slotCmd=SLOT(slotCmd_commit()); - } else if (!QString::compare(m_pCPart->cmd,"list")|| - !QString::compare(m_pCPart->cmd,"ls")) { - slotCmd=SLOT(slotCmd_list()); - } else if (!QString::compare(m_pCPart->cmd,"copy")|| - !QString::compare(m_pCPart->cmd,"cp")) { - slotCmd=SLOT(slotCmd_copy()); + } else if (!TQString::compare(m_pCPart->cmd,"commit")|| + !TQString::compare(m_pCPart->cmd,"ci")) { + slotCmd=TQT_SLOT(slotCmd_commit()); + } else if (!TQString::compare(m_pCPart->cmd,"list")|| + !TQString::compare(m_pCPart->cmd,"ls")) { + slotCmd=TQT_SLOT(slotCmd_list()); + } else if (!TQString::compare(m_pCPart->cmd,"copy")|| + !TQString::compare(m_pCPart->cmd,"cp")) { + slotCmd=TQT_SLOT(slotCmd_copy()); dont_check_second = true; - } else if (!QString::compare(m_pCPart->cmd,"move")|| - !QString::compare(m_pCPart->cmd,"rename")|| - !QString::compare(m_pCPart->cmd,"mv")) { - slotCmd=SLOT(slotCmd_move()); + } else if (!TQString::compare(m_pCPart->cmd,"move")|| + !TQString::compare(m_pCPart->cmd,"rename")|| + !TQString::compare(m_pCPart->cmd,"mv")) { + slotCmd=TQT_SLOT(slotCmd_move()); dont_check_second = true; - } else if (!QString::compare(m_pCPart->cmd,"checkout")|| - !QString::compare(m_pCPart->cmd,"co")) { - slotCmd=SLOT(slotCmd_checkout()); + } else if (!TQString::compare(m_pCPart->cmd,"checkout")|| + !TQString::compare(m_pCPart->cmd,"co")) { + slotCmd=TQT_SLOT(slotCmd_checkout()); dont_check_second = true; - } else if (!QString::compare(m_pCPart->cmd,"checkoutto")|| - !QString::compare(m_pCPart->cmd,"coto")) { - slotCmd=SLOT(slotCmd_checkoutto()); + } else if (!TQString::compare(m_pCPart->cmd,"checkoutto")|| + !TQString::compare(m_pCPart->cmd,"coto")) { + slotCmd=TQT_SLOT(slotCmd_checkoutto()); dont_check_second = true; - } else if (!QString::compare(m_pCPart->cmd,"export")) { - slotCmd=SLOT(slotCmd_export()); + } else if (!TQString::compare(m_pCPart->cmd,"export")) { + slotCmd=TQT_SLOT(slotCmd_export()); dont_check_second = true; - } else if (!QString::compare(m_pCPart->cmd,"exportto")) { - slotCmd=SLOT(slotCmd_exportto()); + } else if (!TQString::compare(m_pCPart->cmd,"exportto")) { + slotCmd=TQT_SLOT(slotCmd_exportto()); dont_check_second = true; - } else if (!QString::compare(m_pCPart->cmd,"delete")|| - !QString::compare(m_pCPart->cmd,"del")|| - !QString::compare(m_pCPart->cmd,"rm")|| - !QString::compare(m_pCPart->cmd,"remove")) { - slotCmd=SLOT(slotCmd_delete()); - } else if (!QString::compare(m_pCPart->cmd,"add")) { - slotCmd=SLOT(slotCmd_add()); + } else if (!TQString::compare(m_pCPart->cmd,"delete")|| + !TQString::compare(m_pCPart->cmd,"del")|| + !TQString::compare(m_pCPart->cmd,"rm")|| + !TQString::compare(m_pCPart->cmd,"remove")) { + slotCmd=TQT_SLOT(slotCmd_delete()); + } else if (!TQString::compare(m_pCPart->cmd,"add")) { + slotCmd=TQT_SLOT(slotCmd_add()); dont_check_all = true; path_only=true; - } else if (!QString::compare(m_pCPart->cmd,"undo")|| - !QString::compare(m_pCPart->cmd,"revert")) { - slotCmd=SLOT(slotCmd_revert()); - } else if (!QString::compare(m_pCPart->cmd,"checknew")|| - !QString::compare(m_pCPart->cmd,"addnew")) { - slotCmd=SLOT(slotCmd_addnew()); - } else if (!QString::compare(m_pCPart->cmd,"switch")) { - slotCmd=SLOT(slotCmd_switch()); - } else if (!QString::compare(m_pCPart->cmd,"tree")) { - slotCmd=SLOT(slotCmd_tree()); - } else if (!QString::compare(m_pCPart->cmd,"lock")) { - slotCmd=SLOT(slotCmd_lock()); + } else if (!TQString::compare(m_pCPart->cmd,"undo")|| + !TQString::compare(m_pCPart->cmd,"revert")) { + slotCmd=TQT_SLOT(slotCmd_revert()); + } else if (!TQString::compare(m_pCPart->cmd,"checknew")|| + !TQString::compare(m_pCPart->cmd,"addnew")) { + slotCmd=TQT_SLOT(slotCmd_addnew()); + } else if (!TQString::compare(m_pCPart->cmd,"switch")) { + slotCmd=TQT_SLOT(slotCmd_switch()); + } else if (!TQString::compare(m_pCPart->cmd,"tree")) { + slotCmd=TQT_SLOT(slotCmd_tree()); + } else if (!TQString::compare(m_pCPart->cmd,"lock")) { + slotCmd=TQT_SLOT(slotCmd_lock()); no_revision = true; check_force=true; - } else if (!QString::compare(m_pCPart->cmd,"unlock")) { - slotCmd=SLOT(slotCmd_unlock()); + } else if (!TQString::compare(m_pCPart->cmd,"unlock")) { + slotCmd=TQT_SLOT(slotCmd_unlock()); no_revision=true; check_force=true; } - bool found = connect(this,SIGNAL(executeMe()),this,slotCmd.ascii()); + bool found = connect(this,TQT_SIGNAL(executeMe()),this,slotCmd.ascii()); if (!found) { - slotCmd=i18n("Command \"%1\" not implemented or known").arg(m_pCPart->cmd); + slotCmd=i18n("Command \"%1\" not implemented or known").tqarg(m_pCPart->cmd); KMessageBox::sorry(0,slotCmd,i18n("SVN Error")); return -1; } - QString tmp,query,proto,v; - QMap<QString,QString> q; + TQString tmp,query,proto,v; + TQMap<TQString,TQString> q; KURL tmpurl; - QString mainProto; - QString _baseurl; + TQString mainProto; + TQString _baseurl; for (int j = 2; j<m_pCPart->args->count();++j) { tmpurl = helpers::KTranslateUrl::translateSystemUrl(m_pCPart->args->url(j).prettyURL()); query = tmpurl.query(); q = m_pCPart->args->url(j).queryItems(); - if (q.find("rev")!=q.end()) { + if (q.tqfind("rev")!=q.end()) { v = q["rev"]; } else { v = ""; } tmpurl.setProtocol(svn::Url::transformProtokoll(tmpurl.protocol())); - if (tmpurl.protocol().find("ssh")!=-1) { + if (tmpurl.protocol().tqfind("ssh")!=-1) { SshAgent ag; // this class itself checks if done before ag.addSshIdentities(); @@ -260,7 +260,7 @@ int CommandExec::exec() tmp = tmpurl.path(); } } - QStringList l = QStringList::split('?',tmp); + TQStringList l = TQStringList::split('?',tmp); if (l.count()>0) { tmp=l[0]; } @@ -303,7 +303,7 @@ int CommandExec::exec() m_pCPart->outfile = m_pCPart->args->getOption("o"); } if (m_pCPart->args->isSet("l")) { - QString s = m_pCPart->args->getOption("l"); + TQString s = m_pCPart->args->getOption("l"); m_pCPart->log_limit = s.toInt(); if (m_pCPart->log_limit<0) { m_pCPart->log_limit = 0; @@ -314,13 +314,13 @@ int CommandExec::exec() if (Kdesvnsettings::self()->cmdline_show_logwindow() && m_lastMessagesLines >= Kdesvnsettings::self()->cmdline_log_minline()) { KDialogBase dlg ( - KApplication::activeModalWidget(), + TQT_TQWIDGET(KApplication::activeModalWidget()), "execution_log", true, i18n("Execution log"), KDialogBase::Ok); - QWidget* Dialog1Layout = dlg.makeVBoxMainWidget(); + TQWidget* Dialog1Layout = dlg.makeVBoxMainWidget(); KTextBrowser*ptr = new KTextBrowser(Dialog1Layout); ptr->setText(m_lastMessages); dlg.resize(dlg.configDialogSize(*(Kdesvnsettings::self()->config()),"kdesvn_cmd_log")); @@ -333,9 +333,9 @@ int CommandExec::exec() /*! - \fn CommandExec::clientException(const QString&) + \fn CommandExec::clientException(const TQString&) */ -void CommandExec::clientException(const QString&what) +void CommandExec::clientException(const TQString&what) { m_pCPart->Stderr<<what<<endl; KMessageBox::sorry(0,what,i18n("SVN Error")); @@ -410,7 +410,7 @@ void CommandExec::slotCmd_blame() void CommandExec::slotCmd_cat() { - if (m_pCPart->extraRevisions.find(0)!=m_pCPart->extraRevisions.end()) { + if (m_pCPart->extraRevisions.tqfind(0)!=m_pCPart->extraRevisions.end()) { m_pCPart->rev_set=true; m_pCPart->start=m_pCPart->extraRevisions[0]; } else { @@ -423,7 +423,7 @@ void CommandExec::slotCmd_cat() void CommandExec::slotCmd_get() { - if (m_pCPart->extraRevisions.find(0)!=m_pCPart->extraRevisions.end()) { + if (m_pCPart->extraRevisions.tqfind(0)!=m_pCPart->extraRevisions.end()) { m_pCPart->rev_set=true; m_pCPart->start=m_pCPart->extraRevisions[0]; } else { @@ -454,12 +454,12 @@ void CommandExec::slotCmd_diff() } else { svn::Revision r1 = svn::Revision::HEAD; svn::Revision r2 = svn::Revision::HEAD; - if (m_pCPart->extraRevisions.find(0)!=m_pCPart->extraRevisions.end()) { + if (m_pCPart->extraRevisions.tqfind(0)!=m_pCPart->extraRevisions.end()) { r1 = m_pCPart->extraRevisions[0]; } else if (!svn::Url::isValid(m_pCPart->url[0])) { r1 = svn::Revision::WORKING; } - if (m_pCPart->extraRevisions.find(1)!=m_pCPart->extraRevisions.end()) { + if (m_pCPart->extraRevisions.tqfind(1)!=m_pCPart->extraRevisions.end()) { r2 = m_pCPart->extraRevisions[1]; } else if (!svn::Url::isValid(m_pCPart->url[1])) { r2 = svn::Revision::WORKING; @@ -470,7 +470,7 @@ void CommandExec::slotCmd_diff() void CommandExec::slotCmd_info() { - if (m_pCPart->extraRevisions.find(0)!=m_pCPart->extraRevisions.end()) { + if (m_pCPart->extraRevisions.tqfind(0)!=m_pCPart->extraRevisions.end()) { m_pCPart->rev_set=true; m_pCPart->start=m_pCPart->extraRevisions[0]; } @@ -479,7 +479,7 @@ void CommandExec::slotCmd_info() void CommandExec::slotCmd_commit() { - QValueList<svn::Path> targets; + TQValueList<svn::Path> targets; for (unsigned j=0; j<m_pCPart->url.count();++j) { targets.push_back(svn::Path(m_pCPart->url[j])); } @@ -499,7 +499,7 @@ void CommandExec::slotCmd_list() return; } for (unsigned int i = 0; i < res.count();++i) { - QString d = svn::DateTime(res[i]->time()).toString(QString("yyyy-MM-dd hh:mm::ss")); + TQString d = svn::DateTime(res[i]->time()).toString(TQString("yyyy-MM-dd hh:mm::ss")); m_pCPart->Stdout << (res[i]->kind()==svn_node_dir?"D":"F")<<" " << d << " " @@ -509,7 +509,7 @@ void CommandExec::slotCmd_list() void CommandExec::slotCmd_copy() { - QString target; + TQString target; if (m_pCPart->url.count()<2) { bool force_move,ok; target = CopyMoveView_impl::getMoveCopyTo(&ok,&force_move,false, @@ -520,7 +520,7 @@ void CommandExec::slotCmd_copy() } else { target = m_pCPart->url[1]; } - if (m_pCPart->extraRevisions.find(0)!=m_pCPart->extraRevisions.end()) { + if (m_pCPart->extraRevisions.tqfind(0)!=m_pCPart->extraRevisions.end()) { m_pCPart->rev_set=true; m_pCPart->start=m_pCPart->extraRevisions[0]; } else { @@ -533,7 +533,7 @@ void CommandExec::slotCmd_move() { bool force_move,ok; force_move = false; - QString target; + TQString target; if (m_pCPart->url.count()<2) { target = CopyMoveView_impl::getMoveCopyTo(&ok,&force_move,true, m_pCPart->url[0],"",0,"move_name"); @@ -571,8 +571,8 @@ void CommandExec::slotCmd_addnew() */ bool CommandExec::scanRevision() { - QString revstring = m_pCPart->args->getOption("r"); - QStringList revl = QStringList::split(":",revstring); + TQString revstring = m_pCPart->args->getOption("r"); + TQStringList revl = TQStringList::split(":",revstring); if (revl.count()==0) { return false; } @@ -584,7 +584,7 @@ bool CommandExec::scanRevision() return true; } -void CommandExec::slotNotifyMessage(const QString&msg) +void CommandExec::slotNotifyMessage(const TQString&msg) { m_pCPart->m_SvnWrapper->slotExtraLogMsg(msg); if (Kdesvnsettings::self()->cmdline_show_logwindow()) { @@ -596,19 +596,19 @@ void CommandExec::slotNotifyMessage(const QString&msg) bool CommandExec::askRevision() { - QString _head = m_pCPart->cmd+" - Revision"; + TQString _head = m_pCPart->cmd+" - Revision"; KDialogBase dlg( 0, "Revisiondlg", true, _head, KDialogBase::Ok|KDialogBase::Cancel); - QWidget* Dialog1Layout = dlg.makeVBoxMainWidget(); + TQWidget* Dialog1Layout = dlg.makeVBoxMainWidget(); Rangeinput_impl*rdlg; rdlg = new Rangeinput_impl(Dialog1Layout); - dlg.resize( QSize(120,60).expandedTo(dlg.minimumSizeHint())); + dlg.resize( TQSize(120,60).expandedTo(dlg.tqminimumSizeHint())); rdlg->setStartOnly(m_pCPart->single_revision); - if (dlg.exec()==QDialog::Accepted) { + if (dlg.exec()==TQDialog::Accepted) { Rangeinput_impl::revision_range range = rdlg->getRange(); m_pCPart->start = range.first; m_pCPart->end = range.second; @@ -624,12 +624,12 @@ bool CommandExec::askRevision() */ void CommandExec::slotCmd_switch() { - QString base; + TQString base; if (m_pCPart->url.count()>1) { clientException(i18n("May only switch one url at time!")); return; } - if (m_pCPart->baseUrls.find(0)==m_pCPart->baseUrls.end()) { + if (m_pCPart->baseUrls.tqfind(0)==m_pCPart->baseUrls.end()) { clientException(i18n("Switch only on working copies!")); return; } |