TQt4 port kdpkg

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdpkg@1239294 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent b155cffc1b
commit 9885af067f

@ -22,16 +22,16 @@
#include <kgenericfactory.h>
#include <kpushbutton.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qwidgetstack.h>
#include <qlistview.h>
#include <qtextedit.h>
#include <qstring.h>
#include <tqlistbox.h>
#include <tqlineedit.h>
#include <tqcombobox.h>
#include <tqwidgetstack.h>
#include <tqlistview.h>
#include <tqtextedit.h>
#include <tqstring.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include "console.h"
@ -40,8 +40,8 @@
using namespace std;
console::console(QWidget *parent, const QStrList &run, const char *name, const QStringList &)
: Widget(parent,name)
console::console(TQWidget *tqparent, const TQStrList &run, const char *name, const TQStringList &)
: Widget(tqparent,name)
{
// Get KDE prefix
@ -64,7 +64,7 @@ console::console(QWidget *parent, const QStrList &run, const char *name, const Q
i=2048;
}
}
m_kdePrefix = QString(prefix_result);
m_kdePrefix = TQString(prefix_result);
}
//label->setText( name );
@ -73,7 +73,7 @@ console::console(QWidget *parent, const QStrList &run, const char *name, const Q
// run command
terminal()->startProgram( m_kdePrefix + "/share/kdpkg/sh/kdpkg-sh", run );
connect( konsole, SIGNAL(destroyed()), this, SLOT( finish() ) );
connect( konsole, TQT_SIGNAL(destroyed()), this, TQT_SLOT( finish() ) );
}
@ -89,18 +89,18 @@ void console::loadKonsole()
KLibFactory* factory = KLibLoader::self()->factory( "libsanekonsolepart" );
if (!factory)
factory = KLibLoader::self()->factory( "libkonsolepart" );
konsole = static_cast<KParts::Part*>( factory->create( konsoleFrame, "konsolepart", "QObject", "KParts::ReadOnlyPart" ) );
konsole = static_cast<KParts::Part*>( factory->create( TQT_TQOBJECT(konsoleFrame), "konsolepart", TQOBJECT_OBJECT_NAME_STRING, "KParts::ReadOnlyPart" ) );
terminal()->setAutoDestroy( true );
terminal()->setAutoStartShell( false );
konsole->widget()->setGeometry(0, 0, konsoleFrame->width(), konsoleFrame->height());
}
bool console::eventFilter( QObject *o, QEvent *e )
bool console::eventFilter( TQObject *o, TQEvent *e )
{
// This function makes the console emulator expanding
if ( e->type() == QEvent::Resize )
if ( e->type() == TQEvent::Resize )
{
QResizeEvent *re = dynamic_cast< QResizeEvent * >( e );
TQResizeEvent *re = dynamic_cast< TQResizeEvent * >( e );
if ( !re ) return false;
konsole->widget()->setGeometry( 0, 0, re->size().width(), re->size().height() );
}

@ -24,7 +24,7 @@
#include "consoledialog.h"
#include <qstring.h>
#include <tqstring.h>
#include <kde_terminal_interface.h>
#include <kparts/part.h>
@ -32,22 +32,25 @@
class console : public Widget
{
Q_OBJECT
TQ_OBJECT
public:
console(QWidget *parent = 0L, const QStrList &run = QStrList(), const char *name = 0L, const QStringList &foo = QStringList());
console(TQWidget *tqparent = 0L, const TQStrList &run = TQStrList(), const char *name = 0L, const TQStringList &foo = TQStringList());
// console
ExtTerminalInterface *terminal()
{
return static_cast<ExtTerminalInterface*>(konsole->qt_cast( "ExtTerminalInterface" ) );
}
virtual bool eventFilter( QObject *o, QEvent *e );
QString m_kdePrefix;
virtual bool eventFilter( TQObject *o, TQEvent *e );
TQString m_kdePrefix;
public slots:
virtual void finish();
protected slots:
void loadKonsole();
protected:
KParts::Part *konsole;
signals:

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>Widget</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>Widget</cstring>
</property>
@ -19,7 +19,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QFrame" row="0" column="0">
<widget class="TQFrame" row="0" column="0">
<property name="name">
<cstring>borderFrame</cstring>
</property>
@ -39,7 +39,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QFrame" row="0" column="0">
<widget class="TQFrame" row="0" column="0">
<property name="name">
<cstring>konsoleFrame</cstring>
</property>
@ -65,8 +65,8 @@
</widget>
</grid>
</widget>
<slots>
<Q_SLOTS>
<slot>button_clicked()</slot>
</slots>
<layoutdefaults spacing="2" margin="2"/>
</Q_SLOTS>
<tqlayoutdefaults spacing="2" margin="2"/>
</UI>

@ -25,15 +25,15 @@
#include <kurlrequester.h>
#include <kaboutapplication.h>
#include <qlistbox.h>
#include <qfile.h>
#include <qpushbutton.h>
#include <qwidgetstack.h>
#include <qlabel.h>
#include <qlistview.h>
#include <qregexp.h>
#include <qradiobutton.h>
#include <qfiledialog.h>
#include <tqlistbox.h>
#include <tqfile.h>
#include <tqpushbutton.h>
#include <tqwidgetstack.h>
#include <tqlabel.h>
#include <tqlistview.h>
#include <tqregexp.h>
#include <tqradiobutton.h>
#include <tqfiledialog.h>
#include <console.h>
#include <install.h>
@ -43,12 +43,12 @@
using namespace std;
install::install( const QString &url, QWidget *parent, const char *name, const QStringList &)
:InstallDialog(parent, name)
install::install( const TQString &url, TQWidget *tqparent, const char *name, const TQStringList &)
:InstallDialog(tqparent, name)
{
if( !url )
path = KFileDialog::getOpenFileName( QString::null, QString("*.deb|") + i18n("Debian Package (*.deb)"), this, i18n("Choose a Debian package file to open"));
path = KFileDialog::getOpenFileName( TQString(), TQString("*.deb|") + i18n("Debian Package (*.deb)"), this, i18n("Choose a Debian package file to open"));
else
path = url;
@ -56,7 +56,7 @@ install::install( const QString &url, QWidget *parent, const char *name, const Q
this->shell->setCommand("dpkg -f "+path);
this->shell->start(true);
fields = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
fields = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
installPushButton->hide();
nextPushButton1->hide();
@ -81,7 +81,7 @@ install::install( const QString &url, QWidget *parent, const char *name, const Q
i=2048;
}
}
m_kdePrefix = QString(prefix_result);
m_kdePrefix = TQString(prefix_result);
}
if( !checkArchitecture() )
@ -163,14 +163,14 @@ void install::page3()
titleTextLabel->setText( "<b>"+i18n( "Resynchronize Package Index")+"</b>" );
closePushButton->hide();
QStrList run; run.append( m_kdePrefix + "/share/kdpkg/sh/kdpkg-sh" );
TQStrList run; run.append( m_kdePrefix + "/share/kdpkg/sh/kdpkg-sh" );
run.append( "update" );
QWidget *consoleWidget = new console(this, run );
TQWidget *consoleWidget = new console(this, run );
widgetStack->addWidget(consoleWidget, 4);
widgetStack->raiseWidget(4);
connect( consoleWidget, SIGNAL( finished(bool) ), this, SLOT( page1() ));
connect( consoleWidget, TQT_SIGNAL( finished(bool) ), this, TQT_SLOT( page1() ));
}
@ -186,18 +186,18 @@ void install::page4()
if( !removePkg )
removePkg = "none";
QStrList run; run.append( m_kdePrefix + "/share/kdpkg/sh/kdpkg-sh" );
TQStrList run; run.append( m_kdePrefix + "/share/kdpkg/sh/kdpkg-sh" );
run.append( "install" );
run.append( path );
run.append( installPkg );
run.append( removePkg );
QWidget *consoleWidget = new console(this, run );
TQWidget *consoleWidget = new console(this, run );
widgetStack->addWidget(consoleWidget, 5);
widgetStack->raiseWidget(5);
//connect( consoleWidget, SIGNAL( finished(bool) ), this, SLOT( close() ));
connect( consoleWidget, SIGNAL( finished(bool) ), this, SLOT( page5() ));
//connect( consoleWidget, TQT_SIGNAL( finished(bool) ), this, TQT_SLOT( close() ));
connect( consoleWidget, TQT_SIGNAL( finished(bool) ), this, TQT_SLOT( page5() ));
}
@ -215,27 +215,27 @@ void install::page5()
//--- get --------------------------------------------------------------------//
//----------------------------------------------------------------------------//
QStringList install::getVersions(QString package)
TQStringList install::getVersions(TQString package)
{
this->shell->setCommand("apt-cache policy "+package);
this->shell->start(true);
QStringList input = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
TQStringList input = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
QString sysVersion = input[1];
sysVersion = QStringList::split( ":", sysVersion)[1].replace(" ","");
TQString sysVersion = input[1];
sysVersion = TQStringList::split( ":", sysVersion)[1].tqreplace(" ","");
if( sysVersion.contains("(") || sysVersion == "" )
if( sysVersion.tqcontains("(") || sysVersion == "" )
sysVersion = i18n("not installed");
QString repVersion = input[2];
repVersion = QStringList::split( ":", repVersion)[1].replace(" ","");
TQString repVersion = input[2];
repVersion = TQStringList::split( ":", repVersion)[1].tqreplace(" ","");
if( repVersion.contains("(") || repVersion == "" )
if( repVersion.tqcontains("(") || repVersion == "" )
repVersion = i18n("not available");
QStringList versions;
TQStringList versions;
versions.append(sysVersion);
versions.append(repVersion);
@ -253,30 +253,30 @@ void install::showDependencies()
// show packages which will be installed
QString debianPkgName = fields.grep("Package:")[0].mid(9);
QString debianPkgVersion = fields.grep("Version:")[0].mid(9);
QStringList debianVersions = getVersions(fields.grep("Package:")[0].mid(9));
QString debianSysVersion = debianVersions[0];
QListViewItem * ditem = new QListViewItem( dependenciesListView, 0 );
ditem->setPixmap( 0, QPixmap( m_kdePrefix + "/share/kdpkg/icons/install.png") );
TQString debianPkgName = fields.grep("Package:")[0].mid(9);
TQString debianPkgVersion = fields.grep("Version:")[0].mid(9);
TQStringList debianVersions = getVersions(fields.grep("Package:")[0].mid(9));
TQString debianSysVersion = debianVersions[0];
TQListViewItem * ditem = new TQListViewItem( dependenciesListView, 0 );
ditem->setPixmap( 0, TQPixmap( m_kdePrefix + "/share/kdpkg/icons/install.png") );
ditem->setText( 1, debianPkgName );
ditem->setText( 2, debianPkgVersion );
ditem->setText( 3, debianSysVersion );
QString tmpString = fields.grep( QRegExp("^Depends:") )[0].mid(9);
TQString tmpString = fields.grep( TQRegExp("^Depends:") )[0].mid(9);
tmpString += ", "+fields.grep( "Pre-Depends:" )[0].mid(13);
QStringList allDepends = QStringList::split( ", ", tmpString );
TQStringList allDepends = TQStringList::split( ", ", tmpString );
QString missingDepends;
QStringList tmp;
TQString missingDepends;
TQStringList tmp;
for(uint i = 0; i < allDepends.count(); i++)
{
if( allDepends[i].contains("|") ) {
tmp = QStringList::split( " | ", allDepends[i] );
if( allDepends[i].tqcontains("|") ) {
tmp = TQStringList::split( " | ", allDepends[i] );
uint j = 0;
bool exit = FALSE;
while ( !exit && j < tmp.count() ) {
@ -290,35 +290,35 @@ void install::showDependencies()
else
{
if( !isInstalled( allDepends[i] ) )
missingDepends += QStringList::split( " ", allDepends[i] )[0]+" ";
missingDepends += TQStringList::split( " ", allDepends[i] )[0]+" ";
}
}
while (missingDepends.find("(") != -1) {
start_index = missingDepends.find("(");
stop_index = missingDepends.find(")", start_index);
missingDepends.replace(start_index, stop_index-start_index+1, "");
while (missingDepends.tqfind("(") != -1) {
start_index = missingDepends.tqfind("(");
stop_index = missingDepends.tqfind(")", start_index);
missingDepends.tqreplace(start_index, stop_index-start_index+1, "");
}
this->shell->setCommand("apt-get -s install "+missingDepends);
this->shell->start(true);
QStringList installList = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ).grep("Inst");
TQStringList installList = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ).grep("Inst");
for(uint i = 0; i < installList.count(); i++)
{
QString name = QStringList::split( " ", installList[i] )[1];
QString pkgVersion;
QString sysVersion;
if( installList[i].contains("[") )
TQString name = TQStringList::split( " ", installList[i] )[1];
TQString pkgVersion;
TQString sysVersion;
if( installList[i].tqcontains("[") )
{
pkgVersion = QStringList::split( " ", installList[i] )[3].mid(1);
sysVersion = QStringList::split( " ", installList[i] )[2].mid(1).replace("]", "");
pkgVersion = TQStringList::split( " ", installList[i] )[3].mid(1);
sysVersion = TQStringList::split( " ", installList[i] )[2].mid(1).tqreplace("]", "");
}
else
pkgVersion = QStringList::split( " ", installList[i] )[2].mid(1);
pkgVersion = TQStringList::split( " ", installList[i] )[2].mid(1);
QListViewItem * item = new QListViewItem( dependenciesListView, 0 );
item->setPixmap( 0, QPixmap( m_kdePrefix + "/share/kdpkg/icons/install.png") );
TQListViewItem * item = new TQListViewItem( dependenciesListView, 0 );
item->setPixmap( 0, TQPixmap( m_kdePrefix + "/share/kdpkg/icons/install.png") );
item->setText( 1, name );
item->setText( 2, pkgVersion );
item->setText( 3, sysVersion );
@ -328,27 +328,27 @@ void install::showDependencies()
// find rconflicts
QString pkgName = fields.grep("Package:")[0].mid(9);
QString pkgVersion = fields.grep("Version:")[0].mid(9);
TQString pkgName = fields.grep("Package:")[0].mid(9);
TQString pkgVersion = fields.grep("Version:")[0].mid(9);
QString rconflicts;
TQString rconflicts;
this->shell->setCommand("cat /var/lib/dpkg/status | grep "+pkgName+" -B 16| grep Conflicts -B 16");
this->shell->start(true);
QStringList input1 = QStringList::split( "\n\n", this->shell->getBuffer().stripWhiteSpace() );
TQStringList input1 = TQStringList::split( "\n\n", this->shell->getBuffer().stripWhiteSpace() );
for(uint i = 0; i < input1.count(); i++)
{
if( input1[i].contains(pkgName) )
if( input1[i].tqcontains(pkgName) )
{
QStringList input2 = QStringList::split( "\n", input1[i] );
QString name = QStringList::split( " ", input2.grep("Package:")[0] )[1];
QString cVersion = input2.grep("Conflicts:")[0].mid(11); // conflictVersion
cVersion = QStringList::split( ",", cVersion ).grep(pkgName)[0];
cVersion = QStringList::split( "(", cVersion )[1];
cVersion = cVersion.replace(")", "");
QString op = QStringList::split( " ", cVersion )[0];
cVersion = QStringList::split( " ", cVersion )[1];
TQStringList input2 = TQStringList::split( "\n", input1[i] );
TQString name = TQStringList::split( " ", input2.grep("Package:")[0] )[1];
TQString cVersion = input2.grep("Conflicts:")[0].mid(11); // conflictVersion
cVersion = TQStringList::split( ",", cVersion ).grep(pkgName)[0];
cVersion = TQStringList::split( "(", cVersion )[1];
cVersion = cVersion.tqreplace(")", "");
TQString op = TQStringList::split( " ", cVersion )[0];
cVersion = TQStringList::split( " ", cVersion )[1];
if( cVersion == "")
{
@ -369,27 +369,27 @@ void install::showDependencies()
// show packages which will be removed
QString conflicts = fields.grep( "Conflicts" )[0].mid(11);
conflicts = conflicts.replace( ",", "" );
TQString conflicts = fields.grep( "Conflicts" )[0].mid(11);
conflicts = conflicts.tqreplace( ",", "" );
conflicts = conflicts+" "+rconflicts;
while (conflicts.find("(") != -1) {
start_index = conflicts.find("(");
stop_index = conflicts.find(")", start_index);
conflicts.replace(start_index, stop_index-start_index+1, "");
while (conflicts.tqfind("(") != -1) {
start_index = conflicts.tqfind("(");
stop_index = conflicts.tqfind(")", start_index);
conflicts.tqreplace(start_index, stop_index-start_index+1, "");
}
this->shell->setCommand("apt-get -s remove "+conflicts);
this->shell->start(true);
QStringList removeList = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ).grep("Remv");
TQStringList removeList = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ).grep("Remv");
for(uint i = 0; i < removeList.count(); i++)
{
QString name = QStringList::split( " ", removeList[i] )[1];
QString sysVersion = QStringList::split( " [", removeList[i] )[1].replace("]", "");
TQString name = TQStringList::split( " ", removeList[i] )[1];
TQString sysVersion = TQStringList::split( " [", removeList[i] )[1].tqreplace("]", "");
QListViewItem * item = new QListViewItem( dependenciesListView, 0 );
item->setPixmap( 0, QPixmap( m_kdePrefix + "/share/kdpkg/icons/remove.png") );
TQListViewItem * item = new TQListViewItem( dependenciesListView, 0 );
item->setPixmap( 0, TQPixmap( m_kdePrefix + "/share/kdpkg/icons/remove.png") );
item->setText( 1, name );
item->setText( 3, sysVersion );
@ -401,24 +401,24 @@ void install::showDependencies()
//--- isInstalled ------------------------------------------------------------//
//----------------------------------------------------------------------------//
bool install::isInstalled(QString input)
bool install::isInstalled(TQString input)
{
QString package = QStringList::split( " ", input )[0];
QString version = QStringList::split( " (", input )[1].replace(")", "");
TQString package = TQStringList::split( " ", input )[0];
TQString version = TQStringList::split( " (", input )[1].tqreplace(")", "");
this->shell->setCommand("apt-cache policy "+package);
this->shell->start(true);
QString sysVersion = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() )[1];
sysVersion = QStringList::split( ":", sysVersion)[1].replace(" ","");
TQString sysVersion = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() )[1];
sysVersion = TQStringList::split( ":", sysVersion)[1].tqreplace(" ","");
if( sysVersion.contains("(") || sysVersion == "" )
if( sysVersion.tqcontains("(") || sysVersion == "" )
return FALSE;
else if( version != "" )
{
QString op = QStringList::split( " ", version )[0];
QString pkgVersion = QStringList::split( " ", version )[1];
TQString op = TQStringList::split( " ", version )[0];
TQString pkgVersion = TQStringList::split( " ", version )[1];
this->shell->setCommand("if dpkg --compare-versions "+sysVersion+" \""+op+"\" "+pkgVersion+"; then echo \"TRUE\"; fi");
this->shell->start(true);
@ -447,7 +447,7 @@ void install::showAbout()
bool install::checkArchitecture()
{
QString arch = fields.grep("Architecture:")[0].mid(14);
TQString arch = fields.grep("Architecture:")[0].mid(14);
if(arch == "all")
return TRUE;
@ -468,7 +468,7 @@ bool install::isLocked()
{
this->shell->setCommand("apt-get install -s" );
this->shell->start(true);
if( this->shell->getBuffer().stripWhiteSpace().contains("...") )
if( this->shell->getBuffer().stripWhiteSpace().tqcontains("...") )
return FALSE;
else
return TRUE;

@ -25,23 +25,24 @@
#include <kde_terminal_interface.h>
#include <kparts/part.h>
#include <process.h>
#include <qprocess.h>
#include <tqprocess.h>
class install : public InstallDialog
{
Q_OBJECT
TQ_OBJECT
public:
install(const QString &url = QString(), QWidget *parent = 0L, const char *name = 0L, const QStringList &foo = QStringList());
QString installPkg;
QString removePkg;
QString path;
QStringList fields;
QString m_kdePrefix;
bool isInstalled(QString);
install(const TQString &url = TQString(), TQWidget *tqparent = 0L, const char *name = 0L, const TQStringList &foo = TQStringList());
TQString installPkg;
TQString removePkg;
TQString path;
TQStringList fields;
TQString m_kdePrefix;
bool isInstalled(TQString);
bool checkArchitecture();
bool isLocked();
QStringList getVersions(QString);
TQStringList getVersions(TQString);

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>InstallDialog</class>
<author>Fabian Wuertz</author>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>InstallDialog</cstring>
</property>
@ -23,7 +23,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QPushButton" row="4" column="0">
<widget class="TQPushButton" row="4" column="0">
<property name="name">
<cstring>aboutPushButton</cstring>
</property>
@ -37,7 +37,7 @@
<iconset>image1</iconset>
</property>
</widget>
<widget class="QPushButton" row="4" column="5">
<widget class="TQPushButton" row="4" column="5">
<property name="name">
<cstring>closePushButton</cstring>
</property>
@ -51,7 +51,7 @@
<iconset>image2</iconset>
</property>
</widget>
<widget class="QPushButton" row="4" column="4">
<widget class="TQPushButton" row="4" column="4">
<property name="name">
<cstring>installPushButton</cstring>
</property>
@ -76,7 +76,7 @@
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QFrame" row="0" column="0" rowspan="1" colspan="6">
<widget class="TQFrame" row="0" column="0" rowspan="1" colspan="6">
<property name="name">
<cstring>frame</cstring>
</property>
@ -90,7 +90,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="2">
<widget class="TQLabel" row="0" column="2">
<property name="name">
<cstring>titleTextLabel</cstring>
</property>
@ -106,7 +106,7 @@
<string>&lt;b&gt;Package installation&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>logoPixmapLabel</cstring>
</property>
@ -135,7 +135,7 @@
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>5</width>
<height>20</height>
@ -154,14 +154,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>160</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QWidgetStack" row="2" column="0" rowspan="1" colspan="6">
<widget class="TQWidgetStack" row="2" column="0" rowspan="1" colspan="6">
<property name="name">
<cstring>widgetStack</cstring>
</property>
@ -173,14 +173,14 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>WStackPage</cstring>
</property>
<attribute name="id">
<number>0</number>
</attribute>
<widget class="QButtonGroup">
<widget class="TQButtonGroup">
<property name="name">
<cstring>syncGroup</cstring>
</property>
@ -205,7 +205,7 @@
<property name="margin">
<number>6</number>
</property>
<widget class="QRadioButton" row="0" column="0">
<widget class="TQRadioButton" row="0" column="0">
<property name="name">
<cstring>syncRadioButton</cstring>
</property>
@ -219,7 +219,7 @@
<bool>true</bool>
</property>
</widget>
<widget class="QRadioButton" row="1" column="0">
<widget class="TQRadioButton" row="1" column="0">
<property name="name">
<cstring>skipRadioButton</cstring>
</property>
@ -233,7 +233,7 @@
</grid>
</widget>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>WStackPage</cstring>
</property>
@ -244,10 +244,10 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QListView" row="0" column="0">
<widget class="TQListView" row="0" column="0">
<column>
<property name="text">
<string>Status</string>
<string>tqStatus</string>
</property>
<property name="clickable">
<bool>true</bool>
@ -301,14 +301,14 @@
</widget>
</grid>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>WStackPage</cstring>
</property>
<attribute name="id">
<number>2</number>
</attribute>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>errorPixmapLabel</cstring>
</property>
@ -327,7 +327,7 @@
<bool>true</bool>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>errorTextLabel</cstring>
</property>
@ -342,19 +342,19 @@
<property name="text">
<string></string>
</property>
<property name="alignment">
<property name="tqalignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>WStackPage</cstring>
</property>
<attribute name="id">
<number>3</number>
</attribute>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>successPixmapLabel</cstring>
</property>
@ -373,7 +373,7 @@
<bool>true</bool>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>successTextLabel</cstring>
</property>
@ -388,7 +388,7 @@
<property name="text">
<string></string>
</property>
<property name="alignment">
<property name="tqalignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
@ -408,7 +408,7 @@
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QPushButton" row="4" column="2">
<widget class="TQPushButton" row="4" column="2">
<property name="name">
<cstring>nextPushButton1</cstring>
</property>
@ -419,7 +419,7 @@
<string>Alt+X</string>
</property>
</widget>
<widget class="QPushButton" row="4" column="3">
<widget class="TQPushButton" row="4" column="3">
<property name="name">
<cstring>nextPushButton2</cstring>
</property>
@ -487,12 +487,12 @@
<includes>
<include location="local" impldecl="in implementation">kdialog.h</include>
</includes>
<slots>
<Q_SLOTS>
<slot>showDependencies(const QString&amp;)</slot>
<slot>showAbout()</slot>
<slot>page4()</slot>
<slot>next1()</slot>
<slot>next2()</slot>
</slots>
<layoutdefaults spacing="6" margin="6"/>
</Q_SLOTS>
<tqlayoutdefaults spacing="6" margin="6"/>
</UI>

@ -40,7 +40,7 @@ int main(int argc, char **argv)
// specify data for About dialog
KAboutData* about = new KAboutData("kdpkg-install", I18N_NOOP("kdpkg-install"), "");
about->setProgramLogo( QImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") );
about->setProgramLogo( TQImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") );
about->setShortDescription( I18N_NOOP("Frontend for dpkg.") );
about->setLicense(KAboutData::License_GPL_V2);
about->setHomepage("http://trinity.pearsoncomputing.net");
@ -63,10 +63,10 @@ int main(int argc, char **argv)
// no session.. just start up normally
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QString url;
TQString url;
for(int i = 0; i < args->count(); i++) // Counting start at 0!
url = QString::fromLocal8Bit(args->arg(i));
url = TQString::fromLocal8Bit(args->arg(i));
//printf(url);

@ -5,11 +5,11 @@
Process::Process()
{
_buffer = QString::null;
_buffer = TQString();
_process = new KProcess();
connect(_process, SIGNAL(receivedStdout(KProcess*, char*, int)),
this, SLOT(slotProcessOutput(KProcess*, char*, int)));
connect(_process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
this, TQT_SLOT(slotProcessOutput(KProcess*, char*, int)));
}
@ -17,11 +17,11 @@
{
}
void Process::setCommand(QString command)
void Process::setCommand(TQString command)
{
// make clean
_process->clearArguments();
_buffer = QString::null;
_buffer = TQString();
*_process << "/bin/bash";
*_process << "-c";
@ -37,7 +37,7 @@
_process->start(KProcess::DontCare, KProcess::Stdout);
}
QString Process::getBuffer()
TQString Process::getBuffer()
{
return _buffer;
}
@ -56,7 +56,7 @@
{
if (process != _process) return;
_buffer.append(QString::fromLocal8Bit(buffer, len));
_buffer.append(TQString::fromLocal8Bit(buffer, len));
}

@ -11,22 +11,23 @@ class Process;
class Process : public QObject {
class Process : public TQObject {
Q_OBJECT
TQ_OBJECT
public:
Process();
~Process();
QString getBuffer();
TQString getBuffer();
int exitStatus();
bool normalExit();
void setCommand(QString command);
void setCommand(TQString command);
void start(bool block=true);
protected:
KProcess* _process;
QString _buffer;
TQString _buffer;
protected slots:
void slotProcessOutput(KProcess* process, char* buffer, int buflen);

@ -24,28 +24,28 @@
#include <kaboutapplication.h>
#include <kurlrequester.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <qlistbox.h>
#include <qtextbrowser.h>
#include <qwidgetstack.h>
#include <qprocess.h>
#include <qregexp.h>
#include <qfiledialog.h>
#include <tqlabel.h>
#include <tqlineedit.h>
#include <tqlistview.h>
#include <tqlistbox.h>
#include <tqtextbrowser.h>
#include <tqwidgetstack.h>
#include <tqprocess.h>
#include <tqregexp.h>
#include <tqfiledialog.h>
#include "kdpkg.h"
kdpkg::kdpkg( const QString &url, QWidget *parent, const char *name, const QStringList &)
:KdpkgDialog(parent, name)
kdpkg::kdpkg( const TQString &url, TQWidget *tqparent, const char *name, const TQStringList &)
:KdpkgDialog(tqparent, name)
{
if( !url )
path = KFileDialog::getOpenFileName( QString::null, QString("*.deb|") + i18n("Debian Package (*.deb)"), this, i18n("Choose a Debian package file to open"));
path = KFileDialog::getOpenFileName( TQString(), TQString("*.deb|") + i18n("Debian Package (*.deb)"), this, i18n("Choose a Debian package file to open"));
else
path = url;
@ -55,17 +55,17 @@ kdpkg::kdpkg( const QString &url, QWidget *parent, const char *name, const QStri
// show fields
this->shell->setCommand("dpkg -f "+path);
this->shell->start(true);
fields = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
fields = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
showFields();
// show files
this->shell->setCommand("dpkg -c "+url);
this->shell->start(true);
QStringList files = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
QString tmp;
TQStringList files = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
TQString tmp;
for(uint i = 0; i < files.count(); i++)
tmp += QStringList::split( ".", files[i])[1]+"<br>";
tmp += TQStringList::split( ".", files[i])[1]+"<br>";
filesTextBrowser->setText( tmp ) ;
@ -87,11 +87,11 @@ void kdpkg::showFields()
// common
//--------
QString pkgName = fields.grep("Package:")[0].mid(9);
QString pkgVersion = fields.grep("Version:")[0].mid(9);
QStringList versions = getVersions(fields.grep("Package:")[0].mid(9));
QString sysVersion = versions[0];
QString repVersion = versions[1];
TQString pkgName = fields.grep("Package:")[0].mid(9);
TQString pkgVersion = fields.grep("Version:")[0].mid(9);
TQStringList versions = getVersions(fields.grep("Package:")[0].mid(9));
TQString sysVersion = versions[0];
TQString repVersion = versions[1];
package2TextLabel->setText( pkgName );
version2TextLabel->setText( pkgVersion+" (Package)<br>"+sysVersion+" (System)<br>"+repVersion+" (Repository)");
@ -102,8 +102,8 @@ void kdpkg::showFields()
// description
//-------------
QStringList tmp = fields.grep( QRegExp("^ ") );
QString description = "<b>"+fields.grep("Description:")[0].mid(13)+"</b><br><br>";
TQStringList tmp = fields.grep( TQRegExp("^ ") );
TQString description = "<b>"+fields.grep("Description:")[0].mid(13)+"</b><br><br>";
for(uint i = 0; i < tmp.count(); i++)
{
if( tmp[i] == " ." )
@ -125,7 +125,7 @@ void kdpkg::showFields()
types.append("Conflicts");
types.append("Replaces");
for( QStringList::Iterator it = types.begin(); it != types.end(); ++it )
for( TQStringList::Iterator it = types.begin(); it != types.end(); ++it )
dependencies.append(fields.grep(*it+":")[0]);
showDependencies(0);
}
@ -145,19 +145,19 @@ void kdpkg::showDependencies(int i)
if(i == 0) // all
{
for( QStringList::Iterator it = dependencies.begin(); it != dependencies.end(); ++it )
for( TQStringList::Iterator it = dependencies.begin(); it != dependencies.end(); ++it )
{
QStringList tmp = QStringList::split( ", ", *it );
QString type = QStringList::split( ":", tmp[0])[0];
tmp[0] = QStringList::split( ": ", tmp[0] )[1];
TQStringList tmp = TQStringList::split( ", ", *it );
TQString type = TQStringList::split( ":", tmp[0])[0];
tmp[0] = TQStringList::split( ": ", tmp[0] )[1];
for(uint i = 0; i < tmp.count(); i++)
dependenciesListBox->insertItem( type+": "+tmp[i] );
}
}
else
{
QString choice = types[i-1];
dependenciesListBox->insertStringList( QStringList::split( ", ", dependencies.grep(choice+":")[0].mid(choice.length()+2) ) );
TQString choice = types[i-1];
dependenciesListBox->insertStringList( TQStringList::split( ", ", dependencies.grep(choice+":")[0].mid(choice.length()+2) ) );
}
}
@ -166,27 +166,27 @@ void kdpkg::showDependencies(int i)
//--- get --------------------------------------------------------------------//
//----------------------------------------------------------------------------//
QStringList kdpkg::getVersions(QString package)
TQStringList kdpkg::getVersions(TQString package)
{
this->shell->setCommand("apt-cache policy "+package);
this->shell->start(true);
QStringList input = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
TQStringList input = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
QString sysVersion = input[1];
sysVersion = QStringList::split( ":", sysVersion)[1].replace(" ","");
TQString sysVersion = input[1];
sysVersion = TQStringList::split( ":", sysVersion)[1].tqreplace(" ","");
if( sysVersion.contains("(") || sysVersion == "" )
if( sysVersion.tqcontains("(") || sysVersion == "" )
sysVersion = i18n("not installed");
QString repVersion = input[2];
repVersion = QStringList::split( ":", repVersion)[1].replace(" ","");
TQString repVersion = input[2];
repVersion = TQStringList::split( ":", repVersion)[1].tqreplace(" ","");
if( repVersion.contains("(") || repVersion == "" )
if( repVersion.tqcontains("(") || repVersion == "" )
repVersion = i18n("not available");
QStringList versions;
TQStringList versions;
versions.append(sysVersion);
versions.append(repVersion);
@ -199,7 +199,7 @@ QStringList kdpkg::getVersions(QString package)
//----------------------------------------------------------------------------//
void kdpkg::checkArchitecture(QString arch)
void kdpkg::checkArchitecture(TQString arch)
{
if(arch == "all")
return;

@ -25,23 +25,24 @@
#include <kde_terminal_interface.h>
#include <kparts/part.h>
#include <process.h>
#include <qprocess.h>
#include <tqprocess.h>
class kdpkg : public KdpkgDialog
{
Q_OBJECT
TQ_OBJECT
public:
kdpkg(const QString &url = QString(), QWidget *parent = 0L, const char *name = 0L, const QStringList &foo = QStringList());
kdpkg(const TQString &url = TQString(), TQWidget *tqparent = 0L, const char *name = 0L, const TQStringList &foo = TQStringList());
void checkArchitecture(QString);
void checkArchitecture(TQString);
QStringList getVersions(QString);
TQStringList getVersions(TQString);
QStringList fields;
QStringList types;
QStringList dependencies;
QString path;
TQStringList fields;
TQStringList types;
TQStringList dependencies;
TQString path;
private:
Process* shell;

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KdpkgDialog</class>
<author>Fabian Wuertz</author>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>KdpkgDialog</cstring>
</property>
@ -23,18 +23,18 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QTabWidget" row="2" column="0" rowspan="1" colspan="4">
<widget class="TQTabWidget" row="2" column="0" rowspan="1" colspan="4">
<property name="name">
<cstring>tabWidget</cstring>
</property>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
<attribute name="title">
<string>Co&amp;mmon</string>
</attribute>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>package2TextLabel</cstring>
</property>
@ -50,7 +50,7 @@
<string></string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>version1TextLabel</cstring>
</property>
@ -66,7 +66,7 @@
<string>&lt;b&gt;Version:&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>version2TextLabel</cstring>
</property>
@ -82,7 +82,7 @@
<string></string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>maintainer1TextLabel</cstring>
</property>
@ -98,7 +98,7 @@
<string>&lt;b&gt;Maintainer:&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>maintainer2TextLabel</cstring>
</property>
@ -114,7 +114,7 @@
<string></string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>section1TextLabel</cstring>
</property>
@ -130,7 +130,7 @@
<string>&lt;b&gt;Section:&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>section2TextLabel</cstring>
</property>
@ -146,7 +146,7 @@
<string></string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>size1TextLabel</cstring>
</property>
@ -162,7 +162,7 @@
<string>&lt;b&gt;Size:&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>size2TextLabel</cstring>
</property>
@ -178,7 +178,7 @@
<string></string>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>package1TextLabel</cstring>
</property>
@ -195,7 +195,7 @@
</property>
</widget>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>TabPage</cstring>
</property>
@ -206,14 +206,14 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QTextBrowser" row="0" column="0">
<widget class="TQTextBrowser" row="0" column="0">
<property name="name">
<cstring>descriptionTextBrowser</cstring>
</property>
</widget>
</grid>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>TabPage</cstring>
</property>
@ -224,12 +224,12 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QListBox" row="1" column="0">
<widget class="TQListBox" row="1" column="0">
<property name="name">
<cstring>dependenciesListBox</cstring>
</property>
</widget>
<widget class="QComboBox" row="0" column="0">
<widget class="TQComboBox" row="0" column="0">
<item>
<property name="text">
<string>All</string>
@ -281,7 +281,7 @@
</widget>
</grid>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>TabPage</cstring>
</property>
@ -292,7 +292,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QTextBrowser" row="0" column="0">
<widget class="TQTextBrowser" row="0" column="0">
<property name="name">
<cstring>filesTextBrowser</cstring>
</property>
@ -300,7 +300,7 @@
</grid>
</widget>
</widget>
<widget class="QPushButton" row="3" column="0">
<widget class="TQPushButton" row="3" column="0">
<property name="name">
<cstring>aboutPushButton</cstring>
</property>
@ -324,14 +324,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>270</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton" row="3" column="2">
<widget class="TQPushButton" row="3" column="2">
<property name="name">
<cstring>installPushButton</cstring>
</property>
@ -345,7 +345,7 @@
<iconset>image2</iconset>
</property>
</widget>
<widget class="QPushButton" row="3" column="3">
<widget class="TQPushButton" row="3" column="3">
<property name="name">
<cstring>closePushButton</cstring>
</property>
@ -373,7 +373,7 @@
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QFrame" row="0" column="0" rowspan="1" colspan="4">
<widget class="TQFrame" row="0" column="0" rowspan="1" colspan="4">
<property name="name">
<cstring>frame</cstring>
</property>
@ -387,7 +387,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="2">
<widget class="TQLabel" row="0" column="2">
<property name="name">
<cstring>titleTextLabel</cstring>
</property>
@ -403,7 +403,7 @@
<string>&lt;b&gt;Package Information&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>pixmapLabel1</cstring>
</property>
@ -432,7 +432,7 @@
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>5</width>
<height>20</height>
@ -489,10 +489,10 @@
<includes>
<include location="local" impldecl="in implementation">kdialog.h</include>
</includes>
<slots>
<Q_SLOTS>
<slot>showDependencies(int)</slot>
<slot>about()</slot>
<slot>install()</slot>
</slots>
<layoutdefaults spacing="6" margin="6"/>
</Q_SLOTS>
<tqlayoutdefaults spacing="6" margin="6"/>
</UI>

@ -40,7 +40,7 @@ int main(int argc, char **argv)
// specify data for About dialog
KAboutData* about = new KAboutData("kdpkg", I18N_NOOP("kdpkg"), "");
about->setProgramLogo( QImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") );
about->setProgramLogo( TQImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") );
about->setShortDescription( I18N_NOOP("Frontend for dpkg.") );
about->setLicense(KAboutData::License_GPL_V2);
about->setHomepage("http://trinity.pearsoncomputing.net");
@ -66,10 +66,10 @@ int main(int argc, char **argv)
// no session.. just start up normally
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QString url;
TQString url;
for(int i = 0; i < args->count(); i++) // Counting start at 0!
url = QString::fromLocal8Bit(args->arg(i));
url = TQString::fromLocal8Bit(args->arg(i));
//printf(url);

@ -5,11 +5,11 @@
Process::Process()
{
_buffer = QString::null;
_buffer = TQString();
_process = new KProcess();
connect(_process, SIGNAL(receivedStdout(KProcess*, char*, int)),
this, SLOT(slotProcessOutput(KProcess*, char*, int)));
connect(_process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
this, TQT_SLOT(slotProcessOutput(KProcess*, char*, int)));
}
@ -17,11 +17,11 @@
{
}
void Process::setCommand(QString command)
void Process::setCommand(TQString command)
{
// make clean
_process->clearArguments();
_buffer = QString::null;
_buffer = TQString();
*_process << "/bin/sh";
*_process << "-c";
@ -37,7 +37,7 @@
_process->start(KProcess::DontCare, KProcess::Stdout);
}
QString Process::getBuffer()
TQString Process::getBuffer()
{
return _buffer;
}
@ -56,7 +56,7 @@
{
if (process != _process) return;
_buffer.append(QString::fromLocal8Bit(buffer, len));
_buffer.append(TQString::fromLocal8Bit(buffer, len));
}

@ -11,22 +11,23 @@ class Process;
class Process : public QObject {
class Process : public TQObject {
Q_OBJECT
TQ_OBJECT
public:
Process();
~Process();
QString getBuffer();
TQString getBuffer();
int exitStatus();
bool normalExit();
void setCommand(QString command);
void setCommand(TQString command);
void start(bool block=true);
protected:
KProcess* _process;
QString _buffer;
TQString _buffer;
protected slots:
void slotProcessOutput(KProcess* process, char* buffer, int buflen);

Loading…
Cancel
Save