don't let spaceAdd ever become negative and break the layout.
[kdelibs.git] / kdeui / kernel / kapplication_win.cpp
blob4cd1dd67a81b4c4ef60c196bbe475798d07698e0
1 /*
2 This file is part of the KDE libraries
3 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include <QtGui/QApplication>
21 #include <kstandarddirs.h>
22 #include <klocale.h>
24 #include <QTranslator>
25 #include <QLocale>
26 #include <QLibraryInfo>
28 /**
29 * MS Windows-related actions for KApplication startup.
31 * - Use Qt translation which will be usable for QFileDialog
32 * and other Qt-only GUIs. The "qt_<language>.qm" file should be stored
33 * in the same place as .po files for a given language.
35 * @internal
37 void KApplication_init_windows()
39 //QString qt_transl_file = ::locate( "locale", KGlobal::locale()->language()
40 // + "/LC_MESSAGES/qt_" + KGlobal::locale()->language() + ".qm" );
42 QString qt_transl_file = QString("qt_") + QLocale::system().name();
43 qt_transl_file.truncate(5);
44 QTranslator *qt_transl = new QTranslator();
45 if (qt_transl->load( qt_transl_file,
46 QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
47 qApp->installTranslator( qt_transl );
48 else
49 delete qt_transl;