* 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 <kapplication.h>
+#include "dolphinapplication.h"
+#include "dolphinmainwindow.h"
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
static KCmdLineOptions options[] =
{
- { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ { "+[Url]", I18N_NOOP( "Document to open" ), 0 },
KCmdLineLastOption
};
KCmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions(options);
- KApplication app;
+ DolphinApplication app;
- Dolphin& mainWin = Dolphin::mainWin();
- mainWin.show();
+#warning TODO, SessionManagement
+#if 0
if (false /* KDE4-TODO: app.isSessionRestored() */) {
int n = 1;
while (KMainWindow::canBeRestored(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();
}