1/* Copyright (C) 2003-2010 Jesper K. Pedersen <blackie@kde.org>
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public
5 License as published by the Free Software Foundation; either
6 version 2 of the License, or (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifdef KDAB_TEMPORARILY_REMOVED
20#include "Threading/Test.h"
21#endif //KDAB_TEMPORARILY_REMOVED
22#include <QTemporaryFile>
23#include "Settings/SettingsData.h"
24#include "MainWindow/Window.h"
25#include <kapplication.h>
26#include <kcmdlineargs.h>
27#include <kaboutdata.h>
28#include <kimageio.h>
29#include "MainWindow/SplashScreen.h"
30#include <klocale.h>
31#include <kdebug.h>
32#include "RemoteControl/RemoteInterface.h"
33
34#include "version.h"
35
36int main( int argc, char** argv ) {
37 KAboutData aboutData( "kphotoalbum", 0, ki18n("KPhotoAlbum"), KPA_VERSION,
38 ki18n("KDE Photo Album"), KAboutData::License_GPL,
39 KLocalizedString(), KLocalizedString(), "http://www.kphotoalbum.org");
40 aboutData.addAuthor( ki18n("Jesper K. Pedersen"), ki18n("Development"), "blackie@kde.org" );
41 aboutData.addAuthor( ki18n("Hassan Ibraheem"),ki18n("Development"), "hasan.ibraheem@gmail.com");
42 aboutData.addAuthor( ki18n("Miika Turkia"),ki18n("Development"), "miika.turkia@gmail.com");
43 aboutData.addAuthor( ki18n("Tuomas Suutari"), ki18n("SQL backend and numerous features"), "thsuut@utu.fi" );
44 aboutData.addAuthor( ki18n("Jan Kundr&aacute;t"), ki18n("Development"), "jkt@gentoo.org");
45 aboutData.addAuthor( ki18n("Henner Zeller"),ki18n("Development"), "h.zeller@acm.org");
46 aboutData.addAuthor( ki18n("Andreas Neustifter"),ki18n("Development"), "andreas.neustifter@gmail.com");
47 aboutData.addAuthor( ki18n("Johannes Zarl"),ki18n("Development"), "isilmendil@gmx.net");
48 aboutData.addAuthor( ki18n("Tobias Leupold"),ki18n("Development"), "tobias.leupold@web.de");
49
50
51 aboutData.addCredit( ki18n("Will Stephenson"), ki18n("Developing an Icon for KPhotoAlbum"), "will@stevello.free-online.co.uk" );
52 aboutData.addCredit( ki18n("Teemu Rytilahti"),
53 ki18n("Sending patches implementing (.) the \"Set As Wallpaper\" menu in the viewer."
54 "(.) Theme support for HTML generation"), "teemu.rytilahti@kde-fi.org" );
55 aboutData.addCredit( ki18n("Reimar Imhof"), ki18n("Patch to sort items in option listboxes"), "Reimar.Imhof@netCologne.de" );
56 aboutData.addCredit( ki18n("Thomas Schwarzgruber"), ki18n("Patch to sort images in the thumbnail view, plus reading time info out of EXIF images for existing images"), "possebaer@gmx.at" );
57 aboutData.addCredit( ki18n("Marcel Wiesweg"), ki18n("Patch which speed up loading of thumbnails plus preview in image property dialog."), "marcel.wiesweg@gmx.de" );
58 aboutData.addCredit( ki18n("Marco Caldarelli"), ki18n("Patch for making it possible to reread EXIF info using a nice dialog."), "caldarel@yahoo.it" );
59 aboutData.addCredit( ki18n("Jean-Michel FAYARD"), ki18n("(.) Patch with directory info made available through the browser. (.) Patch for adding a check box for \"and/or\" searches in the search page."), "jmfayard@gmail.com" );
60 aboutData.addCredit( ki18n("Robert L Krawitz"), ki18n("Numerous patches plus profiling KPhotoAlbum again and again."), "rlk@alum.mit.edu" );
61 aboutData.addCredit( ki18n("Christoph Moseler"), ki18n("Numerous patches for lots of bugs plus patches for a few new features"), "forums@moseler.net" );
62 aboutData.addCredit( ki18n("Clytie Siddall"), ki18n("Tremendous help with the English text in the application."), "clytie@riverland.net.au" );
63 aboutData.addCredit( ki18n("Wes Hardaker"),ki18n("Some very useful features to improve workflow"), "kpa@capturedonearth.com");
64
65 KCmdLineArgs::init( argc, argv, &aboutData );
66
67 KCmdLineOptions options;
68 options.add("c ", ki18n("Config file"));
69 options.add("demo", ki18n( "Starts KPhotoAlbum with a prebuilt set of demo images" ));
70 options.add("import ", ki18n( "Import file" ));
71 options.add("nolisten-network", ki18n( "Don't start listening for android devices on startup." ));
72 KCmdLineArgs::addCmdLineOptions( options );
73
74 KApplication app;
75
76 new MainWindow::SplashScreen();
77
78 // FIXME: There is no point in using try here, because exceptions
79 // and Qt event loop don't mix. Rather exceptions should be
80 // caught earlier and not passed through Qt code.
81 try {
82 MainWindow::Window* view = new MainWindow::Window( 0 );
83
84 // qApp->setMainWidget( view );
85 view->setGeometry( Settings::SettingsData::instance()->windowGeometry( Settings::MainWindow ) );
86
87 (void) RemoteControl::RemoteInterface::instance();
88
89 int code = app.exec();
90 // I've heard multiple people complain about a crash in this line.
91 // unfortunately valgrind doesn't tell me why that should be, and I haven't seen it myself.
92 // Anyway, the line is really only needed when searching for memory leaks.
93 // delete view;
94 return code;
95 }
96 catch (...) {
97 qFatal("Unknown exception caught");
98 }
99}
100// vi:expandtab:tabstop=4 shiftwidth=4:
101