1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
2 * Understanding is not required. Only obedience.
4 * This program is free software. It comes without any warranty, to
5 * the extent permitted by applicable law. You can redistribute it
6 * and/or modify it under the terms of the Do What The Fuck You Want
7 * To Public License, Version 2, as published by Sam Hocevar. See
8 * http://sam.zoy.org/wtfpl/COPYING for more details.
18 # include <libotr/proto.h>
25 #include <QApplication>
30 #ifdef USE_STATIC_PICPLUGS
32 Q_IMPORT_PLUGIN(qgif4
)
33 Q_IMPORT_PLUGIN(qjpeg4
)
34 Q_IMPORT_PLUGIN(qmng4
)
35 Q_IMPORT_PLUGIN(qico4
)
36 Q_IMPORT_PLUGIN(qsvg4
)
37 Q_IMPORT_PLUGIN(qtiff4
)
42 #include "psycproto.h"
48 #include "dysversion.h"
53 static void fixTextCodec () {
56 kc
= QTextCodec::codecForName("windows-1251");
58 QTextCodec::setCodecForCStrings(kc
);
59 QTextCodec::setCodecForLocale(kc
);
61 const char *ll
= getenv("LANG");
62 if (!ll
|| !ll
[0]) ll
= getenv("LC_CTYPE");
63 if (ll
&& ll
[0] && (strcasestr(ll
, "utf-8") || strcasestr(ll
, "utf8"))) return;
64 kc
= QTextCodec::codecForName("koi8-r");
66 QTextCodec::setCodecForCStrings(kc
);
67 QTextCodec::setCodecForLocale(kc
);
72 bool debugOutput
= false;
74 static void myMessageOutput (QtMsgType type
, const char *msg
) {
76 case QtDebugMsg
: if (debugOutput
) fprintf(stderr
, "Debug: %s\n", msg
); break;
77 case QtWarningMsg
: if (debugOutput
) fprintf(stderr
, "Warning: %s\n", msg
); break;
78 case QtCriticalMsg
: fprintf(stderr
, "Critical: %s\n", msg
); break;
79 case QtFatalMsg
: fprintf(stderr
, "Fatal: %s\n", msg
); abort();
84 static void setDebugOutput (int argc
, char *argv
[]) {
85 qInstallMsgHandler(myMessageOutput
);
87 for (int f
= 1; f
< argc
; ++f
) {
88 if (strcmp(argv
[f
], "-goobers") == 0) {
90 for (int c
= f
; c
< argc
; ++c
) argv
[c
] = argv
[c
+1];
95 dlogfSetStdErr(debugOutput
?1:0);
96 dlogfSetFile(debugOutput
?"debug.log":NULL
);
97 dlogf("Dyskinesia v%d.%d.%d.%d log initialized", DYS_VERSION_HI
, DYS_VERSION_MID
, DYS_VERSION_LO
, DYS_BUILD
);
101 int main (int argc
, char *argv
[]) {
102 setDebugOutput(argc
, argv
);
104 QApplication
app(argc
, argv
);
108 QCoreApplication::setOrganizationName("Vampire Avalon");
109 QCoreApplication::setOrganizationDomain("ketmar.no-ip.org"); // fuck macz
110 QCoreApplication::setApplicationName("Dyskinesia");
116 ChatForm
*f
= new ChatForm();