From aaaf378033f889408155a902349c676429b85254 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 1 Jun 2019 18:44:56 +0900 Subject: [PATCH] Adjusted to use new TQStringVariantMap type. Signed-off-by: Michele Calgaro --- tdecore/kdcoppropertyproxy.cpp | 2 +- tdecore/tdehw/disksHelper.cpp | 25 ++++++++++++------------- tdecore/tdehw/disksHelper.h | 12 ++++++------ tdecore/tdehw/tdestoragedevice.cpp | 21 ++++++++++----------- tdecore/tdehw/tdestoragedevice.h | 15 +++++++-------- tdeio/tdeio/kservice.cpp | 10 +++++----- tdeio/tdeio/kservice.h | 2 +- tdeio/tdeio/kservicetype.cpp | 7 ++----- tdeio/tdeio/kservicetype.h | 2 +- tdeprint/foomatic2loader.cpp | 10 +++++----- tdeprint/foomatic2loader.h | 10 +++++----- tdeprint/fooparser.cpp | 2 +- tdeprint/fooparser.y | 2 +- tdeprint/lpr/matichandler.cpp | 2 +- tdeprint/ppdloader.cpp | 4 ++-- 15 files changed, 60 insertions(+), 66 deletions(-) diff --git a/tdecore/kdcoppropertyproxy.cpp b/tdecore/kdcoppropertyproxy.cpp index 663644b50..714e445bc 100644 --- a/tdecore/kdcoppropertyproxy.cpp +++ b/tdecore/kdcoppropertyproxy.cpp @@ -194,7 +194,7 @@ bool KDCOPPropertyProxy::processPropertyRequest( const TQCString &fun, const TQB break; typedef TQValueList ListType; - typedef TQMap MapType; + typedef TQStringVariantMap MapType; switch ( type ) { diff --git a/tdecore/tdehw/disksHelper.cpp b/tdecore/tdehw/disksHelper.cpp index 37efa25ac..0eab2d28c 100644 --- a/tdecore/tdehw/disksHelper.cpp +++ b/tdecore/tdehw/disksHelper.cpp @@ -20,7 +20,6 @@ #include "disksHelper.h" #include "tdelocale.h" #include "tdestoragedevice.h" -#include #include #include #include @@ -34,8 +33,8 @@ //------------------------------- // UDisks //------------------------------- -TDEStorageOpResult UDisksEjectDrive(TDEStorageDevice *sdevice) { - TDEStorageOpResult result; +TQStringVariantMap UDisksEjectDrive(TDEStorageDevice *sdevice) { + TQStringVariantMap result; result["result"] = false; TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); @@ -67,8 +66,8 @@ TDEStorageOpResult UDisksEjectDrive(TDEStorageDevice *sdevice) { return result; } -TDEStorageOpResult UDisksMountDrive(TQString deviceNode, TQString fileSystemType, TQStringList mountOptions) { - TDEStorageOpResult result; +TQStringVariantMap UDisksMountDrive(TQString deviceNode, TQString fileSystemType, TQStringList mountOptions) { + TQStringVariantMap result; result["result"] = false; result["retcode"] = -2; @@ -109,8 +108,8 @@ TDEStorageOpResult UDisksMountDrive(TQString deviceNode, TQString fileSystemType return result; } -TDEStorageOpResult UDisksUnmountDrive(TQString deviceNode, TQStringList unmountOptions) { - TDEStorageOpResult result; +TQStringVariantMap UDisksUnmountDrive(TQString deviceNode, TQStringList unmountOptions) { + TQStringVariantMap result; result["result"] = false; result["retcode"] = -2; @@ -153,8 +152,8 @@ TDEStorageOpResult UDisksUnmountDrive(TQString deviceNode, TQStringList unmountO //------------------------------- // UDisks2 //------------------------------- -TDEStorageOpResult UDisks2EjectDrive(TDEStorageDevice *sdevice) { - TDEStorageOpResult result; +TQStringVariantMap UDisks2EjectDrive(TDEStorageDevice *sdevice) { + TQStringVariantMap result; result["result"] = false; TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); @@ -223,8 +222,8 @@ TDEStorageOpResult UDisks2EjectDrive(TDEStorageDevice *sdevice) { return result; } -TDEStorageOpResult UDisks2MountDrive(TQString deviceNode, TQString fileSystemType, TQString mountOptions) { - TDEStorageOpResult result; +TQStringVariantMap UDisks2MountDrive(TQString deviceNode, TQString fileSystemType, TQString mountOptions) { + TQStringVariantMap result; result["result"] = false; result["retcode"] = -2; @@ -269,8 +268,8 @@ TDEStorageOpResult UDisks2MountDrive(TQString deviceNode, TQString fileSystemTyp return result; } -TDEStorageOpResult UDisks2UnmountDrive(TQString deviceNode, TQString unmountOptions) { - TDEStorageOpResult result; +TQStringVariantMap UDisks2UnmountDrive(TQString deviceNode, TQString unmountOptions) { + TQStringVariantMap result; result["result"] = false; result["retcode"] = -2; diff --git a/tdecore/tdehw/disksHelper.h b/tdecore/tdehw/disksHelper.h index 5f2d7e7cb..665de8223 100644 --- a/tdecore/tdehw/disksHelper.h +++ b/tdecore/tdehw/disksHelper.h @@ -27,15 +27,15 @@ //------------------------------- // UDisks //------------------------------- -TDEStorageOpResult UDisksEjectDrive(TDEStorageDevice *sdevice); -TDEStorageOpResult UDisksMountDrive(TQString deviceNode, TQString fileSystemType, TQStringList mountOptions); -TDEStorageOpResult UDisksUnmountDrive(TQString deviceNode, TQStringList unmountOptions); +TQStringVariantMap UDisksEjectDrive(TDEStorageDevice *sdevice); +TQStringVariantMap UDisksMountDrive(TQString deviceNode, TQString fileSystemType, TQStringList mountOptions); +TQStringVariantMap UDisksUnmountDrive(TQString deviceNode, TQStringList unmountOptions); //------------------------------- // UDisks2 //------------------------------- -TDEStorageOpResult UDisks2EjectDrive(TDEStorageDevice *sdevice); -TDEStorageOpResult UDisks2MountDrive(TQString deviceNode, TQString fileSystemType, TQString mountOptions); -TDEStorageOpResult UDisks2UnmountDrive(TQString deviceNode, TQString unmountOptions); +TQStringVariantMap UDisks2EjectDrive(TDEStorageDevice *sdevice); +TQStringVariantMap UDisks2MountDrive(TQString deviceNode, TQString fileSystemType, TQString mountOptions); +TQStringVariantMap UDisks2UnmountDrive(TQString deviceNode, TQString unmountOptions); #endif diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp index c21f54606..16e6d6e4d 100644 --- a/tdecore/tdehw/tdestoragedevice.cpp +++ b/tdecore/tdehw/tdestoragedevice.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include "kdebug.h" #include "tdelocale.h" @@ -310,7 +309,7 @@ bool TDEStorageDevice::lockDriveMedia(bool lock) { bool TDEStorageDevice::ejectDrive() { if (!(TDEGlobal::dirs()->findExe("udisksctl").isEmpty())) { - TDEStorageOpResult ejectResult = UDisks2EjectDrive(this); + TQStringVariantMap ejectResult = UDisks2EjectDrive(this); if (ejectResult["result"].toBool()) { return true; } @@ -320,7 +319,7 @@ bool TDEStorageDevice::ejectDrive() { } } if (!(TDEGlobal::dirs()->findExe("udisks").isEmpty())) { - TDEStorageOpResult ejectResult = UDisksEjectDrive(this); + TQStringVariantMap ejectResult = UDisksEjectDrive(this); if (ejectResult["result"].toBool()) { return true; } @@ -702,8 +701,8 @@ TQString TDEStorageDevice::mountPath() { return TQString::null; } -TDEStorageOpResult TDEStorageDevice::mountDevice(TQString mediaName, TDEStorageMountOptions mountOptions) { - TDEStorageOpResult result; +TQStringVariantMap TDEStorageDevice::mountDevice(TQString mediaName, TDEStorageMountOptions mountOptions) { + TQStringVariantMap result; // Check if device is already mounted TQString mountpath = mountPath(); @@ -774,7 +773,7 @@ TDEStorageOpResult TDEStorageDevice::mountDevice(TQString mediaName, TDEStorageM fileSystemType = mountOptions["filesystem"]; } - TDEStorageOpResult mountResult = UDisks2MountDrive(devNode, fileSystemType, optionString); + TQStringVariantMap mountResult = UDisks2MountDrive(devNode, fileSystemType, optionString); if (mountResult["result"].toBool()) { // Update internal mount data TDEGlobal::hardwareDevices()->processModifiedMounts(); @@ -901,9 +900,9 @@ TDEStorageOpResult TDEStorageDevice::mountDevice(TQString mediaName, TDEStorageM return result; } -TDEStorageOpResult TDEStorageDevice::mountEncryptedDevice(TQString passphrase, TQString mediaName, +TQStringVariantMap TDEStorageDevice::mountEncryptedDevice(TQString passphrase, TQString mediaName, TDEStorageMountOptions mountOptions) { - TDEStorageOpResult result; + TQStringVariantMap result; // Check if device is already mounted TQString mountpath = mountPath(); @@ -976,8 +975,8 @@ TDEStorageOpResult TDEStorageDevice::mountEncryptedDevice(TQString passphrase, T return result; } -TDEStorageOpResult TDEStorageDevice::unmountDevice() { - TDEStorageOpResult result; +TQStringVariantMap TDEStorageDevice::unmountDevice() { + TQStringVariantMap result; // Check if device is already unmounted TQString mountpoint = mountPath(); @@ -990,7 +989,7 @@ TDEStorageOpResult TDEStorageDevice::unmountDevice() { TQString devNode = deviceNode(); // Try to use UDISKS v2 via DBUS, if available - TDEStorageOpResult unmountResult = UDisks2UnmountDrive(devNode, TQString::null); + TQStringVariantMap unmountResult = UDisks2UnmountDrive(devNode, TQString::null); if (unmountResult["result"].toBool()) { // Update internal mount data TDEGlobal::hardwareDevices()->processModifiedMounts(); diff --git a/tdecore/tdehw/tdestoragedevice.h b/tdecore/tdehw/tdestoragedevice.h index d6a4269a8..6bd39353b 100644 --- a/tdecore/tdehw/tdestoragedevice.h +++ b/tdecore/tdehw/tdestoragedevice.h @@ -21,6 +21,7 @@ #define _TDESTORAGEDEVICE_H #include "tdegenericdevice.h" +#include "tqvariant.h" struct crypt_device; @@ -166,9 +167,7 @@ enum TDELUKSResult { }; }; -class TQVariant; typedef TQMap TDEStorageMountOptions; -typedef TQMap TDEStorageOpResult; class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice { @@ -235,9 +234,9 @@ class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice * @param a TQString containing a requested mount name under /media, if desired * @param a TDEStorageMountOptions containing any mount options for pmount, if desired * - * @return a TDEStorageOpResult object containing information about the operation outcome + * @return a TQStringVariantMap object containing information about the operation outcome */ - TDEStorageOpResult mountDevice(TQString mediaName = TQString::null, + TQStringVariantMap mountDevice(TQString mediaName = TQString::null, TDEStorageMountOptions mountOptions = TDEStorageMountOptions()); /** @@ -247,17 +246,17 @@ class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice * @param a TQString containing a requested mount name under /media, if desired * @param a TDEStorageMountOptions containing any mount options for pmount, if desired * - * @return a TDEStorageOpResult object containing information about the operation outcome + * @return a TQStringVariantMap object containing information about the operation outcome */ - TDEStorageOpResult mountEncryptedDevice(TQString passphrase, TQString mediaName = TQString::null, + TQStringVariantMap mountEncryptedDevice(TQString passphrase, TQString mediaName = TQString::null, TDEStorageMountOptions mountOptions = TDEStorageMountOptions()); /** * Unmounts the device * - * @return a TDEStorageOpResult object containing information about the operation outcome + * @return a TQStringVariantMap object containing information about the operation outcome */ - TDEStorageOpResult unmountDevice(); + TQStringVariantMap unmountDevice(); /** * @return a TQString with the mount path, if mounted diff --git a/tdeio/tdeio/kservice.cpp b/tdeio/tdeio/kservice.cpp index b059d2375..c097146a3 100644 --- a/tdeio/tdeio/kservice.cpp +++ b/tdeio/tdeio/kservice.cpp @@ -593,7 +593,7 @@ TQVariant KService::property( const TQString& _name, TQVariant::Type t ) const // Then we use a homebuild class based on TDEConfigBase to convert the TQString. // For some often used property types we do the conversion ourselves. - TQMap::ConstIterator it = m_mapProps.find( _name ); + TQStringVariantMap::ConstIterator it = m_mapProps.find( _name ); if ( (it == m_mapProps.end()) || (!it.data().isValid())) { //kdDebug(7012) << "Property not found " << _name << endl; @@ -635,7 +635,7 @@ TQStringList KService::propertyNames() const { TQStringList res; - TQMap::ConstIterator it = m_mapProps.begin(); + TQStringVariantMap::ConstIterator it = m_mapProps.begin(); for( ; it != m_mapProps.end(); ++it ) res.append( it.key() ); @@ -750,7 +750,7 @@ TQString KService::username() const { } bool KService::noDisplay() const { - TQMap::ConstIterator it = m_mapProps.find( "NoDisplay" ); + TQStringVariantMap::ConstIterator it = m_mapProps.find( "NoDisplay" ); if ( (it != m_mapProps.end()) && (it.data().isValid())) { TQString aValue = it.data().toString().lower(); @@ -798,7 +798,7 @@ TQString KService::untranslatedGenericName() const { } bool KService::SuSEunimportant() const { - TQMap::ConstIterator it = m_mapProps.find( "X-SuSE-Unimportant" ); + TQStringVariantMap::ConstIterator it = m_mapProps.find( "X-SuSE-Unimportant" ); if ( (it == m_mapProps.end()) || (!it.data().isValid())) { return false; @@ -812,7 +812,7 @@ bool KService::SuSEunimportant() const { } TQString KService::parentApp() const { - TQMap::ConstIterator it = m_mapProps.find( "X-TDE-ParentApp" ); + TQStringVariantMap::ConstIterator it = m_mapProps.find( "X-TDE-ParentApp" ); if ( (it == m_mapProps.end()) || (!it.data().isValid())) { return TQString::null; diff --git a/tdeio/tdeio/kservice.h b/tdeio/tdeio/kservice.h index 02519c1e8..bd42f9b0d 100644 --- a/tdeio/tdeio/kservice.h +++ b/tdeio/tdeio/kservice.h @@ -548,7 +548,7 @@ private: //TQString m_docPath; //bool m_bHideFromPanel; DCOPServiceType_t m_DCOPServiceType; - TQMap m_mapProps; + TQStringVariantMap m_mapProps; bool m_bValid; TQStringList m_lstKeywords; TQString m_strInit; diff --git a/tdeio/tdeio/kservicetype.cpp b/tdeio/tdeio/kservicetype.cpp index 8565029ee..66d12698b 100644 --- a/tdeio/tdeio/kservicetype.cpp +++ b/tdeio/tdeio/kservicetype.cpp @@ -27,9 +27,6 @@ #include #include -template TQDataStream& operator>> (TQDataStream&, TQMap&); -template TQDataStream& operator<< (TQDataStream&, const TQMap&); - class KServiceType::KServiceTypePrivate { public: @@ -182,7 +179,7 @@ KServiceType::property( const TQString& _name ) const else if ( _name == "Comment" ) v = TQVariant( m_strComment ); else { - TQMap::ConstIterator it = m_mapProps.find( _name ); + TQStringVariantMap::ConstIterator it = m_mapProps.find( _name ); if ( it != m_mapProps.end() ) v = it.data(); } @@ -195,7 +192,7 @@ KServiceType::propertyNames() const { TQStringList res; - TQMap::ConstIterator it = m_mapProps.begin(); + TQStringVariantMap::ConstIterator it = m_mapProps.begin(); for( ; it != m_mapProps.end(); ++it ) res.append( it.key() ); diff --git a/tdeio/tdeio/kservicetype.h b/tdeio/tdeio/kservicetype.h index 9b59b39b4..d333188c1 100644 --- a/tdeio/tdeio/kservicetype.h +++ b/tdeio/tdeio/kservicetype.h @@ -233,7 +233,7 @@ protected: TQString m_strName; TQString m_strIcon; TQString m_strComment; - TQMap m_mapProps; + TQStringVariantMap m_mapProps; TQMap m_mapPropDefs; bool m_bValid:1; diff --git a/tdeprint/foomatic2loader.cpp b/tdeprint/foomatic2loader.cpp index 0d0637c90..c498477fd 100644 --- a/tdeprint/foomatic2loader.cpp +++ b/tdeprint/foomatic2loader.cpp @@ -67,7 +67,7 @@ bool Foomatic2Loader::readFromBuffer( const TQString& buffer ) return false; } -DrBase* Foomatic2Loader::createValue( const TQString& name, const TQMap& m ) const +DrBase* Foomatic2Loader::createValue( const TQString& name, const TQStringVariantMap& m ) const { DrBase *choice = new DrBase; choice->setName( name ); @@ -75,7 +75,7 @@ DrBase* Foomatic2Loader::createValue( const TQString& name, const TQMap& m ) const +DrBase* Foomatic2Loader::createOption( const TQStringVariantMap& m ) const { TQString type = m.operator[]( "type" ).toString(); DrBase *opt = NULL; @@ -83,7 +83,7 @@ DrBase* Foomatic2Loader::createOption( const TQMap& m ) cons { DrListOption *lopt = new DrListOption; TQVariant a = m.operator[]( "vals_byname" ); - TQMap::ConstIterator it = a.mapBegin(); + TQStringVariantMap::ConstIterator it = a.mapBegin(); for ( ; it!=a.mapEnd(); ++it ) { if ( it.data().type() != TQVariant::Map ) @@ -183,7 +183,7 @@ DrMain* Foomatic2Loader::buildDriver() const TQRegExp re( "(\\d+) +(\\d+)" ); if ( choices.type() == TQVariant::Map ) { - TQMap::ConstIterator it = choices.mapBegin(); + TQStringVariantMap::ConstIterator it = choices.mapBegin(); for ( ; it!=choices.mapEnd(); ++it ) { TQString driverval = ( *it ).mapFind( "driverval" ).data().toString(); @@ -234,7 +234,7 @@ DrMain* Foomatic2Loader::modifyDriver( DrMain *driver ) const v = V.mapFind( "args_byname" ).data(); if ( !v.isNull() && v.type() == TQVariant::Map ) { - TQMap::ConstIterator it = v.mapBegin(); + TQStringVariantMap::ConstIterator it = v.mapBegin(); for ( ; it!=v.mapEnd(); ++it ) { if ( ( *it ).type() != TQVariant::Map ) diff --git a/tdeprint/foomatic2loader.h b/tdeprint/foomatic2loader.h index 86bedb412..e61cdfded 100644 --- a/tdeprint/foomatic2loader.h +++ b/tdeprint/foomatic2loader.h @@ -37,21 +37,21 @@ public: bool read( TQIODevice *d ); bool readFromBuffer( const TQString& buffer ); bool readFromFile( const TQString& filename ); - TQMap data() const; + TQStringVariantMap data() const; DrMain* buildDriver() const; DrMain* modifyDriver( DrMain* ) const; static DrMain* loadDriver( const TQString& filename ); private: - TQMap m_foodata; + TQStringVariantMap m_foodata; friend int tdeprint_foomatic2parse( void* ); - DrBase* createValue( const TQString&, const TQMap& ) const; - DrBase* createOption( const TQMap& ) const; + DrBase* createValue( const TQString&, const TQStringVariantMap& ) const; + DrBase* createOption( const TQStringVariantMap& ) const; }; -inline TQMap Foomatic2Loader::data() const +inline TQStringVariantMap Foomatic2Loader::data() const { return m_foodata; } #endif /* FOOMATIC2LOADER_H */ diff --git a/tdeprint/fooparser.cpp b/tdeprint/fooparser.cpp index e919616ab..2a6b38663 100644 --- a/tdeprint/fooparser.cpp +++ b/tdeprint/fooparser.cpp @@ -737,7 +737,7 @@ case 5: break;} case 6: #line 51 "./fooparser.y" -{ TQMap::ConstIterator it = yyvsp[0].mapBegin(); yyvsp[-2].asMap().insert(it.key(), it.data()); yyval = yyvsp[-2]; ; +{ TQStringVariantMap::ConstIterator it = yyvsp[0].mapBegin(); yyvsp[-2].asMap().insert(it.key(), it.data()); yyval = yyvsp[-2]; ; break;} case 7: #line 54 "./fooparser.y" diff --git a/tdeprint/fooparser.y b/tdeprint/fooparser.y index 20626ce59..a9bb56e89 100644 --- a/tdeprint/fooparser.y +++ b/tdeprint/fooparser.y @@ -48,7 +48,7 @@ foodata: VAR '=' '{' fieldlist '}' ';' { static_cast(fooloa ; fieldlist: assignment { $$ = $1; } - | fieldlist ',' assignment { TQMap::ConstIterator it = $3.mapBegin(); $1.asMap().insert(it.key(), it.data()); $$ = $1; } + | fieldlist ',' assignment { TQStringVariantMap::ConstIterator it = $3.mapBegin(); $1.asMap().insert(it.key(), it.data()); $$ = $1; } ; assignment: STRING '=' '>' value { $$.asMap().insert($1.toString(), $4); } diff --git a/tdeprint/lpr/matichandler.cpp b/tdeprint/lpr/matichandler.cpp index 826867cd2..07fee1260 100644 --- a/tdeprint/lpr/matichandler.cpp +++ b/tdeprint/lpr/matichandler.cpp @@ -110,7 +110,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh } } - TQMap m = loader.data()[ "VAR" ].toMap(); + TQStringVariantMap m = loader.data()[ "VAR" ].toMap(); if ( !m.isEmpty() ) { prt->setManufacturer(m["make"].toString()); diff --git a/tdeprint/ppdloader.cpp b/tdeprint/ppdloader.cpp index fd243b0f9..93c63a61c 100644 --- a/tdeprint/ppdloader.cpp +++ b/tdeprint/ppdloader.cpp @@ -438,13 +438,13 @@ bool PPDLoader::putFooData( const TQString& data ) bool PPDLoader::putFooProcessedData( const TQVariant& var ) { - TQMap::ConstIterator it = var.mapFind( "args_byname" ); + TQStringVariantMap::ConstIterator it = var.mapFind( "args_byname" ); if ( it != var.mapEnd() ) { TQVariant opts = it.data(); for ( it = opts.mapBegin(); it != opts.mapEnd(); ++it ) { - TQMap opt = it.data().toMap(); + TQStringVariantMap opt = it.data().toMap(); TQString type = opt[ "type" ].toString(); if ( type == "float" || type == "int" ) {