From 7346aee26bf190a7e70333c40fab4caca847cd27 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:22:56 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- konq-plugins/rsync/rsyncconfigdialog.cpp | 72 +++++----- konq-plugins/rsync/rsyncconfigdialog.h | 40 +++--- konq-plugins/rsync/rsyncplugin.cpp | 224 +++++++++++++++---------------- konq-plugins/rsync/rsyncplugin.h | 36 ++--- 4 files changed, 186 insertions(+), 186 deletions(-) (limited to 'konq-plugins/rsync') diff --git a/konq-plugins/rsync/rsyncconfigdialog.cpp b/konq-plugins/rsync/rsyncconfigdialog.cpp index 0549356..ae89efa 100644 --- a/konq-plugins/rsync/rsyncconfigdialog.cpp +++ b/konq-plugins/rsync/rsyncconfigdialog.cpp @@ -50,25 +50,25 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -100,9 +100,9 @@ /* * RsyncConfigDialog implementation */ -RsyncConfigDialog::RsyncConfigDialog(QWidget* parent, const char* name, - const QString& caption, const QString& text, - const QString& localfolder, const QString& remotefolder, +RsyncConfigDialog::RsyncConfigDialog(TQWidget* parent, const char* name, + const TQString& caption, const TQString& text, + const TQString& localfolder, const TQString& remotefolder, int syncmode, bool modal) : KDialogBase(KDialogBase::Plain, caption, KDialogBase::Cancel | KDialogBase::Ok, KDialogBase::Ok, parent, name, modal), @@ -116,25 +116,25 @@ RsyncConfigDialog::RsyncConfigDialog(QWidget* parent, const char* name, #ifdef Q_WS_X11 KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); #endif - mShowTimer = new QTimer(this); + mShowTimer = new TQTimer(this); showButton(KDialogBase::Close, false); mCancelText = actionButton(KDialogBase::Cancel)->text(); - QFrame* mainWidget = plainPage(); - QVBoxLayout* layout = new QVBoxLayout(mainWidget, 10); - mLabel = new QLabel(QString("") + text + QString("
")+i18n("Setting up synchronization for local folder")+QString("
") + localfolder, mainWidget); + TQFrame* mainWidget = plainPage(); + TQVBoxLayout* layout = new TQVBoxLayout(mainWidget, 10); + mLabel = new TQLabel(TQString("") + text + TQString("
")+i18n("Setting up synchronization for local folder")+TQString("
") + localfolder, mainWidget); layout->addWidget(mLabel); // Create an exclusive button group - QButtonGroup *layoutg = new QButtonGroup( 1, QGroupBox::Horizontal, i18n("Synchronization Method")+QString(":"), mainWidget); + TQButtonGroup *layoutg = new TQButtonGroup( 1, TQGroupBox::Horizontal, i18n("Synchronization Method")+TQString(":"), mainWidget); layout->addWidget( layoutg ); layoutg->setExclusive( TRUE ); // Insert radiobuttons - rsync_rb1 = new QRadioButton(i18n("&Utilize rsync + ssh for upload to remote server\nExample: servername:/path/to/remote/folder"), layoutg); - rsync_rb2 = new QRadioButton(i18n("&Utilize rsync + ssh for download from remote server\nExample: servername:/path/to/remote/folder"), layoutg); - rsync_rb3 = new QRadioButton(i18n("&Utilize unison + ssh for bidirectional synchronization with remote server\nExample: ssh://servername//path/to/remote/folder"), layoutg); + rsync_rb1 = new TQRadioButton(i18n("&Utilize rsync + ssh for upload to remote server\nExample: servername:/path/to/remote/folder"), layoutg); + rsync_rb2 = new TQRadioButton(i18n("&Utilize rsync + ssh for download from remote server\nExample: servername:/path/to/remote/folder"), layoutg); + rsync_rb3 = new TQRadioButton(i18n("&Utilize unison + ssh for bidirectional synchronization with remote server\nExample: ssh://servername//path/to/remote/folder"), layoutg); if (syncmode == 1) rsync_rb1->setChecked( TRUE ); @@ -143,15 +143,15 @@ RsyncConfigDialog::RsyncConfigDialog(QWidget* parent, const char* name, else if (syncmode == 3) rsync_rb3->setChecked( TRUE ); - //(void)new QRadioButton( "R&adiobutton 2", layoutg ); - //(void)new QRadioButton( "Ra&diobutton 3", layoutg ); + //(void)new TQRadioButton( "R&adiobutton 2", layoutg ); + //(void)new TQRadioButton( "Ra&diobutton 3", layoutg ); // Create an exclusive button group - QButtonGroup *layoutm = new QButtonGroup( 1, QGroupBox::Horizontal, i18n("Remote Folder")+QString(":"), mainWidget); + TQButtonGroup *layoutm = new TQButtonGroup( 1, TQGroupBox::Horizontal, i18n("Remote Folder")+TQString(":"), mainWidget); layout->addWidget( layoutm ); layoutg->setExclusive( TRUE ); - m_rsync_txt = new QLineEdit(layoutm); + m_rsync_txt = new TQLineEdit(layoutm); if (remotefolder.isEmpty() == false) { m_rsync_txt->setText(remotefolder); } @@ -168,12 +168,12 @@ int RsyncConfigDialog::getSyncMode() return 3; } -QLineEdit* RsyncConfigDialog::lineEdit() +TQLineEdit* RsyncConfigDialog::lineEdit() { return m_rsync_txt; } -const QLineEdit* RsyncConfigDialog::lineEdit() const +const TQLineEdit* RsyncConfigDialog::lineEdit() const { return m_rsync_txt; } diff --git a/konq-plugins/rsync/rsyncconfigdialog.h b/konq-plugins/rsync/rsyncconfigdialog.h index 38f8687..8e02d54 100644 --- a/konq-plugins/rsync/rsyncconfigdialog.h +++ b/konq-plugins/rsync/rsyncconfigdialog.h @@ -19,10 +19,10 @@ #ifndef __RSYNC_CONFIG_DIALOG_H #define __RSYNC_CONFIG_DIALOG_H -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -39,26 +39,26 @@ class RsyncConfigDialog : public KDialogBase Q_OBJECT public: - RsyncConfigDialog(QWidget* parent = 0, const char* name = 0, - const QString& caption = QString::null, - const QString& text = QString::null, - const QString& localfolder = QString::null, - const QString& remotefolder = QString::null, + RsyncConfigDialog(TQWidget* parent = 0, const char* name = 0, + const TQString& caption = TQString::null, + const TQString& text = TQString::null, + const TQString& localfolder = TQString::null, + const TQString& remotefolder = TQString::null, int syncmode = 1, bool modal = false); /** - * Returns the QLineEdit used in this dialog. + * Returns the TQLineEdit used in this dialog. * To set the number of lines or other text box related * settings, access the KTextEdit object directly via this method. */ - QLineEdit* lineEdit(); + TQLineEdit* lineEdit(); /** - * Returns the QLineEdit used in this dialog. + * Returns the TQLineEdit used in this dialog. * To set the number of lines or other text box related * settings, access the KTextEdit object directly via this method. */ - const QLineEdit* lineEdit() const; + const TQLineEdit* lineEdit() const; /** * Returns index of selected synchronization mode @@ -75,14 +75,14 @@ class RsyncConfigDialog : public KDialogBase bool mAllowCancel; bool mAllowTextEdit; bool mShown; - QString mCancelText; - QLabel* mLabel; + TQString mCancelText; + TQLabel* mLabel; KProgress* mProgressBar; KTextEdit* mTextBox; - QTimer* mShowTimer; - QLineEdit* m_rsync_txt; - QRadioButton *rsync_rb1; - QRadioButton *rsync_rb2; - QRadioButton *rsync_rb3; + TQTimer* mShowTimer; + TQLineEdit* m_rsync_txt; + TQRadioButton *rsync_rb1; + TQRadioButton *rsync_rb2; + TQRadioButton *rsync_rb3; }; #endif diff --git a/konq-plugins/rsync/rsyncplugin.cpp b/konq-plugins/rsync/rsyncplugin.cpp index 3c4ae1a..81a5253 100644 --- a/konq-plugins/rsync/rsyncplugin.cpp +++ b/konq-plugins/rsync/rsyncplugin.cpp @@ -50,23 +50,23 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -106,8 +106,8 @@ typedef KGenericFactory RsyncPluginFactory; K_EXPORT_COMPONENT_FACTORY(librsyncplugin, RsyncPluginFactory("rsyncplugin")) -RsyncPlugin::RsyncPlugin (QObject* parent, const char* name, - const QStringList&) +RsyncPlugin::RsyncPlugin (TQObject* parent, const char* name, + const TQStringList&) :KParts::Plugin (parent, name), m_pSyncNow(0), m_pSyncSetup(0) @@ -125,10 +125,10 @@ RsyncPlugin::RsyncPlugin (QObject* parent, const char* name, m_pSyncSetup->setIcon("remotesyncconfig"); m_pSyncNow->setEnabled (false); - connect (m_part, SIGNAL(aboutToOpenURL()), SLOT(slotOpenURL())); + connect (m_part, TQT_SIGNAL(aboutToOpenURL()), TQT_SLOT(slotOpenURL())); - connect(m_pSyncNow, SIGNAL(activated()), this, SLOT(slotSync())); - connect(m_pSyncSetup, SIGNAL(activated()), this, SLOT(slotSetup())); + connect(m_pSyncNow, TQT_SIGNAL(activated()), this, TQT_SLOT(slotSync())); + connect(m_pSyncSetup, TQT_SIGNAL(activated()), this, TQT_SLOT(slotSetup())); loadSettings(); @@ -221,10 +221,10 @@ close_master: /** creates the unidirectional sync subprocess */ -bool RsyncPlugin::syncUnidirectional(QString synccommand, QString syncflags, int parameter_order, QString localfolder, QString remotepath) { +bool RsyncPlugin::syncUnidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) { int fd[2]; int rc, flags; - thisFn = QString::null; + thisFn = TQString::null; rc = open_pty_pair(fd); if (rc == -1) { @@ -242,12 +242,12 @@ bool RsyncPlugin::syncUnidirectional(QString synccommand, QString syncflags, int } if (childPid == 0) { // Create the rsync command to run - QString execstring; + TQString execstring; if (parameter_order == 0) { - execstring = synccommand + syncflags + localfolder + QString("/ ") + remotepath; + execstring = synccommand + syncflags + localfolder + TQString("/ ") + remotepath; } else { - execstring = synccommand + syncflags + remotepath + QString("/ ") + localfolder; + execstring = synccommand + syncflags + remotepath + TQString("/ ") + localfolder; } // taken from konsole, see TEPty.C for details @@ -358,10 +358,10 @@ bool RsyncPlugin::syncUnidirectional(QString synccommand, QString syncflags, int /** creates the bidirectional sync subprocess */ -bool RsyncPlugin::syncBidirectional(QString synccommand, QString syncflags, int parameter_order, QString localfolder, QString remotepath) { +bool RsyncPlugin::syncBidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) { int fd[2]; int rc, flags; - thisFn = QString::null; + thisFn = TQString::null; // Check for and remove the trailing slash in localfolder if (localfolder.endsWith("/")) { @@ -384,8 +384,8 @@ bool RsyncPlugin::syncBidirectional(QString synccommand, QString syncflags, int } if (childPid == 0) { // Create the rsync command to run - QString execstring; - execstring = synccommand + syncflags + localfolder + QString(" ") + remotepath; + TQString execstring; + execstring = synccommand + syncflags + localfolder + TQString(" ") + remotepath; // taken from konsole, see TEPty.C for details // note: if we're running on socket pairs, @@ -498,7 +498,7 @@ writes one chunk of data to stdin of child process void RsyncPlugin::writeChild(const char *buf, KIO::fileoffset_t len) { if (outBufPos >= 0 && outBuf) { #if 0 - QString debug; + TQString debug; debug.setLatin1(outBuf,outBufLen); if (len > 0) myDebug( << "write request while old one is pending, throwing away input (" << outBufLen << "," << outBufPos << "," << debug.left(10) << "...)" << endl); #endif @@ -513,7 +513,7 @@ void RsyncPlugin::writeChild(const char *buf, KIO::fileoffset_t len) { manages initial communication setup including password queries */ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { - QString buf; + TQString buf; buf.setLatin1(buffer,len); int pos; // Strip trailing whitespace @@ -526,7 +526,7 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { qApp->processEvents(); } pos++; - QString str = buf.left(pos); + TQString str = buf.left(pos); buf = buf.mid(pos); if (str == "\n") continue; @@ -544,7 +544,7 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { m_progressDialog->setAutoClose(true); m_progressDialog->progressBar()->setTotalSteps(2); m_progressDialog->progressBar()->setValue(1); - connect (m_progressDialog, SIGNAL(cancelClicked()), SLOT(slotRsyncCancelled())); + connect (m_progressDialog, TQT_SIGNAL(cancelClicked()), TQT_SLOT(slotRsyncCancelled())); m_progressDialog->show(); m_progressDialogExists = true; } @@ -557,25 +557,25 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { } else if (!connectionPassword.isEmpty()) { myDebug( << "sending cpass" << endl); connectionAuth.password = connectionPassword+"\n"; - connectionPassword = QString::null; + connectionPassword = TQString::null; writeChild(connectionAuth.password.latin1(),connectionAuth.password.length()); } else { myDebug( << "sending mpass" << endl); connectionAuth.prompt = thisFn+buf; - connectionAuth.password = QString::null; // don't prefill - QCString thispass; - if (KPasswordDialog::getPassword (thispass, i18n("Remote authorization required") + QString("\n") + i18n("Please input") + QString(" ") + QString(buf), NULL) != 1) { + connectionAuth.password = TQString::null; // 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); return -1; } else { - connectionAuth.password = QString(thispass); + connectionAuth.password = TQString(thispass); } connectionAuth.password += "\n"; myDebug( << "sending pass" << endl); writeChild(connectionAuth.password.latin1(),connectionAuth.password.length()); } - thisFn = QString::null; + thisFn = TQString::null; return 0; } else if (buf.endsWith("?")) { @@ -585,7 +585,7 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { } else { writeChild("no\n",3); } - thisFn = QString::null; + thisFn = TQString::null; return 0; } @@ -598,8 +598,8 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { else { if (str.contains(", to-check=")) { // Parse the to-check output - QString tocheck_out_cur; - QString tocheck_out_tot; + 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("/")); @@ -620,8 +620,8 @@ int RsyncPlugin::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { /** manages initial communication setup including password queries */ -int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, QString localfolder, QString remotepath) { - QString buf; +int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, TQString localfolder, TQString remotepath) { + TQString buf; buf.setLatin1(buffer,len); int pos; // Strip trailing whitespace @@ -634,7 +634,7 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, qApp->processEvents(); } pos++; - QString str = buf.left(pos); + TQString str = buf.left(pos); buf = buf.mid(pos); if (str == "\n") continue; @@ -651,7 +651,7 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, m_progressDialog->progressBar()->setFormat("%v / %m"); m_progressDialog->progressBar()->setTotalSteps(0); m_progressDialog->setAutoClose(true); - connect (m_progressDialog, SIGNAL(cancelClicked()), SLOT(slotUnisonCancelled())); + connect (m_progressDialog, TQT_SIGNAL(cancelClicked()), TQT_SLOT(slotUnisonCancelled())); m_progressDialog->show(); m_progressDialogExists = true; } @@ -664,25 +664,25 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, } else if (!connectionPassword.isEmpty()) { myDebug( << "sending cpass" << endl); connectionAuth.password = connectionPassword+"\n"; - connectionPassword = QString::null; + connectionPassword = TQString::null; writeChild(connectionAuth.password.latin1(),connectionAuth.password.length()); } else { myDebug( << "sending mpass" << endl); connectionAuth.prompt = thisFn+buf; - connectionAuth.password = QString::null; // don't prefill - QCString thispass; - if (KPasswordDialog::getPassword (thispass, i18n("Remote authorization required") + QString("\n") + i18n("Please input") + QString(" ") + QString(buf), NULL) != 1) { + connectionAuth.password = TQString::null; // don't prefill + TQCString thispass; + if (KPasswordDialog::getPassword (thispass, i18n("Remote authorization required") + TQString("\n") + i18n("Please input") + TQString(" ") + TQString(buf), NULL) != 1) { slotUnisonCancelled(); return -1; } else { - connectionAuth.password = QString(thispass); + connectionAuth.password = TQString(thispass); } connectionAuth.password += "\n"; myDebug( << "sending pass" << endl); writeChild(connectionAuth.password.latin1(),connectionAuth.password.length()); } - thisFn = QString::null; + thisFn = TQString::null; return 0; } else if (buf.endsWith("?") || buf.endsWith("? []")) { @@ -703,7 +703,7 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, writeChild("no\n",3); } } - thisFn = QString::null; + thisFn = TQString::null; buf = ""; return 0; } @@ -715,13 +715,13 @@ int RsyncPlugin::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, currentPos = m_progressDialog->progressBar()->progress(); m_progressDialog->progressBar()->setProgress(++currentPos); } - QString file_name; + TQString file_name; file_name = buf; file_name.replace("[]", ""); - file_name.replace(QString("changed "), ""); + file_name.replace(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, QMessageBox::Warning, QString("") + i18n("WARNING: Both the local and remote file have been modified") + QString("

") + i18n("Local") + QString(": ") + localfolder + QString("/") + file_name + QString("
") + i18n("Remote") + QString(": ") + remotepath + QString("/") + file_name + QString("

") + i18n("Please select the file to duplicate (the other will be overwritten)") + QString("
") + i18n("Or, select Ignore to skip synchronization of this file for now"), QStringList(), QString::null, NULL, 1); + int rc = KMessageBox::createKMessageBox(dialog, TQMessageBox::Warning, TQString("") + i18n("WARNING: Both the local and remote file have been modified") + TQString("

") + i18n("Local") + TQString(": ") + localfolder + TQString("/") + file_name + TQString("
") + i18n("Remote") + TQString(": ") + remotepath + TQString("/") + file_name + TQString("

") + i18n("Please select the file to duplicate (the other will be overwritten)") + TQString("
") + i18n("Or, select Ignore to skip synchronization of this file for now"), TQStringList(), TQString::null, NULL, 1); if (rc == KDialogBase::Yes) { writeChild(">\n",3); } @@ -794,11 +794,11 @@ void RsyncPlugin::saveSettings() KConfig cfg ("rsyncrc", false, false); cfg.setGroup ("General"); - QString longstring = QString(""); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end();) { + TQString longstring = TQString(""); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end();) { longstring = longstring + (*i); i++; - longstring = longstring + QString(";"); + longstring = longstring + TQString(";"); } cfg.writeEntry("LocalFolders", longstring); @@ -818,13 +818,13 @@ void RsyncPlugin::loadSettings() m_bSettingsLoaded = true; } -QString RsyncPlugin::findLocalFolderByName(QString folderurl) +TQString RsyncPlugin::findLocalFolderByName(TQString folderurl) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { - if (QString::compare((*i), folderurl_stripped) == 0) { + folderurl_stripped.replace(TQString("file://"), TQString("")); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { + if (TQString::compare((*i), folderurl_stripped) == 0) { i++; return (*i); i++; @@ -837,13 +837,13 @@ QString RsyncPlugin::findLocalFolderByName(QString folderurl) return NULL; } -QString RsyncPlugin::findSyncMethodByName(QString folderurl) +TQString RsyncPlugin::findSyncMethodByName(TQString folderurl) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { - if (QString::compare((*i), folderurl_stripped) == 0) { + folderurl_stripped.replace(TQString("file://"), TQString("")); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { + if (TQString::compare((*i), folderurl_stripped) == 0) { i++; i++; return (*i); @@ -856,13 +856,13 @@ QString RsyncPlugin::findSyncMethodByName(QString folderurl) return NULL; } -QString RsyncPlugin::findLoginSyncEnabledByName(QString folderurl) +TQString RsyncPlugin::findLoginSyncEnabledByName(TQString folderurl) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { - if (QString::compare((*i), folderurl_stripped) == 0) { + folderurl_stripped.replace(TQString("file://"), TQString("")); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { + if (TQString::compare((*i), folderurl_stripped) == 0) { i++; i++; i++; @@ -875,13 +875,13 @@ QString RsyncPlugin::findLoginSyncEnabledByName(QString folderurl) return NULL; } -QString RsyncPlugin::findLogoutSyncEnabledByName(QString folderurl) +TQString RsyncPlugin::findLogoutSyncEnabledByName(TQString folderurl) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { - if (QString::compare((*i), folderurl_stripped) == 0) { + folderurl_stripped.replace(TQString("file://"), TQString("")); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { + if (TQString::compare((*i), folderurl_stripped) == 0) { i++; i++; i++; @@ -894,13 +894,13 @@ QString RsyncPlugin::findLogoutSyncEnabledByName(QString folderurl) return NULL; } -QString RsyncPlugin::findTimedSyncEnabledByName(QString folderurl) +TQString RsyncPlugin::findTimedSyncEnabledByName(TQString folderurl) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { - if (QString::compare((*i), folderurl_stripped) == 0) { + folderurl_stripped.replace(TQString("file://"), TQString("")); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { + if (TQString::compare((*i), folderurl_stripped) == 0) { i++; i++; i++; @@ -913,13 +913,13 @@ QString RsyncPlugin::findTimedSyncEnabledByName(QString folderurl) return NULL; } -int RsyncPlugin::deleteLocalFolderByName(QString folderurl) +int RsyncPlugin::deleteLocalFolderByName(TQString folderurl) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); - for (QStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { - if (QString::compare((*i), folderurl_stripped) == 0) { + folderurl_stripped.replace(TQString("file://"), TQString("")); + for (TQStringList::Iterator i(cfgfolderlist.begin()); i != cfgfolderlist.end(); ++i) { + if (TQString::compare((*i), folderurl_stripped) == 0) { i=cfgfolderlist.remove(i); i=cfgfolderlist.remove(i); i=cfgfolderlist.remove(i); @@ -933,11 +933,11 @@ int RsyncPlugin::deleteLocalFolderByName(QString folderurl) return 1; } -int RsyncPlugin::addLocalFolderByName(QString folderurl, QString remoteurl, QString syncmethod, QString excludelist, QString sync_on_login, QString sync_on_logout, QString sync_timed_interval) +int RsyncPlugin::addLocalFolderByName(TQString folderurl, TQString remoteurl, TQString syncmethod, TQString excludelist, TQString sync_on_login, TQString sync_on_logout, TQString sync_timed_interval) { - QString folderurl_stripped; + TQString folderurl_stripped; folderurl_stripped = folderurl; - folderurl_stripped.replace(QString("file://"), QString("")); + folderurl_stripped.replace(TQString("file://"), TQString("")); cfgfolderlist.append(folderurl); cfgfolderlist.append(remoteurl); cfgfolderlist.append(syncmethod); @@ -956,19 +956,19 @@ void RsyncPlugin::slotOpenURL () { // See if this URL is "/", "/dev", or "/proc", and disable sync if so // Also disable sync for non-"file://" URLs - if ((url.directory(true, true) + QString("/") + url.fileName(true)) == "//") { + if ((url.directory(true, true) + TQString("/") + url.fileName(true)) == "//") { m_pSyncSetup->setEnabled(false); m_pSyncNow->setEnabled(false); } - else if (((url.directory(true, true) + QString("/") + url.fileName(true)).left(5) == "//dev") || ((url.directory(true, true) + QString("/") + url.fileName(true)).left(4) == "/dev")) { + else if (((url.directory(true, true) + TQString("/") + url.fileName(true)).left(5) == "//dev") || ((url.directory(true, true) + TQString("/") + url.fileName(true)).left(4) == "/dev")) { m_pSyncSetup->setEnabled(false); m_pSyncNow->setEnabled(false); } - else if (((url.directory(true, true) + QString("/") + url.fileName(true)).left(6) == "//proc") || ((url.directory(true, true) + QString("/") + url.fileName(true)).left(5) == "/proc")) { + else if (((url.directory(true, true) + TQString("/") + url.fileName(true)).left(6) == "//proc") || ((url.directory(true, true) + TQString("/") + url.fileName(true)).left(5) == "/proc")) { m_pSyncSetup->setEnabled(false); m_pSyncNow->setEnabled(false); } - else if (url.protocol() != QString("file")) { + else if (url.protocol() != TQString("file")) { m_pSyncSetup->setEnabled(false); m_pSyncNow->setEnabled(false); } @@ -976,7 +976,7 @@ void RsyncPlugin::slotOpenURL () m_pSyncSetup->setEnabled(true); // See if this URL is in the list of rsync-able directories - if (findLocalFolderByName(url.directory(true, true) + QString("/") + url.fileName(true)) != NULL) { + if (findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true)) != NULL) { m_pSyncNow->setEnabled (true); } else { @@ -994,9 +994,9 @@ void RsyncPlugin::slotSetup() m_pSyncSetup->setEnabled (false); // Look up settings - QString localfolder = url.directory(true, true) + QString("/") + url.fileName(true); - QString remotefolder = findLocalFolderByName(url.directory(true, true) + QString("/") + url.fileName(true)); - QString syncmethod = findSyncMethodByName(url.directory(true, true) + QString("/") + url.fileName(true)); + TQString localfolder = url.directory(true, true) + TQString("/") + url.fileName(true); + TQString remotefolder = findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true)); + TQString syncmethod = findSyncMethodByName(url.directory(true, true) + TQString("/") + url.fileName(true)); int syncint; if (syncmethod == NULL) { syncint = 1; @@ -1014,8 +1014,8 @@ void RsyncPlugin::slotSetup() m_configDialog = new RsyncConfigDialog(0, "rsyncConfig", i18n("Remote Folder Synchronization"), i18n("Configuring Remote Folder Synchronization"), localfolder, remotefolder, syncint, true); m_configDialog->show(); - connect (m_configDialog, SIGNAL(okClicked()), SLOT(slotSetupOK())); - connect (m_configDialog, SIGNAL(cancelClicked()), SLOT(slotSetupCancelled())); + connect (m_configDialog, TQT_SIGNAL(okClicked()), TQT_SLOT(slotSetupOK())); + connect (m_configDialog, TQT_SIGNAL(cancelClicked()), TQT_SLOT(slotSetupCancelled())); } void RsyncPlugin::slotSetupOK() @@ -1026,11 +1026,11 @@ void RsyncPlugin::slotSetupOK() KURL url = m_part->url(); // Look up settings - QString localfolder = url.directory(true, true) + QString("/") + url.fileName(true); - QString remotefolder = findLocalFolderByName(localfolder); - QString remotefolder_new = m_configDialog->lineEdit()->text().ascii(); + TQString localfolder = url.directory(true, true) + TQString("/") + url.fileName(true); + TQString remotefolder = findLocalFolderByName(localfolder); + TQString remotefolder_new = m_configDialog->lineEdit()->text().ascii(); int syncmethod = m_configDialog->getSyncMode(); - QString syncmethod_new = ""; + TQString syncmethod_new = ""; if (syncmethod == 1) { syncmethod_new = "rsync_upload"; } @@ -1093,19 +1093,19 @@ void RsyncPlugin::slotSync() m_pSyncNow->setEnabled (false); - QString syncmethod = findSyncMethodByName(url.directory(true, true) + QString("/") + url.fileName(true)); + TQString syncmethod = findSyncMethodByName(url.directory(true, true) + TQString("/") + url.fileName(true)); if (syncmethod == NULL) { // Do nothing } else if (syncmethod == "rsync_upload") { // Initiate rsync - syncUnidirectional(QString("rsync"), QString(" -avtzAXE --delete --progress "), 0, url.directory(true, true) + QString("/") + url.fileName(true), findLocalFolderByName(url.directory(true, true) + QString("/") + url.fileName(true))); + syncUnidirectional(TQString("rsync"), TQString(" -avtzAXE --delete --progress "), 0, url.directory(true, true) + TQString("/") + url.fileName(true), findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true))); } else if (syncmethod == "rsync_download") { - syncUnidirectional(QString("rsync"), QString(" -avtzAXE --delete --progress "), 1, url.directory(true, true) + QString("/") + url.fileName(true), findLocalFolderByName(url.directory(true, true) + QString("/") + url.fileName(true))); + syncUnidirectional(TQString("rsync"), TQString(" -avtzAXE --delete --progress "), 1, url.directory(true, true) + TQString("/") + url.fileName(true), findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true))); } else if (syncmethod == "rsync_bidirectional") { - syncBidirectional(QString("unison"), QString(" -ui text -auto "), 1, url.directory(true, true) + QString("/") + url.fileName(true), findLocalFolderByName(url.directory(true, true) + QString("/") + url.fileName(true))); + syncBidirectional(TQString("unison"), TQString(" -ui text -auto "), 1, url.directory(true, true) + TQString("/") + url.fileName(true), findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true))); } m_progressDialogExists = false; diff --git a/konq-plugins/rsync/rsyncplugin.h b/konq-plugins/rsync/rsyncplugin.h index 67af3d5..0adbfc0 100644 --- a/konq-plugins/rsync/rsyncplugin.h +++ b/konq-plugins/rsync/rsyncplugin.h @@ -19,8 +19,8 @@ #ifndef __RSYNC_PLUGIN_H #define __RSYNC_PLUGIN_H -#include -#include +#include +#include #include #include @@ -51,27 +51,27 @@ class RsyncPlugin : public KParts::Plugin public: - RsyncPlugin (QObject* parent, const char* name, const QStringList &); + RsyncPlugin (TQObject* parent, const char* name, const TQStringList &); virtual ~RsyncPlugin(); protected: void loadSettings(); void saveSettings(); - QString findLocalFolderByName(QString folderurl); - QString findLoginSyncEnabledByName(QString folderurl); - QString findLogoutSyncEnabledByName(QString folderurl); - QString findTimedSyncEnabledByName(QString folderurl); - int deleteLocalFolderByName(QString folderurl); - int addLocalFolderByName(QString folderurl, QString remoteurl, QString syncmethod, QString excludelist, QString sync_on_login, QString sync_on_logout, QString sync_timed_interval); - QString findSyncMethodByName(QString folderurl); + TQString findLocalFolderByName(TQString folderurl); + TQString findLoginSyncEnabledByName(TQString folderurl); + TQString findLogoutSyncEnabledByName(TQString folderurl); + TQString findTimedSyncEnabledByName(TQString folderurl); + int deleteLocalFolderByName(TQString folderurl); + int addLocalFolderByName(TQString folderurl, TQString remoteurl, TQString syncmethod, TQString excludelist, TQString sync_on_login, TQString sync_on_logout, TQString sync_timed_interval); + TQString findSyncMethodByName(TQString folderurl); /** manages initial communication setup including password queries */ int establishConnectionRsync(char *buffer, KIO::fileoffset_t len); /** manages initial communication setup including password queries */ - int establishConnectionUnison(char *buffer, KIO::fileoffset_t len, QString localfolder, QString remotepath); + int establishConnectionUnison(char *buffer, KIO::fileoffset_t len, TQString localfolder, TQString remotepath); /** creates the unidirectional sync subprocess */ - bool syncUnidirectional(QString synccommand, QString syncflags, int parameter_order, QString localfolder, QString remotepath); + bool syncUnidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath); /** creates the bidirectional sync subprocess */ - bool syncBidirectional(QString synccommand, QString syncflags, int parameter_order, QString localfolder, QString remotepath); + bool syncBidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath); /** writes one chunk of data to stdin of child process */ void writeChild(const char *buf, KIO::fileoffset_t len); /** AuthInfo object used for logging in */ @@ -100,7 +100,7 @@ private: KProgressBoxDialog* m_progressDialog; RsyncConfigDialog* m_configDialog; - QStringList cfgfolderlist; + TQStringList cfgfolderlist; bool m_progressDialogExists; bool m_bSettingsLoaded; @@ -122,14 +122,14 @@ private: /** // FIXME: just a workaround for konq deficiencies */ bool isStat; /** // FIXME: just a workaround for konq deficiencies */ - QString redirectUser, redirectPass; + TQString redirectUser, redirectPass; /** user name of current connection */ - QString connectionUser; + TQString connectionUser; /** password of current connection */ - QString connectionPassword; + TQString connectionPassword; /** true if this is the first login attempt (== use cached password) */ bool firstLogin; - QString thisFn; + TQString thisFn; }; #endif -- cgit v1.2.3