summaryrefslogtreecommitdiffstats
path: root/kexi/3rdparty/kolibs/koGlobal.cc
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 /kexi/3rdparty/kolibs/koGlobal.cc
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 'kexi/3rdparty/kolibs/koGlobal.cc')
-rw-r--r--kexi/3rdparty/kolibs/koGlobal.cc68
1 files changed, 34 insertions, 34 deletions
diff --git a/kexi/3rdparty/kolibs/koGlobal.cc b/kexi/3rdparty/kolibs/koGlobal.cc
index 09c74eabe..58c90445d 100644
--- a/kexi/3rdparty/kolibs/koGlobal.cc
+++ b/kexi/3rdparty/kolibs/koGlobal.cc
@@ -21,8 +21,8 @@
#include "config.h"
#include <KoGlobal.h>
#include <kdebug.h>
-#include <qfont.h>
-#include <qfontinfo.h>
+#include <tqfont.h>
+#include <tqfontinfo.h>
#include <kglobalsettings.h>
#include <kglobal.h>
#include <klocale.h>
@@ -58,12 +58,12 @@ KoGlobal::KoGlobal()
// Tell the iconloader about share/apps/koffice/icons
KGlobal::iconLoader()->addAppDir("koffice");
- // Another way to get the DPI of the display would be QPaintDeviceMetrics,
+ // Another way to get the DPI of the display would be TQPaintDeviceMetrics,
// but we have no widget here (and moving this to KoView wouldn't allow
// using this from the document easily).
-#ifdef Q_WS_X11
- m_dpiX = QPaintDevice::x11AppDpiX();
- m_dpiY = QPaintDevice::x11AppDpiY();
+#ifdef TQ_WS_X11
+ m_dpiX = TQPaintDevice::x11AppDpiX();
+ m_dpiY = TQPaintDevice::x11AppDpiY();
#else
m_dpiX = 75;
m_dpiY = 75;
@@ -75,31 +75,31 @@ KoGlobal::~KoGlobal()
delete m_kofficeConfig;
}
-QFont KoGlobal::_defaultFont()
+TQFont KoGlobal::_defaultFont()
{
- QFont font = KGlobalSettings::generalFont();
- // we have to use QFontInfo, in case the font was specified with a pixel size
+ TQFont font = KGlobalSettings::generalFont();
+ // we have to use TQFontInfo, in case the font was specified with a pixel size
if ( font.pointSize() == -1 )
{
- // cache size into m_pointSize, since QFontInfo loads the font -> slow
+ // cache size into m_pointSize, since TQFontInfo loads the font -> slow
if ( m_pointSize == -1 )
- m_pointSize = QFontInfo(font).pointSize();
+ m_pointSize = TQFontInfo(font).pointSize();
Q_ASSERT( m_pointSize != -1 );
font.setPointSize( m_pointSize );
}
- //kdDebug()<<k_funcinfo<<"QFontInfo(font).pointSize() :"<<QFontInfo(font).pointSize()<<endl;
+ //kdDebug()<<k_funcinfo<<"TQFontInfo(font).pointSize() :"<<TQFontInfo(font).pointSize()<<endl;
//kdDebug()<<k_funcinfo<<"font.name() :"<<font.family ()<<endl;
return font;
}
-QStringList KoGlobal::_listOfLanguageTags()
+TQStringList KoGlobal::_listOfLanguageTags()
{
if ( m_langMap.isEmpty() )
createListOfLanguages();
return m_langMap.values();
}
-QStringList KoGlobal::_listOfLanguages()
+TQStringList KoGlobal::_listOfLanguages()
{
if ( m_langMap.empty() )
createListOfLanguages();
@@ -111,17 +111,17 @@ void KoGlobal::createListOfLanguages()
KConfig config( "all_languages", true, false, "locale" );
// Note that we could also use KLocale::allLanguagesTwoAlpha
- QMap<QString, bool> seenLanguages;
- const QStringList langlist = config.groupList();
- for ( QStringList::ConstIterator itall = langlist.begin();
+ TQMap<TQString, bool> seenLanguages;
+ const TQStringList langlist = config.groupList();
+ for ( TQStringList::ConstIterator itall = langlist.begin();
itall != langlist.end(); ++itall )
{
- const QString tag = *itall;
+ const TQString tag = *itall;
config.setGroup( tag );
- const QString name = config.readEntry("Name", tag);
+ const TQString name = config.readEntry("Name", tag);
// e.g. name is "French" and tag is "fr"
- // The QMap does the sorting on the display-name, so that
+ // The TQMap does the sorting on the display-name, so that
// comboboxes are sorted.
m_langMap.insert( name, tag );
@@ -132,23 +132,23 @@ void KoGlobal::createListOfLanguages()
// Many of them are already in all_languages but all_languages doesn't
// currently have en_GB or en_US etc.
- const QStringList translationList = KGlobal::dirs()->findAllResources("locale",
- QString::fromLatin1("*/entry.desktop"));
- for ( QStringList::ConstIterator it = translationList.begin();
+ const TQStringList translationList = KGlobal::dirs()->findAllResources("locale",
+ TQString::tqfromLatin1("*/entry.desktop"));
+ for ( TQStringList::ConstIterator it = translationList.begin();
it != translationList.end(); ++it )
{
// Extract the language tag from the directory name
- QString tag = *it;
- int index = tag.findRev('/');
+ TQString tag = *it;
+ int index = tag.tqfindRev('/');
tag = tag.left(index);
- index = tag.findRev('/');
+ index = tag.tqfindRev('/');
tag = tag.mid(index+1);
- if ( seenLanguages.find( tag ) == seenLanguages.end() ) {
+ if ( seenLanguages.tqfind( tag ) == seenLanguages.end() ) {
KSimpleConfig entry(*it);
entry.setGroup("KCM Locale");
- const QString name = entry.readEntry("Name", tag);
+ const TQString name = entry.readEntry("Name", tag);
// e.g. name is "US English" and tag is "en_US"
m_langMap.insert( name, tag );
@@ -163,20 +163,20 @@ void KoGlobal::createListOfLanguages()
// How to add them?
}
-QString KoGlobal::tagOfLanguage( const QString & _lang)
+TQString KoGlobal::tagOfLanguage( const TQString & _lang)
{
const LanguageMap& map = self()->m_langMap;
- QMap<QString,QString>::ConstIterator it = map.find( _lang );
+ TQMap<TQString,TQString>::ConstIterator it = map.tqfind( _lang );
if ( it != map.end() )
return *it;
- return QString::null;
+ return TQString();
}
-QString KoGlobal::languageFromTag( const QString &langTag )
+TQString KoGlobal::languageFromTag( const TQString &langTag )
{
const LanguageMap& map = self()->m_langMap;
- QMap<QString,QString>::ConstIterator it = map.begin();
- const QMap<QString,QString>::ConstIterator end = map.end();
+ TQMap<TQString,TQString>::ConstIterator it = map.begin();
+ const TQMap<TQString,TQString>::ConstIterator end = map.end();
for ( ; it != end; ++it )
if ( it.data() == langTag )
return it.key();