"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/gui-qt/main.cpp" (12 May 2020, 2129 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /***************************************************************************
    2                                main.cpp
    3                              -------------------
    4     begin                : Mo 16.03.2009
    5     copyright            : (C) 2009 by Andre Simon
    6     email                : a.simon@mailbox.org
    7  ***************************************************************************/
    8 
    9 
   10 /*
   11 This file is part of Highlight.
   12 
   13 Highlight is free software: you can redistribute it and/or modify
   14 it under the terms of the GNU General Public License as published by
   15 the Free Software Foundation, either version 3 of the License, or
   16 (at your option) any later version.
   17 
   18 Highlight is distributed in the hope that it will be useful,
   19 but WITHOUT ANY WARRANTY; without even the implied warranty of
   20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   21 GNU General Public License for more details.
   22 
   23 You should have received a copy of the GNU General Public License
   24 along with Highlight.  If not, see <http://www.gnu.org/licenses/>.
   25 */
   26 
   27 
   28 //?? https://codereview.qt-project.org/#change,51048
   29 
   30 #include <QtGlobal>
   31 
   32 #if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
   33 #include <QtGui/QApplication>
   34 #else
   35 #include <QtWidgets/QApplication>
   36 #endif
   37 #include <QTranslator>
   38 #include <QLocale>
   39 #include <QDir>
   40 
   41 #include "mainwindow.h"
   42 
   43 int main(int argc, char *argv[])
   44 {
   45     QApplication app(argc, argv);
   46     QTranslator translator;
   47 #ifdef DATA_DIR
   48     translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(DATA_DIR).arg(QLocale::system().name()));
   49 #else
   50     translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(QDir::currentPath()).arg(QLocale::system().name()));
   51 #endif
   52     app.installTranslator(&translator);
   53 
   54     if (QCoreApplication::arguments().contains("--portable")) {
   55         QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, QDir::currentPath());
   56     }
   57 
   58     MainWindow w;
   59     /*
   60         QStringList args=QCoreApplication::arguments();
   61         if (args.count()>1){
   62             args.removeFirst(); // drop highlight-gui.exe path
   63             w.addInputFiles(args);
   64         }
   65     */
   66     w.show();
   67     return app.exec();
   68 }