TQt4 port k3b

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1233803 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 12 years ago
parent 2a39a08057
commit d8cc8bdfa7

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>base_K3bSetup2</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>Form1</cstring>
</property>
<property name="geometry">
<property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@ -19,15 +19,15 @@
<property name="margin">
<number>0</number>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
<cstring>tqlayout6</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
@ -38,15 +38,15 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout1</cstring>
<cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>m_checkUseBurningGroup</cstring>
</property>
@ -58,7 +58,7 @@
&lt;p&gt;Otherwise all users on the system have access to the devices and to all K3b functionality.</string>
</property>
</widget>
<widget class="QLineEdit">
<widget class="TQLineEdit">
<property name="name">
<cstring>m_editBurningGroup</cstring>
</property>
@ -71,9 +71,9 @@
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout2</cstring>
<cstring>tqlayout2</cstring>
</property>
<hbox>
<property name="name">
@ -89,14 +89,14 @@
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@ -104,7 +104,7 @@
<string>Users allowed to burn (separated by space):</string>
</property>
</widget>
<widget class="QLineEdit">
<widget class="TQLineEdit">
<property name="name">
<cstring>m_editUsers</cstring>
</property>
@ -116,7 +116,7 @@
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox1</cstring>
</property>
@ -127,7 +127,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
@ -184,9 +184,9 @@
<cstring>m_viewDevices</cstring>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout3</cstring>
<cstring>tqlayout3</cstring>
</property>
<hbox>
<property name="name">
@ -202,14 +202,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>m_buttonAddDevice</cstring>
</property>
@ -221,7 +221,7 @@
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox2</cstring>
</property>
@ -232,11 +232,11 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QTabWidget">
<widget class="TQTabWidget">
<property name="name">
<cstring>tabWidget2</cstring>
</property>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
@ -247,7 +247,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -317,7 +317,7 @@
</widget>
</vbox>
</widget>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
@ -339,7 +339,7 @@
<bool>false</bool>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1_3</cstring>
</property>
@ -370,7 +370,7 @@
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klistview.h</includehint>
<includehint>klistview.h</includehint>

@ -15,16 +15,16 @@
#include <config.h>
#include <qlayout.h>
#include <qmap.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qscrollview.h>
#include <qtimer.h>
#include <tqlayout.h>
#include <tqmap.h>
#include <tqfile.h>
#include <tqfileinfo.h>
#include <tqcheckbox.h>
#include <tqlineedit.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include <tqscrollview.h>
#include <tqtimer.h>
#include <klocale.h>
#include <kglobal.h>
@ -95,19 +95,19 @@ public:
bool changesNeeded;
QMap<QCheckListItem*, QString> listDeviceMap;
QMap<QString, QCheckListItem*> deviceListMap;
TQMap<TQCheckListItem*, TQString> listDeviceMap;
TQMap<TQString, TQCheckListItem*> deviceListMap;
QMap<QCheckListItem*, K3bExternalBin*> listBinMap;
QMap<K3bExternalBin*, QCheckListItem*> binListMap;
TQMap<TQCheckListItem*, K3bExternalBin*> listBinMap;
TQMap<K3bExternalBin*, TQCheckListItem*> binListMap;
KConfig* config;
};
K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& )
: KCModule( parent, "k3bsetup" )
K3bSetup2::K3bSetup2( TQWidget *tqparent, const char *, const TQStringList& )
: KCModule( tqparent, "k3bsetup" )
{
d = new Private();
d->config = new KConfig( "k3bsetup2rc" );
@ -120,7 +120,7 @@ K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& )
setButtons( KCModule::Apply|KCModule::Cancel|KCModule::Ok|KCModule::Default );
QHBoxLayout* box = new QHBoxLayout( this );
TQHBoxLayout* box = new TQHBoxLayout( this );
box->setAutoAdd(true);
box->setMargin(0);
box->setSpacing( KDialog::spacingHint() );
@ -144,14 +144,14 @@ K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& )
w->textLabel2->hide();
connect( w->m_checkUseBurningGroup, SIGNAL(toggled(bool)),
this, SLOT(updateViews()) );
connect( w->m_editBurningGroup, SIGNAL(textChanged(const QString&)),
this, SLOT(updateViews()) );
connect( w->m_editSearchPath, SIGNAL(changed()),
this, SLOT(slotSearchPrograms()) );
connect( w->m_buttonAddDevice, SIGNAL(clicked()),
this, SLOT(slotAddDevice()) );
connect( w->m_checkUseBurningGroup, TQT_SIGNAL(toggled(bool)),
this, TQT_SLOT(updateViews()) );
connect( w->m_editBurningGroup, TQT_SIGNAL(textChanged(const TQString&)),
this, TQT_SLOT(updateViews()) );
connect( w->m_editSearchPath, TQT_SIGNAL(changed()),
this, TQT_SLOT(slotSearchPrograms()) );
connect( w->m_buttonAddDevice, TQT_SIGNAL(clicked()),
this, TQT_SLOT(slotAddDevice()) );
d->externalBinManager = new K3bExternalBinManager( this );
@ -171,7 +171,7 @@ K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& )
// This is a hack to work around a kcm bug which makes the faulty assumption that
// every module starts without anything to apply
//
QTimer::singleShot( 0, this, SLOT(updateViews()) );
TQTimer::singleShot( 0, this, TQT_SLOT(updateViews()) );
if( getuid() != 0 || !d->config->checkConfigFilesWritable( true ) )
makeReadOnly();
@ -200,33 +200,33 @@ void K3bSetup2::updateViews()
void K3bSetup2::updatePrograms()
{
// first save which were checked
QMap<K3bExternalBin*, bool> checkMap;
QListViewItemIterator listIt( w->m_viewPrograms );
TQMap<K3bExternalBin*, bool> checkMap;
TQListViewItemIterator listIt( w->m_viewPrograms );
for( ; listIt.current(); ++listIt )
checkMap.insert( d->listBinMap[(QCheckListItem*)*listIt], ((QCheckListItem*)*listIt)->isOn() );
checkMap.insert( d->listBinMap[(TQCheckListItem*)*listIt], ((TQCheckListItem*)*listIt)->isOn() );
w->m_viewPrograms->clear();
d->binListMap.clear();
d->listBinMap.clear();
// load programs
const QMap<QString, K3bExternalProgram*>& map = d->externalBinManager->programs();
for( QMap<QString, K3bExternalProgram*>::const_iterator it = map.begin(); it != map.end(); ++it ) {
const TQMap<TQString, K3bExternalProgram*>& map = d->externalBinManager->programs();
for( TQMap<TQString, K3bExternalProgram*>::const_iterator it = map.begin(); it != map.end(); ++it ) {
K3bExternalProgram* p = it.data();
QPtrListIterator<K3bExternalBin> binIt( p->bins() );
TQPtrListIterator<K3bExternalBin> binIt( p->bins() );
for( ; binIt.current(); ++binIt ) {
K3bExternalBin* b = *binIt;
QFileInfo fi( b->path );
// we need the uid bit which is not supported by QFileInfo
TQFileInfo fi( b->path );
// we need the uid bit which is not supported by TQFileInfo
struct stat s;
if( ::stat( QFile::encodeName(b->path), &s ) ) {
if( ::stat( TQFile::encodeName(b->path), &s ) ) {
kdDebug() << "(K3bSetup2) unable to stat " << b->path << endl;
}
else {
// create a checkviewitem
QCheckListItem* bi = new QCheckListItem( w->m_viewPrograms, b->name(), QCheckListItem::CheckBox );
TQCheckListItem* bi = new TQCheckListItem( w->m_viewPrograms, b->name(), TQCheckListItem::CheckBox );
bi->setText( 1, b->version );
bi->setText( 2, b->path );
@ -234,11 +234,11 @@ void K3bSetup2::updatePrograms()
d->binListMap.insert( b, bi );
// check the item on first insertion or if it was checked before
bi->setOn( checkMap.contains(b) ? checkMap[b] : true );
bi->setOn( checkMap.tqcontains(b) ? checkMap[b] : true );
int perm = s.st_mode & 0007777;
QString wantedGroup("root");
TQString wantedGroup("root");
if( w->m_checkUseBurningGroup->isChecked() )
wantedGroup = burningGroup();
@ -256,11 +256,11 @@ void K3bSetup2::updatePrograms()
wantedPerm = 0000755;
}
bi->setText( 3, QString::number( perm, 8 ).rightJustify( 4, '0' ) + " " + fi.owner() + "." + fi.group() );
bi->setText( 3, TQString::number( perm, 8 ).rightJustify( 4, '0' ) + " " + fi.owner() + "." + fi.group() );
if( perm != wantedPerm ||
fi.owner() != "root" ||
fi.group() != wantedGroup ) {
bi->setText( 4, QString("%1 root.%2").arg(wantedPerm,0,8).arg(wantedGroup) );
bi->setText( 4, TQString("%1 root.%2").tqarg(wantedPerm,0,8).tqarg(wantedGroup) );
if( bi->isOn() )
d->changesNeeded = true;
}
@ -275,45 +275,45 @@ void K3bSetup2::updatePrograms()
void K3bSetup2::updateDevices()
{
// first save which were checked
QMap<QString, bool> checkMap;
QListViewItemIterator listIt( w->m_viewDevices );
TQMap<TQString, bool> checkMap;
TQListViewItemIterator listIt( w->m_viewDevices );
for( ; listIt.current(); ++listIt )
checkMap.insert( d->listDeviceMap[(QCheckListItem*)*listIt], ((QCheckListItem*)*listIt)->isOn() );
checkMap.insert( d->listDeviceMap[(TQCheckListItem*)*listIt], ((TQCheckListItem*)*listIt)->isOn() );
w->m_viewDevices->clear();
d->listDeviceMap.clear();
d->deviceListMap.clear();
QPtrListIterator<K3bDevice::Device> it( d->deviceManager->allDevices() );
TQPtrListIterator<K3bDevice::Device> it( d->deviceManager->allDevices() );
for( ; it.current(); ++it ) {
K3bDevice::Device* device = *it;
// check the item on first insertion or if it was checked before
QCheckListItem* item = createDeviceItem( device->blockDeviceName() );
item->setOn( checkMap.contains(device->blockDeviceName()) ? checkMap[device->blockDeviceName()] : true );
TQCheckListItem* item = createDeviceItem( device->blockDeviceName() );
item->setOn( checkMap.tqcontains(device->blockDeviceName()) ? checkMap[device->blockDeviceName()] : true );
item->setText( 0, device->vendor() + " " + device->description() );
if( !device->genericDevice().isEmpty() ) {
QCheckListItem* item = createDeviceItem( device->genericDevice() );
item->setOn( checkMap.contains(device->genericDevice()) ? checkMap[device->genericDevice()] : true );
TQCheckListItem* item = createDeviceItem( device->genericDevice() );
item->setOn( checkMap.tqcontains(device->genericDevice()) ? checkMap[device->genericDevice()] : true );
item->setText( 0, device->vendor() + " " + device->description() + " (" + i18n("Generic SCSI Device") + ")" );
}
}
}
QCheckListItem* K3bSetup2::createDeviceItem( const QString& deviceNode )
TQCheckListItem* K3bSetup2::createDeviceItem( const TQString& deviceNode )
{
QFileInfo fi( deviceNode );
TQFileInfo fi( deviceNode );
struct stat s;
if( ::stat( QFile::encodeName(deviceNode), &s ) ) {
if( ::stat( TQFile::encodeName(deviceNode), &s ) ) {
kdDebug() << "(K3bSetup2) unable to stat " << deviceNode << endl;
return 0;
}
else {
// create a checkviewitem
QCheckListItem* bi = new QCheckListItem( w->m_viewDevices,
TQCheckListItem* bi = new TQCheckListItem( w->m_viewDevices,
deviceNode,
QCheckListItem::CheckBox );
TQCheckListItem::CheckBox );
d->listDeviceMap.insert( bi, deviceNode );
d->deviceListMap.insert( deviceNode, bi );
@ -322,7 +322,7 @@ QCheckListItem* K3bSetup2::createDeviceItem( const QString& deviceNode )
int perm = s.st_mode & 0000777;
bi->setText( 2, QString::number( perm, 8 ).rightJustify( 3, '0' ) + " " + fi.owner() + "." + fi.group() );
bi->setText( 2, TQString::number( perm, 8 ).rightJustify( 3, '0' ) + " " + fi.owner() + "." + fi.group() );
if( w->m_checkUseBurningGroup->isChecked() ) {
// we ignore the device's owner here
if( perm != 0000660 ||
@ -383,7 +383,7 @@ void K3bSetup2::defaults()
// This is a hack to work around a kcm bug which makes the faulty assumption that
// every module defaults to a state where nothing is to be applied
//
QTimer::singleShot( 0, this, SLOT(updateViews()) );
TQTimer::singleShot( 0, this, TQT_SLOT(updateViews()) );
}
@ -405,30 +405,30 @@ void K3bSetup2::save()
// TODO: create the group if it's not there
g = getgrnam( burningGroup().local8Bit() );
if( !g ) {
KMessageBox::error( this, i18n("There is no group %1.").arg(burningGroup()) );
KMessageBox::error( this, i18n("There is no group %1.").tqarg(burningGroup()) );
return;
}
}
// save the device permissions
QListViewItemIterator listIt( w->m_viewDevices );
TQListViewItemIterator listIt( w->m_viewDevices );
for( ; listIt.current(); ++listIt ) {
QCheckListItem* checkItem = (QCheckListItem*)listIt.current();
TQCheckListItem* checkItem = (TQCheckListItem*)listIt.current();
if( checkItem->isOn() ) {
QString dev = d->listDeviceMap[checkItem];
TQString dev = d->listDeviceMap[checkItem];
if( w->m_checkUseBurningGroup->isChecked() ) {
if( ::chmod( QFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP ) )
if( ::chmod( TQFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP ) )
success = false;
if( ::chown( QFile::encodeName(dev), (gid_t)-1, g->gr_gid ) )
if( ::chown( TQFile::encodeName(dev), (gid_t)-1, g->gr_gid ) )
success = false;
}
else {
if( ::chmod( QFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH ) )
if( ::chmod( TQFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH ) )
success = false;
}
}
@ -436,17 +436,17 @@ void K3bSetup2::save()
// save the program permissions
listIt = QListViewItemIterator( w->m_viewPrograms );
listIt = TQListViewItemIterator( w->m_viewPrograms );
for( ; listIt.current(); ++listIt ) {
QCheckListItem* checkItem = (QCheckListItem*)listIt.current();
TQCheckListItem* checkItem = (TQCheckListItem*)listIt.current();
if( checkItem->isOn() ) {
K3bExternalBin* bin = d->listBinMap[checkItem];
if( w->m_checkUseBurningGroup->isChecked() ) {
if( ::chown( QFile::encodeName(bin->path), (gid_t)0, g->gr_gid ) )
if( ::chown( TQFile::encodeName(bin->path), (gid_t)0, g->gr_gid ) )
success = false;
int perm = 0;
@ -455,11 +455,11 @@ void K3bSetup2::save()
else
perm = S_IRWXU|S_IXGRP|S_IRGRP;
if( ::chmod( QFile::encodeName(bin->path), perm ) )
if( ::chmod( TQFile::encodeName(bin->path), perm ) )
success = false;
}
else {
if( ::chown( QFile::encodeName(bin->path), 0, 0 ) )
if( ::chown( TQFile::encodeName(bin->path), 0, 0 ) )
success = false;
int perm = 0;
@ -468,7 +468,7 @@ void K3bSetup2::save()
else
perm = S_IRWXU|S_IXGRP|S_IRGRP|S_IXOTH|S_IROTH;
if( ::chmod( QFile::encodeName(bin->path), perm ) )
if( ::chmod( TQFile::encodeName(bin->path), perm ) )
success = false;
}
}
@ -490,7 +490,7 @@ void K3bSetup2::save()
}
QString K3bSetup2::quickHelp() const
TQString K3bSetup2::quickHelp() const
{
return i18n("<h2>K3bSetup 2</h2>"
"<p>This simple setup assistant is able to set the permissions needed by K3b in order to "
@ -504,10 +504,10 @@ QString K3bSetup2::quickHelp() const
}
QString K3bSetup2::burningGroup() const
TQString K3bSetup2::burningGroup() const
{
QString g = w->m_editBurningGroup->text();
return g.isEmpty() ? QString("burning") : g;
TQString g = w->m_editBurningGroup->text();
return g.isEmpty() ? TQString("burning") : g;
}
@ -524,7 +524,7 @@ void K3bSetup2::slotSearchPrograms()
void K3bSetup2::slotAddDevice()
{
bool ok;
QString newDevicename = KInputDialog::getText( i18n("Location of New Drive"),
TQString newDevicename = KInputDialog::getText( i18n("Location of New Drive"),
i18n("Please enter the device name where K3b should search\n"
"for a new drive (example: /dev/mebecdrom):"),
"/dev/", &ok, this );
@ -536,7 +536,7 @@ void K3bSetup2::slotAddDevice()
emit changed( d->changesNeeded );
}
else
KMessageBox::error( this, i18n("Could not find an additional device at\n%1").arg(newDevicename),
KMessageBox::error( this, i18n("Could not find an additional device at\n%1").tqarg(newDevicename),
i18n("Error"), false );
}
}
@ -553,7 +553,7 @@ void K3bSetup2::makeReadOnly()
}
typedef KGenericFactory<K3bSetup2, QWidget> K3bSetup2Factory;
typedef KGenericFactory<K3bSetup2, TQWidget> K3bSetup2Factory;
K_EXPORT_COMPONENT_FACTORY( kcm_k3bsetup2, K3bSetup2Factory("k3bsetup") )

@ -22,18 +22,19 @@
class base_K3bSetup2;
class QCheckListItem;
class TQCheckListItem;
class K3bSetup2: public KCModule
{
Q_OBJECT
TQ_OBJECT
public:
K3bSetup2( QWidget* parent = 0, const char* name = 0, const QStringList& args = QStringList() );
K3bSetup2( TQWidget* tqparent = 0, const char* name = 0, const TQStringList& args = TQStringList() );
~K3bSetup2();
QString quickHelp() const;
TQString quickHelp() const;
const KAboutData* aboutData() { return m_aboutData; };
void load();
@ -50,9 +51,9 @@ class K3bSetup2: public KCModule
private:
void updatePrograms();
void updateDevices();
QString burningGroup() const;
TQString burningGroup() const;
void makeReadOnly();
QCheckListItem* createDeviceItem( const QString& deviceNode );
TQCheckListItem* createDeviceItem( const TQString& deviceNode );
class Private;
Private* d;

@ -14,7 +14,7 @@ noinst_HEADERS = kfile_k3bprojectfileplugin.h
kde_module_LTLIBRARIES = kfile_k3b.la
kfile_k3b_la_SOURCES = kfile_k3bprojectfileplugin.cpp
kfile_k3b_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
kfile_k3b_la_LDFLAGS = $(all_libraries) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) -module $(KDE_PLUGIN)
kfile_k3b_la_LIBADD = $(LIB_KIO) ../../libk3b/libk3b.la ../../src/projects/kostore/libkostore.la
# let automoc handle all of the meta source files (moc)

@ -24,24 +24,24 @@
#include <kgenericfactory.h>
#include <qtextstream.h>
#include <qdom.h>
#include <qfile.h>
#include <tqtextstream.h>
#include <tqdom.h>
#include <tqfile.h>
K_EXPORT_COMPONENT_FACTORY(kfile_k3b, KGenericFactory<K3bProjectFilePlugin>("kfile_k3b"))
K3bProjectFilePlugin::K3bProjectFilePlugin( QObject *parent, const char *name,
const QStringList &args)
: KFilePlugin(parent, name, args)
K3bProjectFilePlugin::K3bProjectFilePlugin( TQObject *tqparent, const char *name,
const TQStringList &args)
: KFilePlugin(tqparent, name, args)
{
KFileMimeTypeInfo* info = addMimeTypeInfo( "application/x-k3b" );
KFileMimeTypeInfo::GroupInfo* group = addGroupInfo( info, "General", i18n("General") );
addItemInfo( group, "documenttype", i18n("Document Type"), QVariant::String );
addItemInfo( group, "documenttype", i18n("Document Type"), TQVariant::String );
}
@ -54,12 +54,12 @@ bool K3bProjectFilePlugin::readInfo( KFileMetaInfo& info, uint /*what*/)
// open the file
bool success = false;
QDomDocument xmlDoc;
TQDomDocument xmlDoc;
// try opening a store
KoStore* store = KoStore::createStore( info.url().path(), KoStore::Read );
if( store && !store->bad() && store->open( "maindata.xml" ) ) {
QIODevice* dev = store->device();
TQIODevice* dev = store->device();
dev->open( IO_ReadOnly );
if( xmlDoc.setContent( dev ) )
success = true;
@ -93,7 +93,7 @@ bool K3bProjectFilePlugin::readInfo( KFileMetaInfo& info, uint /*what*/)
success = false;
}
QString stringType;
TQString stringType;
switch( type ) {
case K3bDoc::AUDIO:
stringType = i18n("Audio CD");

@ -21,14 +21,15 @@
*/
#include <kfilemetainfo.h>
class QStringList;
class TQStringList;
class K3bProjectFilePlugin: public KFilePlugin
{
Q_OBJECT
TQ_OBJECT
public:
K3bProjectFilePlugin( QObject *parent, const char *name, const QStringList& args );
K3bProjectFilePlugin( TQObject *tqparent, const char *name, const TQStringList& args );
virtual bool readInfo( KFileMetaInfo& info, uint what);
};

@ -15,10 +15,10 @@
#include <config.h>
#include <qcstring.h>
#include <qdatetime.h>
#include <qbitarray.h>
#include <qptrlist.h>
#include <tqcstring.h>
#include <tqdatetime.h>
#include <tqbitarray.h>
#include <tqptrlist.h>
#include <kdebug.h>
#include <kinstance.h>
@ -67,7 +67,7 @@ extern "C"
K3bDevice::DeviceManager* kio_videodvdProtocol::s_deviceManager = 0;
int kio_videodvdProtocol::s_instanceCnt = 0;
kio_videodvdProtocol::kio_videodvdProtocol(const QCString &pool_socket, const QCString &app_socket)
kio_videodvdProtocol::kio_videodvdProtocol(const TQCString &pool_socket, const TQCString &app_socket)
: SlaveBase("kio_videodvd", pool_socket, app_socket)
{
kdDebug() << "kio_videodvdProtocol::kio_videodvdProtocol()" << endl;
@ -150,16 +150,16 @@ KIO::UDSEntry kio_videodvdProtocol::createUDSEntry( const K3bIso9660Entry* e ) c
// FIXME: remember the iso instance for quicker something and search for the videodvd
// in the available devices.
K3bIso9660* kio_videodvdProtocol::openIso( const KURL& url, QString& plainIsoPath )
K3bIso9660* kio_videodvdProtocol::openIso( const KURL& url, TQString& plainIsoPath )
{
// get the volume id from the url
QString volumeId = url.path().section( '/', 1, 1 );
TQString volumeId = url.path().section( '/', 1, 1 );
kdDebug() << "(kio_videodvdProtocol) searching for Video dvd: " << volumeId << endl;
// now search the devices for this volume id
// FIXME: use the cache created in listVideoDVDs
for( QPtrListIterator<K3bDevice::Device> it( s_deviceManager->dvdReader() ); *it; ++it ) {
for( TQPtrListIterator<K3bDevice::Device> it( s_deviceManager->dvdReader() ); *it; ++it ) {
K3bDevice::Device* dev = *it;
K3bDevice::DiskInfo di = dev->diskInfo();
@ -187,7 +187,7 @@ void kio_videodvdProtocol::get(const KURL& url )
{
kdDebug() << "kio_videodvd::get(const KURL& url)" << endl ;
QString isoPath;
TQString isoPath;
if( K3bIso9660* iso = openIso( url, isoPath ) )
{
const K3bIso9660Entry* e = iso->firstIsoDirEntry()->entry( isoPath );
@ -195,7 +195,7 @@ void kio_videodvdProtocol::get(const KURL& url )
{
const K3bIso9660File* file = static_cast<const K3bIso9660File*>( e );
totalSize( file->size() );
QByteArray buffer( 10*2048 );
TQByteArray buffer( 10*2048 );
int read = 0;
int cnt = 0;
KIO::filesize_t totalRead = 0;
@ -214,7 +214,7 @@ void kio_videodvdProtocol::get(const KURL& url )
delete iso;
data(QByteArray()); // empty array means we're done sending the data
data(TQByteArray()); // empty array means we're done sending the data
if( read == 0 )
finished();
@ -233,7 +233,7 @@ void kio_videodvdProtocol::listDir( const KURL& url )
listVideoDVDs();
}
else {
QString isoPath;
TQString isoPath;
K3bIso9660* iso = openIso( url, isoPath );
if( iso ) {
const K3bIso9660Directory* mainDir = iso->firstIsoDirEntry();
@ -241,11 +241,11 @@ void kio_videodvdProtocol::listDir( const KURL& url )
if( e ) {
if( e->isDirectory() ) {
const K3bIso9660Directory* dir = static_cast<const K3bIso9660Directory*>(e);
QStringList el = dir->entries();
TQStringList el = dir->entries();
el.remove( "." );
el.remove( ".." );
UDSEntryList udsl;
for( QStringList::const_iterator it = el.begin(); it != el.end(); ++it )
for( TQStringList::const_iterator it = el.begin(); it != el.end(); ++it )
udsl.append( createUDSEntry( dir->entry( *it ) ) );
listEntries( udsl );
finished();
@ -269,7 +269,7 @@ void kio_videodvdProtocol::listVideoDVDs()
{
int cnt = 0;
for( QPtrListIterator<K3bDevice::Device> it( s_deviceManager->dvdReader() ); *it; ++it ) {
for( TQPtrListIterator<K3bDevice::Device> it( s_deviceManager->dvdReader() ); *it; ++it ) {
K3bDevice::Device* dev = *it;
K3bDevice::DiskInfo di = dev->diskInfo();
@ -346,7 +346,7 @@ void kio_videodvdProtocol::stat( const KURL& url )
finished();
}
else {
QString isoPath;
TQString isoPath;
K3bIso9660* iso = openIso( url, isoPath );
if( iso ) {
const K3bIso9660Entry* e = iso->firstIsoDirEntry()->entry( isoPath );
@ -371,7 +371,7 @@ void kio_videodvdProtocol::mimetype( const KURL& url )
return;
}
QString isoPath;
TQString isoPath;
K3bIso9660* iso = openIso( url, isoPath );
if( iso )
{
@ -388,13 +388,13 @@ void kio_videodvdProtocol::mimetype( const KURL& url )
{
// send some data
const K3bIso9660File* file = static_cast<const K3bIso9660File*>( e );
QByteArray buffer( 10*2048 );
TQByteArray buffer( 10*2048 );
int read = file->read( 0, buffer.data(), buffer.size() );
if( read > 0 )
{
buffer.resize( read );
data(buffer);
data(QByteArray());
data(TQByteArray());
finished();
// FIXME: do we need to emit finished() after emitting the end of data()?
}

@ -17,14 +17,14 @@
#ifndef _videodvd_H_
#define _videodvd_H_
#include <qstring.h>
#include <qcstring.h>
#include <tqstring.h>
#include <tqcstring.h>
#include <kurl.h>
#include <kio/global.h>
#include <kio/slavebase.h>
class QCString;
class TQCString;
class K3bIso9660Entry;
class K3bIso9660;
namespace K3bDevice
@ -35,7 +35,7 @@ namespace K3bDevice
class kio_videodvdProtocol : public KIO::SlaveBase
{
public:
kio_videodvdProtocol(const QCString &pool_socket, const QCString &app_socket);
kio_videodvdProtocol(const TQCString &pool_socket, const TQCString &app_socket);
~kio_videodvdProtocol();
void mimetype( const KURL& url );
@ -44,7 +44,7 @@ public:
void listDir( const KURL& url );
private:
K3bIso9660* openIso( const KURL&, QString& plainIsoPath );
K3bIso9660* openIso( const KURL&, TQString& plainIsoPath );
KIO::UDSEntry createUDSEntry( const K3bIso9660Entry* e ) const;
void listVideoDVDs();

@ -1,3 +1,5 @@
AM_CPPFLAGS = $(all_includes)
if include_videodvdrip
VIDEODVDDIR = videodvd
VIDEODVDLIB = videodvd/libvideodvd.la

@ -15,10 +15,10 @@
#include <qstring.h>
#include <qvaluelist.h>
#include <qstringlist.h>
#include <qtimer.h>
#include <tqstring.h>
#include <tqvaluelist.h>
#include <tqstringlist.h>
#include <tqtimer.h>
#include <klocale.h>
#include <kconfig.h>
@ -36,8 +36,8 @@
#include "k3bcddbmultientriesdialog.h"
K3bCddb::K3bCddb( QObject* parent, const char* name )
: QObject( parent, name )
K3bCddb::K3bCddb( TQObject* tqparent, const char* name )
: TQObject( tqparent, name )
{
m_httpQuery = 0;
m_cddbpQuery = 0;
@ -61,8 +61,8 @@ void K3bCddb::readConfig( KConfig* c )
m_bLocalCddbQuery = c->readBoolEntry( "use local cddb query", false );
// old config <= 0.7.3
QStringList cddbpServer = c->readListEntry( "cddbp server" );
QStringList httpServer = c->readListEntry( "http server" );
TQStringList cddbpServer = c->readListEntry( "cddbp server" );
TQStringList httpServer = c->readListEntry( "http server" );
// new config
m_cddbServer = c->readListEntry( "cddb server" );
@ -77,12 +77,12 @@ void K3bCddb::readConfig( KConfig* c )
// old config <= 0.7.3
if( !httpServer.isEmpty() ) {
for( QStringList::iterator it = httpServer.begin(); it != httpServer.end(); ++it ) {
for( TQStringList::iterator it = httpServer.begin(); it != httpServer.end(); ++it ) {
m_cddbServer.append( "Http " + *it );
}
}
if( !cddbpServer.isEmpty() ) {
for( QStringList::iterator it = cddbpServer.begin(); it != cddbpServer.end(); ++it ) {
for( TQStringList::iterator it = cddbpServer.begin(); it != cddbpServer.end(); ++it ) {
m_cddbServer.append( "Cddbp " + *it );
}
}
@ -98,14 +98,14 @@ void K3bCddb::query( const K3bDevice::Toc& toc )
if( m_bLocalCddbQuery ) {
m_iCurrentQueriedLocalDir = 0;
QTimer::singleShot( 0, this, SLOT(localQuery()) );
TQTimer::singleShot( 0, this, TQT_SLOT(localQuery()) );
}
else if( m_bRemoteCddbQuery ) {
m_iCurrentQueriedServer = 0;
QTimer::singleShot( 0, this, SLOT(remoteQuery()) );
TQTimer::singleShot( 0, this, TQT_SLOT(remoteQuery()) );
}
else {
QTimer::singleShot( 0, this, SLOT(slotNoEntry()) );
TQTimer::singleShot( 0, this, TQT_SLOT(slotNoEntry()) );
}
}
@ -141,7 +141,7 @@ void K3bCddb::slotQueryFinished( K3bCddbQuery* query )
m_lastResult = m_lastUsedQuery->result();
// make sure the result has the requested discid since otherwise local saving does not make much sense
m_lastResult.discid = QString::number( m_toc.discId(), 16 ).rightJustify( 8, '0' );
m_lastResult.discid = TQString::number( m_toc.discId(), 16 ).rightJustify( 8, '0' );
emit queryFinished( K3bCddbQuery::SUCCESS );
}
@ -169,37 +169,37 @@ void K3bCddb::slotQueryFinished( K3bCddbQuery* query )
}
K3bCddbQuery* K3bCddb::getQuery( const QString& s )
K3bCddbQuery* K3bCddb::getQuery( const TQString& s )
{
QStringList buf = QStringList::split( ":", s.mid( s.find(" ")+1 ) );
QString server = buf[0];
TQStringList buf = TQStringList::split( ":", s.mid( s.tqfind(" ")+1 ) );
TQString server = buf[0];
int port = buf[1].toInt();
if( s.startsWith("Http") ) {
if( !m_httpQuery ) {
m_httpQuery = new K3bCddbHttpQuery( this );
connect( m_httpQuery, SIGNAL(infoMessage(const QString&)),
this, SIGNAL(infoMessage(const QString&)) );
connect( m_httpQuery, SIGNAL(queryFinished(K3bCddbQuery*)),
this, SLOT(slotQueryFinished(K3bCddbQuery*)) );
connect( m_httpQuery, SIGNAL(inexactMatches(K3bCddbQuery*)),
this, SLOT(slotMultibleMatches(K3bCddbQuery*)) );
connect( m_httpQuery, TQT_SIGNAL(infoMessage(const TQString&)),
this, TQT_SIGNAL(infoMessage(const TQString&)) );
connect( m_httpQuery, TQT_SIGNAL(queryFinished(K3bCddbQuery*)),
this, TQT_SLOT(slotQueryFinished(K3bCddbQuery*)) );
connect( m_httpQuery, TQT_SIGNAL(inexactMatches(K3bCddbQuery*)),
this, TQT_SLOT(slotMultibleMatches(K3bCddbQuery*)) );
}
m_httpQuery->setServer( server, port );
m_httpQuery->setCgiPath( m_bUseManualCgiPath ? m_cgiPath : QString::fromLatin1("/~cddb/cddb.cgi") );
m_httpQuery->setCgiPath( m_bUseManualCgiPath ? m_cgiPath : TQString::tqfromLatin1("/~cddb/cddb.cgi") );
return m_httpQuery;
}
else {
if( !m_cddbpQuery ) {
m_cddbpQuery = new K3bCddbpQuery( this );
connect( m_cddbpQuery, SIGNAL(infoMessage(const QString&)),
this, SIGNAL(infoMessage(const QString&)) );
connect( m_cddbpQuery, SIGNAL(queryFinished(K3bCddbQuery*)),
this, SLOT(slotQueryFinished(K3bCddbQuery*)) );
connect( m_cddbpQuery, SIGNAL(inexactMatches(K3bCddbQuery*)),
this, SLOT(slotMultibleMatches(K3bCddbQuery*)) );
connect( m_cddbpQuery, TQT_SIGNAL(infoMessage(const TQString&)),
this, TQT_SIGNAL(infoMessage(const TQString&)) );
connect( m_cddbpQuery, TQT_SIGNAL(queryFinished(K3bCddbQuery*)),
this, TQT_SLOT(slotQueryFinished(K3bCddbQuery*)) );
connect( m_cddbpQuery, TQT_SIGNAL(inexactMatches(K3bCddbQuery*)),
this, TQT_SLOT(slotMultibleMatches(K3bCddbQuery*)) );
}
m_cddbpQuery->setServer( server, port );
@ -213,12 +213,12 @@ void K3bCddb::localQuery()
{
if( !m_localQuery ) {
m_localQuery = new K3bCddbLocalQuery( this );
connect( m_localQuery, SIGNAL(infoMessage(const QString&)),
this, SIGNAL(infoMessage(const QString&)) );
connect( m_localQuery, SIGNAL(queryFinished(K3bCddbQuery*)),
this, SLOT(slotQueryFinished(K3bCddbQuery*)) );
connect( m_localQuery, SIGNAL(inexactMatches(K3bCddbQuery*)),
this, SLOT(slotMultibleMatches(K3bCddbQuery*)) );
connect( m_localQuery, TQT_SIGNAL(infoMessage(const TQString&)),
this, TQT_SIGNAL(infoMessage(const TQString&)) );
connect( m_localQuery, TQT_SIGNAL(queryFinished(K3bCddbQuery*)),
this, TQT_SLOT(slotQueryFinished(K3bCddbQuery*)) );
connect( m_localQuery, TQT_SIGNAL(inexactMatches(K3bCddbQuery*)),
this, TQT_SLOT(slotMultibleMatches(K3bCddbQuery*)) );
}
m_localQuery->setCddbDir( m_localCddbDirs[m_iCurrentQueriedLocalDir] );
@ -227,7 +227,7 @@ void K3bCddb::localQuery()
}
QString K3bCddb::errorString() const
TQString K3bCddb::errorString() const
{
if( !m_lastUsedQuery )
return "no query";
@ -241,7 +241,7 @@ QString K3bCddb::errorString() const
return i18n("Error while connecting to host.");
case K3bCddbQuery::WORKING:
return i18n("Working...");
case K3bCddbQuery::QUERY_ERROR:
case K3bCddbQuery::TQUERY_ERROR:
case K3bCddbQuery::READ_ERROR:
case K3bCddbQuery::FAILURE:
default:
@ -261,8 +261,8 @@ void K3bCddb::saveEntry( const K3bCddbResultEntry& entry )
{
if( !m_localSubmit ) {
m_localSubmit = new K3bCddbLocalSubmit( this );
connect( m_localSubmit, SIGNAL(submitFinished(K3bCddbSubmit*)),
this, SLOT(slotSubmitFinished(K3bCddbSubmit*)) );
connect( m_localSubmit, TQT_SIGNAL(submitFinished(K3bCddbSubmit*)),
this, TQT_SLOT(slotSubmitFinished(K3bCddbSubmit*)) );
}
m_localSubmit->setCddbDir( m_localCddbDirs[0] );

@ -17,9 +17,9 @@
#ifndef K3BCDDB_H
#define K3BCDDB_H
#include <qstring.h>
#include <qstringlist.h>
#include <qobject.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include <tqobject.h>
#include <k3btoc.h>
@ -35,15 +35,16 @@ class K3bCddbSubmit;
class K3bCddbLocalSubmit;
class LIBK3B_EXPORT K3bCddb : public QObject
class LIBK3B_EXPORT K3bCddb : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
K3bCddb( QObject* parent = 0, const char* name = 0 );
K3bCddb( TQObject* tqparent = 0, const char* name = 0 );
~K3bCddb();
QString errorString() const;
TQString errorString() const;
/**
* Do NOT call this before queryResult has
@ -60,7 +61,7 @@ class LIBK3B_EXPORT K3bCddb : public QObject
signals:
void queryFinished( int error );
void submitFinished( bool success );
void infoMessage( const QString& );
void infoMessage( const TQString& );
private slots:
void localQuery();
@ -71,7 +72,7 @@ class LIBK3B_EXPORT K3bCddb : public QObject
void slotNoEntry();
private:
K3bCddbQuery* getQuery( const QString& );
K3bCddbQuery* getQuery( const TQString& );
K3bCddbHttpQuery* m_httpQuery;
K3bCddbpQuery* m_cddbpQuery;
@ -86,13 +87,13 @@ class LIBK3B_EXPORT K3bCddb : public QObject
K3bCddbResultEntry m_lastResult;
// config
QStringList m_cddbServer;
QString m_proxyServer;
TQStringList m_cddbServer;
TQString m_proxyServer;
int m_proxyPort;
QString m_cgiPath;
TQString m_cgiPath;
bool m_bUseProxyServer;
bool m_bUseKdeSettings;
QStringList m_localCddbDirs;
TQStringList m_localCddbDirs;
bool m_bSaveCddbEntriesLocally;
bool m_bUseManualCgiPath;
bool m_bRemoteCddbQuery;

@ -19,9 +19,9 @@
#include "k3bcddbresult.h"
#include <qstringlist.h>
#include <qregexp.h>
#include <qtextstream.h>
#include <tqstringlist.h>
#include <tqregexp.h>
#include <tqtextstream.h>
#include <klocale.h>
#include <kdebug.h>
@ -29,8 +29,8 @@
#include <kio/job.h>
K3bCddbHttpQuery::K3bCddbHttpQuery( QObject* parent, const char* name )
: K3bCddbQuery( parent, name )
K3bCddbHttpQuery::K3bCddbHttpQuery( TQObject* tqparent, const char* name )