Adjusted to use new TQStringVariantMap type.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/5/head
Michele Calgaro 5 years ago
parent 5fcb1d91b4
commit b1e66b339b
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -63,7 +63,7 @@ class MetaDataBaseRecord
public: public:
TQObject *object; TQObject *object;
TQStringList changedProperties; TQStringList changedProperties;
TQMap<TQString,TQVariant> fakeProperties; TQStringVariantMap fakeProperties;
TQMap<TQString, TQString> propertyComments; TQMap<TQString, TQString> propertyComments;
int spacing, margin; int spacing, margin;
TQString resizeMode; TQString resizeMode;
@ -271,14 +271,14 @@ TQVariant MetaDataBase::fakeProperty( TQObject * o, const TQString &property)
o, o->name(), o->className() ); o, o->name(), o->className() );
return TQVariant(); return TQVariant();
} }
TQMap<TQString, TQVariant>::Iterator it = r->fakeProperties.find( property ); TQStringVariantMap::Iterator it = r->fakeProperties.find( property );
if ( it != r->fakeProperties.end() ) if ( it != r->fakeProperties.end() )
return r->fakeProperties[property]; return r->fakeProperties[property];
return WidgetFactory::defaultValue( o, property ); return WidgetFactory::defaultValue( o, property );
} }
TQMap<TQString,TQVariant>* MetaDataBase::fakeProperties( TQObject* o ) TQStringVariantMap* MetaDataBase::fakeProperties( TQObject* o )
{ {
setupDataBase(); setupDataBase();
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );

@ -155,7 +155,7 @@ public:
static void setFakeProperty( TQObject *o, const TQString &property, const TQVariant& value ); static void setFakeProperty( TQObject *o, const TQString &property, const TQVariant& value );
static TQVariant fakeProperty( TQObject * o, const TQString &property ); static TQVariant fakeProperty( TQObject * o, const TQString &property );
static TQMap<TQString,TQVariant>* fakeProperties( TQObject* o ); static TQStringVariantMap* fakeProperties( TQObject* o );
static void setSpacing( TQObject *o, int spacing ); static void setSpacing( TQObject *o, int spacing );
static int spacing( TQObject *o ); static int spacing( TQObject *o );

@ -1474,8 +1474,8 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
} }
if ( w->isWidgetType() && MetaDataBase::fakeProperties( w ) ) { if ( w->isWidgetType() && MetaDataBase::fakeProperties( w ) ) {
TQMap<TQString, TQVariant>* fakeProperties = MetaDataBase::fakeProperties( w ); TQStringVariantMap* fakeProperties = MetaDataBase::fakeProperties( w );
for ( TQMap<TQString, TQVariant>::Iterator fake = fakeProperties->begin(); for ( TQStringVariantMap::Iterator fake = fakeProperties->begin();
fake != fakeProperties->end(); ++fake ) { fake != fakeProperties->end(); ++fake ) {
if ( MetaDataBase::isPropertyChanged( w, fake.key() ) ) { if ( MetaDataBase::isPropertyChanged( w, fake.key() ) ) {
if ( w->inherits("CustomWidget") ) { if ( w->inherits("CustomWidget") ) {

@ -35,7 +35,7 @@ ChildProperty::ChildProperty(MultiProperty *parent, int type, ChildPropertyType
} }
ChildProperty::ChildProperty(MultiProperty *parent, const TQString & name, ChildPropertyType childType, ChildProperty::ChildProperty(MultiProperty *parent, const TQString & name, ChildPropertyType childType,
const TQMap<TQString, TQVariant> &v_valueList, const TQString &description, const TQStringVariantMap &v_valueList, const TQString &description,
const TQVariant &value, bool save, bool readOnly) const TQVariant &value, bool save, bool readOnly)
:Property(name, v_valueList, description, value, save, readOnly), m_parent(parent), m_childType(childType) :Property(name, v_valueList, description, value, save, readOnly), m_parent(parent), m_childType(childType)
{ {

@ -65,7 +65,7 @@ public:
bool save = true, bool readOnly = false); bool save = true, bool readOnly = false);
/**Constructs property with @ref ValueFromList type.*/ /**Constructs property with @ref ValueFromList type.*/
ChildProperty(MultiProperty *parent, const TQString &name, ChildPropertyType childType, ChildProperty(MultiProperty *parent, const TQString &name, ChildPropertyType childType,
const TQMap<TQString, TQVariant> &v_valueList, const TQString &description, const TQStringVariantMap &v_valueList, const TQString &description,
const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false);
/**@return the value of the property.*/ /**@return the value of the property.*/

@ -129,11 +129,11 @@ bool MultiProperty::visible() const
return v; return v;
} }
TQMap<TQString, TQVariant> MultiProperty::valueList() const TQStringVariantMap MultiProperty::valueList() const
{ {
if (list.count() >= 1) if (list.count() >= 1)
return list.getFirst()->valueList; return list.getFirst()->valueList;
return TQMap<TQString, TQVariant>(); return TQStringVariantMap();
} }
void MultiProperty::setDescription(const TQString &description) void MultiProperty::setDescription(const TQString &description)
@ -176,7 +176,7 @@ void MultiProperty::setValue(const TQVariant &value, bool emitChange)
} }
} }
void MultiProperty::setValueList(const TQMap<TQString, TQVariant> &valueList) void MultiProperty::setValueList(const TQStringVariantMap &valueList)
{ {
Property *property; Property *property;
for (property = list.first(); property; property = list.next()) for (property = list.first(); property; property = list.next())
@ -232,8 +232,8 @@ TQVariant MultiProperty::findValueDescription() const
TQVariant val = value(); TQVariant val = value();
if (type() != Property::ValueFromList) if (type() != Property::ValueFromList)
return val; return val;
TQMap<TQString, TQVariant> vl = valueList(); TQStringVariantMap vl = valueList();
for (TQMap<TQString, TQVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it) for (TQStringVariantMap::const_iterator it = vl.begin(); it != vl.end(); ++ it)
{ {
if (it.data() == val) if (it.data() == val)
return it.key(); return it.key();
@ -245,8 +245,8 @@ TQVariant MultiProperty::findValueDescription(TQVariant val) const
{ {
if (type() != Property::ValueFromList) if (type() != Property::ValueFromList)
return val; return val;
TQMap<TQString, TQVariant> vl = valueList(); TQStringVariantMap vl = valueList();
for (TQMap<TQString, TQVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it) for (TQStringVariantMap::const_iterator it = vl.begin(); it != vl.end(); ++ it)
{ {
if (it.data() == val) if (it.data() == val)
return it.key(); return it.key();

@ -84,7 +84,7 @@ public:
/**Returns the visibility attribute of a %property.*/ /**Returns the visibility attribute of a %property.*/
bool visible() const; bool visible() const;
/**The string-to-value correspondence list of the %property.*/ /**The string-to-value correspondence list of the %property.*/
TQMap<TQString, TQVariant> valueList() const; TQStringVariantMap valueList() const;
/**Sets the value of a %property.*/ /**Sets the value of a %property.*/
void setValue(const TQVariant& value); void setValue(const TQVariant& value);

@ -24,13 +24,13 @@
namespace PropertyLib{ namespace PropertyLib{
PComboBox::PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, TQWidget *parent, const char *name) PComboBox::PComboBox(MultiProperty *property, const TQStringVariantMap &list, TQWidget *parent, const char *name)
:PropertyWidget(property, parent, name), m_valueList(list) :PropertyWidget(property, parent, name), m_valueList(list)
{ {
init(false); init(false);
} }
PComboBox::PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, bool rw, TQWidget *parent, const char *name) PComboBox::PComboBox(MultiProperty *property, const TQStringVariantMap &list, bool rw, TQWidget *parent, const char *name)
:PropertyWidget(property, parent, name), m_valueList(list) :PropertyWidget(property, parent, name), m_valueList(list)
{ {
init(rw); init(rw);
@ -50,7 +50,7 @@ void PComboBox::init(bool rw)
void PComboBox::fillBox() void PComboBox::fillBox()
{ {
for (TQMap<TQString, TQVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); it++) for (TQStringVariantMap::const_iterator it = m_valueList.begin(); it != m_valueList.end(); it++)
{ {
m_edit->insertItem(it.key()); m_edit->insertItem(it.key());
} }
@ -58,7 +58,7 @@ void PComboBox::fillBox()
TQVariant PComboBox::value() const TQVariant PComboBox::value() const
{ {
TQMap<TQString, TQVariant>::const_iterator it = m_valueList.find(m_edit->currentText()); TQStringVariantMap::const_iterator it = m_valueList.find(m_edit->currentText());
if (it == m_valueList.end()) if (it == m_valueList.end())
return TQVariant(""); return TQVariant("");
return TQVariant(it.data()); return TQVariant(it.data());
@ -83,7 +83,7 @@ void PComboBox::updateProperty(int /*val*/)
TQString PComboBox::findDescription(const TQVariant &value) TQString PComboBox::findDescription(const TQVariant &value)
{ {
for (TQMap<TQString, TQVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); ++ it) for (TQStringVariantMap::const_iterator it = m_valueList.begin(); it != m_valueList.end(); ++ it)
{ {
if (it.data() == value) if (it.data() == value)
return it.key(); return it.key();
@ -91,7 +91,7 @@ TQString PComboBox::findDescription(const TQVariant &value)
return ""; return "";
} }
void PComboBox::setValueList(const TQMap<TQString, TQVariant> &valueList) void PComboBox::setValueList(const TQStringVariantMap &valueList)
{ {
m_valueList = valueList; m_valueList = valueList;
m_edit->clear(); m_edit->clear();

@ -38,9 +38,9 @@ class PComboBox: public PropertyWidget{
public: public:
/**This constructor is used for read-only selection combo. It provides a value from valueList*/ /**This constructor is used for read-only selection combo. It provides a value from valueList*/
PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, TQWidget *parent = 0, const char *name = 0); PComboBox(MultiProperty *property, const TQStringVariantMap &list, TQWidget *parent = 0, const char *name = 0);
/**This constructor is used for read-write selection combo. It provides a value from valueList*/ /**This constructor is used for read-write selection combo. It provides a value from valueList*/
PComboBox(MultiProperty *property, const TQMap<TQString, TQVariant> &list, bool rw, TQWidget *parent = 0, const char *name = 0); PComboBox(MultiProperty *property, const TQStringVariantMap &list, bool rw, TQWidget *parent = 0, const char *name = 0);
/**@return the value currently entered in the editor widget.*/ /**@return the value currently entered in the editor widget.*/
virtual TQVariant value() const; virtual TQVariant value() const;
@ -50,7 +50,7 @@ public:
/**Sets the list of possible values shown in the editor widget. This method /**Sets the list of possible values shown in the editor widget. This method
does not emit propertyChanged signal. Reimplemented because combobox is used does not emit propertyChanged signal. Reimplemented because combobox is used
to display possible values from valueList.*/ to display possible values from valueList.*/
virtual void setValueList(const TQMap<TQString, TQVariant> &valueList); virtual void setValueList(const TQStringVariantMap &valueList);
protected: protected:
TQString findDescription(const TQVariant &value); TQString findDescription(const TQVariant &value);
@ -63,7 +63,7 @@ private:
void init(bool rw = false); void init(bool rw = false);
/** map<description, value>*/ /** map<description, value>*/
TQMap<TQString, TQVariant> m_valueList; TQStringVariantMap m_valueList;
TQComboBox *m_edit; TQComboBox *m_edit;
}; };

@ -23,7 +23,7 @@
namespace PropertyLib{ namespace PropertyLib{
PCursorEdit::PCursorEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, PCursorEdit::PCursorEdit(MultiProperty* property, const TQStringVariantMap &spValues,
TQWidget* parent, const char* name) TQWidget* parent, const char* name)
:PComboBox(property, spValues, parent, name) :PComboBox(property, spValues, parent, name)
{ {

@ -32,7 +32,7 @@ class PCursorEdit: public PComboBox
Q_OBJECT Q_OBJECT
public: public:
PCursorEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, PCursorEdit(MultiProperty* property, const TQStringVariantMap &spValues,
TQWidget* parent = 0, const char* name = 0); TQWidget* parent = 0, const char* name = 0);
virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value);

@ -29,7 +29,7 @@ Property::Property(int type, const TQString &name, const TQString &description,
{ {
} }
Property::Property(const TQString &name, const TQMap<TQString, TQVariant> &v_valueList, Property::Property(const TQString &name, const TQStringVariantMap &v_valueList,
const TQString &description, const TQVariant &value, bool save, bool readOnly): const TQString &description, const TQVariant &value, bool save, bool readOnly):
valueList(v_valueList), m_type(ValueFromList), m_name(name), valueList(v_valueList), m_type(ValueFromList), m_name(name),
m_description(description), m_value(value), m_save(save), m_readOnly(readOnly), m_description(description), m_value(value), m_save(save), m_readOnly(readOnly),
@ -98,7 +98,7 @@ void Property::setDescription(const TQString &description)
m_description = description; m_description = description;
} }
void Property::setValueList(const TQMap<TQString, TQVariant> &v_valueList) void Property::setValueList(const TQStringVariantMap &v_valueList)
{ {
valueList = v_valueList; valueList = v_valueList;
} }

@ -66,7 +66,7 @@ public:
enum PropertyType { enum PropertyType {
//standard supported TQVariant types //standard supported TQVariant types
Invalid = TQVariant::Invalid /**<invalid property type*/, Invalid = TQVariant::Invalid /**<invalid property type*/,
Map = TQVariant::Map /**<TQMap<TQString, TQVariant>*/, Map = TQVariant::Map /**<TQStringVariantMap*/,
List = TQVariant::List /**<TQValueList<TQVariant>*/, List = TQVariant::List /**<TQValueList<TQVariant>*/,
String = TQVariant::String /**<string*/, String = TQVariant::String /**<string*/,
StringList = TQVariant::StringList /**<string list*/, StringList = TQVariant::StringList /**<string list*/,
@ -120,7 +120,7 @@ public:
Property(int type, const TQString &name, const TQString &description, Property(int type, const TQString &name, const TQString &description,
const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false);
/**Constructs property with @ref ValueFromList type.*/ /**Constructs property with @ref ValueFromList type.*/
Property(const TQString &name, const TQMap<TQString, TQVariant> &v_valueList, Property(const TQString &name, const TQStringVariantMap &v_valueList,
const TQString &description, const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false); const TQString &description, const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false);
virtual ~Property(); virtual ~Property();
@ -144,9 +144,9 @@ public:
virtual void setDescription(const TQString &description); virtual void setDescription(const TQString &description);
/**Sets the string-to-value correspondence list of the property. /**Sets the string-to-value correspondence list of the property.
This is used to create comboboxes-like property editors.*/ This is used to create comboboxes-like property editors.*/
virtual void setValueList(const TQMap<TQString, TQVariant> &list); virtual void setValueList(const TQStringVariantMap &list);
/**The string-to-value correspondence list of the property.*/ /**The string-to-value correspondence list of the property.*/
TQMap<TQString, TQVariant> valueList; TQStringVariantMap valueList;
/**Tells if the property can be saved to a stream, xml, etc. /**Tells if the property can be saved to a stream, xml, etc.
There is a possibility to use "GUI" properties that aren't There is a possibility to use "GUI" properties that aren't

@ -441,7 +441,7 @@ Machine *PropertyEditor::machine(MultiProperty *property)
{ {
// int type = property->type(); // int type = property->type();
TQString name = property->name(); TQString name = property->name();
TQMap<TQString, TQVariant> values = property->valueList(); TQStringVariantMap values = property->valueList();
if (m_registeredForType[name] == 0) if (m_registeredForType[name] == 0)
{ {
m_registeredForType[name] = PropertyMachineFactory::getInstance()->machineForProperty(property); m_registeredForType[name] = PropertyMachineFactory::getInstance()->machineForProperty(property);

@ -74,7 +74,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
{ {
int type = property->type(); int type = property->type();
TQString propertyName = property->name(); TQString propertyName = property->name();
TQMap<TQString, TQVariant> valueList = property->valueList(); TQStringVariantMap valueList = property->valueList();
if (m_registeredForType.contains(propertyName)) if (m_registeredForType.contains(propertyName))
return (*m_registeredForType[propertyName])(); return (*m_registeredForType[propertyName])();
@ -143,7 +143,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
} }
case Property::SizePolicy: case Property::SizePolicy:
{ {
TQMap<TQString, TQVariant> spValues; TQStringVariantMap spValues;
spValues[i18n("Fixed")] = TQSizePolicy::Fixed; spValues[i18n("Fixed")] = TQSizePolicy::Fixed;
spValues[i18n("Minimum")] = TQSizePolicy::Minimum; spValues[i18n("Minimum")] = TQSizePolicy::Minimum;
spValues[i18n("Maximum")] = TQSizePolicy::Maximum; spValues[i18n("Maximum")] = TQSizePolicy::Maximum;
@ -161,7 +161,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
} }
case Property::Cursor: case Property::Cursor:
{ {
TQMap<TQString, TQVariant> spValues; TQStringVariantMap spValues;
spValues[i18n("Arrow")] = TQt::ArrowCursor; spValues[i18n("Arrow")] = TQt::ArrowCursor;
spValues[i18n("Up Arrow")] = TQt::UpArrowCursor; spValues[i18n("Up Arrow")] = TQt::UpArrowCursor;
spValues[i18n("Cross")] = TQt::CrossCursor; spValues[i18n("Cross")] = TQt::CrossCursor;

@ -46,7 +46,7 @@ void PropertyWidget::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRe
p->drawText(r, TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, value.toString()); p->drawText(r, TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, value.toString());
} }
void PropertyWidget::setValueList(const TQMap<TQString, TQVariant> &// valueList void PropertyWidget::setValueList(const TQStringVariantMap &// valueList
) )
{ {
//this does nothing //this does nothing

@ -65,7 +65,7 @@ public:
virtual void setProperty(MultiProperty *property); virtual void setProperty(MultiProperty *property);
/**Sets the list of possible values shown in the editor widget. This method /**Sets the list of possible values shown in the editor widget. This method
does not emit propertyChanged signal.*/ does not emit propertyChanged signal.*/
virtual void setValueList(const TQMap<TQString, TQVariant> &valueList); virtual void setValueList(const TQStringVariantMap &valueList);
/**Function to draw a property viewer when the editor isn't shown.*/ /**Function to draw a property viewer when the editor isn't shown.*/
virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value); virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value);

@ -26,7 +26,7 @@
namespace PropertyLib{ namespace PropertyLib{
PSizePolicyEdit::PSizePolicyEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, TQWidget* parent, const char* name) PSizePolicyEdit::PSizePolicyEdit(MultiProperty* property, const TQStringVariantMap &spValues, TQWidget* parent, const char* name)
:PropertyWidget(property, parent, name), m_spValues(spValues) :PropertyWidget(property, parent, name), m_spValues(spValues)
{ {
TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0); TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0);
@ -62,7 +62,7 @@ void PSizePolicyEdit::setValue(const TQVariant& value, bool emitChange)
TQString PSizePolicyEdit::findValueDescription(TQVariant val) const TQString PSizePolicyEdit::findValueDescription(TQVariant val) const
{ {
// tqWarning("PSizePolicyEdit::findValueDescription : %d", val.toInt()); // tqWarning("PSizePolicyEdit::findValueDescription : %d", val.toInt());
for (TQMap<TQString, TQVariant>::const_iterator it = m_spValues.begin(); it != m_spValues.end(); ++ it) for (TQStringVariantMap::const_iterator it = m_spValues.begin(); it != m_spValues.end(); ++ it)
{ {
if (it.data() == val) if (it.data() == val)
return it.key(); return it.key();

@ -36,7 +36,7 @@ class PSizePolicyEdit : public PropertyWidget
Q_OBJECT Q_OBJECT
public: public:
PSizePolicyEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues, TQWidget* parent=0, const char* name=0); PSizePolicyEdit(MultiProperty* property, const TQStringVariantMap &spValues, TQWidget* parent=0, const char* name=0);
virtual TQVariant value() const; virtual TQVariant value() const;
virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value); virtual void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value);
@ -47,7 +47,7 @@ public:
private: private:
KLineEdit *m_edit; KLineEdit *m_edit;
TQVariant m_value; TQVariant m_value;
TQMap<TQString, TQVariant> m_spValues; TQStringVariantMap m_spValues;
}; };
} }

@ -38,9 +38,9 @@ string ASStringIterator::nextLine()
} }
KDevFormatter::KDevFormatter(const TQMap<TQString, TQVariant>& options) KDevFormatter::KDevFormatter(const TQStringVariantMap& options)
{ {
// for ( TQMap<TQString, TQVariant>::ConstIterator iter = options.begin();iter != options.end();iter++ ) // for ( TQStringVariantMap::ConstIterator iter = options.begin();iter != options.end();iter++ )
// { // {
// kdDebug ( 9009 ) << "format: " << iter.key() << "=" << iter.data() << endl; // kdDebug ( 9009 ) << "format: " << iter.key() << "=" << iter.data() << endl;
// } // }

@ -37,7 +37,7 @@ class KDevFormatter : public astyle::ASFormatter
{ {
public: public:
KDevFormatter(const TQMap<TQString, TQVariant>& options); KDevFormatter(const TQStringVariantMap& options);
KDevFormatter( AStyleWidget * widget ); KDevFormatter( AStyleWidget * widget );
TQString indentString() const TQString indentString() const
{ {

@ -101,7 +101,7 @@ void AStylePart::loadGlobal()
} }
// for (TQMap<TQString, TQVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++) // for (TQStringVariantMap::iterator iter = m_global.begin();iter != m_global.end();iter++)
// { // {
// kdDebug(9009) << "load: " <<iter.key() << "="<< iter.data() << endl; // kdDebug(9009) << "load: " <<iter.key() << "="<< iter.data() << endl;
// } // }
@ -110,7 +110,7 @@ void AStylePart::loadGlobal()
void AStylePart::saveGlobal() void AStylePart::saveGlobal()
{ {
TQString options; TQString options;
for (TQMap<TQString, TQVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++) for (TQStringVariantMap::iterator iter = m_global.begin();iter != m_global.end();iter++)
{ {
// kdDebug(9009) <<"saveGlobal" <<iter.key() << "="<< iter.data() << endl; // kdDebug(9009) <<"saveGlobal" <<iter.key() << "="<< iter.data() << endl;
options += iter.key(); options += iter.key();
@ -118,7 +118,7 @@ void AStylePart::saveGlobal()
options += iter.data().toString(); options += iter.data().toString();
options += ","; options += ",";
} }
// for (TQMap<TQString, TQVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++) // for (TQStringVariantMap::iterator iter = m_project.begin();iter != m_project.end();iter++)
// { // {
// kdDebug(9009) << "project before: " <<iter.key() << "="<< iter.data() << endl; // kdDebug(9009) << "project before: " <<iter.key() << "="<< iter.data() << endl;
// } // }
@ -129,11 +129,11 @@ void AStylePart::saveGlobal()
config->writeEntry("Extensions",m_globalExtensions.join(",")); config->writeEntry("Extensions",m_globalExtensions.join(","));
config->sync(); config->sync();
// for (TQMap<TQString, TQVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++) // for (TQStringVariantMap::iterator iter = m_global.begin();iter != m_global.end();iter++)
// { // {
// kdDebug(9009) << "global after: " <<iter.key() << "="<< iter.data() << endl; // kdDebug(9009) << "global after: " <<iter.key() << "="<< iter.data() << endl;
// } // }
// for (TQMap<TQString, TQVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++) // for (TQStringVariantMap::iterator iter = m_project.begin();iter != m_project.end();iter++)
// { // {
// kdDebug(9009) << "project after: " <<iter.key() << "="<< iter.data() << endl; // kdDebug(9009) << "project after: " <<iter.key() << "="<< iter.data() << endl;
// } // }
@ -343,7 +343,7 @@ void AStylePart::activePartChanged ( KParts::Part *part )
formatTextAction->setEnabled ( enabled ); formatTextAction->setEnabled ( enabled );
} }
TQString AStylePart::formatSource( const TQString text, AStyleWidget * widget, const TQMap<TQString, TQVariant>& options ) TQString AStylePart::formatSource( const TQString text, AStyleWidget * widget, const TQStringVariantMap& options )
{ {
ASStringIterator is(text); ASStringIterator is(text);
KDevFormatter * formatter = ( widget)? new KDevFormatter( widget ) : new KDevFormatter(options); KDevFormatter * formatter = ( widget)? new KDevFormatter( widget ) : new KDevFormatter(options);
@ -426,7 +426,7 @@ void AStylePart::restorePartialProjectSession(const TQDomElement * el)
} }
else else
{ {
for (TQMap<TQString, TQVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++) for (TQStringVariantMap::iterator iter = m_global.begin();iter != m_global.end();iter++)
{ {
m_project[iter.key()] = style.attribute(iter.key(),iter.data().toString()); m_project[iter.key()] = style.attribute(iter.key(),iter.data().toString());
} }
@ -451,7 +451,7 @@ void AStylePart::savePartialProjectSession(TQDomElement * el)
style.setAttribute("FStyle", m_project["FStyle"].toString()); style.setAttribute("FStyle", m_project["FStyle"].toString());
if (m_project["FStyle"] != "GLOBAL") if (m_project["FStyle"] != "GLOBAL")
{ {
for (TQMap<TQString, TQVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++) for (TQStringVariantMap::iterator iter = m_project.begin();iter != m_project.end();iter++)
{ {
style.setAttribute(iter.key(),iter.data().toString()); style.setAttribute(iter.key(),iter.data().toString());
} }

@ -30,7 +30,7 @@ public:
AStylePart(TQObject *parent, const char *name, const TQStringList &); AStylePart(TQObject *parent, const char *name, const TQStringList &);
~AStylePart(); ~AStylePart();
TQString formatSource(const TQString text, AStyleWidget * widget, const TQMap<TQString, TQVariant>& options); TQString formatSource(const TQString text, AStyleWidget * widget, const TQStringVariantMap& options);
virtual TQString formatSource(const TQString text); virtual TQString formatSource(const TQString text);
TQString indentString() const; TQString indentString() const;
void saveGlobal(); void saveGlobal();
@ -40,8 +40,8 @@ public:
void restorePartialProjectSession(const TQDomElement * el); void restorePartialProjectSession(const TQDomElement * el);
void savePartialProjectSession(TQDomElement * el); void savePartialProjectSession(TQDomElement * el);
TQMap<TQString, TQVariant>& getProjectOptions(){return m_project;} TQStringVariantMap& getProjectOptions(){return m_project;}
TQMap<TQString, TQVariant>& getGlobalOptions(){return m_global;} TQStringVariantMap& getGlobalOptions(){return m_global;}
private slots: private slots:
@ -65,8 +65,8 @@ private:
TDEAction *formatFileAction; TDEAction *formatFileAction;
// the configurable options. // the configurable options.
TQMap<TQString, TQVariant> m_project; TQStringVariantMap m_project;
TQMap<TQString, TQVariant> m_global; TQStringVariantMap m_global;
TQStringList m_projectExtensions; TQStringList m_projectExtensions;
TQStringList m_globalExtensions; TQStringList m_globalExtensions;
TQMap<TQString, TQString> m_searchExtensions; TQMap<TQString, TQString> m_searchExtensions;

@ -53,7 +53,7 @@ AStyleWidget::AStyleWidget(AStylePart * part, bool global, TQWidget *parent, con
connect(Keep_Blocks, TQT_SIGNAL(clicked()), this, TQT_SLOT(styleChanged())); connect(Keep_Blocks, TQT_SIGNAL(clicked()), this, TQT_SLOT(styleChanged()));
TQMap<TQString, TQVariant> option; TQStringVariantMap option;
if ( isGlobalWidget){ if ( isGlobalWidget){
Style_Global->hide(); Style_Global->hide();
option = m_part->getGlobalOptions(); option = m_part->getGlobalOptions();
@ -172,7 +172,7 @@ AStyleWidget::~AStyleWidget()
void AStyleWidget::accept() void AStyleWidget::accept()
{ {
TQMap<TQString, TQVariant>* m_option; TQStringVariantMap* m_option;
if ( isGlobalWidget){ if ( isGlobalWidget){
m_option = &(m_part->getGlobalOptions()); m_option = &(m_part->getGlobalOptions());
m_part->setExtensions(GeneralExtension->text(),true); m_part->setExtensions(GeneralExtension->text(),true);
@ -195,8 +195,8 @@ void AStyleWidget::accept()
else if (Style_JAVA->isChecked()) else if (Style_JAVA->isChecked())
(*m_option)["FStyle"] = "JAVA"; (*m_option)["FStyle"] = "JAVA";
else if (Style_Global->isChecked()){ else if (Style_Global->isChecked()){
TQMap<TQString,TQVariant>& global = m_part->getGlobalOptions(); TQStringVariantMap& global = m_part->getGlobalOptions();
TQMap<TQString,TQVariant>& project = m_part->getProjectOptions(); TQStringVariantMap& project = m_part->getProjectOptions();
project=global; project=global;
project["FStyle"]="GLOBAL"; project["FStyle"]="GLOBAL";
} }
@ -264,7 +264,7 @@ void AStyleWidget::accept()
} }
if ( isGlobalWidget){ if ( isGlobalWidget){
TQMap<TQString, TQVariant>& project = m_part->getProjectOptions(); TQStringVariantMap& project = m_part->getProjectOptions();
if ( project["FStyle"] == "GLOBAL"){ if ( project["FStyle"] == "GLOBAL"){
project = m_part->getGlobalOptions(); project = m_part->getGlobalOptions();
project["FStyle"] = "GLOBAL"; project["FStyle"] = "GLOBAL";
@ -272,7 +272,7 @@ void AStyleWidget::accept()
m_part->saveGlobal(); m_part->saveGlobal();
} }
// for ( TQMap<TQString, TQVariant>::ConstIterator iter = m_option->begin();iter != m_option->end();iter++ ) // for ( TQStringVariantMap::ConstIterator iter = m_option->begin();iter != m_option->end();iter++ )
// { // {
// kdDebug ( 9009 ) << "widget: " << iter.key() << "=" << iter.data() << endl; // kdDebug ( 9009 ) << "widget: " << iter.key() << "=" << iter.data() << endl;
// } // }

Loading…
Cancel
Save