-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
55 lines (47 loc) · 1.34 KB
/
main.cpp
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
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QCoreApplication>
#include <QPixmap>
#include <QSplashScreen>
#include <QTextStream>
//#include <kcmdlineargs.h>
//#include <kurl.h>
//#include <kaboutdata.h>
#include <KDE/KCmdLineArgs>
#include <KDE/KUrl>
#include <KDE/KAboutData>
int main(int argc, char *argv[])
{
KAboutData aboutData( "WebPhonon", "WebPhonon",
ki18n("WebPhonon"), "1.4",
ki18n("Media Player"),
KAboutData::License_GPL,
ki18n("Copyright (c) 2013 Zakhrov") );
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineOptions options; //new
options.add("+[file]", ki18n("Document to open")); //new
KCmdLineArgs::addCmdLineOptions(options); //new
QApplication a(argc, argv);
QCoreApplication::setApplicationName("WebPhonon");
MainWindow w;
QPixmap img;
img.load(":/splash/WebPhonon-Master-text2.png");
QSplashScreen spl;
spl.setPixmap(img);
spl.show();
QStringList cmd=a.arguments();
// QTextStream cout(stdout);
// cout<<argv[0]<<endl;
// cout<<argv[1]<<endl;
// if(!cmd.isEmpty())
// {
// w.cmdopen(cmd.last());
// }
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
if(args->count()) //new
{
w.cmdopen(args->url(0).url()); //new
}
w.showMaximized();
return a.exec();
}