-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
61 lines (52 loc) · 2.2 KB
/
Copy pathmain.cpp
File metadata and controls
61 lines (52 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
**************************************************************************
description
--------------------
copyright : (C) 2000-2001 by Andreas Zehender
email : zehender@kde.org
**************************************************************************
**************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
**************************************************************************/
#include <QApplication>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QLocale>
#include "pmshell.h"
#include "pmrendermanager.h"
#include "version.h"
int main( int argc, char* argv[] )
{
PMShell* shell = nullptr;
QApplication app( argc, argv ); // PORTING SCRIPT: move this to before the KAboutData initialization
QCommandLineParser parser;
parser.addVersionOption();
parser.addHelpOption();
parser.process( app ); // PORTING SCRIPT: move this to after any parser.addOption
parser.addPositionalArgument( QLatin1String( "[file]" ), "File to open" );
parser.addOption( QCommandLineOption( QStringList() << QLatin1String( "no-dri" ), "Disables direct rendering" ) );
QCoreApplication::setOrganizationName( "kpovmodeler" );
QCoreApplication::setApplicationName( "kpovmodeler" );
if( !parser.isSet( "-dri" ) )
PMGLView::enableDirectRendering( false );
if( parser.positionalArguments().count() > 0 )
{
for( int i = 0 ; i < parser.positionalArguments().count() ; i++ )
{
shell = new PMShell( parser.positionalArguments().at( i ) );
shell->show();
}
}
else
{
shell = new PMShell;
shell->show();
}
parser.clearPositionalArguments();
return app.exec();
}