2006-11-21 06:02:05 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
|
|
|
* Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com> *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
2006-12-08 21:24:08 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
2006-11-21 06:02:05 +00:00
|
|
|
***************************************************************************/
|
|
|
|
|
2006-11-29 00:02:19 +00:00
|
|
|
#include "dolphinapplication.h"
|
2007-03-22 16:39:43 +00:00
|
|
|
|
2007-09-27 12:36:40 +00:00
|
|
|
#include "dolphinmainwindow.h"
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
#include <kaboutdata.h>
|
|
|
|
#include <kcmdlineargs.h>
|
|
|
|
#include <klocale.h>
|
2007-09-27 12:36:40 +00:00
|
|
|
#include <kmainwindow.h>
|
2007-10-05 22:21:25 +00:00
|
|
|
#include <kdebug.h>
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2010-03-16 12:30:46 +00:00
|
|
|
extern "C"
|
|
|
|
KDE_EXPORT int kdemain(int argc, char **argv)
|
2006-11-21 06:02:05 +00:00
|
|
|
{
|
2007-07-02 08:49:20 +00:00
|
|
|
KAboutData about("dolphin", 0,
|
2007-07-13 18:39:57 +00:00
|
|
|
ki18nc("@title", "Dolphin"),
|
2010-01-06 17:07:06 +00:00
|
|
|
"1.4",
|
2007-07-13 18:39:57 +00:00
|
|
|
ki18nc("@title", "File Manager"),
|
2006-11-21 06:02:05 +00:00
|
|
|
KAboutData::License_GPL,
|
2009-01-08 20:42:09 +00:00
|
|
|
ki18nc("@info:credit", "(C) 2006-2009 Peter Penz"));
|
2008-07-26 14:01:34 +00:00
|
|
|
about.setHomepage("http://dolphin.kde.org");
|
2007-07-11 10:04:13 +00:00
|
|
|
about.addAuthor(ki18nc("@info:credit", "Peter Penz"),
|
|
|
|
ki18nc("@info:credit", "Maintainer and developer"),
|
|
|
|
"peter.penz@gmx.at");
|
2007-07-13 18:56:51 +00:00
|
|
|
about.addAuthor(ki18nc("@info:credit", "David Faure"),
|
2007-07-11 10:04:13 +00:00
|
|
|
ki18nc("@info:credit", "Developer"),
|
2007-07-13 18:56:51 +00:00
|
|
|
"faure@kde.org");
|
|
|
|
about.addAuthor(ki18nc("@info:credit", "Aaron J. Seigo"),
|
2007-07-11 10:04:13 +00:00
|
|
|
ki18nc("@info:credit", "Developer"),
|
2007-07-13 18:56:51 +00:00
|
|
|
"aseigo@kde.org");
|
|
|
|
about.addAuthor(ki18nc("@info:credit", "Rafael Fernández López"),
|
|
|
|
ki18nc("@info:credit", "Developer"),
|
2007-10-03 00:44:18 +00:00
|
|
|
"ereslibre@kde.org");
|
2007-07-13 18:56:51 +00:00
|
|
|
about.addAuthor(ki18nc("@info:credit", "Kevin Ottens"),
|
|
|
|
ki18nc("@info:credit", "Developer"),
|
|
|
|
"ervin@kde.org");
|
|
|
|
about.addAuthor(ki18nc("@info:credit", "Holger Freyther"),
|
|
|
|
ki18nc("@info:credit", "Developer"),
|
|
|
|
"freyther@gmx.net");
|
|
|
|
about.addAuthor(ki18nc("@info:credit", "Max Blazejak"),
|
|
|
|
ki18nc("@info:credit", "Developer"),
|
|
|
|
"m43ksrocks@gmail.com");
|
2007-07-11 10:04:13 +00:00
|
|
|
about.addAuthor(ki18nc("@info:credit", "Michael Austin"),
|
|
|
|
ki18nc("@info:credit", "Documentation"),
|
|
|
|
"tuxedup@users.sourceforge.net");
|
2009-01-12 10:11:30 +00:00
|
|
|
// the .desktop file is not taken into account when launching manually, so
|
|
|
|
// set the icon precautionally:
|
2008-04-20 23:35:54 +00:00
|
|
|
about.setProgramIconName("system-file-manager");
|
2006-11-21 06:02:05 +00:00
|
|
|
|
|
|
|
KCmdLineArgs::init(argc, argv, &about);
|
2007-07-02 08:49:20 +00:00
|
|
|
|
|
|
|
KCmdLineOptions options;
|
2009-12-17 21:07:18 +00:00
|
|
|
|
|
|
|
// TODO KDE SC 4.5: The string freeze is valid and no new localized strings are allowed.
|
|
|
|
// To get in the --select option that was available in Konqueror 3, an already existing
|
|
|
|
// string ("Document to open") is used as workaround (the --select option will most probably
|
|
|
|
// anyhow used by applications and not by users).
|
|
|
|
const KLocalizedString& documentToOpen = ki18nc("@info:shell", "Document to open");
|
|
|
|
options.add("select", documentToOpen);
|
|
|
|
options.add("+[Url]", documentToOpen);
|
2006-11-21 06:02:05 +00:00
|
|
|
KCmdLineArgs::addCmdLineOptions(options);
|
2007-03-22 07:19:07 +00:00
|
|
|
|
2007-03-22 16:39:43 +00:00
|
|
|
if (!DolphinApplication::start()) {
|
|
|
|
return 0;
|
|
|
|
}
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-03-22 16:39:43 +00:00
|
|
|
DolphinApplication app;
|
2007-07-14 09:41:25 +00:00
|
|
|
KGlobal::locale()->insertCatalog("libkonq"); // needed for applications using libkonq
|
|
|
|
|
2007-11-30 18:42:17 +00:00
|
|
|
if (app.isSessionRestored()) {
|
2006-11-21 06:02:05 +00:00
|
|
|
int n = 1;
|
2007-04-09 19:12:54 +00:00
|
|
|
while (KMainWindow::canBeRestored(n)) {
|
2007-09-27 12:36:40 +00:00
|
|
|
const QString className = KXmlGuiWindow::classNameOfToplevel(n);
|
|
|
|
if (className == QLatin1String("DolphinMainWindow")) {
|
|
|
|
DolphinMainWindow* win = app.createMainWindow();
|
|
|
|
win->restore(n);
|
|
|
|
} else {
|
|
|
|
kWarning() << "Unknown class " << className << " in session saved data!";
|
|
|
|
}
|
2006-11-21 06:02:05 +00:00
|
|
|
++n;
|
|
|
|
}
|
2007-04-09 19:12:54 +00:00
|
|
|
}
|
2009-05-26 18:24:23 +00:00
|
|
|
app.exec(); // krazy:exclude=crashy
|
2007-09-27 12:36:40 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|