summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/KoOasisSettings.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kofficecore/KoOasisSettings.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kofficecore/KoOasisSettings.cpp')
-rw-r--r--lib/kofficecore/KoOasisSettings.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/lib/kofficecore/KoOasisSettings.cpp b/lib/kofficecore/KoOasisSettings.cpp
index 99f63524..37a0acec 100644
--- a/lib/kofficecore/KoOasisSettings.cpp
+++ b/lib/kofficecore/KoOasisSettings.cpp
@@ -22,74 +22,74 @@
#include "KoDom.h"
#include <kdebug.h>
-KoOasisSettings::KoOasisSettings( const QDomDocument& doc )
+KoOasisSettings::KoOasisSettings( const TQDomDocument& doc )
: m_settingsElement( KoDom::namedItemNS( doc.documentElement(), KoXmlNS::office, "settings" ) ),
m_configNSURI( KoXmlNS::config )
{
- const QDomElement contents = doc.documentElement();
+ const TQDomElement contents = doc.documentElement();
if ( m_settingsElement.isNull() )
kdDebug() << " document doesn't have tag 'office:settings'\n";
}
-KoOasisSettings::KoOasisSettings( const QDomDocument& doc, const char* officeNSURI, const char* configNSURI )
+KoOasisSettings::KoOasisSettings( const TQDomDocument& doc, const char* officeNSURI, const char* configNSURI )
: m_settingsElement( KoDom::namedItemNS( doc.documentElement(), officeNSURI, "settings" ) ),
m_configNSURI( configNSURI )
{
- const QDomElement contents = doc.documentElement();
+ const TQDomElement contents = doc.documentElement();
if ( m_settingsElement.isNull() )
kdDebug() << " document doesn't have tag 'office:settings'\n";
}
-KoOasisSettings::Items KoOasisSettings::itemSet( const QString& itemSetName ) const
+KoOasisSettings::Items KoOasisSettings::itemSet( const TQString& itemSetName ) const
{
- QDomElement e;
+ TQDomElement e;
forEachElement( e, m_settingsElement )
{
if ( e.localName() == "config-item-set" &&
e.namespaceURI() == m_configNSURI &&
- e.attributeNS( m_configNSURI, "name", QString::null ) == itemSetName )
+ e.attributeNS( m_configNSURI, "name", TQString() ) == itemSetName )
{
return Items( e, this );
}
}
- return Items( QDomElement(), this );
+ return Items( TQDomElement(), this );
}
-KoOasisSettings::IndexedMap KoOasisSettings::Items::indexedMap( const QString& itemMapName ) const
+KoOasisSettings::IndexedMap KoOasisSettings::Items::indexedMap( const TQString& itemMapName ) const
{
- QDomElement configItem;
+ TQDomElement configItem;
forEachElement( configItem, m_element )
{
if ( configItem.localName() == "config-item-map-indexed" &&
configItem.namespaceURI() == m_settings->m_configNSURI &&
- configItem.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == itemMapName )
+ configItem.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == itemMapName )
{
return IndexedMap( configItem, m_settings );
}
}
- return IndexedMap( QDomElement(), m_settings );
+ return IndexedMap( TQDomElement(), m_settings );
}
-KoOasisSettings::NamedMap KoOasisSettings::Items::namedMap( const QString& itemMapName ) const
+KoOasisSettings::NamedMap KoOasisSettings::Items::namedMap( const TQString& itemMapName ) const
{
- QDomElement configItem;
+ TQDomElement configItem;
forEachElement( configItem, m_element )
{
if ( configItem.localName() == "config-item-map-named" &&
configItem.namespaceURI() == m_settings->m_configNSURI &&
- configItem.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == itemMapName )
+ configItem.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == itemMapName )
{
return NamedMap( configItem, m_settings );
}
}
- return NamedMap( QDomElement(), m_settings );
+ return NamedMap( TQDomElement(), m_settings );
}
KoOasisSettings::Items KoOasisSettings::IndexedMap::entry( int entryIndex ) const
{
int i = 0;
- QDomElement entry;
+ TQDomElement entry;
forEachElement( entry, m_element )
{
if ( entry.localName() == "config-item-map-entry" &&
@@ -101,51 +101,51 @@ KoOasisSettings::Items KoOasisSettings::IndexedMap::entry( int entryIndex ) cons
++i;
}
}
- return Items( QDomElement(), m_settings );
+ return Items( TQDomElement(), m_settings );
}
-KoOasisSettings::Items KoOasisSettings::NamedMap::entry( const QString& entryName ) const
+KoOasisSettings::Items KoOasisSettings::NamedMap::entry( const TQString& entryName ) const
{
- QDomElement entry;
+ TQDomElement entry;
forEachElement( entry, m_element )
{
if ( entry.localName() == "config-item-map-entry" &&
entry.namespaceURI() == m_settings->m_configNSURI &&
- entry.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == entryName )
+ entry.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == entryName )
{
return Items( entry, m_settings );
}
}
- return Items( QDomElement(), m_settings );
+ return Items( TQDomElement(), m_settings );
}
// helper method
-QString KoOasisSettings::Items::findConfigItem( const QDomElement& element,
- const QString& item, bool* ok ) const
+TQString KoOasisSettings::Items::findConfigItem( const TQDomElement& element,
+ const TQString& item, bool* ok ) const
{
- QDomElement it;
+ TQDomElement it;
forEachElement( it, element )
{
if ( it.localName() == "config-item" &&
it.namespaceURI() == m_settings->m_configNSURI &&
- it.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == item )
+ it.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == item )
{
*ok = true;
return it.text();
}
}
*ok = false;
- return QString::null;
+ return TQString();
}
-QString KoOasisSettings::Items::findConfigItem( const QString& item, bool* ok ) const
+TQString KoOasisSettings::Items::findConfigItem( const TQString& item, bool* ok ) const
{
return findConfigItem( m_element, item, ok );
}
#if 0 // does anyone need this one? passing a default value does the job, too
-bool KoOasisSettings::Items::hasConfigItem( const QString& configName ) const
+bool KoOasisSettings::Items::hasConfigItem( const TQString& configName ) const
{
bool ok;
(void)findConfigItem( configName, &ok );
@@ -153,17 +153,17 @@ bool KoOasisSettings::Items::hasConfigItem( const QString& configName ) const
}
#endif
-QString KoOasisSettings::Items::parseConfigItemString( const QString& configName, const QString& defValue ) const
+TQString KoOasisSettings::Items::parseConfigItemString( const TQString& configName, const TQString& defValue ) const
{
bool ok;
- const QString str = findConfigItem( configName, &ok );
+ const TQString str = findConfigItem( configName, &ok );
return ok ? str : defValue;
}
-int KoOasisSettings::Items::parseConfigItemInt( const QString& configName, int defValue ) const
+int KoOasisSettings::Items::parseConfigItemInt( const TQString& configName, int defValue ) const
{
bool ok;
- const QString str = findConfigItem( configName, &ok );
+ const TQString str = findConfigItem( configName, &ok );
int value;
if ( ok ) {
value = str.toInt( &ok );
@@ -173,10 +173,10 @@ int KoOasisSettings::Items::parseConfigItemInt( const QString& configName, int d
return defValue;
}
-double KoOasisSettings::Items::parseConfigItemDouble( const QString& configName, double defValue ) const
+double KoOasisSettings::Items::parseConfigItemDouble( const TQString& configName, double defValue ) const
{
bool ok;
- const QString str = findConfigItem( configName, &ok );
+ const TQString str = findConfigItem( configName, &ok );
double value;
if ( ok ) {
value = str.toDouble( &ok );
@@ -186,10 +186,10 @@ double KoOasisSettings::Items::parseConfigItemDouble( const QString& configName,
return defValue;
}
-bool KoOasisSettings::Items::parseConfigItemBool( const QString& configName, bool defValue ) const
+bool KoOasisSettings::Items::parseConfigItemBool( const TQString& configName, bool defValue ) const
{
bool ok;
- const QString str = findConfigItem( configName, &ok );
+ const TQString str = findConfigItem( configName, &ok );
if ( str == "true" )
return true;
else if ( str == "false" )
@@ -197,10 +197,10 @@ bool KoOasisSettings::Items::parseConfigItemBool( const QString& configName, boo
return defValue;
}
-short KoOasisSettings::Items::parseConfigItemShort( const QString& configName, short defValue ) const
+short KoOasisSettings::Items::parseConfigItemShort( const TQString& configName, short defValue ) const
{
bool ok;
- const QString str = findConfigItem( configName, &ok );
+ const TQString str = findConfigItem( configName, &ok );
short value;
if ( ok ) {
value = str.toShort( &ok );
@@ -210,10 +210,10 @@ short KoOasisSettings::Items::parseConfigItemShort( const QString& configName, s
return defValue;
}
-long KoOasisSettings::Items::parseConfigItemLong( const QString& configName, long defValue ) const
+long KoOasisSettings::Items::parseConfigItemLong( const TQString& configName, long defValue ) const
{
bool ok;
- const QString str = findConfigItem( configName, &ok );
+ const TQString str = findConfigItem( configName, &ok );
long value;
if ( ok ) {
value = str.toLong( &ok );