diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
commit | d7633c195a464e4d344ada9eea61afd10110598a (patch) | |
tree | 1f2da0b135f3ed84955e340cae823f00c4ce7284 /src/kdesvnd | |
parent | 3fa7eb804f67b2789f128075cc2522f398640250 (diff) | |
download | tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.tar.gz tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.zip |
Port kdesvn to TQt4
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesvn@1230412 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kdesvnd')
-rw-r--r-- | src/kdesvnd/kdesvnd_dcop.cpp | 120 | ||||
-rw-r--r-- | src/kdesvnd/kdesvnd_dcop.h | 27 |
2 files changed, 74 insertions, 73 deletions
diff --git a/src/kdesvnd/kdesvnd_dcop.cpp b/src/kdesvnd/kdesvnd_dcop.cpp index 580fa92..09afbec 100644 --- a/src/kdesvnd/kdesvnd_dcop.cpp +++ b/src/kdesvnd/kdesvnd_dcop.cpp @@ -40,10 +40,10 @@ #include <kfiledialog.h> #include <kpassdlg.h> -#include <qdir.h> +#include <tqdir.h> extern "C" { - KDESVN_EXPORT KDEDModule *create_kdesvnd(const QCString &name) + KDESVN_EXPORT KDEDModule *create_kdesvnd(const TQCString &name) { return new kdesvnd_dcop(name); } @@ -58,12 +58,12 @@ public: IListener(kdesvnd_dcop*p); virtual ~IListener(); /* context-listener methods */ - virtual bool contextGetLogin (const QString & realm, - QString & username, - QString & password, + virtual bool contextGetLogin (const TQString & realm, + TQString & username, + TQString & password, bool & maySave); - virtual bool contextGetSavedLogin (const QString & realm,QString & username,QString & password); - virtual bool contextGetCachedLogin (const QString & realm,QString & username,QString & password); + virtual bool contextGetSavedLogin (const TQString & realm,TQString & username,TQString & password); + virtual bool contextGetCachedLogin (const TQString & realm,TQString & username,TQString & password); virtual void contextNotify (const char *path, svn_wc_notify_action_t action, @@ -75,14 +75,14 @@ public: virtual void contextNotify (const svn_wc_notify_t *action); virtual bool contextCancel(); - virtual bool contextGetLogMessage (QString & msg,const svn::CommitItemList&); + virtual bool contextGetLogMessage (TQString & msg,const svn::CommitItemList&); virtual svn::ContextListener::SslServerTrustAnswer contextSslServerTrustPrompt (const SslServerTrustData & data, apr_uint32_t & acceptedFailures); - virtual bool contextSslClientCertPrompt (QString & certFile); - virtual bool contextLoadSslClientCertPw(QString&password,const QString&realm); - virtual bool contextSslClientCertPwPrompt (QString & password, - const QString & realm, bool & maySave); + virtual bool contextSslClientCertPrompt (TQString & certFile); + virtual bool contextLoadSslClientCertPw(TQString&password,const TQString&realm); + virtual bool contextSslClientCertPwPrompt (TQString & password, + const TQString & realm, bool & maySave); virtual void contextProgress(long long int current, long long int max); /* context listener virtuals end */ @@ -106,7 +106,7 @@ IListener::~IListener() { } -kdesvnd_dcop::kdesvnd_dcop(const QCString&name) : KDEDModule(name) +kdesvnd_dcop::kdesvnd_dcop(const TQCString&name) : KDEDModule(name) { KGlobal::locale()->insertCatalogue("kdesvn"); m_Listener=new IListener(this); @@ -117,24 +117,24 @@ kdesvnd_dcop::~kdesvnd_dcop() delete m_Listener; } -QStringList kdesvnd_dcop::getActionMenu (const KURL::List list) +TQStringList kdesvnd_dcop::getActionMenu (const KURL::List list) { - QStringList result; + TQStringList result; Kdesvnsettings::self()->readConfig(); if (Kdesvnsettings::no_konqueror_contextmenu()||list.count()==0) { return result; } - QString base; + TQString base; - bool parentIsWc = false; + bool tqparentIsWc = false; bool itemIsWc = isWorkingCopy(list[0],base); bool itemIsRepository = false; - QString _par = list[0].directory(true,true); - parentIsWc = isWorkingCopy(_par,base); + TQString _par = list[0].directory(true,true); + tqparentIsWc = isWorkingCopy(_par,base); - if (!parentIsWc && !itemIsWc) { + if (!tqparentIsWc && !itemIsWc) { itemIsRepository = isRepository(list[0]); } @@ -151,7 +151,7 @@ QStringList kdesvnd_dcop::getActionMenu (const KURL::List list) << "Commit"; } - if (!parentIsWc && !itemIsWc) { + if (!tqparentIsWc && !itemIsWc) { if (itemIsRepository) { result << "Log" << "Info"; @@ -178,7 +178,7 @@ QStringList kdesvnd_dcop::getActionMenu (const KURL::List list) KURL url = helpers::KTranslateUrl::translateSystemUrl(list[0]); - QFileInfo f(url.path()); + TQFileInfo f(url.path()); if (f.isFile()) { result << "Blame"; } @@ -191,17 +191,17 @@ QStringList kdesvnd_dcop::getActionMenu (const KURL::List list) return result; } -QStringList kdesvnd_dcop::getSingleActionMenu(QCString what) +TQStringList kdesvnd_dcop::getSingleActionMenu(TQCString what) { KURL::List l; l.append(KURL(what)); return getActionMenu(l); } -QStringList kdesvnd_dcop::get_login(QString realm,QString user) +TQStringList kdesvnd_dcop::get_login(TQString realm,TQString user) { AuthDialogImpl auth(realm,user); - QStringList res; - if (auth.exec()==QDialog::Accepted) { + TQStringList res; + if (auth.exec()==TQDialog::Accepted) { res.append(auth.Username()); res.append(auth.Password()); if (auth.maySave()) { @@ -213,7 +213,7 @@ QStringList kdesvnd_dcop::get_login(QString realm,QString user) return res; } -int kdesvnd_dcop::get_sslaccept(QString hostname,QString fingerprint,QString validFrom,QString validUntil,QString issuerDName,QString realm) +int kdesvnd_dcop::get_sslaccept(TQString hostname,TQString fingerprint,TQString validFrom,TQString validUntil,TQString issuerDName,TQString realm) { bool ok,saveit; if (!SslTrustPrompt_impl::sslTrust( @@ -223,7 +223,7 @@ int kdesvnd_dcop::get_sslaccept(QString hostname,QString fingerprint,QString val validUntil, issuerDName, realm, - QStringList(), + TQStringList(), &ok,&saveit)) { return -1; } @@ -233,16 +233,16 @@ int kdesvnd_dcop::get_sslaccept(QString hostname,QString fingerprint,QString val return 1; } -QStringList kdesvnd_dcop::get_sslclientcertpw(QString realm) +TQStringList kdesvnd_dcop::get_sslclientcertpw(TQString realm) { - QStringList resList; - QCString npass; + TQStringList resList; + TQCString npass; int keep = 1; - int res = KPasswordDialog::getPassword(npass,i18n("Enter password for realm %1").arg(realm),&keep); + int res = KPasswordDialog::getPassword(npass,i18n("Enter password for realm %1").tqarg(realm),&keep); if (res!=KPasswordDialog::Accepted) { return resList; } - resList.append(QString(npass)); + resList.append(TQString(npass)); if (keep) { resList.append("true"); } else { @@ -251,20 +251,20 @@ QStringList kdesvnd_dcop::get_sslclientcertpw(QString realm) return resList; } -QString kdesvnd_dcop::get_sslclientcertfile() +TQString kdesvnd_dcop::get_sslclientcertfile() { - QString afile = KFileDialog::getOpenFileName(QString::null, - QString::null, + TQString afile = KFileDialog::getOpenFileName(TQString(), + TQString(), 0, i18n("Open a file with a #PKCS12 certificate")); return afile; } -QStringList kdesvnd_dcop::get_logmsg() +TQStringList kdesvnd_dcop::get_logmsg() { - QStringList res; + TQStringList res; bool ok; - QString logMessage = Logmsg_impl::getLogmessage(&ok,0,0,0,"logmsg_impl"); + TQString logMessage = Logmsg_impl::getLogmessage(&ok,0,0,0,"logmsg_impl"); if (!ok) { return res; } @@ -272,11 +272,11 @@ QStringList kdesvnd_dcop::get_logmsg() return res; } -QStringList kdesvnd_dcop::get_logmsg(QMap<QString,QString> list) +TQStringList kdesvnd_dcop::get_logmsg(TQMap<TQString,TQString> list) { - QStringList res; + TQStringList res; bool ok; - QString logMessage = Logmsg_impl::getLogmessage(list,&ok,0,0,0,"logmsg_impl"); + TQString logMessage = Logmsg_impl::getLogmessage(list,&ok,0,0,0,"logmsg_impl"); if (!ok) { return res; } @@ -284,9 +284,9 @@ QStringList kdesvnd_dcop::get_logmsg(QMap<QString,QString> list) return res; } -QString kdesvnd_dcop::cleanUrl(const KURL&url) +TQString kdesvnd_dcop::cleanUrl(const KURL&url) { - QString cleanpath = url.path(); + TQString cleanpath = url.path(); while (cleanpath.endsWith("/")) { cleanpath.truncate(cleanpath.length()-1); } @@ -297,7 +297,7 @@ QString kdesvnd_dcop::cleanUrl(const KURL&url) bool kdesvnd_dcop::isRepository(const KURL&url) { kdDebug()<<"kdesvnd_dcop::isRepository Url zum repo check: "<<url<<endl; - QString proto = svn::Url::transformProtokoll(url.protocol()); + TQString proto = svn::Url::transformProtokoll(url.protocol()); kdDebug()<<"kdesvnd_dcop::isRepository Protokoll: " << proto << endl; if (proto=="file") { // local access - may a repository @@ -315,7 +315,7 @@ bool kdesvnd_dcop::isRepository(const KURL&url) } } -bool kdesvnd_dcop::isWorkingCopy(const KURL&_url,QString&base) +bool kdesvnd_dcop::isWorkingCopy(const KURL&_url,TQString&base) { base = ""; KURL url = _url; @@ -335,24 +335,24 @@ bool kdesvnd_dcop::isWorkingCopy(const KURL&_url,QString&base) return true; } -bool IListener::contextGetSavedLogin (const QString & realm,QString & username,QString & password) +bool IListener::contextGetSavedLogin (const TQString & realm,TQString & username,TQString & password) { PwStorage::self()->getLogin(realm,username,password); return true; } -bool IListener::contextGetCachedLogin (const QString & realm,QString & username,QString & password) +bool IListener::contextGetCachedLogin (const TQString & realm,TQString & username,TQString & password) { return true; } -bool IListener::contextGetLogin (const QString & realm, - QString & username, - QString & password, +bool IListener::contextGetLogin (const TQString & realm, + TQString & username, + TQString & password, bool & maySave) { maySave=false; - QStringList res = m_back->get_login(realm,username); + TQStringList res = m_back->get_login(realm,username); if (res.count()!=3) { return false; } @@ -385,9 +385,9 @@ bool IListener::contextCancel() return false; } -bool IListener::contextGetLogMessage (QString & msg,const svn::CommitItemList&) +bool IListener::contextGetLogMessage (TQString & msg,const svn::CommitItemList&) { - QStringList res = m_back->get_logmsg(); + TQStringList res = m_back->get_logmsg(); if (res.count()==0) { return false; } @@ -420,7 +420,7 @@ svn::ContextListener::SslServerTrustAnswer IListener::contextSslServerTrustPromp return ACCEPT_TEMPORARILY; } -bool IListener::contextSslClientCertPrompt (QString & certFile) +bool IListener::contextSslClientCertPrompt (TQString & certFile) { certFile = m_back->get_sslclientcertfile(); if (certFile.isEmpty()) { @@ -429,24 +429,24 @@ bool IListener::contextSslClientCertPrompt (QString & certFile) return true; } -bool IListener::contextLoadSslClientCertPw(QString&password,const QString&realm) +bool IListener::contextLoadSslClientCertPw(TQString&password,const TQString&realm) { return PwStorage::self()->getCertPw(realm,password); } -bool IListener::contextSslClientCertPwPrompt (QString & password, - const QString & realm, bool & maySave) +bool IListener::contextSslClientCertPwPrompt (TQString & password, + const TQString & realm, bool & maySave) { maySave=false; if (PwStorage::self()->getCertPw(realm,password)) { return true; } - QStringList res = m_back->get_sslclientcertpw(realm); + TQStringList res = m_back->get_sslclientcertpw(realm); if (res.size()!=2) { return false; } password=res[0]; - maySave=res[1]==QString("true"); + maySave=res[1]==TQString("true"); if (maySave && Kdesvnsettings::passwords_in_wallet() ) { PwStorage::self()->setCertPw(realm,password); diff --git a/src/kdesvnd/kdesvnd_dcop.h b/src/kdesvnd/kdesvnd_dcop.h index 61b8f83..dca96f3 100644 --- a/src/kdesvnd/kdesvnd_dcop.h +++ b/src/kdesvnd/kdesvnd_dcop.h @@ -22,8 +22,8 @@ #ifndef _kdesvnd_dcop_H #define _kdesvnd_dcop_H -#include <qstringlist.h> -#include <qstring.h> +#include <tqstringlist.h> +#include <tqstring.h> #include <kurl.h> #include <dcopobject.h> #include <kdedmodule.h> @@ -33,18 +33,19 @@ class IListener; class kdesvnd_dcop : public KDEDModule { Q_OBJECT +// TQ_OBJECT K_DCOP private: public: - kdesvnd_dcop(const QCString&); + kdesvnd_dcop(const TQCString&); virtual ~kdesvnd_dcop(); protected: - bool isWorkingCopy(const KURL&url,QString&base); + bool isWorkingCopy(const KURL&url,TQString&base); bool isRepository(const KURL&url); - static QString cleanUrl(const KURL&url); + static TQString cleanUrl(const KURL&url); IListener*m_Listener; k_dcop: @@ -54,21 +55,21 @@ k_dcop: * \param user default username * \return a stringlist containing username-password-saveit as "true" or "false" or empty list if cancel hit. */ - QStringList get_login(QString,QString); + TQStringList get_login(TQString,TQString); // return: -1 dont accept 0 accept temporary 1 accept always // hostname, fingerprint, validFrom, validUntil, issuerDName, realm, - int get_sslaccept(QString, QString, QString, QString, QString, QString); + int get_sslaccept(TQString, TQString, TQString, TQString, TQString, TQString); // returns cert file or empty string - QString get_sslclientcertfile(); + TQString get_sslclientcertfile(); // return a logmessage at pos 0, null-size list if cancel hit - QStringList get_logmsg(); + TQStringList get_logmsg(); // return a logmessage at pos 0, null-size list if cancel hit, parameter is path -> action for display - QStringList get_logmsg(QMap<QString,QString>); + TQStringList get_logmsg(TQMap<TQString,TQString>); // return pw at pos 0, maysafe at pos 1, null-size if cancel hit. - QStringList get_sslclientcertpw(QString); - QStringList getActionMenu(KURL::List); - QStringList getSingleActionMenu(QCString); + TQStringList get_sslclientcertpw(TQString); + TQStringList getActionMenu(KURL::List); + TQStringList getSingleActionMenu(TQCString); }; #endif |