diff options
| author | Holger Freyther <[email protected]> | 2006-11-29 00:02:19 +0000 |
|---|---|---|
| committer | Holger Freyther <[email protected]> | 2006-11-29 00:02:19 +0000 |
| commit | f31a541925033c2ef5e27b85c099d47791b50121 (patch) | |
| tree | 11cc728aa7d247ca5b075776c438be0f381be765 /src/main.cpp | |
| parent | 68e81f7280c810e26cabf6cd2897b9dc8466f458 (diff) | |
Make it (almost) possible to have more than one Dolphin KMainWindow
Create a DolphinApplication, holding DolphinMainWindows and update
the code to use the DolphinView to get the MainWindow, or get a ptr
to the MainWindow directly. Or if all windows are effected go through
the DolphinApplication to update every mainwindow.
The UndowManager and ProgressIndicator have a rather strange relationship
and will need some more attention but as UndoManager will be killed
anyway I have skipped this.
More cleanup, debugging and thinking is needed.
svn path=/trunk/playground/utils/dolphin/; revision=608945
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp index eacff0cba..6d71bd720 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "dolphin.h" +#include "dolphinapplication.h" +#include "dolphinmainwindow.h" #include <kapplication.h> #include <kaboutdata.h> #include <kcmdlineargs.h> @@ -54,11 +55,11 @@ int main(int argc, char **argv) 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)){ @@ -66,16 +67,20 @@ int main(int argc, char **argv) ++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(); } |
