]> cloud.milkyroute.net Git - dolphin.git/blob - src/main.cpp
Better fix for compilation without Nepomuk - like Sebastian noted SDO is being search...
[dolphin.git] / src / main.cpp
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 ***************************************************************************/
20
21 #include "dolphinapplication.h"
22
23 #include "dolphinmainwindow.h"
24
25 #include <kaboutdata.h>
26 #include <kcmdlineargs.h>
27 #include <klocale.h>
28 #include <kmainwindow.h>
29 #include <kdebug.h>
30
31 int main(int argc, char **argv)
32 {
33 KAboutData about("dolphin", 0,
34 ki18nc("@title", "Dolphin"),
35 "1.3.80",
36 ki18nc("@title", "File Manager"),
37 KAboutData::License_GPL,
38 ki18nc("@info:credit", "(C) 2006-2009 Peter Penz"));
39 about.setHomepage("http://dolphin.kde.org");
40 about.addAuthor(ki18nc("@info:credit", "Peter Penz"),
41 ki18nc("@info:credit", "Maintainer and developer"),
42 "peter.penz@gmx.at");
43 about.addAuthor(ki18nc("@info:credit", "David Faure"),
44 ki18nc("@info:credit", "Developer"),
45 "faure@kde.org");
46 about.addAuthor(ki18nc("@info:credit", "Aaron J. Seigo"),
47 ki18nc("@info:credit", "Developer"),
48 "aseigo@kde.org");
49 about.addAuthor(ki18nc("@info:credit", "Rafael Fernández López"),
50 ki18nc("@info:credit", "Developer"),
51 "ereslibre@kde.org");
52 about.addAuthor(ki18nc("@info:credit", "Kevin Ottens"),
53 ki18nc("@info:credit", "Developer"),
54 "ervin@kde.org");
55 about.addAuthor(ki18nc("@info:credit", "Holger Freyther"),
56 ki18nc("@info:credit", "Developer"),
57 "freyther@gmx.net");
58 about.addAuthor(ki18nc("@info:credit", "Max Blazejak"),
59 ki18nc("@info:credit", "Developer"),
60 "m43ksrocks@gmail.com");
61 about.addAuthor(ki18nc("@info:credit", "Michael Austin"),
62 ki18nc("@info:credit", "Documentation"),
63 "tuxedup@users.sourceforge.net");
64 // the .desktop file is not taken into account when launching manually, so
65 // set the icon precautionally:
66 about.setProgramIconName("system-file-manager");
67
68 KCmdLineArgs::init(argc, argv, &about);
69
70 KCmdLineOptions options;
71
72 // TODO KDE SC 4.5: The string freeze is valid and no new localized strings are allowed.
73 // To get in the --select option that was available in Konqueror 3, an already existing
74 // string ("Document to open") is used as workaround (the --select option will most probably
75 // anyhow used by applications and not by users).
76 const KLocalizedString& documentToOpen = ki18nc("@info:shell", "Document to open");
77 options.add("select", documentToOpen);
78 options.add("+[Url]", documentToOpen);
79 KCmdLineArgs::addCmdLineOptions(options);
80
81 if (!DolphinApplication::start()) {
82 return 0;
83 }
84
85 DolphinApplication app;
86 KGlobal::locale()->insertCatalog("libkonq"); // needed for applications using libkonq
87
88 if (app.isSessionRestored()) {
89 int n = 1;
90 while (KMainWindow::canBeRestored(n)) {
91 const QString className = KXmlGuiWindow::classNameOfToplevel(n);
92 if (className == QLatin1String("DolphinMainWindow")) {
93 DolphinMainWindow* win = app.createMainWindow();
94 win->restore(n);
95 } else {
96 kWarning() << "Unknown class " << className << " in session saved data!";
97 }
98 ++n;
99 }
100 }
101 app.exec(); // krazy:exclude=crashy
102
103 return 0;
104 }