summaryrefslogtreecommitdiffstats
path: root/src/update.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2013-07-27 16:57:53 +0200
committerSlávek Banko <[email protected]>2013-07-27 18:48:46 +0200
commit7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931 (patch)
tree4655c7263ca5c64d23d10167cb459dd9cb253815 /src/update.cpp
parent88ea2b6cd4382627fb6efca9cc54825aee881d1e (diff)
downloadtork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.tar.gz
tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.zip
Initial TQt conversion
Diffstat (limited to 'src/update.cpp')
-rw-r--r--src/update.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/update.cpp b/src/update.cpp
index 0785526..d406ac4 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -29,11 +29,11 @@
#include <kaction.h>
-#include <qcheckbox.h>
+#include <ntqcheckbox.h>
#include <kbuttonbox.h>
#include <kurlcompletion.h>
#include <kcombobox.h>
-#include <qlayout.h>
+#include <ntqlayout.h>
#include <kmessagebox.h>
#include <klineedit.h>
#include <ktempfile.h>
@@ -47,8 +47,8 @@
#include <dcopclient.h>
#include <kuser.h>
-#include <qtimer.h>
-#include <qdir.h>
+#include <ntqtimer.h>
+#include <ntqdir.h>
#include "version.h"
#include <stdlib.h>
@@ -74,8 +74,8 @@ const char *mirrors[] = {
0
};
-TorkUpdate::TorkUpdate(QWidget *parent, const char *name)
- : QWidget(parent, name),filelist(new KHTMLPart(this))
+TorkUpdate::TorkUpdate(TQWidget *parent, const char *name)
+ : TQWidget(parent, name),filelist(new KHTMLPart(this))
{
}
@@ -86,25 +86,25 @@ TorkUpdate::~TorkUpdate()
}
-void TorkUpdate::downloadComponent(QString component, QString version, QString extension)
+void TorkUpdate::downloadComponent(TQString component, TQString version, TQString extension)
{
upgradeinprogress = true;
- QString location = getenv("HOME");
+ TQString location = getenv("HOME");
location += "/.tork";
- QDir torkdir(location);
+ TQDir torkdir(location);
if (!torkdir.exists() && !torkdir.mkdir(location))
location = getenv("HOME");
- QString currenttor = location + QString("/%1-%2").arg(component).arg(version);
- QDir tordir(currenttor);
+ TQString currenttor = location + TQString("/%1-%2").arg(component).arg(version);
+ TQDir tordir(currenttor);
- QString configure;
- configure = QString("%1/%2-%3/configure").arg(location).arg(component).arg(version);
+ TQString configure;
+ configure = TQString("%1/%2-%3/configure").arg(location).arg(component).arg(version);
- QFile configurefile(configure);
+ TQFile configurefile(configure);
bool download = true;
@@ -119,28 +119,28 @@ void TorkUpdate::downloadComponent(QString component, QString version, QString e
}
}
- QStringList entry;
+ TQStringList entry;
while (download){
startProgressDialog( i18n( "Downloading %1-%2..." ).arg(component).arg(version) );
- QString dlLocation;
- QString dlLocationSig;
+ TQString dlLocation;
+ TQString dlLocationSig;
if (component == "tor"){
- dlLocation = QString("https://torproject.org/dist/%3").arg(highestsofarfilename);
- dlLocationSig = QString("https://torproject.org/dist/%3.asc").arg(highestsofarfilename);
+ dlLocation = TQString("https://torproject.org/dist/%3").arg(highestsofarfilename);
+ dlLocationSig = TQString("https://torproject.org/dist/%3.asc").arg(highestsofarfilename);
}else if (component == "privoxy")
- dlLocation = QString("http://%1.dl.sourceforge.net/sourceforge%3").arg(getMirror()).arg(highestsofarfilename);
+ dlLocation = TQString("http://%1.dl.sourceforge.net/sourceforge%3").arg(getMirror()).arg(highestsofarfilename);
else if (component == "dante")
- dlLocation = QString("http://www.mirrors.wiretapped.net/security/firewalls/dante/%3").arg(highestsofarfilename);
+ dlLocation = TQString("http://www.mirrors.wiretapped.net/security/firewalls/dante/%3").arg(highestsofarfilename);
else if (component == "thttpd")
- dlLocation = QString("http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz");
+ dlLocation = TQString("http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz");
else if (component == "Mixminion")
- dlLocation = QString("http://www.mixminion.net/dist/0.0.8alpha3/Mixminion-0.0.8alpha3.tar.gz");
+ dlLocation = TQString("http://www.mixminion.net/dist/0.0.8alpha3/Mixminion-0.0.8alpha3.tar.gz");
else
- dlLocation = QString("http://%1.dl.sourceforge.net/sourceforge/%2/%3-%4%5").arg(getMirror()).arg(component).arg(component).arg(version).arg(extension);
+ dlLocation = TQString("http://%1.dl.sourceforge.net/sourceforge/%2/%3-%4%5").arg(getMirror()).arg(component).arg(component).arg(version).arg(extension);
- QString tmpFile;
+ TQString tmpFile;
if ( !KIO::NetAccess::download( dlLocation, tmpFile, 0L ) ){
KMessageBox::information (0,i18n("Couldn't download %1.").arg(component));
delete timer;
@@ -151,7 +151,7 @@ void TorkUpdate::downloadComponent(QString component, QString version, QString e
return;
}
- QString tmpFile2;
+ TQString tmpFile2;
if (!dlLocationSig.isEmpty()){
if ( !KIO::NetAccess::download( dlLocationSig, tmpFile2, 0L ) ){
KMessageBox::information (0,i18n("Couldn't download %1 signature file.").arg(component));
@@ -234,12 +234,12 @@ void TorkUpdate::downloadComponent(QString component, QString version, QString e
//KTar does not honour executable permissions
if (component == "privoxy"){
- configure = QString("%1/%2/").arg(location).arg(entry.first());
+ configure = TQString("%1/%2/").arg(location).arg(entry.first());
configurefile.setName(configure+"configure.in");
}
if (component == "Mixminion"){
- configure = QString("%1/%2/").arg(location).arg(entry.first());
+ configure = TQString("%1/%2/").arg(location).arg(entry.first());
configurefile.setName(configure+"README");
}
@@ -259,18 +259,18 @@ void TorkUpdate::downloadComponent(QString component, QString version, QString e
KProcess* arkollonproc = new KShellProcess();
KMessageBox::information (this,i18n( "<p><b>If this the first time you've compiled software then here are a few useful tips:</b><br>"
- "1. Any error messages in the log file with the words 'KDE', 'Qt','curl' or 'X' in them mean that you need to install "
+ "1. Any error messages in the log file with the words 'KDE', 'TQt','curl' or 'X' in them mean that you need to install "
"the appropriate development libraries.<br>"
"2. Any package provided by your distribution with 'lib' or 'devel' in the name is a development library, e.g. qt-devel, libkde.<br>"
"</p>" ),"Compilation Tips","compiler");
- QString command;
+ TQString command;
if (component == "Mixminion")
- command = QString("kdesu -i tork -c 'xterm -hold -e \"cd %1;make install;printf \\\"If there were errors try downloading and installing Mixminion from the Mixminion homepage. If the installation looks successful try sending an anonymous mail to yourself. Close the window to continue.\\\"\"'").arg(configure);
+ command = TQString("kdesu -i tork -c 'xterm -hold -e \"cd %1;make install;printf \\\"If there were errors try downloading and installing Mixminion from the Mixminion homepage. If the installation looks successful try sending an anonymous mail to yourself. Close the window to continue.\\\"\"'").arg(configure);
else if (component == "privoxy")
- command = QString("cd %1; autoheader;autoconf;torkarkollon %2").arg(configure).arg(configure);
+ command = TQString("cd %1; autoheader;autoconf;torkarkollon %2").arg(configure).arg(configure);
else
- command = QString("torkarkollon %1/%2-%3").arg(location).arg(component).arg(version);
+ command = TQString("torkarkollon %1/%2-%3").arg(location).arg(component).arg(version);
*arkollonproc << command;
@@ -357,7 +357,7 @@ void TorkUpdate::checkForNewDanteDirectly()
}
-void TorkUpdate::completedSearchForUpdates(const QString &component, const QString &extension)
+void TorkUpdate::completedSearchForUpdates(const TQString &component, const TQString &extension)
{
double currentversion;
@@ -396,11 +396,11 @@ void TorkUpdate::completedSearchForUpdates(const QString &component, const QStri
-void TorkUpdate::startProgressDialog( const QString & text )
+void TorkUpdate::startProgressDialog( const TQString & text )
{
- progressDialog = new KProgressDialog( 0, "progress_dialog", QString::null, text, false );
+ progressDialog = new KProgressDialog( 0, "progress_dialog", TQString::null, text, false );
progressDialog->setAllowCancel( true );
progressDialog->showCancelButton( true );
@@ -415,7 +415,7 @@ void TorkUpdate::startProgressDialog( const QString & text )
connect( progressDialog, SIGNAL( cancelClicked() ), this,
SLOT( updateCanceled() ) );
- timer = new QTimer( this );
+ timer = new TQTimer( this );
connect( timer, SIGNAL( timeout() ), this, SLOT( slotProg() ) );
timer->start( 200, FALSE );
@@ -576,7 +576,7 @@ void TorkUpdate::parseSFPageHack()
void TorkUpdate::getVersionFromLink( const DOM::Node &n )
{
double numericversion;
- QString tmpversion;
+ TQString tmpversion;
if ( n.isNull() || n.nodeType() != DOM::Node::ELEMENT_NODE )
return;
@@ -585,14 +585,14 @@ void TorkUpdate::getVersionFromLink( const DOM::Node &n )
KURL href ( elem.getAttribute( "href" ).string() );
- QString name = elem.getAttribute( "href" ).string();
- QString version = name.replace(".tar.bz2","").replace(".tar.gz","");
+ TQString name = elem.getAttribute( "href" ).string();
+ TQString version = name.replace(".tar.bz2","").replace(".tar.gz","");
version = version.replace("tork-","").replace("tor-","")
.replace("/ijbswa/privoxy-","")
.replace("-stable-src","")
.replace("dante-","");
- QString rawversion = version;
+ TQString rawversion = version;
if (m_alpha) {
version.remove("-alpha").remove("-beta").remove("-rc");
}
@@ -607,7 +607,7 @@ void TorkUpdate::getVersionFromLink( const DOM::Node &n )
}
-QString TorkUpdate::getMirror()
+TQString TorkUpdate::getMirror()
{
int r = 1+(int) (16.0*rand()/(RAND_MAX+1.0));
static int previousmirror = 0;
@@ -620,11 +620,11 @@ QString TorkUpdate::getMirror()
return mirrors[r];
}
-double TorkUpdate::numericizeVersion(QString &version)
+double TorkUpdate::numericizeVersion(TQString &version)
{
- QString tmpversion = version;
- QStringList tokens = QStringList::split(".",tmpversion);
- for ( QStringList::Iterator it = tokens.begin(); it != tokens.end(); it++ )
+ TQString tmpversion = version;
+ TQStringList tokens = TQStringList::split(".",tmpversion);
+ for ( TQStringList::Iterator it = tokens.begin(); it != tokens.end(); it++ )
{
if ((*it).length() < 2)
(*it).prepend("0");