Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / dolphin / src / main.cpp
blob28a69390f71be6e0a8db86189df0224b5b482a0e
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #include "dolphinapplication.h"
23 #include "dolphinmainwindow.h"
25 #include <kaboutdata.h>
26 #include <kcmdlineargs.h>
27 #include <kicon.h>
28 #include <klocale.h>
29 #include <kmainwindow.h>
30 #include <kdebug.h>
32 int main(int argc, char **argv)
34 KAboutData about("dolphin", 0,
35 ki18nc("@title", "Dolphin"),
36 "1.0.99",
37 ki18nc("@title", "File Manager"),
38 KAboutData::License_GPL,
39 ki18nc("@info:credit", "(C) 2006, 2007 Peter Penz"));
40 about.setHomepage("http://enzosworld.gmxhome.de");
41 about.addAuthor(ki18nc("@info:credit", "Peter Penz"),
42 ki18nc("@info:credit", "Maintainer and developer"),
43 "peter.penz@gmx.at");
44 about.addAuthor(ki18nc("@info:credit", "David Faure"),
45 ki18nc("@info:credit", "Developer"),
46 "faure@kde.org");
47 about.addAuthor(ki18nc("@info:credit", "Aaron J. Seigo"),
48 ki18nc("@info:credit", "Developer"),
49 "aseigo@kde.org");
50 about.addAuthor(ki18nc("@info:credit", "Rafael Fernández López"),
51 ki18nc("@info:credit", "Developer"),
52 "ereslibre@kde.org");
53 about.addAuthor(ki18nc("@info:credit", "Kevin Ottens"),
54 ki18nc("@info:credit", "Developer"),
55 "ervin@kde.org");
56 about.addAuthor(ki18nc("@info:credit", "Holger Freyther"),
57 ki18nc("@info:credit", "Developer"),
58 "freyther@gmx.net");
59 about.addAuthor(ki18nc("@info:credit", "Max Blazejak"),
60 ki18nc("@info:credit", "Developer"),
61 "m43ksrocks@gmail.com");
62 about.addAuthor(ki18nc("@info:credit", "Michael Austin"),
63 ki18nc("@info:credit", "Documentation"),
64 "tuxedup@users.sourceforge.net");
66 KCmdLineArgs::init(argc, argv, &about);
68 KCmdLineOptions options;
69 options.add("+[Url]", ki18nc("@info:shell", "Document to open"));
70 KCmdLineArgs::addCmdLineOptions(options);
72 if (!DolphinApplication::start()) {
73 return 0;
76 DolphinApplication app;
77 // the .desktop file is not taken into account when launching manually, so
78 // set the icon precautionally:
79 QApplication::setWindowIcon(KIcon("system-file-manager"));
80 KGlobal::locale()->insertCatalog("libkonq"); // needed for applications using libkonq
82 if (app.isSessionRestored()) {
83 int n = 1;
84 while (KMainWindow::canBeRestored(n)) {
85 const QString className = KXmlGuiWindow::classNameOfToplevel(n);
86 if (className == QLatin1String("DolphinMainWindow")) {
87 DolphinMainWindow* win = app.createMainWindow();
88 win->restore(n);
89 } else {
90 kWarning() << "Unknown class " << className << " in session saved data!";
92 ++n;
95 app.exec();
97 return 0;