X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5252c12db4929886dbe502013e0a1fee6500f568..dc3e19744dedef4b185eb0becb00a28c74381c4c:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 00e6aeb99..f5a51ee30 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,11 +15,11 @@ * 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., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ -#include "dolphin.h" -#include +#include "dolphinapplication.h" +#include "dolphinmainwindow.h" #include #include #include @@ -27,7 +27,7 @@ static KCmdLineOptions options[] = { - { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + { "+[Url]", I18N_NOOP( "Document to open" ), 0 }, KCmdLineLastOption }; @@ -54,28 +54,32 @@ int main(int argc, char **argv) KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions(options); - KApplication app; + DolphinApplication app; - Dolphin& mainWin = Dolphin::mainWin(); - mainWin.show(); - if (false /* KDE4-TODO: app.isRestored() */) { +#warning TODO, SessionManagement +#if 0 + if (false /* KDE4-TODO: app.isSessionRestored() */) { int n = 1; while (KMainWindow::canBeRestored(n)){ Dolphin::mainWin().restore(n); ++n; } } else { +#endif + KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); if (args->count() > 0) { - mainWin.activeView()->setURL(args->url(0)); - - for (int i = 1; i < args->count(); ++i) { - KRun::run("dolphin", args->url(i)); + for (int i = 0; i < args->count(); ++i) { + DolphinMainWindow *win = app.createMainWindow(); + win->activeView()->setUrl(args->url(i)); + win->show(); } + } else { + DolphinMainWindow* mainWin = app.createMainWindow(); + mainWin->show(); } args->clear(); - } - + return app.exec(); }