Adjusted to use new TQStringVariantMap type.

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

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

@ -155,7 +155,7 @@ public:
static void setFakeProperty( TQObject *o, const TQString &property, const TQVariant& value );
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 int spacing( TQObject *o );

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

@ -35,7 +35,7 @@ ChildProperty::ChildProperty(MultiProperty *parent, int type, ChildPropertyType
}
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)
: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);
/**Constructs property with @ref ValueFromList type.*/
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);
/**@return the value of the property.*/

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

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

@ -24,13 +24,13 @@
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)
{
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)
{
init(rw);
@ -50,7 +50,7 @@ void PComboBox::init(bool rw)
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());
}
@ -58,7 +58,7 @@ void PComboBox::fillBox()
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())
return TQVariant("");
return TQVariant(it.data());
@ -83,7 +83,7 @@ void PComboBox::updateProperty(int /*val*/)
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)
return it.key();
@ -91,7 +91,7 @@ TQString PComboBox::findDescription(const TQVariant &value)
return "";
}
void PComboBox::setValueList(const TQMap<TQString, TQVariant> &valueList)
void PComboBox::setValueList(const TQStringVariantMap &valueList)
{
m_valueList = valueList;
m_edit->clear();

@ -38,9 +38,9 @@ class PComboBox: public PropertyWidget{
public:
/**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*/
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.*/
virtual TQVariant value() const;
@ -50,7 +50,7 @@ public:
/**Sets the list of possible values shown in the editor widget. This method
does not emit propertyChanged signal. Reimplemented because combobox is used
to display possible values from valueList.*/
virtual void setValueList(const TQMap<TQString, TQVariant> &valueList);
virtual void setValueList(const TQStringVariantMap &valueList);
protected:
TQString findDescription(const TQVariant &value);
@ -63,7 +63,7 @@ private:
void init(bool rw = false);
/** map<description, value>*/
TQMap<TQString, TQVariant> m_valueList;
TQStringVariantMap m_valueList;
TQComboBox *m_edit;
};

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

@ -32,7 +32,7 @@ class PCursorEdit: public PComboBox
Q_OBJECT
public:
PCursorEdit(MultiProperty* property, const TQMap<TQString, TQVariant> &spValues,
PCursorEdit(MultiProperty* property, const TQStringVariantMap &spValues,
TQWidget* parent = 0, const char* name = 0);
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):
valueList(v_valueList), m_type(ValueFromList), m_name(name),
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;
}
void Property::setValueList(const TQMap<TQString, TQVariant> &v_valueList)
void Property::setValueList(const TQStringVariantMap &v_valueList)
{
valueList = v_valueList;
}

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

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

@ -74,7 +74,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
{
int type = property->type();
TQString propertyName = property->name();
TQMap<TQString, TQVariant> valueList = property->valueList();
TQStringVariantMap valueList = property->valueList();
if (m_registeredForType.contains(propertyName))
return (*m_registeredForType[propertyName])();
@ -143,7 +143,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
}
case Property::SizePolicy:
{
TQMap<TQString, TQVariant> spValues;
TQStringVariantMap spValues;
spValues[i18n("Fixed")] = TQSizePolicy::Fixed;
spValues[i18n("Minimum")] = TQSizePolicy::Minimum;
spValues[i18n("Maximum")] = TQSizePolicy::Maximum;
@ -161,7 +161,7 @@ Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
}
case Property::Cursor:
{
TQMap<TQString, TQVariant> spValues;
TQStringVariantMap spValues;
spValues[i18n("Arrow")] = TQt::ArrowCursor;
spValues[i18n("Up Arrow")] = TQt::UpArrowCursor;
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());
}
void PropertyWidget::setValueList(const TQMap<TQString, TQVariant> &// valueList
void PropertyWidget::setValueList(const TQStringVariantMap &// valueList
)
{
//this does nothing

@ -65,7 +65,7 @@ public:
virtual void setProperty(MultiProperty *property);
/**Sets the list of possible values shown in the editor widget. This method
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.*/
virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value);

@ -26,7 +26,7 @@
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)
{
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
{
// 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)
return it.key();

@ -36,7 +36,7 @@ class PSizePolicyEdit : public PropertyWidget
Q_OBJECT
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 void drawViewer(TQPainter* p, const TQColorGroup& cg, const TQRect& r, const TQVariant& value);
@ -47,7 +47,7 @@ public:
private:
KLineEdit *m_edit;
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;
// }

@ -37,7 +37,7 @@ class KDevFormatter : public astyle::ASFormatter
{
public:
KDevFormatter(const TQMap<TQString, TQVariant>& options);
KDevFormatter(const TQStringVariantMap& options);
KDevFormatter( AStyleWidget * widget );
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;
// }
@ -110,7 +110,7 @@ void AStylePart::loadGlobal()
void AStylePart::saveGlobal()
{
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;
options += iter.key();
@ -118,7 +118,7 @@ void AStylePart::saveGlobal()
options += iter.data().toString();
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;
// }
@ -129,11 +129,11 @@ void AStylePart::saveGlobal()
config->writeEntry("Extensions",m_globalExtensions.join(","));
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;
// }
// 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;
// }
@ -343,7 +343,7 @@ void AStylePart::activePartChanged ( KParts::Part *part )
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);
KDevFormatter * formatter = ( widget)? new KDevFormatter( widget ) : new KDevFormatter(options);
@ -426,7 +426,7 @@ void AStylePart::restorePartialProjectSession(const TQDomElement * el)
}
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());
}
@ -451,7 +451,7 @@ void AStylePart::savePartialProjectSession(TQDomElement * el)
style.setAttribute("FStyle", m_project["FStyle"].toString());
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());
}

@ -30,7 +30,7 @@ public:
AStylePart(TQObject *parent, const char *name, const TQStringList &);
~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);
TQString indentString() const;
void saveGlobal();
@ -40,8 +40,8 @@ public:
void restorePartialProjectSession(const TQDomElement * el);
void savePartialProjectSession(TQDomElement * el);
TQMap<TQString, TQVariant>& getProjectOptions(){return m_project;}
TQMap<TQString, TQVariant>& getGlobalOptions(){return m_global;}
TQStringVariantMap& getProjectOptions(){return m_project;}
TQStringVariantMap& getGlobalOptions(){return m_global;}
private slots:
@ -65,8 +65,8 @@ private:
TDEAction *formatFileAction;
// the configurable options.
TQMap<TQString, TQVariant> m_project;
TQMap<TQString, TQVariant> m_global;
TQStringVariantMap m_project;
TQStringVariantMap m_global;
TQStringList m_projectExtensions;
TQStringList m_globalExtensions;
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()));
TQMap<TQString, TQVariant> option;
TQStringVariantMap option;
if ( isGlobalWidget){
Style_Global->hide();
option = m_part->getGlobalOptions();
@ -172,7 +172,7 @@ AStyleWidget::~AStyleWidget()
void AStyleWidget::accept()
{
TQMap<TQString, TQVariant>* m_option;
TQStringVariantMap* m_option;
if ( isGlobalWidget){
m_option = &(m_part->getGlobalOptions());
m_part->setExtensions(GeneralExtension->text(),true);
@ -195,8 +195,8 @@ void AStyleWidget::accept()
else if (Style_JAVA->isChecked())
(*m_option)["FStyle"] = "JAVA";
else if (Style_Global->isChecked()){
TQMap<TQString,TQVariant>& global = m_part->getGlobalOptions();
TQMap<TQString,TQVariant>& project = m_part->getProjectOptions();
TQStringVariantMap& global = m_part->getGlobalOptions();
TQStringVariantMap& project = m_part->getProjectOptions();
project=global;
project["FStyle"]="GLOBAL";
}
@ -264,7 +264,7 @@ void AStyleWidget::accept()
}
if ( isGlobalWidget){
TQMap<TQString, TQVariant>& project = m_part->getProjectOptions();
TQStringVariantMap& project = m_part->getProjectOptions();
if ( project["FStyle"] == "GLOBAL"){
project = m_part->getGlobalOptions();
project["FStyle"] = "GLOBAL";
@ -272,7 +272,7 @@ void AStyleWidget::accept()
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;
// }

Loading…
Cancel
Save