~ubuntu-branches/ubuntu/natty/qtpfsgui/natty

« back to all changes in this revision

Viewing changes to src/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-01-06 04:39:36 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080106043936-a9u9g7yih3w16ru5
Tags: 1.9.0-1
* New upstream release.
* Replace “COPYING” with “LICENSE” in the NOT_NEEDED variable of
  debian/rules, following upstream's renaming.
* Update debian/links accordingly.
* Delete the matching TODO item since there's no longer needed to have a
  patched (with HTML tags) license file to get a correct display in the
  “License agreement” tab.
* Update the gcc4.3 patch (drop the hunk touching src/Libpfs/pfs.cpp):
   - 20_gcc4.3_includes.
* Add a link from /usr/share/qtpfsgui/html to the HTML documentation
  under /usr/share/doc/qtpfsgui/html since the former is used at runtime
  to display the manual.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <QLocale>
26
26
#include <QTranslator>
27
27
// #include <QDir>
28
 
#include "MainWindow/maingui_impl.h"
 
28
#include "MainWindow/mainWindow.h"
 
29
#include "Common/commandline.h"
29
30
 
30
31
#ifdef WIN32
31
32
#include <QMessageBox>
33
34
 
34
35
int main( int argc, char ** argv )
35
36
{
36
 
        QApplication a( argc, argv );
 
37
        //CLI application
 
38
        if (argc>1) {
 
39
                QCoreApplication CLIapplication( argc, argv );
 
40
                CommandLineInterfaceManager cli( argc, argv );
 
41
                CLIapplication.connect(&cli, SIGNAL(finishedParsing()), &CLIapplication, SLOT(quit()));
 
42
                return CLIapplication.exec();
 
43
        }
 
44
 
 
45
        //GUI application
 
46
        QApplication application( argc, argv );
37
47
//      qDebug() << "QDir::currentPath()=" << QDir::currentPath();
38
48
//      qDebug() << "QCoreApplication::applicationDirPath()=" << QCoreApplication::applicationDirPath();
39
49
 
40
50
#ifdef WIN32
41
51
        bool found_DLL=false;
42
 
        foreach (QString path, a.libraryPaths()) {
 
52
        foreach (QString path, application.libraryPaths()) {
43
53
                if (QFile::exists(path+"/imageformats/qjpeg4.dll"))
44
54
                        found_DLL=true;
45
55
        }
52
62
        QTranslator translator;
53
63
//      qDebug( "Looking for i18n files in: " I18NDIR );
54
64
        translator.load(QString("lang_") + locale, I18NDIR);
55
 
        a.installTranslator(&translator);
56
 
        MainGui w;
57
 
        a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
58
 
        w.show();
59
 
        return a.exec();
 
65
        application.installTranslator(&translator);
 
66
        MainGui maingui;
 
67
        application.connect( &application, SIGNAL(lastWindowClosed()), &application, SLOT(quit()) );
 
68
        maingui.show();
 
69
        return application.exec();
60
70
}