Changeset 149 in tspsg-svn for trunk/src/main.cpp


Ignore:
Timestamp:
Dec 20, 2010, 9:53:45 PM (14 years ago)
Author:
laleppa
Message:

Converted file formatting to have spaces instead of tabs. No code changes...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main.cpp

    r141 r149  
    2424#include "mainwindow.h"
    2525#if QT_VERSION < 0x040600
    26         #ifdef Q_CC_MSVC
    27                 #pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.")
    28         #elif defined(Q_CC_GNU)
    29                 #warning WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.
    30         #else
    31                 #error You are using Qt version < 4.6. Application will not support some non-critical features. To continue, please, comment line 31 at main.cpp.
    32         #endif
     26#   ifdef Q_CC_MSVC
     27#       pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.")
     28#   elif defined(Q_CC_GNU)
     29#       warning WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.
     30#   else
     31#       error You are using Qt version < 4.6. Application will not support some non-critical features. To continue, please, comment line 31 at main.cpp.
     32#   endif
    3333#endif
    3434
     
    4242{
    4343QApplication app(argc, argv);
    44         app.setOverrideCursor(QCursor(Qt::WaitCursor));
    45         QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
    46         QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
    47         QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
    48         app.setOrganizationName("Oleksii \"Lёppa\" Serdiuk");
    49         app.setOrganizationDomain("oleksii.name");
    50         app.setApplicationName("TSP Solver and Generator");
    51         app.setApplicationVersion(BUILD_VERSION);
     44    app.setOverrideCursor(QCursor(Qt::WaitCursor));
     45    QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
     46    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
     47    QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
     48    app.setOrganizationName("Oleksii \"Lёppa\" Serdiuk");
     49    app.setOrganizationDomain("oleksii.name");
     50    app.setApplicationName("TSP Solver and Generator");
     51    app.setApplicationVersion(BUILD_VERSION);
    5252
    53         // Seeding random number generator
    54         qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y());
     53    // Seeding random number generator
     54    qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y());
    5555
    5656#ifdef Q_WS_WINCE_WM
    57         // Qt "leaves" unpacked .ttf files after running - let's try to delete them.
     57    // Qt "leaves" unpacked .ttf files after running - let's try to delete them.
    5858QStringList files = QDir(app.applicationDirPath(), "*.ttf").entryList();
    59         foreach (QString file, files) {
    60                 QFile::remove(file);
    61         }
     59    foreach (QString file, files) {
     60        QFile::remove(file);
     61    }
    6262#endif
    63         // Don't load the font if it is already available
    64         if (!QFontDatabase().families().contains(DEF_FONT_FACE))
    65                 QFontDatabase::addApplicationFont(":/files/DejaVuLGCSansMono.ttf");
     63    // Don't load the font if it is already available
     64    if (!QFontDatabase().families().contains(DEF_FONT_FACE))
     65        QFontDatabase::addApplicationFont(":/files/DejaVuLGCSansMono.ttf");
    6666
    6767QTranslator en;
    68         if (en.load("tspsg_en", PATH_L10N))
    69                 app.installTranslator(&en);
    70         else if (en.load("tspsg_en", ":/l10n"))
    71                 app.installTranslator(&en);
     68    if (en.load("tspsg_en", PATH_L10N))
     69        app.installTranslator(&en);
     70    else if (en.load("tspsg_en", ":/l10n"))
     71        app.installTranslator(&en);
    7272
    7373MainWindow mainwindow;
    7474#ifdef HANDHELD
    75         mainwindow.showMaximized();
     75    mainwindow.showMaximized();
    7676#else // HANDHELD
    77         mainwindow.show();
     77    mainwindow.show();
    7878#endif // HANDHELD
    79         app.restoreOverrideCursor();
    80         return app.exec();
     79    app.restoreOverrideCursor();
     80    return app.exec();
    8181}
Note: See TracChangeset for help on using the changeset viewer.