QTfrontend/main.cpp.in
changeset 146 458f4f58c1b6
parent 123 6987769ced3d
child 148 c0355acf07c8
equal deleted inserted replaced
145:e593d5266e01 146:458f4f58c1b6
     1 /*
     1 /*
     2  * Hedgewars, a worms-like game
     2  * Hedgewars, a worms-like game
     3  * Copyright (c) 2005 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2005, 2006 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * Distributed under the terms of the BSD-modified licence:
     5  * Distributed under the terms of the BSD-modified licence:
     6  *
     6  *
     7  * Permission is hereby granted, free of charge, to any person obtaining a copy
     7  * Permission is hereby granted, free of charge, to any person obtaining a copy
     8  * of this software and associated documentation files (the "Software"), to deal
     8  * of this software and associated documentation files (the "Software"), to deal
    34 #include <QApplication>
    34 #include <QApplication>
    35 #include <QTranslator>
    35 #include <QTranslator>
    36 #include <QLocale>
    36 #include <QLocale>
    37 #include <QMessageBox>
    37 #include <QMessageBox>
    38 #include <QFileInfo>
    38 #include <QFileInfo>
       
    39 #include <QDateTime>
    39 #include "hwform.h"
    40 #include "hwform.h"
    40 #include "hwconsts.h"
    41 #include "hwconsts.h"
    41 
    42 
    42 QDir * bindir;
    43 QDir * bindir;
    43 QDir * cfgdir;
    44 QDir * cfgdir;
    44 QDir * datadir;
    45 QDir * datadir;
    45 
    46 
    46 int main(int argc, char *argv[])
    47 int main(int argc, char *argv[])
    47 {
    48 {
    48 	QApplication app(argc, argv);
    49 	QApplication app(argc, argv);
       
    50 
       
    51 	QDateTime now = QDateTime::currentDateTime();
       
    52 	QDateTime zero;
       
    53 	srand(now.secsTo(zero));
    49 
    54 
    50 	Q_INIT_RESOURCE(hedgewars);
    55 	Q_INIT_RESOURCE(hedgewars);
    51 
    56 
    52 	QTranslator Translator;
    57 	QTranslator Translator;
    53 	Translator.load(":/translations/hedgewars_" + QLocale::system().name());
    58 	Translator.load(":/translations/hedgewars_" + QLocale::system().name());