diff options
Diffstat (limited to 'kioslave/media/mediamanager')
-rw-r--r-- | kioslave/media/mediamanager/fstabbackend.cpp | 104 | ||||
-rw-r--r-- | kioslave/media/mediamanager/fstabbackend.h | 40 | ||||
-rw-r--r-- | kioslave/media/mediamanager/halbackend.cpp | 324 | ||||
-rw-r--r-- | kioslave/media/mediamanager/halbackend.h | 38 | ||||
-rw-r--r-- | kioslave/media/mediamanager/linuxcdpolling.cpp | 96 | ||||
-rw-r--r-- | kioslave/media/mediamanager/linuxcdpolling.h | 26 | ||||
-rw-r--r-- | kioslave/media/mediamanager/mediadirnotify.cpp | 8 | ||||
-rw-r--r-- | kioslave/media/mediamanager/medialist.cpp | 68 | ||||
-rw-r--r-- | kioslave/media/mediamanager/medialist.h | 60 | ||||
-rw-r--r-- | kioslave/media/mediamanager/mediamanager.cpp | 84 | ||||
-rw-r--r-- | kioslave/media/mediamanager/mediamanager.h | 52 | ||||
-rw-r--r-- | kioslave/media/mediamanager/removablebackend.cpp | 62 | ||||
-rw-r--r-- | kioslave/media/mediamanager/removablebackend.h | 22 |
13 files changed, 492 insertions, 492 deletions
diff --git a/kioslave/media/mediamanager/fstabbackend.cpp b/kioslave/media/mediamanager/fstabbackend.cpp index 4ffcf4b2d..189f52aee 100644 --- a/kioslave/media/mediamanager/fstabbackend.cpp +++ b/kioslave/media/mediamanager/fstabbackend.cpp @@ -33,7 +33,7 @@ #define CDC_CD_R 0x2000 /* drive is a CD-R */ #define CDC_CD_RW 0x4000 /* drive is a CD-RW */ #define CDC_DVD 0x8000 /* drive is a DVD */ -#include <qfile.h> +#include <tqfile.h> #endif #include <klocale.h> @@ -56,13 +56,13 @@ FstabBackend::FstabBackend(MediaList &list, bool networkSharesOnly) - : QObject(), BackendBase(list), m_networkSharesOnly(networkSharesOnly) + : TQObject(), BackendBase(list), m_networkSharesOnly(networkSharesOnly) { KDirWatch::self()->addFile(MTAB); KDirWatch::self()->addFile(FSTAB); - connect( KDirWatch::self(), SIGNAL( dirty(const QString&) ), - this, SLOT( slotDirty(const QString&) ) ); + connect( KDirWatch::self(), TQT_SIGNAL( dirty(const TQString&) ), + this, TQT_SLOT( slotDirty(const TQString&) ) ); handleFstabChange(false); handleMtabChange(false); @@ -70,16 +70,16 @@ FstabBackend::FstabBackend(MediaList &list, bool networkSharesOnly) KDirWatch::self()->startScan(); #ifdef Q_OS_FREEBSD - connect( &m_mtabTimer, SIGNAL( timeout() ), - this, SLOT( handleMtabChange() ) ); + connect( &m_mtabTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( handleMtabChange() ) ); m_mtabTimer.start(250); #endif } FstabBackend::~FstabBackend() { - QStringList::iterator it = m_mtabIds.begin(); - QStringList::iterator end = m_mtabIds.end(); + TQStringList::iterator it = m_mtabIds.begin(); + TQStringList::iterator end = m_mtabIds.end(); for (; it!=end; ++it) { @@ -97,27 +97,27 @@ FstabBackend::~FstabBackend() KDirWatch::self()->removeFile(MTAB); } -QString FstabBackend::mount( const QString &_udi ) +TQString FstabBackend::mount( const TQString &_udi ) { const Medium* medium = m_mediaList.findById(_udi); if (!medium) return i18n("No such medium: %1").arg(_udi); KIO::Job* job = KIO::mount( false, 0, medium->deviceNode(), medium->mountPoint()); KIO::NetAccess::synchronousRun( job, 0 ); - return QString::null; + return TQString::null; } -QString FstabBackend::unmount( const QString &_udi ) +TQString FstabBackend::unmount( const TQString &_udi ) { const Medium* medium = m_mediaList.findById(_udi); if (!medium) return i18n("No such medium: %1").arg(_udi); KIO::Job* job = KIO::unmount( medium->mountPoint(), false); KIO::NetAccess::synchronousRun( job, 0 ); - return QString::null; + return TQString::null; } -void FstabBackend::slotDirty(const QString &path) +void FstabBackend::slotDirty(const TQString &path) { if (path==MTAB) { @@ -169,7 +169,7 @@ bool inExclusionPattern(KMountPoint *mount, bool networkSharesOnly) void FstabBackend::handleMtabChange(bool allowNotification) { - QStringList new_mtabIds; + TQStringList new_mtabIds; KMountPoint::List mtab = KMountPoint::currentMountPoints(); KMountPoint::List::iterator it = mtab.begin(); @@ -177,28 +177,28 @@ void FstabBackend::handleMtabChange(bool allowNotification) for (; it!=end; ++it) { - QString dev = (*it)->mountedFrom(); - QString mp = (*it)->mountPoint(); - QString fs = (*it)->mountType(); + TQString dev = (*it)->mountedFrom(); + TQString mp = (*it)->mountPoint(); + TQString fs = (*it)->mountType(); if ( ::inExclusionPattern(*it, m_networkSharesOnly) ) continue; /* Did we know this already before ? If yes, then nothing has changed, do not stat the mount point. Avoids hang if network shares are stalling */ - QString mtabEntry = dev + "*" + mp + "*" + fs; + TQString mtabEntry = dev + "*" + mp + "*" + fs; if(m_mtabEntries.contains(mtabEntry)) { new_mtabIds += m_mtabEntries[mtabEntry]; continue; } - QString id = generateId(dev, mp); + TQString id = generateId(dev, mp); new_mtabIds+=id; m_mtabEntries[mtabEntry] = id; if ( !m_mtabIds.contains(id) && m_fstabIds.contains(id) ) { - QString mime, icon, label; + TQString mime, icon, label; guess(dev, mp, fs, true, mime, icon, label); m_mediaList.changeMediumState(id, true, false, mime, icon, label); @@ -206,13 +206,13 @@ void FstabBackend::handleMtabChange(bool allowNotification) #if 0 else if ( !m_mtabIds.contains(id) ) { - QString name = generateName(dev, fs); + TQString name = generateName(dev, fs); Medium *m = new Medium(id, name); m->mountableState(dev, mp, fs, true); - QString mime, icon, label; + TQString mime, icon, label; guess(dev, mp, fs, true, mime, icon, label); m->setMimeType(mime); @@ -224,8 +224,8 @@ void FstabBackend::handleMtabChange(bool allowNotification) #endif } - QStringList::iterator it2 = m_mtabIds.begin(); - QStringList::iterator end2 = m_mtabIds.end(); + TQStringList::iterator it2 = m_mtabIds.begin(); + TQStringList::iterator end2 = m_mtabIds.end(); for (; it2!=end2; ++it2) { @@ -233,15 +233,15 @@ void FstabBackend::handleMtabChange(bool allowNotification) { const Medium *medium = m_mediaList.findById(*it2); - QString dev = medium->deviceNode(); - QString mp = medium->mountPoint(); - QString fs = medium->fsType(); + TQString dev = medium->deviceNode(); + TQString mp = medium->mountPoint(); + TQString fs = medium->fsType(); - QString mtabEntry = dev + "*" + mp + "*" + fs; + TQString mtabEntry = dev + "*" + mp + "*" + fs; m_mtabEntries.remove(mtabEntry); - QString mime, icon, label; + TQString mime, icon, label; guess(dev, mp, fs, false, mime, icon, label); m_mediaList.changeMediumState(*it2, false, false, @@ -260,7 +260,7 @@ void FstabBackend::handleMtabChange(bool allowNotification) void FstabBackend::handleFstabChange(bool allowNotification) { - QStringList new_fstabIds; + TQStringList new_fstabIds; KMountPoint::List fstab = KMountPoint::possibleMountPoints(); KMountPoint::List::iterator it = fstab.begin(); @@ -268,24 +268,24 @@ void FstabBackend::handleFstabChange(bool allowNotification) for (; it!=end; ++it) { - QString dev = (*it)->mountedFrom(); - QString mp = (*it)->mountPoint(); - QString fs = (*it)->mountType(); + TQString dev = (*it)->mountedFrom(); + TQString mp = (*it)->mountPoint(); + TQString fs = (*it)->mountType(); if ( ::inExclusionPattern(*it, m_networkSharesOnly) ) continue; - QString id = generateId(dev, mp); + TQString id = generateId(dev, mp); new_fstabIds+=id; if ( !m_fstabIds.contains(id) ) { - QString name = generateName(dev, fs); + TQString name = generateName(dev, fs); Medium *m = new Medium(id, name); m->mountableState(dev, mp, fs, false); - QString mime, icon, label; + TQString mime, icon, label; guess(dev, mp, fs, false, mime, icon, label); m->setMimeType(mime); @@ -296,8 +296,8 @@ void FstabBackend::handleFstabChange(bool allowNotification) } } - QStringList::iterator it2 = m_fstabIds.begin(); - QStringList::iterator end2 = m_fstabIds.end(); + TQStringList::iterator it2 = m_fstabIds.begin(); + TQStringList::iterator end2 = m_fstabIds.end(); for (; it2!=end2; ++it2) { @@ -310,18 +310,18 @@ void FstabBackend::handleFstabChange(bool allowNotification) m_fstabIds = new_fstabIds; } -QString FstabBackend::generateId(const QString &devNode, - const QString &mountPoint) +TQString FstabBackend::generateId(const TQString &devNode, + const TQString &mountPoint) { - QString d = KStandardDirs::realFilePath(devNode); - QString m = KStandardDirs::realPath(mountPoint); + TQString d = KStandardDirs::realFilePath(devNode); + TQString m = KStandardDirs::realPath(mountPoint); return "/org/kde/mediamanager/fstab/" +d.replace("/", "") +m.replace("/", ""); } -QString FstabBackend::generateName(const QString &devNode, const QString &fsType) +TQString FstabBackend::generateName(const TQString &devNode, const TQString &fsType) { KURL url( devNode ); @@ -335,19 +335,19 @@ QString FstabBackend::generateName(const QString &devNode, const QString &fsType } } -void FstabBackend::guess(const QString &devNode, const QString &mountPoint, - const QString &fsType, bool mounted, - QString &mimeType, QString &iconName, QString &label) +void FstabBackend::guess(const TQString &devNode, const TQString &mountPoint, + const TQString &fsType, bool mounted, + TQString &mimeType, TQString &iconName, TQString &label) { enum { UNKNOWN, CD, CDWRITER, DVD, DVDWRITER } devType = UNKNOWN; #ifdef __linux__ // Guessing device types by mount point is not exactly accurate... // Do something accurate first, and fall back if necessary. - int device=open(QFile::encodeName(devNode), O_RDONLY|O_NONBLOCK); + int device=open(TQFile::encodeName(devNode), O_RDONLY|O_NONBLOCK); if(device>=0) { bool isCd=false; - QString devname=devNode.section('/', -1); + TQString devname=devNode.section('/', -1); if(devname.startsWith("scd") || devname.startsWith("sr")) { // SCSI CD/DVD drive @@ -358,10 +358,10 @@ void FstabBackend::guess(const QString &devNode, const QString &mountPoint, // IDE device -- we can't tell if this is a // CD/DVD drive or harddisk by just looking at the // filename - QFile m(QString("/proc/ide/") + devname + "/media"); + TQFile m(TQString("/proc/ide/") + devname + "/media"); if(m.open(IO_ReadOnly)) { - QString buf; + TQString buf; m.readLine(buf, 1024); if(buf.contains("cdrom")) isCd=true; @@ -469,7 +469,7 @@ void FstabBackend::guess(const QString &devNode, const QString &mountPoint, } else { - QString tmp = devNode; + TQString tmp = devNode; if ( tmp.startsWith("/dev/") ) { tmp = tmp.mid(5); @@ -477,7 +477,7 @@ void FstabBackend::guess(const QString &devNode, const QString &mountPoint, label+= " (" + tmp + ")"; } mimeType+= (mounted ? "_mounted" : "_unmounted"); - iconName = QString::null; + iconName = TQString::null; } #include "fstabbackend.moc" diff --git a/kioslave/media/mediamanager/fstabbackend.h b/kioslave/media/mediamanager/fstabbackend.h index ceb2f23ef..e43ed48c0 100644 --- a/kioslave/media/mediamanager/fstabbackend.h +++ b/kioslave/media/mediamanager/fstabbackend.h @@ -21,15 +21,15 @@ #include "backendbase.h" -#include <qobject.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqmap.h> #ifdef Q_OS_FREEBSD -#include <qtimer.h> +#include <tqtimer.h> #endif -class FstabBackend : public QObject, public BackendBase +class FstabBackend : public TQObject, public BackendBase { Q_OBJECT @@ -37,31 +37,31 @@ public: FstabBackend(MediaList &list, bool networkSharesOnly = false); virtual ~FstabBackend(); - static void guess(const QString &devNode, const QString &mountPoint, - const QString &fsType, bool mounted, - QString &mimeType, QString &iconName, - QString &label); + static void guess(const TQString &devNode, const TQString &mountPoint, + const TQString &fsType, bool mounted, + TQString &mimeType, TQString &iconName, + TQString &label); - QString mount(const QString &id); - QString unmount(const QString &id); + TQString mount(const TQString &id); + TQString unmount(const TQString &id); private slots: - void slotDirty(const QString &path); + void slotDirty(const TQString &path); void handleFstabChange(bool allowNotification = true); void handleMtabChange(bool allowNotification = true); private: - static QString generateId(const QString &devNode, - const QString &mountPoint); - static QString generateName(const QString &devNode, - const QString &fsType); + static TQString generateId(const TQString &devNode, + const TQString &mountPoint); + static TQString generateName(const TQString &devNode, + const TQString &fsType); bool m_networkSharesOnly; - QStringList m_mtabIds; - QMap<QString, QString> m_mtabEntries; - QStringList m_fstabIds; + TQStringList m_mtabIds; + TQMap<TQString, TQString> m_mtabEntries; + TQStringList m_fstabIds; #ifdef Q_OS_FREEBSD - QTimer m_mtabTimer; + TQTimer m_mtabTimer; #endif }; diff --git a/kioslave/media/mediamanager/halbackend.cpp b/kioslave/media/mediamanager/halbackend.cpp index 4d6d9b19d..b6763ee84 100644 --- a/kioslave/media/mediamanager/halbackend.cpp +++ b/kioslave/media/mediamanager/halbackend.cpp @@ -24,14 +24,14 @@ #include <kapplication.h> #include <kmessagebox.h> -#include <qeventloop.h> -#include <qfile.h> +#include <tqeventloop.h> +#include <tqfile.h> #include <klocale.h> #include <kurl.h> #include <kdebug.h> #include <kprocess.h> #include <kconfig.h> -#include <qstylesheet.h> +#include <tqstylesheet.h> #include <kmountpoint.h> #include <kmessagebox.h> #include <kio/job.h> @@ -39,22 +39,22 @@ #include <kprocess.h> #define MOUNT_SUFFIX ( \ - (medium->isMounted() ? QString("_mounted") : QString("_unmounted")) + \ + (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")) + \ (medium->isEncrypted() ? (halClearVolume ? "_decrypted" : "_encrypted") : "" ) \ ) #define MOUNT_ICON_SUFFIX ( \ - (medium->isMounted() ? QString("_mount") : QString("_unmount")) + \ + (medium->isMounted() ? TQString("_mount") : TQString("_unmount")) + \ (medium->isEncrypted() ? (halClearVolume ? "_decrypt" : "_encrypt") : "" ) \ ) /* Static instance of this class, for static HAL callbacks */ static HALBackend* s_HALBackend; -/* A macro function to convert HAL string properties to QString */ -QString libhal_device_get_property_QString(LibHalContext *ctx, const char* udi, const char *key) +/* A macro function to convert HAL string properties to TQString */ +TQString libhal_device_get_property_QString(LibHalContext *ctx, const char* udi, const char *key) { char* _ppt_string; - QString _ppt_QString; + TQString _ppt_QString; DBusError error; dbus_error_init(&error); _ppt_string = libhal_device_get_property_string(ctx, udi, key, &error); @@ -65,8 +65,8 @@ QString libhal_device_get_property_QString(LibHalContext *ctx, const char* udi, } /* Constructor */ -HALBackend::HALBackend(MediaList &list, QObject* parent) - : QObject() +HALBackend::HALBackend(MediaList &list, TQObject* parent) + : TQObject() , BackendBase(list) , m_halContext(NULL) , m_halStoragePolicy(NULL) @@ -81,8 +81,8 @@ HALBackend::~HALBackend() /* Close HAL connection */ if (m_halContext) { - const QPtrList<Medium> medlist = m_mediaList.list(); - QPtrListIterator<Medium> it (medlist); + const TQPtrList<Medium> medlist = m_mediaList.list(); + TQPtrListIterator<Medium> it (medlist); for ( const Medium *current_medium = it.current(); current_medium; current_medium = ++it) { if( !current_medium->id().startsWith( "/org/kde" )) @@ -235,7 +235,7 @@ void HALBackend::AddDevice(const char *udi, bool allowNotification) return; /* Query drive udi */ - QString driveUdi = libhal_device_get_property_QString(m_halContext, udi, "block.storage_device"); + TQString driveUdi = libhal_device_get_property_QString(m_halContext, udi, "block.storage_device"); if ( driveUdi.isNull() ) // no storage - no fun return; @@ -284,10 +284,10 @@ void HALBackend::AddDevice(const char *udi, bool allowNotification) m_mediaList.addMedium(medium, allowNotification); // finally check for automount - QMap<QString,QString> options = MediaManagerUtils::splitOptions(mountoptions(udi)); + TQMap<TQString,TQString> options = MediaManagerUtils::splitOptions(mountoptions(udi)); kdDebug() << "automount " << options["automount"] << endl; if (options["automount"] == "true" && allowNotification ) { - QString error = mount(medium); + TQString error = mount(medium); if (!error.isEmpty()) kdDebug() << "error " << error << endl; } @@ -354,20 +354,20 @@ void HALBackend::ModifyDevice(const char *udi, const char* key) void HALBackend::DeviceCondition(const char* udi, const char* condition) { - QString conditionName = QString(condition); + TQString conditionName = TQString(condition); kdDebug(1219) << "Processing device condition " << conditionName << " for " << udi << endl; if (conditionName == "EjectPressed") { const Medium* medium = m_mediaList.findById(udi); if (!medium) { /* the ejectpressed appears on the drive and we need to find the volume */ - const QPtrList<Medium> medlist = m_mediaList.list(); - QPtrListIterator<Medium> it (medlist); + const TQPtrList<Medium> medlist = m_mediaList.list(); + TQPtrListIterator<Medium> it (medlist); for ( const Medium *current_medium = it.current(); current_medium; current_medium = ++it) { if( current_medium->id().startsWith( "/org/kde" )) continue; - QString driveUdi = libhal_device_get_property_QString(m_halContext, current_medium->id().latin1(), "block.storage_device"); + TQString driveUdi = libhal_device_get_property_QString(m_halContext, current_medium->id().latin1(), "block.storage_device"); if (driveUdi == udi) { medium = current_medium; @@ -436,7 +436,7 @@ const char* HALBackend::findMediumUdiFromUdi(const char* udi) libhal_volume_free(halVolume); /* this is a volume whose drive is registered */ - QString driveUdi = libhal_device_get_property_QString(m_halContext, udi, "block.storage_device"); + TQString driveUdi = libhal_device_get_property_QString(m_halContext, udi, "block.storage_device"); return findMediumUdiFromUdi(driveUdi.ascii()); } @@ -446,7 +446,7 @@ const char* HALBackend::findMediumUdiFromUdi(const char* udi) void HALBackend::ResetProperties(const char* mediumUdi, bool allowNotification) { kdDebug(1219) << "HALBackend::setProperties" << endl; - if ( QString::fromLatin1( mediumUdi ).startsWith( "/org/kde/" ) ) + if ( TQString::fromLatin1( mediumUdi ).startsWith( "/org/kde/" ) ) { const Medium *cmedium = m_mediaList.findById(mediumUdi); if ( cmedium ) @@ -487,7 +487,7 @@ void HALBackend::setVolumeProperties(Medium* medium) LibHalVolume* halVolume = libhal_volume_from_udi(m_halContext, udi); if (!halVolume) return; - QString driveUdi = libhal_volume_get_storage_device_udi(halVolume); + TQString driveUdi = libhal_volume_get_storage_device_udi(halVolume); LibHalDrive* halDrive = 0; if ( !driveUdi.isNull() ) halDrive = libhal_drive_from_udi(m_halContext, driveUdi.ascii()); @@ -507,7 +507,7 @@ void HALBackend::setVolumeProperties(Medium* medium) medium->setEncrypted(true); char* clearUdi = libhal_volume_crypto_get_clear_volume_udi(m_halContext, halVolume); - QString clearUdiString; + TQString clearUdiString; if (clearUdi != NULL) { kdDebug(1219) << "HALBackend::setVolumeProperties : crypto clear volume avail - " << clearUdi << endl; halClearVolume = libhal_volume_from_udi(m_halContext, clearUdi); @@ -526,9 +526,9 @@ void HALBackend::setVolumeProperties(Medium* medium) else medium->mountableState( libhal_volume_get_device_file(halVolume), /* Device node */ - QString::null, - QString::null, /* Mount point */ - QString::null, /* Filesystem type */ + TQString::null, + TQString::null, /* Mount point */ + TQString::null, /* Filesystem type */ false ); /* Mounted ? */ } else @@ -543,12 +543,12 @@ void HALBackend::setVolumeProperties(Medium* medium) char* name = libhal_volume_policy_compute_display_name(halDrive, halVolume, m_halStoragePolicy); - QString volume_name = QString::fromUtf8(name); - QString media_name = volume_name; + TQString volume_name = TQString::fromUtf8(name); + TQString media_name = volume_name; medium->setLabel(media_name); free(name); - QString mimeType; + TQString mimeType; if (libhal_volume_is_disc(halVolume)) { mimeType = "media/cdrom" + MOUNT_SUFFIX; @@ -579,10 +579,10 @@ void HALBackend::setVolumeProperties(Medium* medium) if (libhal_volume_disc_has_audio(halVolume) && !libhal_volume_disc_has_data(halVolume)) { mimeType = "media/audiocd"; - medium->unmountableState( "audiocd:/?device=" + QString(libhal_volume_get_device_file(halVolume)) ); + medium->unmountableState( "audiocd:/?device=" + TQString(libhal_volume_get_device_file(halVolume)) ); } - medium->setIconName(QString::null); + medium->setIconName(TQString::null); /* check if the disc id a vcd or a video dvd */ DiscType type = LinuxCDPolling::identifyDiscType(libhal_volume_get_device_file(halVolume)); @@ -602,7 +602,7 @@ void HALBackend::setVolumeProperties(Medium* medium) else { mimeType = "media/hdd" + MOUNT_SUFFIX; - medium->setIconName(QString::null); // reset icon + medium->setIconName(TQString::null); // reset icon if (libhal_drive_is_hotpluggable(halDrive)) { mimeType = "media/removable" + MOUNT_SUFFIX; @@ -640,13 +640,13 @@ void HALBackend::setVolumeProperties(Medium* medium) break; } case LIBHAL_DRIVE_TYPE_TAPE: - medium->setIconName(QString::null); //FIXME need icon + medium->setIconName(TQString::null); //FIXME need icon break; default: - medium->setIconName(QString::null); + medium->setIconName(TQString::null); } - if (medium->isMounted() && QFile::exists(medium->mountPoint() + "/dcim")) + if (medium->isMounted() && TQFile::exists(medium->mountPoint() + "/dcim")) { mimeType = "media/camera" + MOUNT_SUFFIX; } @@ -660,7 +660,7 @@ void HALBackend::setVolumeProperties(Medium* medium) bool HALBackend::setFstabProperties( Medium *medium ) { - QString mp = isInFstab(medium); + TQString mp = isInFstab(medium); if (!mp.isNull() && !medium->id().startsWith( "/org/kde" ) ) { @@ -682,7 +682,7 @@ bool HALBackend::setFstabProperties( Medium *medium ) } kdDebug() << mp << " " << mounted << " " << medium->deviceNode() << " " << endl; - QString fstype = medium->fsType(); + TQString fstype = medium->fsType(); if ( fstype.isNull() ) fstype = "auto"; @@ -713,7 +713,7 @@ bool HALBackend::setFloppyProperties(Medium* medium) if (!halDrive) return false; - QString drive_type = libhal_device_get_property_QString(m_halContext, udi, "storage.drive_type"); + TQString drive_type = libhal_device_get_property_QString(m_halContext, udi, "storage.drive_type"); if (drive_type == "zip") { int numVolumes; @@ -731,7 +731,7 @@ bool HALBackend::setFloppyProperties(Medium* medium) medium->setLabel(i18n("Unknown Drive")); // HAL hates floppies - so we have to do it twice ;( - medium->mountableState(libhal_drive_get_device_file(halDrive), QString::null, QString::null, false); + medium->mountableState(libhal_drive_get_device_file(halDrive), TQString::null, TQString::null, false); setFloppyMountState(medium); if (drive_type == "floppy") @@ -753,7 +753,7 @@ bool HALBackend::setFloppyProperties(Medium* medium) /** @todo And mimtype for JAZ drives ? */ - medium->setIconName(QString::null); + medium->setIconName(TQString::null); libhal_drive_free(halDrive); @@ -768,8 +768,8 @@ void HALBackend::setFloppyMountState( Medium *medium ) KMountPoint::List::iterator it = mtab.begin(); KMountPoint::List::iterator end = mtab.end(); - QString fstype; - QString mountpoint; + TQString fstype; + TQString mountpoint; for (; it!=end; ++it) { if ((*it)->mountedFrom() == medium->deviceNode() ) @@ -795,7 +795,7 @@ void HALBackend::setCameraProperties(Medium* medium) /** @todo find name */ medium->setName("camera"); - QString device = "camera:/"; + TQString device = "camera:/"; char *cam = libhal_device_get_property_string(m_halContext, udi, "camera.libgphoto2.name", NULL); DBusError error; @@ -812,7 +812,7 @@ void HALBackend::setCameraProperties(Medium* medium) /** @todo find the rest of this URL */ medium->unmountableState(device); medium->setMimeType("media/gphoto2camera"); - medium->setIconName(QString::null); + medium->setIconName(TQString::null); if (libhal_device_property_exists(m_halContext, udi, "usb_device.product", NULL)) medium->setLabel(libhal_device_get_property_QString(m_halContext, udi, "usb_device.product")); else if (libhal_device_property_exists(m_halContext, udi, "usb.product", NULL)) @@ -821,7 +821,7 @@ void HALBackend::setCameraProperties(Medium* medium) medium->setLabel(i18n("Camera")); } -QString HALBackend::generateName(const QString &devNode) +TQString HALBackend::generateName(const TQString &devNode) { return KURL(devNode).fileName(); } @@ -865,15 +865,15 @@ void HALBackend::hal_device_condition(LibHalContext *ctx, const char *udi, s_HALBackend->DeviceCondition(udi, condition_name); } -QStringList HALBackend::mountoptions(const QString &name) +TQStringList HALBackend::mountoptions(const TQString &name) { const Medium* medium = m_mediaList.findById(name); if (!medium) - return QStringList(); // we don't know about that one + return TQStringList(); // we don't know about that one if (!isInFstab(medium).isNull()) - return QStringList(); // not handled by HAL - fstab entry + return TQStringList(); // not handled by HAL - fstab entry - QString volume_udi = name; + TQString volume_udi = name; if (medium->isEncrypted()) { // see if we have a clear volume LibHalVolume* halVolume = libhal_volume_from_udi(m_halContext, medium->id().latin1()); @@ -884,12 +884,12 @@ QStringList HALBackend::mountoptions(const QString &name) libhal_free_string(clearUdi); } else { // if not decrypted yet then no mountoptions - return QStringList(); + return TQStringList(); } libhal_volume_free(halVolume); } else { // strange... - return QStringList(); + return TQStringList(); } } @@ -897,24 +897,24 @@ QStringList HALBackend::mountoptions(const QString &name) config.setGroup(name); char ** array = libhal_device_get_property_strlist(m_halContext, volume_udi.latin1(), "volume.mount.valid_options", NULL); - QMap<QString,bool> valids; + TQMap<TQString,bool> valids; for (int index = 0; array && array[index]; ++index) { - QString t = array[index]; + TQString t = array[index]; if (t.endsWith("=")) t = t.left(t.length() - 1); valids[t] = true; kdDebug() << "valid " << t << endl; } libhal_free_string_array(array); - QStringList result; - QString tmp; + TQStringList result; + TQString tmp; - QString fstype = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "volume.fstype"); + TQString fstype = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "volume.fstype"); if (fstype.isNull()) fstype = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "volume.policy.mount_filesystem"); - QString drive_udi = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "block.storage_device"); + TQString drive_udi = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "block.storage_device"); bool removable = false; if ( !drive_udi.isNull() ) @@ -932,12 +932,12 @@ QStringList HALBackend::mountoptions(const QString &name) || libhal_device_get_property_bool(m_halContext, volume_udi.latin1(), "volume.disc.has_audio", NULL)) value = false; - result << QString("automount=%1").arg(value ? "true" : "false"); + result << TQString("automount=%1").arg(value ? "true" : "false"); if (valids.contains("ro")) { value = config.readBoolEntry("ro", false); - tmp = QString("ro=%1").arg(value ? "true" : "false"); + tmp = TQString("ro=%1").arg(value ? "true" : "false"); if (fstype != "iso9660") // makes no sense result << tmp; } @@ -945,7 +945,7 @@ QStringList HALBackend::mountoptions(const QString &name) if (valids.contains("quiet")) { value = config.readBoolEntry("quiet", false); - tmp = QString("quiet=%1").arg(value ? "true" : "false"); + tmp = TQString("quiet=%1").arg(value ? "true" : "false"); if (fstype != "iso9660") // makes no sense result << tmp; } @@ -953,27 +953,27 @@ QStringList HALBackend::mountoptions(const QString &name) if (valids.contains("flush")) { value = config.readBoolEntry("flush", fstype.endsWith("fat")); - tmp = QString("flush=%1").arg(value ? "true" : "false"); + tmp = TQString("flush=%1").arg(value ? "true" : "false"); result << tmp; } if (valids.contains("uid")) { value = config.readBoolEntry("uid", true); - tmp = QString("uid=%1").arg(value ? "true" : "false"); + tmp = TQString("uid=%1").arg(value ? "true" : "false"); result << tmp; } if (valids.contains("utf8")) { value = config.readBoolEntry("utf8", true); - tmp = QString("utf8=%1").arg(value ? "true" : "false"); + tmp = TQString("utf8=%1").arg(value ? "true" : "false"); result << tmp; } if (valids.contains("shortname")) { - QString svalue = config.readEntry("shortname", "lower").lower(); + TQString svalue = config.readEntry("shortname", "lower").lower(); if (svalue == "winnt") result << "shortname=winnt"; else if (svalue == "win95") @@ -991,14 +991,14 @@ QStringList HALBackend::mountoptions(const QString &name) // check in the same order as `locale` does char *cType; if ( (cType = getenv("LC_ALL")) || (cType = getenv("LC_CTYPE")) || (cType = getenv("LANG")) ) { - result << QString("locale=%1").arg(cType); + result << TQString("locale=%1").arg(cType); } } if (valids.contains("sync")) { value = config.readBoolEntry("sync", ( valids.contains("flush") && !fstype.endsWith("fat") ) && removable); - tmp = QString("sync=%1").arg(value ? "true" : "false"); + tmp = TQString("sync=%1").arg(value ? "true" : "false"); if (fstype != "iso9660") // makes no sense result << tmp; } @@ -1006,12 +1006,12 @@ QStringList HALBackend::mountoptions(const QString &name) if (valids.contains("noatime")) { value = config.readBoolEntry("atime", !fstype.endsWith("fat")); - tmp = QString("atime=%1").arg(value ? "true" : "false"); + tmp = TQString("atime=%1").arg(value ? "true" : "false"); if (fstype != "iso9660") // makes no sense result << tmp; } - QString mount_point = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "volume.mount_point"); + TQString mount_point = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "volume.mount_point"); if (mount_point.isEmpty()) mount_point = libhal_device_get_property_QString(m_halContext, volume_udi.latin1(), "volume.policy.desired_mount_point"); @@ -1020,12 +1020,12 @@ QStringList HALBackend::mountoptions(const QString &name) if (!mount_point.startsWith("/")) mount_point = "/media/" + mount_point; - result << QString("mountpoint=%1").arg(mount_point); - result << QString("filesystem=%1").arg(fstype); + result << TQString("mountpoint=%1").arg(mount_point); + result << TQString("filesystem=%1").arg(fstype); if (valids.contains("data")) { - QString svalue = config.readEntry("journaling").lower(); + TQString svalue = config.readEntry("journaling").lower(); if (svalue == "ordered") result << "journaling=ordered"; else if (svalue == "writeback") @@ -1039,14 +1039,14 @@ QStringList HALBackend::mountoptions(const QString &name) return result; } -bool HALBackend::setMountoptions(const QString &name, const QStringList &options ) +bool HALBackend::setMountoptions(const TQString &name, const TQStringList &options ) { kdDebug() << "setMountoptions " << name << " " << options << endl; KConfig config("mediamanagerrc"); config.setGroup(name); - QMap<QString,QString> valids = MediaManagerUtils::splitOptions(options); + TQMap<TQString,TQString> valids = MediaManagerUtils::splitOptions(options); const char *names[] = { "ro", "quiet", "atime", "uid", "utf8", "flush", "sync", 0 }; for (int index = 0; names[index]; ++index) @@ -1059,11 +1059,11 @@ bool HALBackend::setMountoptions(const QString &name, const QStringList &options if (valids.contains("journaling")) config.writeEntry("journaling", valids["journaling"]); - if (!mountoptions(name).contains(QString("mountpoint=%1").arg(valids["mountpoint"]))) + if (!mountoptions(name).contains(TQString("mountpoint=%1").arg(valids["mountpoint"]))) config.writeEntry("mountpoint", valids["mountpoint"]); if (valids.contains("automount")) { - QString drive_udi = libhal_device_get_property_QString(m_halContext, name.latin1(), "block.storage_device"); + TQString drive_udi = libhal_device_get_property_QString(m_halContext, name.latin1(), "block.storage_device"); config.setGroup(drive_udi); config.writeEntry("automount", valids["automount"]); } @@ -1071,8 +1071,8 @@ bool HALBackend::setMountoptions(const QString &name, const QStringList &options return true; } -QString startKdeSudoProcess(const QString& kdesudoPath, const QString& command, - const QString& dialogCaption, const QString& dialogComment) +TQString startKdeSudoProcess(const TQString& kdesudoPath, const TQString& command, + const TQString& dialogCaption, const TQString& dialogComment) { KProcess kdesudoProcess; @@ -1086,11 +1086,11 @@ QString startKdeSudoProcess(const QString& kdesudoPath, const QString& command, // @todo handle kdesudo output kdesudoProcess.start(KProcess::Block); - return QString(); + return TQString(); } -QString startKdeSuProcess(const QString& kdesuPath, const QString& command, - const QString& dialogCaption) +TQString startKdeSuProcess(const TQString& kdesuPath, const TQString& command, + const TQString& dialogCaption) { KProcess kdesuProcess; @@ -1103,19 +1103,19 @@ QString startKdeSuProcess(const QString& kdesuPath, const QString& command, // @todo handle kdesu output kdesuProcess.start(KProcess::Block); - return QString(); + return TQString(); } -QString startPrivilegedProcess(const QString& command, const QString& dialogCaption, const QString& dialogComment) +TQString startPrivilegedProcess(const TQString& command, const TQString& dialogCaption, const TQString& dialogComment) { - QString error; + TQString error; - QString kdesudoPath = KStandardDirs::findExe("kdesudo"); + TQString kdesudoPath = KStandardDirs::findExe("kdesudo"); if (!kdesudoPath.isEmpty()) error = startKdeSudoProcess(kdesudoPath, command, dialogCaption, dialogComment); else { - QString kdesuPath = KStandardDirs::findExe("kdesu"); + TQString kdesuPath = KStandardDirs::findExe("kdesu"); if (!kdesuPath.isEmpty()) error = startKdeSuProcess(kdesuPath, command, dialogCaption); @@ -1124,28 +1124,28 @@ QString startPrivilegedProcess(const QString& command, const QString& dialogCapt return error; } -QString privilegedMount(const char* udi, const char* mountPoint, const char** options, int numberOfOptions) +TQString privilegedMount(const char* udi, const char* mountPoint, const char** options, int numberOfOptions) { - QString error; + TQString error; kdDebug() << "run privileged mount for " << udi << endl; - QString dbusSendPath = KStandardDirs::findExe("dbus-send"); + TQString dbusSendPath = KStandardDirs::findExe("dbus-send"); // @todo return error message if (dbusSendPath.isEmpty()) - return QString(); + return TQString(); - QString mountOptions; - QTextOStream optionsStream(&mountOptions); + TQString mountOptions; + TQTextOStream optionsStream(&mountOptions); for (int optionIndex = 0; optionIndex < numberOfOptions; optionIndex++) { optionsStream << options[optionIndex]; if (optionIndex < numberOfOptions - 1) optionsStream << ","; } - QString command; - QTextOStream(&command) << dbusSendPath + TQString command; + TQTextOStream(&command) << dbusSendPath << " --system --print-reply --dest=org.freedesktop.Hal " << udi << " org.freedesktop.Hal.Device.Volume.Mount string:" << mountPoint << " string: array:string:" << mountOptions; @@ -1159,20 +1159,20 @@ QString privilegedMount(const char* udi, const char* mountPoint, const char** op return error; } -QString privilegedUnmount(const char* udi) +TQString privilegedUnmount(const char* udi) { - QString error; + TQString error; kdDebug() << "run privileged unmount for " << udi << endl; - QString dbusSendPath = KStandardDirs::findExe("dbus-send"); + TQString dbusSendPath = KStandardDirs::findExe("dbus-send"); // @todo return error message if (dbusSendPath.isEmpty()) - return QString(); + return TQString(); - QString command; - QTextOStream(&command) << dbusSendPath + TQString command; + TQTextOStream(&command) << dbusSendPath << " --system --print-reply --dest=org.freedesktop.Hal " << udi << " org.freedesktop.Hal.Device.Volume.Unmount array:string:force"; @@ -1185,7 +1185,7 @@ QString privilegedUnmount(const char* udi) return error; } -static QString mount_priv(const char *udi, const char *mount_point, const char **poptions, int noptions, +static TQString mount_priv(const char *udi, const char *mount_point, const char **poptions, int noptions, DBusConnection *dbus_connection) { DBusMessage *dmesg, *reply; @@ -1208,12 +1208,12 @@ static QString mount_priv(const char *udi, const char *mount_point, const char * return i18n("Internal Error"); } - QString qerror; + TQString qerror; dbus_error_init (&error); if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, dmesg, -1, &error))) { - QString qerror = error.message; + TQString qerror = error.message; kdError() << "mount failed for " << udi << ": " << error.name << " - " << qerror << endl; if ( !strcmp(error.name, "org.freedesktop.Hal.Device.Volume.UnknownFilesystemType")) qerror = i18n("Invalid filesystem type"); @@ -1242,20 +1242,20 @@ static QString mount_priv(const char *udi, const char *mount_point, const char * } -QString HALBackend::listUsingProcesses(const Medium* medium) +TQString HALBackend::listUsingProcesses(const Medium* medium) { - QString proclist, fullmsg; - QString cmdline = QString("/usr/bin/env fuser -vm %1 2>&1").arg(KProcess::quote(medium->mountPoint())); + TQString proclist, fullmsg; + TQString cmdline = TQString("/usr/bin/env fuser -vm %1 2>&1").arg(KProcess::quote(medium->mountPoint())); FILE *fuser = popen(cmdline.latin1(), "r"); uint counter = 0; if (fuser) { proclist += "<pre>"; - QTextIStream is(fuser); - QString tmp; + TQTextIStream is(fuser); + TQString tmp; while (!is.atEnd()) { tmp = is.readLine(); - tmp = QStyleSheet::escape(tmp) + "\n"; + tmp = TQStyleSheet::escape(tmp) + "\n"; proclist += tmp; if (counter++ > 10) @@ -1275,24 +1275,24 @@ QString HALBackend::listUsingProcesses(const Medium* medium) fullmsg += "<br>" + proclist; return fullmsg; } else { - return QString::null; + return TQString::null; } } -QString HALBackend::killUsingProcesses(const Medium* medium) +TQString HALBackend::killUsingProcesses(const Medium* medium) { - QString proclist, fullmsg; - QString cmdline = QString("/usr/bin/env fuser -vmk %1 2>&1").arg(KProcess::quote(medium->mountPoint())); + TQString proclist, fullmsg; + TQString cmdline = TQString("/usr/bin/env fuser -vmk %1 2>&1").arg(KProcess::quote(medium->mountPoint())); FILE *fuser = popen(cmdline.latin1(), "r"); uint counter = 0; if (fuser) { proclist += "<pre>"; - QTextIStream is(fuser); - QString tmp; + TQTextIStream is(fuser); + TQString tmp; while (!is.atEnd()) { tmp = is.readLine(); - tmp = QStyleSheet::escape(tmp) + "\n"; + tmp = TQStyleSheet::escape(tmp) + "\n"; proclist += tmp; if (counter++ > 10) @@ -1310,7 +1310,7 @@ QString HALBackend::killUsingProcesses(const Medium* medium) fullmsg += "<br>" + proclist; return fullmsg; } else { - return QString::null; + return TQString::null; } } @@ -1319,11 +1319,11 @@ void HALBackend::slotResult(KIO::Job *job) kdDebug() << "slotResult " << mount_jobs[job] << endl; struct mount_job_data *data = mount_jobs[job]; - QString& qerror = data->errorMessage; + TQString& qerror = data->errorMessage; const Medium* medium = data->medium; if (job->error() == KIO::ERR_COULD_NOT_UNMOUNT) { - QString proclist(listUsingProcesses(medium)); + TQString proclist(listUsingProcesses(medium)); qerror = "<qt>"; qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and " @@ -1352,7 +1352,7 @@ void HALBackend::slotResult(KIO::Job *job) kapp->eventLoop()->exitLoop(); } -QString HALBackend::isInFstab(const Medium *medium) +TQString HALBackend::isInFstab(const Medium *medium) { KMountPoint::List fstab = KMountPoint::possibleMountPoints(KMountPoint::NeedMountOptions|KMountPoint::NeedRealDeviceName); @@ -1361,27 +1361,27 @@ QString HALBackend::isInFstab(const Medium *medium) for (; it!=end; ++it) { - QString reald = (*it)->realDeviceName(); + TQString reald = (*it)->realDeviceName(); if ( reald.endsWith( "/" ) ) reald = reald.left( reald.length() - 1 ); kdDebug() << "isInFstab -" << medium->deviceNode() << "- -" << reald << "- -" << (*it)->mountedFrom() << "-" << endl; if ((*it)->mountedFrom() == medium->deviceNode() || ( !medium->deviceNode().isEmpty() && reald == medium->deviceNode() ) ) { - QStringList opts = (*it)->mountOptions(); + TQStringList opts = (*it)->mountOptions(); if (opts.contains("user") || opts.contains("users")) return (*it)->mountPoint(); } } - return QString::null; + return TQString::null; } -QString HALBackend::mount(const Medium *medium) +TQString HALBackend::mount(const Medium *medium) { if (medium->isMounted()) - return QString(); // that was easy + return TQString(); // that was easy - QString mountPoint = isInFstab(medium); + TQString mountPoint = isInFstab(medium); if (!mountPoint.isNull()) { struct mount_job_data data; @@ -1390,8 +1390,8 @@ QString HALBackend::mount(const Medium *medium) kdDebug() << "triggering user mount " << medium->deviceNode() << " " << mountPoint << " " << medium->id() << endl; KIO::Job *job = KIO::mount( false, 0, medium->deviceNode(), mountPoint ); - connect(job, SIGNAL( result (KIO::Job *)), - SLOT( slotResult( KIO::Job *))); + connect(job, TQT_SIGNAL( result (KIO::Job *)), + TQT_SLOT( slotResult( KIO::Job *))); mount_jobs[job] = &data; // The caller expects the device to be mounted when the function // completes. Thus block until the job completes. @@ -1399,22 +1399,22 @@ QString HALBackend::mount(const Medium *medium) kapp->eventLoop()->enterLoop(); } // Return the error message (if any) to the caller - return (data.error) ? data.errorMessage : QString::null; + return (data.error) ? data.errorMessage : TQString::null; } else if (medium->id().startsWith("/org/kde/") ) return i18n("Permissions denied"); - QStringList soptions; + TQStringList soptions; kdDebug() << "mounting " << medium->id() << "..." << endl; - QMap<QString,QString> valids = MediaManagerUtils::splitOptions(mountoptions(medium->id())); + TQMap<TQString,TQString> valids = MediaManagerUtils::splitOptions(mountoptions(medium->id())); if (valids["flush"] == "true") soptions << "flush"; if ((valids["uid"] == "true") && (medium->fsType() != "ntfs")) { - soptions << QString("uid=%1").arg(getuid()); + soptions << TQString("uid=%1").arg(getuid()); } if (valids["ro"] == "true") @@ -1433,44 +1433,44 @@ QString HALBackend::mount(const Medium *medium) soptions << "sync"; if (medium->fsType() == "ntfs") { - QString fsLocale("locale="); + TQString fsLocale("locale="); fsLocale += setlocale(LC_ALL, ""); soptions << fsLocale; } - QString mount_point = valids["mountpoint"]; + TQString mount_point = valids["mountpoint"]; if (mount_point.startsWith("/media/")) mount_point = mount_point.mid(7); if (valids.contains("shortname")) { - soptions << QString("shortname=%1").arg(valids["shortname"]); + soptions << TQString("shortname=%1").arg(valids["shortname"]); } if (valids.contains("locale")) { - soptions << QString("locale=%1").arg(valids["locale"]); + soptions << TQString("locale=%1").arg(valids["locale"]); } if (valids.contains("journaling")) { - QString option = valids["journaling"]; + TQString option = valids["journaling"]; if (option == "data") - soptions << QString("data=journal"); + soptions << TQString("data=journal"); else if (option == "writeback") - soptions << QString("data=writeback"); + soptions << TQString("data=writeback"); else - soptions << QString("data=ordered"); + soptions << TQString("data=ordered"); } const char **options = new const char*[soptions.size() + 1]; uint noptions = 0; - for (QStringList::ConstIterator it = soptions.begin(); it != soptions.end(); ++it, ++noptions) + for (TQStringList::ConstIterator it = soptions.begin(); it != soptions.end(); ++it, ++noptions) options[noptions] = (*it).latin1(); options[noptions] = NULL; - QString qerror = i18n("Cannot mount encrypted drives!"); + TQString qerror = i18n("Cannot mount encrypted drives!"); if (!medium->isEncrypted()) { // normal volume @@ -1496,10 +1496,10 @@ QString HALBackend::mount(const Medium *medium) medium->setHalMounted(true); ResetProperties(medium->id().latin1()); - return QString(); + return TQString(); } -QString HALBackend::mount(const QString &_udi) +TQString HALBackend::mount(const TQString &_udi) { const Medium* medium = m_mediaList.findById(_udi); if (!medium) @@ -1508,7 +1508,7 @@ QString HALBackend::mount(const QString &_udi) return mount(medium); } -QString HALBackend::unmount(const QString &_udi) +TQString HALBackend::unmount(const TQString &_udi) { const Medium* medium = m_mediaList.findById(_udi); if (!medium) @@ -1528,9 +1528,9 @@ QString HALBackend::unmount(const QString &_udi) return i18n("No such medium: %1").arg(_udi); if (!medium->isMounted()) - return QString(); // that was easy + return TQString(); // that was easy - QString mountPoint = isInFstab(medium); + TQString mountPoint = isInFstab(medium); if (!mountPoint.isNull()) { struct mount_job_data data; @@ -1539,8 +1539,8 @@ QString HALBackend::unmount(const QString &_udi) kdDebug() << "triggering user unmount " << medium->deviceNode() << " " << mountPoint << endl; KIO::Job *job = KIO::unmount( medium->mountPoint(), false ); - connect(job, SIGNAL( result (KIO::Job *)), - SLOT( slotResult( KIO::Job *))); + connect(job, TQT_SIGNAL( result (KIO::Job *)), + TQT_SLOT( slotResult( KIO::Job *))); mount_jobs[job] = &data; // The caller expects the device to be unmounted when the function // completes. Thus block until the job completes. @@ -1548,13 +1548,13 @@ QString HALBackend::unmount(const QString &_udi) kapp->eventLoop()->enterLoop(); } // Return the error message (if any) to the caller - return (data.error) ? data.errorMessage : QString::null; + return (data.error) ? data.errorMessage : TQString::null; } DBusMessage *dmesg, *reply; DBusError error; const char *options[2]; - QString udi = QString::null; + TQString udi = TQString::null; if (!medium->isEncrypted()) { // normal volume @@ -1607,7 +1607,7 @@ QString HALBackend::unmount(const QString &_udi) if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, dmesg, -1, &error))) { thisunmounthasfailed = 1; - QString qerror, reason, origqerror; + TQString qerror, reason, origqerror; if (!strcmp(error.name, "org.freedesktop.Hal.Device.PermissionDeniedByPolicy")) { qerror = privilegedUnmount(udi.latin1()); @@ -1615,7 +1615,7 @@ QString HALBackend::unmount(const QString &_udi) if (qerror.isEmpty()) { dbus_message_unref(dmesg); dbus_error_free(&error); - return QString(); + return TQString(); } // @todo handle unmount error message @@ -1675,17 +1675,17 @@ QString HALBackend::unmount(const QString &_udi) while (dbus_connection_dispatch(dbus_connection) == DBUS_DISPATCH_DATA_REMAINS) ; - return QString(); + return TQString(); } -QString HALBackend::decrypt(const QString &_udi, const QString &password) +TQString HALBackend::decrypt(const TQString &_udi, const TQString &password) { const Medium* medium = m_mediaList.findById(_udi); if (!medium) return i18n("No such medium: %1").arg(_udi); if (!medium->isEncrypted() || !medium->clearDeviceUdi().isNull()) - return QString(); + return TQString(); const char *udi = medium->id().latin1(); DBusMessage *msg = NULL; @@ -1702,7 +1702,7 @@ QString HALBackend::decrypt(const QString &_udi, const QString &password) return i18n("Internal Error"); } - QCString pwdUtf8 = password.utf8(); + TQCString pwdUtf8 = password.utf8(); const char *pwd_utf8 = pwdUtf8; if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, &pwd_utf8, DBUS_TYPE_INVALID)) { kdDebug() << "decrypt failed for " << udi << ": could not append args to dbus message\n"; @@ -1714,7 +1714,7 @@ QString HALBackend::decrypt(const QString &_udi, const QString &password) if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, -1, &error)) || dbus_error_is_set (&error)) { - QString qerror = i18n("Internal Error"); + TQString qerror = i18n("Internal Error"); kdDebug() << "decrypt failed for " << udi << ": " << error.name << " " << error.message << endl; if (strcmp (error.name, "org.freedesktop.Hal.Device.Volume.Crypto.SetupPasswordError") == 0) { qerror = i18n("Wrong password"); @@ -1730,17 +1730,17 @@ QString HALBackend::decrypt(const QString &_udi, const QString &password) while (dbus_connection_dispatch(dbus_connection) == DBUS_DISPATCH_DATA_REMAINS) ; - return QString(); + return TQString(); } -QString HALBackend::undecrypt(const QString &_udi) +TQString HALBackend::undecrypt(const TQString &_udi) { const Medium* medium = m_mediaList.findById(_udi); if (!medium) return i18n("No such medium: %1").arg(_udi); if (!medium->isEncrypted() || medium->clearDeviceUdi().isNull()) - return QString(); + return TQString(); const char *udi = medium->id().latin1(); DBusMessage *msg = NULL; @@ -1767,7 +1767,7 @@ QString HALBackend::undecrypt(const QString &_udi) if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, -1, &error)) || dbus_error_is_set (&error)) { - QString qerror = i18n("Internal Error"); + TQString qerror = i18n("Internal Error"); kdDebug() << "teardown failed for " << udi << ": " << error.name << " " << error.message << endl; dbus_error_free (&error); dbus_message_unref (msg); @@ -1782,7 +1782,7 @@ QString HALBackend::undecrypt(const QString &_udi) while (dbus_connection_dispatch(dbus_connection) == DBUS_DISPATCH_DATA_REMAINS) ; - return QString(); + return TQString(); } #include "halbackend.moc" diff --git a/kioslave/media/mediamanager/halbackend.h b/kioslave/media/mediamanager/halbackend.h index c5bdd532c..59c7aa366 100644 --- a/kioslave/media/mediamanager/halbackend.h +++ b/kioslave/media/mediamanager/halbackend.h @@ -31,9 +31,9 @@ #include "backendbase.h" -#include <qobject.h> -#include <qstringlist.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqstring.h> #include <config.h> @@ -49,7 +49,7 @@ namespace KIO { class Job; } -class HALBackend : public QObject, public BackendBase +class HALBackend : public TQObject, public BackendBase { Q_OBJECT @@ -57,7 +57,7 @@ public: /** * Constructor */ - HALBackend(MediaList &list, QObject* parent); + HALBackend(MediaList &list, TQObject* parent); /** * Destructor @@ -78,15 +78,15 @@ public: */ bool ListDevices(); - QStringList mountoptions(const QString &id); + TQStringList mountoptions(const TQString &id); - bool setMountoptions(const QString &id, const QStringList &options); + bool setMountoptions(const TQString &id, const TQStringList &options); - QString mount(const QString &id); - QString mount(const Medium *medium); - QString unmount(const QString &id); - QString decrypt(const QString &id, const QString &password); - QString undecrypt(const QString &id); + TQString mount(const TQString &id); + TQString mount(const Medium *medium); + TQString unmount(const TQString &id); + TQString decrypt(const TQString &id, const TQString &password); + TQString undecrypt(const TQString &id); private: /** @@ -142,10 +142,10 @@ private: void setFloppyMountState( Medium* medium ); bool setFstabProperties(Medium* medium); void setCameraProperties(Medium* medium); - QString generateName(const QString &devNode); - static QString isInFstab(const Medium *medium); - static QString listUsingProcesses(const Medium *medium); - static QString killUsingProcesses(const Medium *medium); + TQString generateName(const TQString &devNode); + static TQString isInFstab(const Medium *medium); + static TQString listUsingProcesses(const Medium *medium); + static TQString killUsingProcesses(const Medium *medium); private slots: void slotResult(KIO::Job *job); @@ -207,7 +207,7 @@ private: /** * Object for the kded module */ - QObject* m_parent; + TQObject* m_parent; DBusConnection *dbus_connection; @@ -222,10 +222,10 @@ private: // [out] KIO::Error if an error occured during operation. Otherwise, 0 int error; // [out] Error message to be displayed to the user - QString errorMessage; + TQString errorMessage; }; - QMap<KIO::Job *, struct mount_job_data*> mount_jobs; + TQMap<KIO::Job *, struct mount_job_data*> mount_jobs; }; #endif /* _HALBACKEND_H_ */ diff --git a/kioslave/media/mediamanager/linuxcdpolling.cpp b/kioslave/media/mediamanager/linuxcdpolling.cpp index 7519023fe..945fd950a 100644 --- a/kioslave/media/mediamanager/linuxcdpolling.cpp +++ b/kioslave/media/mediamanager/linuxcdpolling.cpp @@ -21,9 +21,9 @@ #include "linuxcdpolling.h" -#include <qthread.h> -#include <qmutex.h> -#include <qfile.h> +#include <tqthread.h> +#include <tqmutex.h> +#include <tqfile.h> #include <kdebug.h> @@ -113,7 +113,7 @@ DiscType::operator int() const class PollingThread : public QThread { public: - PollingThread(const QCString &devNode) : m_dev(devNode) + PollingThread(const TQCString &devNode) : m_dev(devNode) { kdDebug(1219) << "PollingThread::PollingThread(" << devNode << ")" << endl; @@ -125,20 +125,20 @@ public: void stop() { - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); m_stop = true; } bool hasChanged() { - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); return m_currentType!=m_lastPollType; } DiscType type() { - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); m_currentType = m_lastPollType; return m_currentType; } @@ -165,36 +165,36 @@ protected: } private: - QMutex m_mutex; + TQMutex m_mutex; bool m_stop; - const QCString m_dev; + const TQCString m_dev; DiscType m_currentType; DiscType m_lastPollType; }; LinuxCDPolling::LinuxCDPolling(MediaList &list) - : QObject(), BackendBase(list) + : TQObject(), BackendBase(list) { - connect(&m_mediaList, SIGNAL(mediumAdded(const QString &, - const QString &, bool)), - this, SLOT(slotMediumAdded(const QString &)) ); + connect(&m_mediaList, TQT_SIGNAL(mediumAdded(const TQString &, + const TQString &, bool)), + this, TQT_SLOT(slotMediumAdded(const TQString &)) ); - connect(&m_mediaList, SIGNAL(mediumRemoved(const QString &, - const QString &, bool)), - this, SLOT(slotMediumRemoved(const QString &)) ); + connect(&m_mediaList, TQT_SIGNAL(mediumRemoved(const TQString &, + const TQString &, bool)), + this, TQT_SLOT(slotMediumRemoved(const TQString &)) ); - connect(&m_mediaList, SIGNAL(mediumStateChanged(const QString &, - const QString &, bool, bool)), - this, SLOT(slotMediumStateChanged(const QString &)) ); + connect(&m_mediaList, TQT_SIGNAL(mediumStateChanged(const TQString &, + const TQString &, bool, bool)), + this, TQT_SLOT(slotMediumStateChanged(const TQString &)) ); - connect(&m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout())); } LinuxCDPolling::~LinuxCDPolling() { - QMap<QString, PollingThread*>::iterator it = m_threads.begin(); - QMap<QString, PollingThread*>::iterator end = m_threads.end(); + TQMap<TQString, PollingThread*>::iterator it = m_threads.begin(); + TQMap<TQString, PollingThread*>::iterator end = m_threads.end(); for(; it!=end; ++it) { @@ -205,7 +205,7 @@ LinuxCDPolling::~LinuxCDPolling() } } -void LinuxCDPolling::slotMediumAdded(const QString &id) +void LinuxCDPolling::slotMediumAdded(const TQString &id) { kdDebug(1219) << "LinuxCDPolling::slotMediumAdded(" << id << ")" << endl; @@ -213,7 +213,7 @@ void LinuxCDPolling::slotMediumAdded(const QString &id) const Medium *medium = m_mediaList.findById(id); - QString mime = medium->mimeType(); + TQString mime = medium->mimeType(); kdDebug(1219) << "mime == " << mime << endl; if (mime.find("dvd")==-1 && mime.find("cd")==-1) return; @@ -222,7 +222,7 @@ void LinuxCDPolling::slotMediumAdded(const QString &id) { m_excludeNotification.append( id ); - QCString dev = QFile::encodeName( medium->deviceNode() ).data(); + TQCString dev = TQFile::encodeName( medium->deviceNode() ).data(); PollingThread *thread = new PollingThread(dev); m_threads[id] = thread; thread->start(); @@ -230,7 +230,7 @@ void LinuxCDPolling::slotMediumAdded(const QString &id) } } -void LinuxCDPolling::slotMediumRemoved(const QString &id) +void LinuxCDPolling::slotMediumRemoved(const TQString &id) { kdDebug(1219) << "LinuxCDPolling::slotMediumRemoved(" << id << ")" << endl; @@ -245,14 +245,14 @@ void LinuxCDPolling::slotMediumRemoved(const QString &id) m_excludeNotification.remove(id); } -void LinuxCDPolling::slotMediumStateChanged(const QString &id) +void LinuxCDPolling::slotMediumStateChanged(const TQString &id) { kdDebug(1219) << "LinuxCDPolling::slotMediumStateChanged(" << id << ")" << endl; const Medium *medium = m_mediaList.findById(id); - QString mime = medium->mimeType(); + TQString mime = medium->mimeType(); kdDebug(1219) << "mime == " << mime << endl; if (mime.find("dvd")==-1 && mime.find("cd")==-1) return; @@ -262,7 +262,7 @@ void LinuxCDPolling::slotMediumStateChanged(const QString &id) // It is just a mount state change, no need to notify m_excludeNotification.append( id ); - QCString dev = QFile::encodeName( medium->deviceNode() ).data(); + TQCString dev = TQFile::encodeName( medium->deviceNode() ).data(); PollingThread *thread = new PollingThread(dev); m_threads[id] = thread; thread->start(); @@ -288,12 +288,12 @@ void LinuxCDPolling::slotTimeout() return; } - QMap<QString, PollingThread*>::iterator it = m_threads.begin(); - QMap<QString, PollingThread*>::iterator end = m_threads.end(); + TQMap<TQString, PollingThread*>::iterator it = m_threads.begin(); + TQMap<TQString, PollingThread*>::iterator end = m_threads.end(); for(; it!=end; ++it) { - QString id = it.key(); + TQString id = it.key(); PollingThread *thread = it.data(); if (thread->hasChanged()) @@ -305,16 +305,16 @@ void LinuxCDPolling::slotTimeout() } } -static QString baseType(const Medium *medium) +static TQString baseType(const Medium *medium) { kdDebug(1219) << "baseType(" << medium->id() << ")" << endl; - QString devNode = medium->deviceNode(); - QString mountPoint = medium->mountPoint(); - QString fsType = medium->fsType(); + TQString devNode = medium->deviceNode(); + TQString mountPoint = medium->mountPoint(); + TQString fsType = medium->fsType(); bool mounted = medium->isMounted(); - QString mimeType, iconName, label; + TQString mimeType, iconName, label; FstabBackend::guess(devNode, mountPoint, fsType, mounted, mimeType, iconName, label); @@ -336,13 +336,13 @@ static void restoreEmptyState(MediaList &list, const Medium *medium, { kdDebug(1219) << "restoreEmptyState(" << medium->id() << ")" << endl; - QString id = medium->id(); - QString devNode = medium->deviceNode(); - QString mountPoint = medium->mountPoint(); - QString fsType = medium->fsType(); + TQString id = medium->id(); + TQString devNode = medium->deviceNode(); + TQString mountPoint = medium->mountPoint(); + TQString fsType = medium->fsType(); bool mounted = medium->isMounted(); - QString mimeType, iconName, label; + TQString mimeType, iconName, label; FstabBackend::guess(devNode, mountPoint, fsType, mounted, mimeType, iconName, label); @@ -357,8 +357,8 @@ void LinuxCDPolling::applyType(DiscType type, const Medium *medium) kdDebug(1219) << "LinuxCDPolling::applyType(" << type << ", " << medium->id() << ")" << endl; - QString id = medium->id(); - QString dev = medium->deviceNode(); + TQString id = medium->id(); + TQString dev = medium->deviceNode(); bool notify = !m_excludeNotification.contains(id); m_excludeNotification.remove(id); @@ -402,7 +402,7 @@ void LinuxCDPolling::applyType(DiscType type, const Medium *medium) } } -DiscType LinuxCDPolling::identifyDiscType(const QCString &devNode, +DiscType LinuxCDPolling::identifyDiscType(const TQCString &devNode, const DiscType ¤t) { //kdDebug(1219) << "LinuxCDPolling::identifyDiscType(" @@ -475,7 +475,7 @@ DiscType LinuxCDPolling::identifyDiscType(const QCString &devNode, } } -bool LinuxCDPolling::hasDirectory(const QCString &devNode, const QCString &dir) +bool LinuxCDPolling::hasDirectory(const TQCString &devNode, const TQCString &dir) { bool ret = false; // return value int fd = 0; // file descriptor for drive @@ -487,7 +487,7 @@ bool LinuxCDPolling::hasDirectory(const QCString &devNode, const QCString &dir) char dirname[256]; // filename for the current path table entry int pos = 0; // our position into the path table int curr_record = 1; // the path table record we're on - QCString fixed_directory = dir.upper(); // the uppercase version of the "directory" parameter + TQCString fixed_directory = dir.upper(); // the uppercase version of the "directory" parameter // open the drive fd = open(devNode, O_RDONLY | O_NONBLOCK); @@ -555,7 +555,7 @@ bool LinuxCDPolling::hasDirectory(const QCString &devNode, const QCString &dir) break; } dirname[len_di] = 0; - qstrcpy(dirname, QCString(dirname).upper()); + qstrcpy(dirname, TQCString(dirname).upper()); // if we found a folder that has the root as a parent, and the directory name matches // then return success diff --git a/kioslave/media/mediamanager/linuxcdpolling.h b/kioslave/media/mediamanager/linuxcdpolling.h index 1df113962..3dec7e3ee 100644 --- a/kioslave/media/mediamanager/linuxcdpolling.h +++ b/kioslave/media/mediamanager/linuxcdpolling.h @@ -21,10 +21,10 @@ #include "backendbase.h" -#include <qobject.h> -#include <qcstring.h> -#include <qmap.h> -#include <qtimer.h> +#include <tqobject.h> +#include <tqcstring.h> +#include <tqmap.h> +#include <tqtimer.h> class DiscType { @@ -47,7 +47,7 @@ private: class PollingThread; -class LinuxCDPolling : public QObject, public BackendBase +class LinuxCDPolling : public TQObject, public BackendBase { Q_OBJECT @@ -64,23 +64,23 @@ public: * @param current the current known state of the drive * @return the disc type */ - static DiscType identifyDiscType(const QCString &devNode, + static DiscType identifyDiscType(const TQCString &devNode, const DiscType ¤t = DiscType::Unknown); private slots: - void slotMediumAdded(const QString &id); - void slotMediumRemoved(const QString &id); - void slotMediumStateChanged(const QString &id); + void slotMediumAdded(const TQString &id); + void slotMediumRemoved(const TQString &id); + void slotMediumStateChanged(const TQString &id); void slotTimeout(); private: void applyType(DiscType type, const Medium *medium); - static bool hasDirectory(const QCString &devNode, const QCString &dir); + static bool hasDirectory(const TQCString &devNode, const TQCString &dir); - QMap<QString, PollingThread*> m_threads; - QStringList m_excludeNotification; - QTimer m_timer; + TQMap<TQString, PollingThread*> m_threads; + TQStringList m_excludeNotification; + TQTimer m_timer; }; #endif diff --git a/kioslave/media/mediamanager/mediadirnotify.cpp b/kioslave/media/mediamanager/mediadirnotify.cpp index 340414634..9e6658153 100644 --- a/kioslave/media/mediamanager/mediadirnotify.cpp +++ b/kioslave/media/mediamanager/mediadirnotify.cpp @@ -36,10 +36,10 @@ KURL::List MediaDirNotify::toMediaURL(const KURL &url) KURL::List result; - const QPtrList<Medium> list = m_mediaList.list(); + const TQPtrList<Medium> list = m_mediaList.list(); - QPtrList<Medium>::const_iterator it = list.begin(); - QPtrList<Medium>::const_iterator end = list.end(); + TQPtrList<Medium>::const_iterator it = list.begin(); + TQPtrList<Medium>::const_iterator end = list.end(); for (; it!=end; ++it) { @@ -48,7 +48,7 @@ KURL::List MediaDirNotify::toMediaURL(const KURL &url) if ( base.isParentOf(url) ) { - QString path = KURL::relativePath(base.path(), + TQString path = KURL::relativePath(base.path(), url.path()); KURL new_url("media:/"+m->name()+"/"+path ); diff --git a/kioslave/media/mediamanager/medialist.cpp b/kioslave/media/mediamanager/medialist.cpp index 974eddbf6..bb0de6248 100644 --- a/kioslave/media/mediamanager/medialist.cpp +++ b/kioslave/media/mediamanager/medialist.cpp @@ -27,14 +27,14 @@ MediaList::MediaList() m_media.setAutoDelete(true); } -const QPtrList<Medium> MediaList::list() const +const TQPtrList<Medium> MediaList::list() const { kdDebug(1219) << "MediaList::list()" << endl; return m_media; } -const Medium *MediaList::findById(const QString &id) const +const Medium *MediaList::findById(const TQString &id) const { kdDebug(1219) << "MediaList::findById(" << id << ")" << endl; @@ -43,7 +43,7 @@ const Medium *MediaList::findById(const QString &id) const return m_idMap[id]; } -const Medium *MediaList::findByName(const QString &name) const +const Medium *MediaList::findByName(const TQString &name) const { kdDebug(1219) << "MediaList::findByName(" << name << ")" << endl; @@ -52,7 +52,7 @@ const Medium *MediaList::findByName(const QString &name) const return m_nameMap[name]; } -const Medium *MediaList::findByClearUdi(const QString &name) +const Medium *MediaList::findByClearUdi(const TQString &name) { kdDebug(1219) << "MediaList::findByClearUdi(" << name << ")" << endl; @@ -65,17 +65,17 @@ const Medium *MediaList::findByClearUdi(const QString &name) } -QString MediaList::addMedium(Medium *medium, bool allowNotification) +TQString MediaList::addMedium(Medium *medium, bool allowNotification) { kdDebug(1219) << "MediaList::addMedium(@" << medium->id() << ")" << endl; - QString id = medium->id(); - if ( m_idMap.contains(id) ) return QString::null; + TQString id = medium->id(); + if ( m_idMap.contains(id) ) return TQString::null; m_media.append( medium ); m_idMap[id] = medium; - QString name = medium->name(); + TQString name = medium->name(); if ( !m_nameMap.contains(name) ) { m_nameMap[name] = medium; @@ -87,15 +87,15 @@ QString MediaList::addMedium(Medium *medium, bool allowNotification) return name; } - QString base_name = name+"_"; + TQString base_name = name+"_"; int i = 1; - while ( m_nameMap.contains(base_name+QString::number(i)) ) + while ( m_nameMap.contains(base_name+TQString::number(i)) ) { i++; } - name = base_name+QString::number(i); + name = base_name+TQString::number(i); medium->setName(name); m_nameMap[name] = medium; @@ -105,14 +105,14 @@ QString MediaList::addMedium(Medium *medium, bool allowNotification) return name; } -bool MediaList::removeMedium(const QString &id, bool allowNotification) +bool MediaList::removeMedium(const TQString &id, bool allowNotification) { kdDebug(1219) << "MediaList::removeMedium(" << id << ")" << endl; if ( !m_idMap.contains(id) ) return false; Medium *medium = m_idMap[id]; - QString name = medium->name(); + TQString name = medium->name(); m_idMap.remove(id); m_nameMap.remove( medium->name() ); @@ -132,10 +132,10 @@ bool MediaList::changeMediumState(const Medium &medium, bool allowNotification) if ( medium.isMountable() ) { - QString device_node = medium.deviceNode(); - QString clear_device_udi = medium.clearDeviceUdi(); - QString mount_point = medium.mountPoint(); - QString fs_type = medium.fsType(); + TQString device_node = medium.deviceNode(); + TQString clear_device_udi = medium.clearDeviceUdi(); + TQString mount_point = medium.mountPoint(); + TQString fs_type = medium.fsType(); bool mounted = medium.isMounted(); m->mountableState( device_node, clear_device_udi, mount_point, @@ -166,12 +166,12 @@ bool MediaList::changeMediumState(const Medium &medium, bool allowNotification) return true; } -bool MediaList::changeMediumState(const QString &id, - const QString &baseURL, +bool MediaList::changeMediumState(const TQString &id, + const TQString &baseURL, bool allowNotification, - const QString &mimeType, - const QString &iconName, - const QString &label) + const TQString &mimeType, + const TQString &iconName, + const TQString &label) { kdDebug(1219) << "MediaList::changeMediumState(" << id << ", " << baseURL << ", " << mimeType << ", " << iconName << ")" @@ -204,14 +204,14 @@ bool MediaList::changeMediumState(const QString &id, return true; } -bool MediaList::changeMediumState(const QString &id, - const QString &deviceNode, - const QString &mountPoint, - const QString &fsType, bool mounted, +bool MediaList::changeMediumState(const TQString &id, + const TQString &deviceNode, + const TQString &mountPoint, + const TQString &fsType, bool mounted, bool allowNotification, - const QString &mimeType, - const QString &iconName, - const QString &label) + const TQString &mimeType, + const TQString &iconName, + const TQString &label) { kdDebug(1219) << "MediaList::changeMediumState(" << id << ", " << deviceNode << ", " << mountPoint << ", " << fsType << ", " @@ -245,11 +245,11 @@ bool MediaList::changeMediumState(const QString &id, return true; } -bool MediaList::changeMediumState(const QString &id, bool mounted, +bool MediaList::changeMediumState(const TQString &id, bool mounted, bool allowNotification, - const QString &mimeType, - const QString &iconName, - const QString &label) + const TQString &mimeType, + const TQString &iconName, + const TQString &label) { kdDebug(1219) << "MediaList::changeMediumState(" << id << ", " << mounted << ", " << mimeType << ", " << iconName << ")" @@ -282,7 +282,7 @@ bool MediaList::changeMediumState(const QString &id, bool mounted, return true; } -bool MediaList::setUserLabel(const QString &name, const QString &label) +bool MediaList::setUserLabel(const TQString &name, const TQString &label) { kdDebug(1219) << "MediaList::setUserLabel(" << name << ", " << label << ")" << endl; diff --git a/kioslave/media/mediamanager/medialist.h b/kioslave/media/mediamanager/medialist.h index 4de333875..59ddb6bd2 100644 --- a/kioslave/media/mediamanager/medialist.h +++ b/kioslave/media/mediamanager/medialist.h @@ -19,7 +19,7 @@ #ifndef _MEDIALIST_H_ #define _MEDIALIST_H_ -#include <qobject.h> +#include <tqobject.h> #include "medium.h" @@ -31,50 +31,50 @@ public: MediaList(); // FIXME: should be <const Medium> or something similar... - const QPtrList<Medium> list() const; - const Medium *findById(const QString &id) const; - const Medium *findByName(const QString &name) const; - const Medium *findByClearUdi(const QString &name); + const TQPtrList<Medium> list() const; + const Medium *findById(const TQString &id) const; + const Medium *findByName(const TQString &name) const; + const Medium *findByClearUdi(const TQString &name); public: - QString addMedium(Medium *medium, bool allowNotification = true); - bool removeMedium(const QString &id, bool allowNotification = true); + TQString addMedium(Medium *medium, bool allowNotification = true); + bool removeMedium(const TQString &id, bool allowNotification = true); bool changeMediumState(const Medium &medium, bool allowNotification); - bool changeMediumState(const QString &id, - const QString &baseURL, + bool changeMediumState(const TQString &id, + const TQString &baseURL, bool allowNotification = true, - const QString &mimeType = QString::null, - const QString &iconName = QString::null, - const QString &label = QString::null); - bool changeMediumState(const QString &id, - const QString &deviceNode, - const QString &mountPoint, - const QString &fsType, bool mounted, + const TQString &mimeType = TQString::null, + const TQString &iconName = TQString::null, + const TQString &label = TQString::null); + bool changeMediumState(const TQString &id, + const TQString &deviceNode, + const TQString &mountPoint, + const TQString &fsType, bool mounted, bool allowNotification = true, - const QString &mimeType = QString::null, - const QString &iconName = QString::null, - const QString &label = QString::null); - bool changeMediumState(const QString &id, bool mounted, + const TQString &mimeType = TQString::null, + const TQString &iconName = TQString::null, + const TQString &label = TQString::null); + bool changeMediumState(const TQString &id, bool mounted, bool allowNotification = true, - const QString &mimeType = QString::null, - const QString &iconName = QString::null, - const QString &label = QString::null); + const TQString &mimeType = TQString::null, + const TQString &iconName = TQString::null, + const TQString &label = TQString::null); - bool setUserLabel(const QString &name, const QString &label); + bool setUserLabel(const TQString &name, const TQString &label); signals: - void mediumAdded(const QString &id, const QString &name, + void mediumAdded(const TQString &id, const TQString &name, bool allowNotification); - void mediumRemoved(const QString &id, const QString &name, + void mediumRemoved(const TQString &id, const TQString &name, bool allowNotification); - void mediumStateChanged(const QString &id, const QString &name, + void mediumStateChanged(const TQString &id, const TQString &name, bool mounted, bool allowNotification); private: - QPtrList<Medium> m_media; - QMap<QString,Medium*> m_nameMap; - QMap<QString,Medium*> m_idMap; + TQPtrList<Medium> m_media; + TQMap<TQString,Medium*> m_nameMap; + TQMap<TQString,Medium*> m_idMap; }; #endif diff --git a/kioslave/media/mediamanager/mediamanager.cpp b/kioslave/media/mediamanager/mediamanager.cpp index f1569e817..5d8eb4143 100644 --- a/kioslave/media/mediamanager/mediamanager.cpp +++ b/kioslave/media/mediamanager/mediamanager.cpp @@ -19,7 +19,7 @@ #include "mediamanager.h" #include <config.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kdebug.h> #include <kglobal.h> @@ -41,18 +41,18 @@ #endif //COMPILE_LINUXCDPOLLING -MediaManager::MediaManager(const QCString &obj) +MediaManager::MediaManager(const TQCString &obj) : KDEDModule(obj), m_dirNotify(m_mediaList) { - connect( &m_mediaList, SIGNAL(mediumAdded(const QString&, const QString&, bool)), - SLOT(slotMediumAdded(const QString&, const QString&, bool)) ); - connect( &m_mediaList, SIGNAL(mediumRemoved(const QString&, const QString&, bool)), - SLOT(slotMediumRemoved(const QString&, const QString&, bool)) ); + connect( &m_mediaList, TQT_SIGNAL(mediumAdded(const TQString&, const TQString&, bool)), + TQT_SLOT(slotMediumAdded(const TQString&, const TQString&, bool)) ); + connect( &m_mediaList, TQT_SIGNAL(mediumRemoved(const TQString&, const TQString&, bool)), + TQT_SLOT(slotMediumRemoved(const TQString&, const TQString&, bool)) ); connect( &m_mediaList, - SIGNAL(mediumStateChanged(const QString&, const QString&, bool, bool)), - SLOT(slotMediumChanged(const QString&, const QString&, bool, bool)) ); + TQT_SIGNAL(mediumStateChanged(const TQString&, const TQString&, bool, bool)), + TQT_SLOT(slotMediumChanged(const TQString&, const TQString&, bool, bool)) ); - QTimer::singleShot( 10, this, SLOT( loadBackends() ) ); + TQTimer::singleShot( 10, this, TQT_SLOT( loadBackends() ) ); } MediaManager::~MediaManager() @@ -117,14 +117,14 @@ void MediaManager::loadBackends() } -QStringList MediaManager::fullList() +TQStringList MediaManager::fullList() { - QPtrList<Medium> list = m_mediaList.list(); + TQPtrList<Medium> list = m_mediaList.list(); - QStringList result; + TQStringList result; - QPtrList<Medium>::const_iterator it = list.begin(); - QPtrList<Medium>::const_iterator end = list.end(); + TQPtrList<Medium>::const_iterator it = list.begin(); + TQPtrList<Medium>::const_iterator end = list.end(); for (; it!=end; ++it) { result+= (*it)->properties(); @@ -134,7 +134,7 @@ QStringList MediaManager::fullList() return result; } -QStringList MediaManager::properties(const QString &name) +TQStringList MediaManager::properties(const TQString &name) { const Medium *m = m_mediaList.findByName(name); @@ -146,7 +146,7 @@ QStringList MediaManager::properties(const QString &name) { if (u.protocol() == "system") { - QString path = u.path(); + TQString path = u.path(); if (path.startsWith("/media/")) path = path.mid(strlen("/media/")); m = m_mediaList.findByName(path); @@ -160,10 +160,10 @@ QStringList MediaManager::properties(const QString &name) else if (u.protocol() == "file") { // look for the mount point - QPtrList<Medium> list = m_mediaList.list(); - QPtrList<Medium>::const_iterator it = list.begin(); - QPtrList<Medium>::const_iterator end = list.end(); - QString path; + TQPtrList<Medium> list = m_mediaList.list(); + TQPtrList<Medium>::const_iterator it = list.begin(); + TQPtrList<Medium>::const_iterator end = list.end(); + TQString path; for (; it!=end; ++it) { @@ -181,21 +181,21 @@ QStringList MediaManager::properties(const QString &name) if (m) return m->properties(); else - return QStringList(); + return TQStringList(); } -QStringList MediaManager::mountoptions(const QString &name) +TQStringList MediaManager::mountoptions(const TQString &name) { #ifdef COMPILE_HALBACKEND if (!m_halbackend) - return QStringList(); + return TQStringList(); return m_halbackend->mountoptions(name); #else - return QStringList(); + return TQStringList(); #endif } -bool MediaManager::setMountoptions(const QString &name, const QStringList &options) +bool MediaManager::setMountoptions(const TQString &name, const TQStringList &options) { #ifdef COMPILE_HALBACKEND if (!m_halbackend) @@ -206,7 +206,7 @@ bool MediaManager::setMountoptions(const QString &name, const QStringList &optio #endif } -QString MediaManager::mount(const QString &name) +TQString MediaManager::mount(const TQString &name) { #ifdef COMPILE_HALBACKEND if (!m_halbackend) @@ -219,7 +219,7 @@ QString MediaManager::mount(const QString &name) #endif } -QString MediaManager::unmount(const QString &name) +TQString MediaManager::unmount(const TQString &name) { #ifdef COMPILE_HALBACKEND if (!m_halbackend) @@ -232,7 +232,7 @@ QString MediaManager::unmount(const QString &name) #endif } -QString MediaManager::decrypt(const QString &name, const QString &password) +TQString MediaManager::decrypt(const TQString &name, const TQString &password) { #ifdef COMPILE_HALBACKEND if (!m_halbackend) @@ -243,7 +243,7 @@ QString MediaManager::decrypt(const QString &name, const QString &password) #endif } -QString MediaManager::undecrypt(const QString &name) +TQString MediaManager::undecrypt(const TQString &name) { #ifdef COMPILE_HALBACKEND if (!m_halbackend) @@ -254,12 +254,12 @@ QString MediaManager::undecrypt(const QString &name) #endif } -QString MediaManager::nameForLabel(const QString &label) +TQString MediaManager::nameForLabel(const TQString &label) { - const QPtrList<Medium> media = m_mediaList.list(); + const TQPtrList<Medium> media = m_mediaList.list(); - QPtrList<Medium>::const_iterator it = media.begin(); - QPtrList<Medium>::const_iterator end = media.end(); + TQPtrList<Medium>::const_iterator it = media.begin(); + TQPtrList<Medium>::const_iterator end = media.end(); for (; it!=end; ++it) { const Medium *m = *it; @@ -270,10 +270,10 @@ QString MediaManager::nameForLabel(const QString &label) } } - return QString::null; + return TQString::null; } -ASYNC MediaManager::setUserLabel(const QString &name, const QString &label) +ASYNC MediaManager::setUserLabel(const TQString &name, const TQString &label) { m_mediaList.setUserLabel(name, label); } @@ -284,7 +284,7 @@ ASYNC MediaManager::reloadBackends() loadBackends(); } -bool MediaManager::removablePlug(const QString &devNode, const QString &label) +bool MediaManager::removablePlug(const TQString &devNode, const TQString &label) { if (mp_removableBackend) { @@ -293,7 +293,7 @@ bool MediaManager::removablePlug(const QString &devNode, const QString &label) return false; } -bool MediaManager::removableUnplug(const QString &devNode) +bool MediaManager::removableUnplug(const TQString &devNode) { if (mp_removableBackend) { @@ -302,7 +302,7 @@ bool MediaManager::removableUnplug(const QString &devNode) return false; } -bool MediaManager::removableCamera(const QString &devNode) +bool MediaManager::removableCamera(const TQString &devNode) { if (mp_removableBackend) { @@ -312,7 +312,7 @@ bool MediaManager::removableCamera(const QString &devNode) } -void MediaManager::slotMediumAdded(const QString &/*id*/, const QString &name, +void MediaManager::slotMediumAdded(const TQString &/*id*/, const TQString &name, bool allowNotification) { kdDebug(1219) << "MediaManager::slotMediumAdded: " << name << endl; @@ -324,7 +324,7 @@ void MediaManager::slotMediumAdded(const QString &/*id*/, const QString &name, emit mediumAdded(name); } -void MediaManager::slotMediumRemoved(const QString &/*id*/, const QString &name, +void MediaManager::slotMediumRemoved(const TQString &/*id*/, const TQString &name, bool allowNotification) { kdDebug(1219) << "MediaManager::slotMediumRemoved: " << name << endl; @@ -336,7 +336,7 @@ void MediaManager::slotMediumRemoved(const QString &/*id*/, const QString &name, emit mediumRemoved(name); } -void MediaManager::slotMediumChanged(const QString &/*id*/, const QString &name, +void MediaManager::slotMediumChanged(const TQString &/*id*/, const TQString &name, bool mounted, bool allowNotification) { kdDebug(1219) << "MediaManager::slotMediumChanged: " << name << endl; @@ -354,7 +354,7 @@ void MediaManager::slotMediumChanged(const QString &/*id*/, const QString &name, extern "C" { - KDE_EXPORT KDEDModule *create_mediamanager(const QCString &obj) + KDE_EXPORT KDEDModule *create_mediamanager(const TQCString &obj) { KGlobal::locale()->insertCatalogue("kio_media"); return new MediaManager(obj); diff --git a/kioslave/media/mediamanager/mediamanager.h b/kioslave/media/mediamanager/mediamanager.h index 36942362d..2cc46f8cf 100644 --- a/kioslave/media/mediamanager/mediamanager.h +++ b/kioslave/media/mediamanager/mediamanager.h @@ -20,8 +20,8 @@ #define _MEDIAMANAGER_H_ #include <kdedmodule.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include "medialist.h" #include "backendbase.h" @@ -36,53 +36,53 @@ class MediaManager : public KDEDModule Q_OBJECT K_DCOP public: - MediaManager(const QCString &obj); + MediaManager(const TQCString &obj); ~MediaManager(); k_dcop: - QStringList fullList(); - QStringList properties(const QString &name); - QStringList mountoptions(const QString &name); - bool setMountoptions(const QString &name, const QStringList &options); + TQStringList fullList(); + TQStringList properties(const TQString &name); + TQStringList mountoptions(const TQString &name); + bool setMountoptions(const TQString &name, const TQStringList &options); - QString mount(const QString &uid); - QString unmount(const QString &uid); - QString decrypt(const QString &uid, const QString &password); - QString undecrypt(const QString &uid); + TQString mount(const TQString &uid); + TQString unmount(const TQString &uid); + TQString decrypt(const TQString &uid, const TQString &password); + TQString undecrypt(const TQString &uid); - QString nameForLabel(const QString &label); - ASYNC setUserLabel(const QString &name, const QString &label); + TQString nameForLabel(const TQString &label); + ASYNC setUserLabel(const TQString &name, const TQString &label); ASYNC reloadBackends(); // Removable media handling (for people not having HAL) - bool removablePlug(const QString &devNode, const QString &label); - bool removableUnplug(const QString &devNode); - bool removableCamera(const QString &devNode); + bool removablePlug(const TQString &devNode, const TQString &label); + bool removableUnplug(const TQString &devNode); + bool removableCamera(const TQString &devNode); k_dcop_signals: - void mediumAdded(const QString &name, bool allowNotification); - void mediumRemoved(const QString &name, bool allowNotification); - void mediumChanged(const QString &name, bool allowNotification); + void mediumAdded(const TQString &name, bool allowNotification); + void mediumRemoved(const TQString &name, bool allowNotification); + void mediumChanged(const TQString &name, bool allowNotification); // For compatibility purpose, not needed for KDE4 - void mediumAdded(const QString &name); - void mediumRemoved(const QString &name); - void mediumChanged(const QString &name); + void mediumAdded(const TQString &name); + void mediumRemoved(const TQString &name); + void mediumChanged(const TQString &name); private slots: void loadBackends(); - void slotMediumAdded(const QString &id, const QString &name, + void slotMediumAdded(const TQString &id, const TQString &name, bool allowNotification); - void slotMediumRemoved(const QString &id, const QString &name, + void slotMediumRemoved(const TQString &id, const TQString &name, bool allowNotification); - void slotMediumChanged(const QString &id, const QString &name, + void slotMediumChanged(const TQString &id, const TQString &name, bool mounted, bool allowNotification); private: MediaList m_mediaList; - QValueList<BackendBase*> m_backends; + TQValueList<BackendBase*> m_backends; RemovableBackend *mp_removableBackend; HALBackend *m_halbackend; MediaDirNotify m_dirNotify; diff --git a/kioslave/media/mediamanager/removablebackend.cpp b/kioslave/media/mediamanager/removablebackend.cpp index ea8318ecf..f307ee2f8 100644 --- a/kioslave/media/mediamanager/removablebackend.cpp +++ b/kioslave/media/mediamanager/removablebackend.cpp @@ -33,19 +33,19 @@ RemovableBackend::RemovableBackend(MediaList &list) - : QObject(), BackendBase(list) + : TQObject(), BackendBase(list) { KDirWatch::self()->addFile(MTAB); - connect( KDirWatch::self(), SIGNAL( dirty(const QString&) ), - this, SLOT( slotDirty(const QString&) ) ); + connect( KDirWatch::self(), TQT_SIGNAL( dirty(const TQString&) ), + this, TQT_SLOT( slotDirty(const TQString&) ) ); KDirWatch::self()->startScan(); } RemovableBackend::~RemovableBackend() { - QStringList::iterator it = m_removableIds.begin(); - QStringList::iterator end = m_removableIds.end(); + TQStringList::iterator it = m_removableIds.begin(); + TQStringList::iterator end = m_removableIds.end(); for (; it!=end; ++it) { @@ -55,25 +55,25 @@ RemovableBackend::~RemovableBackend() KDirWatch::self()->removeFile(MTAB); } -bool RemovableBackend::plug(const QString &devNode, const QString &label) +bool RemovableBackend::plug(const TQString &devNode, const TQString &label) { - QString name = generateName(devNode); - QString id = generateId(devNode); + TQString name = generateName(devNode); + TQString id = generateId(devNode); if (!m_removableIds.contains(id)) { Medium *medium = new Medium(id, name); - medium->mountableState(devNode, QString::null, - QString::null, false); + medium->mountableState(devNode, TQString::null, + TQString::null, false); - QStringList words = QStringList::split(" ", label); + TQStringList words = TQStringList::split(" ", label); - QStringList::iterator it = words.begin(); - QStringList::iterator end = words.end(); + TQStringList::iterator it = words.begin(); + TQStringList::iterator end = words.end(); - QString tmp = (*it).lower(); + TQString tmp = (*it).lower(); tmp[0] = tmp[0].upper(); - QString new_label = tmp; + TQString new_label = tmp; ++it; for (; it!=end; ++it) @@ -92,9 +92,9 @@ bool RemovableBackend::plug(const QString &devNode, const QString &label) return false; } -bool RemovableBackend::unplug(const QString &devNode) +bool RemovableBackend::unplug(const TQString &devNode) { - QString id = generateId(devNode); + TQString id = generateId(devNode); if (m_removableIds.contains(id)) { m_removableIds.remove(id); @@ -103,18 +103,18 @@ bool RemovableBackend::unplug(const QString &devNode) return false; } -bool RemovableBackend::camera(const QString &devNode) +bool RemovableBackend::camera(const TQString &devNode) { - QString id = generateId(devNode); + TQString id = generateId(devNode); if (m_removableIds.contains(id)) { return m_mediaList.changeMediumState(id, - QString("camera:/"), false, "media/gphoto2camera"); + TQString("camera:/"), false, "media/gphoto2camera"); } return false; } -void RemovableBackend::slotDirty(const QString &path) +void RemovableBackend::slotDirty(const TQString &path) { if (path==MTAB) { @@ -125,7 +125,7 @@ void RemovableBackend::slotDirty(const QString &path) void RemovableBackend::handleMtabChange() { - QStringList new_mtabIds; + TQStringList new_mtabIds; KMountPoint::List mtab = KMountPoint::currentMountPoints(); KMountPoint::List::iterator it = mtab.begin(); @@ -133,11 +133,11 @@ void RemovableBackend::handleMtabChange() for (; it!=end; ++it) { - QString dev = (*it)->mountedFrom(); - QString mp = (*it)->mountPoint(); - QString fs = (*it)->mountType(); + TQString dev = (*it)->mountedFrom(); + TQString mp = (*it)->mountPoint(); + TQString fs = (*it)->mountType(); - QString id = generateId(dev); + TQString id = generateId(dev); new_mtabIds+=id; if ( !m_mtabIds.contains(id) @@ -148,8 +148,8 @@ void RemovableBackend::handleMtabChange() } } - QStringList::iterator it2 = m_mtabIds.begin(); - QStringList::iterator end2 = m_mtabIds.end(); + TQStringList::iterator it2 = m_mtabIds.begin(); + TQStringList::iterator end2 = m_mtabIds.end(); for (; it2!=end2; ++it2) { @@ -164,15 +164,15 @@ void RemovableBackend::handleMtabChange() m_mtabIds = new_mtabIds; } -QString RemovableBackend::generateId(const QString &devNode) +TQString RemovableBackend::generateId(const TQString &devNode) { - QString dev = KStandardDirs::realFilePath(devNode); + TQString dev = KStandardDirs::realFilePath(devNode); return "/org/kde/mediamanager/removable/" +dev.replace("/", ""); } -QString RemovableBackend::generateName(const QString &devNode) +TQString RemovableBackend::generateName(const TQString &devNode) { return KURL(devNode).fileName(); } diff --git a/kioslave/media/mediamanager/removablebackend.h b/kioslave/media/mediamanager/removablebackend.h index 02fc0409e..fa16a391b 100644 --- a/kioslave/media/mediamanager/removablebackend.h +++ b/kioslave/media/mediamanager/removablebackend.h @@ -21,10 +21,10 @@ #include "backendbase.h" -#include <qobject.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqstringlist.h> -class RemovableBackend : public QObject, public BackendBase +class RemovableBackend : public TQObject, public BackendBase { Q_OBJECT @@ -32,21 +32,21 @@ public: RemovableBackend(MediaList &list); virtual ~RemovableBackend(); - bool plug(const QString &devNode, const QString &label); - bool unplug(const QString &devNode); - bool camera(const QString &devNode); + bool plug(const TQString &devNode, const TQString &label); + bool unplug(const TQString &devNode); + bool camera(const TQString &devNode); private slots: - void slotDirty(const QString &path); + void slotDirty(const TQString &path); private: void handleMtabChange(); - static QString generateId(const QString &devNode); - static QString generateName(const QString &devNode); + static TQString generateId(const TQString &devNode); + static TQString generateName(const TQString &devNode); - QStringList m_removableIds; - QStringList m_mtabIds; + TQStringList m_removableIds; + TQStringList m_mtabIds; }; #endif |