Browse Source

Adjusted to use new TQStringVariantMap type.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
undefined
Michele Calgaro 2 months ago
parent
commit
37383578b1
Signed by: Michele Calgaro <michele.calgaro@yahoo.it> GPG Key ID: 2A75B7CA8ADED5CF

+ 1
- 1
tdecore/kdcoppropertyproxy.cpp View File

@@ -194,7 +194,7 @@ bool KDCOPPropertyProxy::processPropertyRequest( const TQCString &fun, const TQB
break;

typedef TQValueList<TQVariant> ListType;
typedef TQMap<TQString,TQVariant> MapType;
typedef TQStringVariantMap MapType;

switch ( type )
{

+ 12
- 13
tdecore/tdehw/disksHelper.cpp View File

@@ -20,7 +20,6 @@
#include "disksHelper.h"
#include "tdelocale.h"
#include "tdestoragedevice.h"
#include <tqvariant.h>
#include <tqdbusdata.h>
#include <tqdbusmessage.h>
#include <tqdbusproxy.h>
@@ -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);
@@ -66,8 +65,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;

@@ -107,8 +106,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;

@@ -150,8 +149,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);
@@ -219,8 +218,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;

@@ -264,8 +263,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;


+ 6
- 6
tdecore/tdehw/disksHelper.h View File

@@ -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

+ 10
- 11
tdecore/tdehw/tdestoragedevice.cpp View File

@@ -28,7 +28,6 @@
#include <tqregexp.h>
#include <tqpixmap.h>
#include <tqfile.h>
#include <tqvariant.h>

#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();

+ 7
- 8
tdecore/tdehw/tdestoragedevice.h View File

@@ -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<TQString, TQString> TDEStorageMountOptions;
typedef TQMap<TQString, TQVariant> 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

+ 5
- 5
tdeio/tdeio/kservice.cpp View File

@@ -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<TQString,TQVariant>::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<TQString,TQVariant>::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<TQString,TQVariant>::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<TQString,TQVariant>::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<TQString,TQVariant>::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;

+ 1
- 1
tdeio/tdeio/kservice.h View File

@@ -548,7 +548,7 @@ private:
//TQString m_docPath;
//bool m_bHideFromPanel;
DCOPServiceType_t m_DCOPServiceType;
TQMap<TQString,TQVariant> m_mapProps;
TQStringVariantMap m_mapProps;
bool m_bValid;
TQStringList m_lstKeywords;
TQString m_strInit;

+ 2
- 5
tdeio/tdeio/kservicetype.cpp View File

@@ -27,9 +27,6 @@
#include <kdebug.h>
#include <kdesktopfile.h>

template TQDataStream& operator>> <TQString, TQVariant>(TQDataStream&, TQMap<TQString, TQVariant>&);
template TQDataStream& operator<< <TQString, TQVariant>(TQDataStream&, const TQMap<TQString, TQVariant>&);

class KServiceType::KServiceTypePrivate
{
public:
@@ -182,7 +179,7 @@ KServiceType::property( const TQString& _name ) const
else if ( _name == "Comment" )
v = TQVariant( m_strComment );
else {
TQMap<TQString,TQVariant>::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<TQString,TQVariant>::ConstIterator it = m_mapProps.begin();
TQStringVariantMap::ConstIterator it = m_mapProps.begin();
for( ; it != m_mapProps.end(); ++it )
res.append( it.key() );


+ 1
- 1
tdeio/tdeio/kservicetype.h View File

@@ -233,7 +233,7 @@ protected:
TQString m_strName;
TQString m_strIcon;
TQString m_strComment;
TQMap<TQString,TQVariant> m_mapProps;
TQStringVariantMap m_mapProps;
TQMap<TQString,TQVariant::Type> m_mapPropDefs;

bool m_bValid:1;

+ 5
- 5
tdeprint/foomatic2loader.cpp View File

@@ -67,7 +67,7 @@ bool Foomatic2Loader::readFromBuffer( const TQString& buffer )
return false;
}

DrBase* Foomatic2Loader::createValue( const TQString& name, const TQMap<TQString,TQVariant>& 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<TQString
return choice;
}

DrBase* Foomatic2Loader::createOption( const TQMap<TQString,TQVariant>& 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<TQString,TQVariant>& m ) cons
{
DrListOption *lopt = new DrListOption;
TQVariant a = m.operator[]( "vals_byname" );
TQMap<TQString,TQVariant>::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<TQString,TQVariant>::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<TQString,TQVariant>::ConstIterator it = v.mapBegin();
TQStringVariantMap::ConstIterator it = v.mapBegin();
for ( ; it!=v.mapEnd(); ++it )
{
if ( ( *it ).type() != TQVariant::Map )

+ 5
- 5
tdeprint/foomatic2loader.h View File

@@ -37,21 +37,21 @@ public:
bool read( TQIODevice *d );
bool readFromBuffer( const TQString& buffer );
bool readFromFile( const TQString& filename );
TQMap<TQString,TQVariant> data() const;
TQStringVariantMap data() const;
DrMain* buildDriver() const;
DrMain* modifyDriver( DrMain* ) const;

static DrMain* loadDriver( const TQString& filename );

private:
TQMap<TQString,TQVariant> m_foodata;
TQStringVariantMap m_foodata;

friend int tdeprint_foomatic2parse( void* );
DrBase* createValue( const TQString&, const TQMap<TQString,TQVariant>& ) const;
DrBase* createOption( const TQMap<TQString,TQVariant>& ) const;
DrBase* createValue( const TQString&, const TQStringVariantMap& ) const;
DrBase* createOption( const TQStringVariantMap& ) const;
};

inline TQMap<TQString,TQVariant> Foomatic2Loader::data() const
inline TQStringVariantMap Foomatic2Loader::data() const
{ return m_foodata; }

#endif /* FOOMATIC2LOADER_H */

+ 1
- 1
tdeprint/fooparser.cpp View File

@@ -737,7 +737,7 @@ case 5:
break;}
case 6:
#line 51 "./fooparser.y"
{ TQMap<TQString,TQVariant>::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"

+ 1
- 1
tdeprint/fooparser.y View File

@@ -48,7 +48,7 @@ foodata: VAR '=' '{' fieldlist '}' ';' { static_cast<Foomatic2Loader*>(fooloa
;

fieldlist: assignment { $$ = $1; }
| fieldlist ',' assignment { TQMap<TQString,TQVariant>::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); }

+ 1
- 1
tdeprint/lpr/matichandler.cpp View File

@@ -110,7 +110,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
}
}

TQMap<TQString,TQVariant> m = loader.data()[ "VAR" ].toMap();
TQStringVariantMap m = loader.data()[ "VAR" ].toMap();
if ( !m.isEmpty() )
{
prt->setManufacturer(m["make"].toString());

+ 2
- 2
tdeprint/ppdloader.cpp View File

@@ -438,13 +438,13 @@ bool PPDLoader::putFooData( const TQString& data )

bool PPDLoader::putFooProcessedData( const TQVariant& var )
{
TQMap<TQString,TQVariant>::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<TQString,TQVariant> opt = it.data().toMap();
TQStringVariantMap opt = it.data().toMap();
TQString type = opt[ "type" ].toString();
if ( type == "float" || type == "int" )
{

Loading…
Cancel
Save