summaryrefslogtreecommitdiffstats
path: root/vcs/perforce/perforcepart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcs/perforce/perforcepart.cpp')
-rw-r--r--vcs/perforce/perforcepart.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/vcs/perforce/perforcepart.cpp b/vcs/perforce/perforcepart.cpp
index 9aeadc6f..cb3d7ba9 100644
--- a/vcs/perforce/perforcepart.cpp
+++ b/vcs/perforce/perforcepart.cpp
@@ -12,9 +12,9 @@
#include "perforcepart.h"
-#include <qfileinfo.h>
-#include <qpopupmenu.h>
-#include <qregexp.h>
+#include <tqfileinfo.h>
+#include <tqpopupmenu.h>
+#include <tqregexp.h>
#include <kpopupmenu.h>
#include <kdebug.h>
#include <kdevgenericfactory.h>
@@ -38,14 +38,14 @@ static const KDevPluginInfo data("kdevperforce");
typedef KDevGenericFactory<PerforcePart> PerforceFactory;
K_EXPORT_COMPONENT_FACTORY( libkdevperforce, PerforceFactory( data ) )
-PerforcePart::PerforcePart( QObject *parent, const char *name, const QStringList & )
+PerforcePart::PerforcePart( TQObject *parent, const char *name, const TQStringList & )
: KDevVersionControl( &data, parent, name ? name : "PerforcePart" )
{
setInstance(PerforceFactory::instance());
setupActions();
- connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
- this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)),
+ this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)) );
}
@@ -54,88 +54,88 @@ PerforcePart::~PerforcePart()
void PerforcePart::setupActions()
{
- actionEdit = new KAction( i18n("Edit"), 0, this, SLOT(slotActionEdit()),
+ actionEdit = new KAction( i18n("Edit"), 0, this, TQT_SLOT(slotActionEdit()),
actionCollection(), "perforce_edit" );
actionEdit->setToolTip(i18n("Edit"));
actionEdit->setWhatsThis(i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit."));
- actionRevert = new KAction( i18n("Revert"), 0, this, SLOT(slotActionRevert()),
+ actionRevert = new KAction( i18n("Revert"), 0, this, TQT_SLOT(slotActionRevert()),
actionCollection(), "perforce_revert" );
actionRevert->setToolTip(i18n("Revert"));
actionRevert->setWhatsThis(i18n("<b>Revert</b><p>Discards changes made to open files."));
- actionSubmit = new KAction( i18n("Submit"), 0, this, SLOT(slotActionCommit()),
+ actionSubmit = new KAction( i18n("Submit"), 0, this, TQT_SLOT(slotActionCommit()),
actionCollection(), "perforce_submit" );
actionSubmit->setToolTip(i18n("Submit"));
actionSubmit->setWhatsThis(i18n("<b>Submit</b><p>Sends changes made to open files to the depot."));
- actionSync = new KAction( i18n("Sync"), 0, this, SLOT(slotActionUpdate()),
+ actionSync = new KAction( i18n("Sync"), 0, this, TQT_SLOT(slotActionUpdate()),
actionCollection(), "perforce_sync" );
actionSync->setToolTip(i18n("Sync"));
actionSync->setWhatsThis(i18n("<b>Sync</b><p>Copies files from the depot into the workspace."));
- actionDiff = new KAction( i18n("Diff Against Repository"), 0, this, SLOT(slotActionDiff()),
+ actionDiff = new KAction( i18n("Diff Against Repository"), 0, this, TQT_SLOT(slotActionDiff()),
actionCollection(), "perforce_diff" );
actionDiff->setToolTip(i18n("Diff against repository"));
actionDiff->setWhatsThis(i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot."));
- actionAdd = new KAction( i18n("Add to Repository"), 0, this, SLOT(slotActionAdd()),
+ actionAdd = new KAction( i18n("Add to Repository"), 0, this, TQT_SLOT(slotActionAdd()),
actionCollection(), "perforce_add" );
actionAdd->setToolTip(i18n("Add to repository"));
actionAdd->setWhatsThis(i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot."));
- actionRemove = new KAction( i18n("Remove From Repository"), 0, this, SLOT(slotActionRemove()),
+ actionRemove = new KAction( i18n("Remove From Repository"), 0, this, TQT_SLOT(slotActionRemove()),
actionCollection(), "perforce_remove" );
actionRemove->setToolTip(i18n("Remove from repository"));
actionRemove->setWhatsThis(i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot."));
}
-void PerforcePart::contextMenu(QPopupMenu *popup, const Context *context)
+void PerforcePart::contextMenu(TQPopupMenu *popup, const Context *context)
{
if (context->hasType( Context::FileContext )) {
const FileContext *fcontext = static_cast<const FileContext*>(context);
popupfile = fcontext->urls().first().path();
- QFileInfo fi( popupfile );
+ TQFileInfo fi( popupfile );
popup->insertSeparator();
KPopupMenu *sub = new KPopupMenu(popup);
- QString name = fi.fileName();
+ TQString name = fi.fileName();
sub->insertTitle( i18n("Actions for %1").arg(name) );
int id = sub->insertItem( i18n("Edit"),
- this, SLOT(slotEdit()) );
+ this, TQT_SLOT(slotEdit()) );
sub->setWhatsThis(id, i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit."));
id = sub->insertItem( i18n("Revert"),
- this, SLOT(slotRevert()) );
+ this, TQT_SLOT(slotRevert()) );
sub->setWhatsThis(id, i18n("<b>Revert</b><p>Discards changes made to open files."));
id = sub->insertItem( i18n("Submit"),
- this, SLOT(slotCommit()) );
+ this, TQT_SLOT(slotCommit()) );
sub->setWhatsThis(id, i18n("<b>Submit</b><p>Sends changes made to open files to the depot."));
id = sub->insertItem( i18n("Sync"),
- this, SLOT(slotUpdate()) );
+ this, TQT_SLOT(slotUpdate()) );
sub->setWhatsThis(id, i18n("<b>Sync</b><p>Copies files from the depot into the workspace."));
sub->insertSeparator();
id = sub->insertItem( i18n("Diff Against Repository"),
- this, SLOT(slotDiff()) );
+ this, TQT_SLOT(slotDiff()) );
sub->setWhatsThis(id, i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot."));
id = sub->insertItem( i18n("Add to Repository"),
- this, SLOT(slotAdd()) );
+ this, TQT_SLOT(slotAdd()) );
sub->setWhatsThis(id, i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot."));
id = sub->insertItem( i18n("Remove From Repository"),
- this, SLOT(slotRemove()) );
+ this, TQT_SLOT(slotRemove()) );
sub->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot."));
id = popup->insertItem(i18n("Perforce"), sub);
}
}
-void PerforcePart::execCommand( const QString& cmd, const QString& filename )
+void PerforcePart::execCommand( const TQString& cmd, const TQString& filename )
{
if ( filename.isEmpty() )
return;
- QFileInfo fi( filename );
+ TQFileInfo fi( filename );
if (fi.isDir()) {
KMessageBox::error( 0, i18n("Cannot handle directories, please select single files") );
return;
}
- QString dir = fi.dirPath();
- QString name = fi.fileName();
+ TQString dir = fi.dirPath();
+ TQString name = fi.fileName();
- QString command("cd ");
+ TQString command("cd ");
command += KProcess::quote(dir);
command += " && p4 " + cmd + " ";
command += name;
@@ -144,43 +144,43 @@ void PerforcePart::execCommand( const QString& cmd, const QString& filename )
makeFrontend->queueCommand(dir, command);
}
-void PerforcePart::edit( const QString& filename )
+void PerforcePart::edit( const TQString& filename )
{
execCommand( "edit", filename );
}
-void PerforcePart::revert( const QString& filename )
+void PerforcePart::revert( const TQString& filename )
{
if ( KMessageBox::questionYesNo( 0,
i18n("Do you really want to revert "
- "the file %1 and lose all your changes?").arg( filename ), QString::null, i18n("Revert"), i18n("Do Not Revert") ) == KMessageBox::Yes ) {
+ "the file %1 and lose all your changes?").arg( filename ), TQString::null, i18n("Revert"), i18n("Do Not Revert") ) == KMessageBox::Yes ) {
execCommand( "revert", filename );
}
}
-void PerforcePart::commit( const QString& filename )
+void PerforcePart::commit( const TQString& filename )
{
if ( filename.isEmpty() )
return;
- QFileInfo fi( filename );
+ TQFileInfo fi( filename );
if ( fi.isDir() ) {
KMessageBox::error( 0, i18n("Submitting of subdirectories is not supported") );
return;
}
CommitDialog d;
- QStringList lst;
+ TQStringList lst;
lst << filename;
d.setFiles( lst );
- if (d.exec() == QDialog::Rejected)
+ if (d.exec() == TQDialog::Rejected)
return;
- QString message = d.changeList();
+ TQString message = d.changeList();
if (!message.isEmpty())
message = KShellProcess::quote(message);
- QString command("echo " + message);
+ TQString command("echo " + message);
command += " | p4 submit -i";
if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
@@ -188,13 +188,13 @@ void PerforcePart::commit( const QString& filename )
}
-void PerforcePart::update( const QString& filename )
+void PerforcePart::update( const TQString& filename )
{
if ( filename.isEmpty() )
return;
- QString dir, name;
- QFileInfo fi( filename );
+ TQString dir, name;
+ TQFileInfo fi( filename );
if (fi.isDir()) {
dir = fi.absFilePath();
name = "..."; // three dots means "recoursive"
@@ -203,7 +203,7 @@ void PerforcePart::update( const QString& filename )
name = fi.fileName();
}
- QString command("cd ");
+ TQString command("cd ");
command += KProcess::quote(dir);
command += " && p4 sync ";
command += name;
@@ -213,41 +213,41 @@ void PerforcePart::update( const QString& filename )
}
-void PerforcePart::add( const QString& filename )
+void PerforcePart::add( const TQString& filename )
{
execCommand( "add", filename );
}
-void PerforcePart::remove( const QString& filename )
+void PerforcePart::remove( const TQString& filename )
{
execCommand( "delete", filename );
}
-void PerforcePart::diff( const QString& filename )
+void PerforcePart::diff( const TQString& filename )
{
if ( filename.isEmpty() )
return;
- QString name;
- QFileInfo fi( filename );
+ TQString name;
+ TQFileInfo fi( filename );
if ( fi.isDir() ) {
name = fi.absFilePath() + "...";
} else {
name = filename;
}
- QStringList args;
+ TQStringList args;
args << "diff";
args << "-du";
args << name;
- ExecCommand* cmv = new ExecCommand( "p4", args, QString::null, QStringList(), this );
- connect( cmv, SIGNAL(finished( const QString&, const QString& )),
- this, SLOT(slotDiffFinished( const QString&, const QString& )) );
+ ExecCommand* cmv = new ExecCommand( "p4", args, TQString::null, TQStringList(), this );
+ connect( cmv, TQT_SIGNAL(finished( const TQString&, const TQString& )),
+ this, TQT_SLOT(slotDiffFinished( const TQString&, const TQString& )) );
}
-void PerforcePart::slotDiffFinished( const QString& diff, const QString& err )
+void PerforcePart::slotDiffFinished( const TQString& diff, const TQString& err )
{
if ( diff.isNull() && err.isNull() ) {
kdDebug(9000) << "p4 diff cancelled" << endl;
@@ -261,7 +261,7 @@ void PerforcePart::slotDiffFinished( const QString& diff, const QString& err )
if ( !err.isEmpty() ) {
int s = KMessageBox::warningContinueCancelList( 0, i18n("P4 output errors during diff. Do you still want to continue?"),
- QStringList::split( "\n", err, false ), i18n("Errors During Diff") );
+ TQStringList::split( "\n", err, false ), i18n("Errors During Diff") );
if ( s != KMessageBox::Continue )
return;
}
@@ -272,16 +272,16 @@ void PerforcePart::slotDiffFinished( const QString& diff, const QString& err )
}
// strip the ==== headers
- static QRegExp rx( "(^|\\n)==== ([^ ]+) -.*====\\n" );
+ static TQRegExp rx( "(^|\\n)==== ([^ ]+) -.*====\\n" );
rx.setMinimal( true );
- QString strippedDiff = diff;
+ TQString strippedDiff = diff;
strippedDiff.replace( rx, "--- \\2\n+++ \\2\n" );
if (KDevDiffFrontend *diffFrontend = extension<KDevDiffFrontend>("KDevelop/DiffFrontend"))
diffFrontend->showDiff( strippedDiff );
}
-QString PerforcePart::currentFile()
+TQString PerforcePart::currentFile()
{
KParts::ReadOnlyPart *part = dynamic_cast<KParts::ReadOnlyPart*>( partController()->activePart() );
if ( part ) {
@@ -289,7 +289,7 @@ QString PerforcePart::currentFile()
if ( url.isLocalFile() )
return url.path();
}
- return QString::null;
+ return TQString::null;
}
void PerforcePart::slotActionCommit()