KDECore
kglobal_p.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Sirtaj Singh Kanq <taj@kde.org> 00003 Copyright (C) 2007 Matthias Kretz <kretz@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KGLOBAL_P_H 00021 #define KGLOBAL_P_H 00022 00023 #include <kdecore_export.h> 00024 #include <QtCore/QAtomicPointer> 00025 00026 class KComponentData; 00027 00028 namespace KGlobal 00029 { 00031 void newComponentData(const KComponentData &c); 00032 } 00033 00034 #include "kglobal.h" 00035 #include "klocale.h" 00036 #undef QT_NO_TRANSLATION 00037 #include <QtCore/QTranslator> 00038 #define QT_NO_TRANSLATION 00039 00040 class KDETranslator : public QTranslator 00041 { 00042 public: 00043 KDETranslator(QObject *parent) : QTranslator(parent) 00044 { 00045 setObjectName(QLatin1String("kdetranslator")); 00046 } 00047 00048 virtual QString translate(const char* context, 00049 const char *sourceText, 00050 const char* message) const 00051 { 00052 return KGlobal::locale()->translateQt(context, sourceText, message); 00053 } 00054 00055 virtual bool isEmpty() const 00056 { 00057 return false; 00058 } 00059 }; 00060 00061 #endif // KGLOBAL_P_H
KDE 4.6 API Reference