File indexing completed on 2022-12-06 19:12:09

0001 /* This file is part of the KDE libraries
0002     Copyright (c) 2006 David Faure <faure@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License as published by the Free Software Foundation; either
0007     version 2 of the License, or (at your option) any later version.
0008 
0009     This library is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012     Library General Public License for more details.
0013 
0014     You should have received a copy of the GNU Library General Public License
0015     along with this library; see the file COPYING.LIB.  If not, write to
0016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017     Boston, MA 02110-1301, USA.
0018 */
0019 
0020 //#include <kaboutdata.h>
0021 #include <QApplication>
0022 #include <kglobalsettings.h>
0023 #include <qdebug.h>
0024 
0025 int main(int argc, char **argv)
0026 {
0027     //KCmdLineOptions options;
0028     //options.add("p", qi18n("emit paletteChanged()"));
0029     //options.add("f", qi18n("emit fontChanged()"));
0030     //options.add("ps", qi18n("emit settingsChanged(SETTINGS_PATH)"));
0031 
0032     QApplication app(argc, argv, false);
0033 
0034     QByteArray opt = argc > 1 ? argv[1] : "";
0035     if (opt == "-p") {
0036         qDebug() << "emitChange(PaletteChanged)";
0037         KGlobalSettings::self()->emitChange(KGlobalSettings::PaletteChanged);
0038         return 0;
0039     } else if (opt == "-f") {
0040         qDebug() << "emitChange(FontChanged)";
0041         KGlobalSettings::self()->emitChange(KGlobalSettings::FontChanged);
0042         return 0;
0043     } else if (opt == "--ps") {
0044         qDebug() << "emitChange(SettingsChanged)";
0045         KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
0046         return 0;
0047     }
0048 
0049     qWarning() << "No action specified";
0050     return 1;
0051 }