summaryrefslogtreecommitdiffstats
path: root/konq-plugins/rsync/rsyncplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'konq-plugins/rsync/rsyncplugin.cpp')
-rw-r--r--konq-plugins/rsync/rsyncplugin.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/konq-plugins/rsync/rsyncplugin.cpp b/konq-plugins/rsync/rsyncplugin.cpp
index 81a5253..b223a93 100644
--- a/konq-plugins/rsync/rsyncplugin.cpp
+++ b/konq-plugins/rsync/rsyncplugin.cpp
@@ -106,13 +106,13 @@ typedef KGenericFactory<RsyncPlugin> RsyncPluginFactory;
K_EXPORT_COMPONENT_FACTORY(librsyncplugin,
RsyncPluginFactory("rsyncplugin"))
-RsyncPlugin::RsyncPlugin (TQObject* parent, const char* name,
+RsyncPlugin::RsyncPlugin (TQObject* tqparent, const char* name,
const TQStringList&)
- :KParts::Plugin (parent, name),
+ :KParts::Plugin (tqparent, name),
m_pSyncNow(0),
m_pSyncSetup(0)
{
- m_part = ::qt_cast<KonqDirPart*>(parent);
+ m_part = ::tqqt_cast<KonqDirPart*>(tqparent);
if ( !m_part || !m_part->scrollWidget() )
return;
@@ -224,7 +224,7 @@ creates the unidirectional sync subprocess
bool RsyncPlugin::syncUnidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) {
int fd[2];
int rc, flags;
- thisFn = TQString::null;
+ thisFn = TQString();
rc = open_pty_pair(fd);
if (rc == -1) {
@@ -361,7 +361,7 @@ creates the bidirectional sync subprocess
bool RsyncPlugin::syncBidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) {
int fd[2];
int rc, flags;
- thisFn = TQString::null;
+ thisFn = TQString();
// Check for and remove the trailing slash in localfolder
if (localfolder.endsWith("/")) {
@@ -521,17 +521,17 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) {
buf.truncate(buf.length()-1);
myDebug( << "establishing: got " << buf << endl);
- while (childPid && ((pos = buf.find('\n')) >= 0 || buf.endsWith(":") || buf.endsWith("?"))) {
+ while (childPid && ((pos = buf.tqfind('\n')) >= 0 || buf.endsWith(":") || buf.endsWith("?"))) {
if (m_progressDialogExists == true) {
- qApp->processEvents();
+ tqApp->processEvents();
}
pos++;
TQString str = buf.left(pos);
buf = buf.mid(pos);
if (str == "\n")
continue;
- //if (str.contains("rsync error:")) {
- if (str.contains("rsync:") || str.contains("failed.") || (str.contains("Could not") && str.endsWith("."))) {
+ //if (str.tqcontains("rsync error:")) {
+ if (str.tqcontains("rsync:") || str.tqcontains("failed.") || (str.tqcontains("Could not") && str.endsWith("."))) {
KMessageBox::error(NULL, str);
}
else if (!str.isEmpty()) {
@@ -557,12 +557,12 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) {
} else if (!connectionPassword.isEmpty()) {
myDebug( << "sending cpass" << endl);
connectionAuth.password = connectionPassword+"\n";
- connectionPassword = TQString::null;
+ connectionPassword = TQString();
writeChild(connectionAuth.password.latin1(),connectionAuth.password.length());
} else {
myDebug( << "sending mpass" << endl);
connectionAuth.prompt = thisFn+buf;
- connectionAuth.password = TQString::null; // don't prefill
+ connectionAuth.password = TQString(); // don't prefill
TQCString thispass;
if (KPasswordDialog::getPassword (thispass, i18n("Remote authorization required") + TQString("\n") + i18n("Please input") + TQString(" ") + TQString(buf), NULL) != 1) {
shutdownConnection(true, false);
@@ -575,7 +575,7 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) {
myDebug( << "sending pass" << endl);
writeChild(connectionAuth.password.latin1(),connectionAuth.password.length());
}
- thisFn = TQString::null;
+ thisFn = TQString();
return 0;
}
else if (buf.endsWith("?")) {
@@ -585,25 +585,25 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) {
} else {
writeChild("no\n",3);
}
- thisFn = TQString::null;
+ thisFn = TQString();
return 0;
}
if (m_progressDialogExists == true) {
- if (str.contains("exit()") && str.contains("ICE default IO")) {
+ if (str.tqcontains("exit()") && str.tqcontains("ICE default IO")) {
if (m_progressDialogExists == true) {
m_progressDialog->progressBar()->setValue(m_progressDialog->progressBar()->totalSteps());
}
}
else {
- if (str.contains(", to-check=")) {
+ if (str.tqcontains(", to-check=")) {
// Parse the to-check output
TQString tocheck_out_cur;
TQString tocheck_out_tot;
- tocheck_out_cur = str.mid(str.find(", to-check=") + 11, str.length());
- tocheck_out_tot = tocheck_out_cur.mid(tocheck_out_cur.find("/") + 1, tocheck_out_cur.length());
- tocheck_out_cur = tocheck_out_cur.left(tocheck_out_cur.find("/"));
- tocheck_out_tot = tocheck_out_tot.left(tocheck_out_tot.find(")"));
+ tocheck_out_cur = str.mid(str.tqfind(", to-check=") + 11, str.length());
+ tocheck_out_tot = tocheck_out_cur.mid(tocheck_out_cur.tqfind("/") + 1, tocheck_out_cur.length());
+ tocheck_out_cur = tocheck_out_cur.left(tocheck_out_cur.tqfind("/"));
+ tocheck_out_tot = tocheck_out_tot.left(tocheck_out_tot.tqfind(")"));
m_progressDialog->progressBar()->setTotalSteps(tocheck_out_tot.toInt()-1);
m_progressDialog->progressBar()->setValue(tocheck_out_tot.toInt()-tocheck_out_cur.toInt()-2);
}
@@ -629,17 +629,17 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len,
buf.truncate(buf.length()-1);
myDebug( << "establishing: got " << buf << endl);
- while (childPid && (((pos = buf.find('\n')) >= 0) || buf.endsWith(":") || buf.endsWith("?") || buf.endsWith("]"))) {
+ while (childPid && (((pos = buf.tqfind('\n')) >= 0) || buf.endsWith(":") || buf.endsWith("?") || buf.endsWith("]"))) {
if (m_progressDialogExists == true) {
- qApp->processEvents();
+ tqApp->processEvents();
}
pos++;
TQString str = buf.left(pos);
buf = buf.mid(pos);
if (str == "\n")
continue;
- //if (str.contains("rsync error:")) {
- if (str.contains("rsync:") || str.contains("failed.") || (str.contains("Could not") && str.endsWith("."))) {
+ //if (str.tqcontains("rsync error:")) {
+ if (str.tqcontains("rsync:") || str.tqcontains("failed.") || (str.tqcontains("Could not") && str.endsWith("."))) {
KMessageBox::error(NULL, str);
}
else if (!str.isEmpty()) {
@@ -664,12 +664,12 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len,
} else if (!connectionPassword.isEmpty()) {
myDebug( << "sending cpass" << endl);
connectionAuth.password = connectionPassword+"\n";
- connectionPassword = TQString::null;
+ connectionPassword = TQString();
writeChild(connectionAuth.password.latin1(),connectionAuth.password.length());
} else {
myDebug( << "sending mpass" << endl);
connectionAuth.prompt = thisFn+buf;
- connectionAuth.password = TQString::null; // don't prefill
+ connectionAuth.password = TQString(); // don't prefill
TQCString thispass;
if (KPasswordDialog::getPassword (thispass, i18n("Remote authorization required") + TQString("\n") + i18n("Please input") + TQString(" ") + TQString(buf), NULL) != 1) {
slotUnisonCancelled();
@@ -682,11 +682,11 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len,
myDebug( << "sending pass" << endl);
writeChild(connectionAuth.password.latin1(),connectionAuth.password.length());
}
- thisFn = TQString::null;
+ thisFn = TQString();
return 0;
}
else if (buf.endsWith("?") || buf.endsWith("? []")) {
- buf.replace("[]", "");
+ buf.tqreplace("[]", "");
if (buf.endsWith("? []")) {
int rc = KMessageBox::questionYesNo(NULL, buf);
if (rc == KMessageBox::Yes) {
@@ -703,7 +703,7 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len,
writeChild("no\n",3);
}
}
- thisFn = TQString::null;
+ thisFn = TQString();
buf = "";
return 0;
}
@@ -717,11 +717,11 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len,
}
TQString file_name;
file_name = buf;
- file_name.replace("[]", "");
- file_name.replace(TQString("changed "), "");
+ file_name.tqreplace("[]", "");
+ file_name.tqreplace(TQString("changed "), "");
//file_name = file_name.simplifyWhiteSpace();
KDialogBase *dialog= new KDialogBase(i18n("User Intervention Required"), KDialogBase::Yes | KDialogBase::No | KDialogBase::Cancel, KDialogBase::Yes, KDialogBase::Cancel, NULL, "warningYesNoCancel", true, true, i18n("Use &Local File"), i18n("Use &Remote File"), i18n("&Ignore"));
- int rc = KMessageBox::createKMessageBox(dialog, TQMessageBox::Warning, TQString("<b>") + i18n("WARNING: Both the local and remote file have been modified") + TQString("</b><p>") + i18n("Local") + TQString(": ") + localfolder + TQString("/") + file_name + TQString("<br>") + i18n("Remote") + TQString(": ") + remotepath + TQString("/") + file_name + TQString("<p>") + i18n("Please select the file to duplicate (the other will be overwritten)") + TQString("<br>") + i18n("Or, select Ignore to skip synchronization of this file for now"), TQStringList(), TQString::null, NULL, 1);
+ int rc = KMessageBox::createKMessageBox(dialog, TQMessageBox::Warning, TQString("<b>") + i18n("WARNING: Both the local and remote file have been modified") + TQString("</b><p>") + i18n("Local") + TQString(": ") + localfolder + TQString("/") + file_name + TQString("<br>") + i18n("Remote") + TQString(": ") + remotepath + TQString("/") + file_name + TQString("<p>") + i18n("Please select the file to duplicate (the other will be overwritten)") + TQString("<br>") + i18n("Or, select Ignore to skip synchronization of this file for now"), TQStringList(), TQString(), NULL, 1);
if (rc == KDialogBase::Yes) {
writeChild(">\n",3);
}
@@ -735,7 +735,7 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len,
}
if (m_progressDialogExists == true) {
- if (str.contains("exit()") && str.contains("ICE default IO")) {
+ if (str.tqcontains("exit()") && str.tqcontains("ICE default IO")) {
if (m_progressDialogExists == true) {
m_progressDialog->progressBar()->setFormat("%v / %m");
m_progressDialog->progressBar()->setTotalSteps(2);
@@ -822,7 +822,7 @@ TQString RsyncPlugin::findLocalFolderByName(TQString folderurl)
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) {
if (TQString::compare((*i), folderurl_stripped) == 0) {
i++;
@@ -841,7 +841,7 @@ TQString RsyncPlugin::findSyncMethodByName(TQString folderurl)
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) {
if (TQString::compare((*i), folderurl_stripped) == 0) {
i++;
@@ -860,7 +860,7 @@ TQString RsyncPlugin::findLoginSyncEnabledByName(TQString folderurl)
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) {
if (TQString::compare((*i), folderurl_stripped) == 0) {
i++;
@@ -879,7 +879,7 @@ TQString RsyncPlugin::findLogoutSyncEnabledByName(TQString folderurl)
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) {
if (TQString::compare((*i), folderurl_stripped) == 0) {
i++;
@@ -898,7 +898,7 @@ TQString RsyncPlugin::findTimedSyncEnabledByName(TQString folderurl)
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) {
if (TQString::compare((*i), folderurl_stripped) == 0) {
i++;
@@ -917,7 +917,7 @@ int RsyncPlugin::deleteLocalFolderByName(TQString folderurl)
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) {
if (TQString::compare((*i), folderurl_stripped) == 0) {
i=cfgfolderlist.remove(i);
@@ -937,7 +937,7 @@ int RsyncPlugin::addLocalFolderByName(TQString folderurl, TQString remoteurl, TQ
{
TQString folderurl_stripped;
folderurl_stripped = folderurl;
- folderurl_stripped.replace(TQString("file://"), TQString(""));
+ folderurl_stripped.tqreplace(TQString("file://"), TQString(""));
cfgfolderlist.append(folderurl);
cfgfolderlist.append(remoteurl);
cfgfolderlist.append(syncmethod);