argdox for stdockConvert; locale detection
[xcurtheme.git] / src / main.cpp
blob222db7b86725ea13eac1771aa657b246b919d5fe
1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
3 * This program is free software. It comes without any warranty, to
4 * the extent permitted by applicable law. You can redistribute it
5 * and/or modify it under the terms of the Do What The Fuck You Want
6 * To Public License, Version 2, as published by Sam Hocevar. See
7 * http://sam.zoy.org/wtfpl/COPYING for more details.
8 */
9 //#include <QtCore>
10 #include <QDebug>
12 #include "main.h"
14 #include <QApplication>
15 #include <QFile>
16 #include <QImage>
17 #include <QString>
18 #include <QStringList>
19 #include <QTextCodec>
20 #include <QTextStream>
23 ///////////////////////////////////////////////////////////////////////////////
24 static void fixTextCodec () {
25 QTextCodec *kc;
26 const char *ll = getenv("LANG");
28 if (!ll || !ll[0]) ll = getenv("LC_CTYPE");
29 if (ll && ll[0] && (strcasestr(ll, "utf-8") || strcasestr(ll, "utf8"))) return;
30 kc = QTextCodec::codecForName("koi8-r");
31 if (!kc) return;
32 QTextCodec::setCodecForCStrings(kc);
33 QTextCodec::setCodecForLocale(kc);
37 ///////////////////////////////////////////////////////////////////////////////
38 int main (int argc, char *argv[]) {
39 fixTextCodec();
41 QApplication app(argc, argv);
43 //qDebug() << findDefaultTheme() << getCurrentTheme();
45 SelectWnd *sw = new SelectWnd;
46 sw->show();
47 sw->setCurrent();
48 return app.exec();