author | spiralman <spiralman> | 2003-03-21 21:59:58 (UTC) |
---|---|---|
committer | spiralman <spiralman> | 2003-03-21 21:59:58 (UTC) |
commit | 07a03b603d964b07d2866e04f480014fadcf1570 (patch) (unidiff) | |
tree | bcc0b9c9a91855a21ec6dc777eb9ca803bf1b2f4 /noncore/net/ubrowser/mainview.cpp | |
parent | d1d55108ecc8c913267122014aa2f139be947299 (diff) | |
download | opie-07a03b603d964b07d2866e04f480014fadcf1570.zip opie-07a03b603d964b07d2866e04f480014fadcf1570.tar.gz opie-07a03b603d964b07d2866e04f480014fadcf1570.tar.bz2 |
fixed commandline argument reading, made ubrowser a "document-oriented application" (implemented setDocument, etc)
Diffstat (limited to 'noncore/net/ubrowser/mainview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/ubrowser/mainview.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/noncore/net/ubrowser/mainview.cpp b/noncore/net/ubrowser/mainview.cpp index d3f4c57..f68c5db 100644 --- a/noncore/net/ubrowser/mainview.cpp +++ b/noncore/net/ubrowser/mainview.cpp | |||
@@ -33,6 +33,7 @@ MainView::MainView(QWidget *parent, const char *name) : QMainWindow(parent, name | |||
33 | 33 | ||
34 | toolbar->setStretchableWidget(location); | 34 | toolbar->setStretchableWidget(location); |
35 | toolbar->setHorizontalStretchable(true); | 35 | toolbar->setHorizontalStretchable(true); |
36 | location->setAutoCompletion( true ); | ||
36 | 37 | ||
37 | addToolBar(toolbar); | 38 | addToolBar(toolbar); |
38 | 39 | ||
@@ -61,12 +62,19 @@ MainView::MainView(QWidget *parent, const char *name) : QMainWindow(parent, name | |||
61 | if( qApp->argc() > 1 ) | 62 | if( qApp->argc() > 1 ) |
62 | { | 63 | { |
63 | char **argv = qApp->argv(); | 64 | char **argv = qApp->argv(); |
64 | QString *argv1 = new QString( argv[1] ); | 65 | int i = 0; |
65 | if( !argv1->startsWith( "http://" ) && !argv1->startsWith( "/" ) ) | 66 | QString *openfile = new QString( argv[0] ); |
67 | while( openfile->contains( "ubrowser" ) == 0 && i < qApp->argc() ) | ||
66 | { | 68 | { |
67 | argv1->insert( 0, QDir::currentDirPath()+"/" ); | 69 | i++; |
70 | *openfile = argv[i]; | ||
68 | } | 71 | } |
69 | location->setEditText( *argv1 ); | 72 | *openfile = argv[i+1]; |
73 | if( !openfile->startsWith( "http://" ) && !openfile->startsWith( "/" ) ) | ||
74 | { | ||
75 | openfile->insert( 0, QDir::currentDirPath()+"/" ); | ||
76 | } | ||
77 | location->setEditText( *openfile ); | ||
70 | goClicked(); | 78 | goClicked(); |
71 | } | 79 | } |
72 | } | 80 | } |
@@ -103,3 +111,11 @@ void MainView::textChanged() | |||
103 | 111 | ||
104 | location->setEditText(browser->source()); | 112 | location->setEditText(browser->source()); |
105 | } | 113 | } |
114 | |||
115 | void MainView::setDocument( const QString& applnk_filename ) | ||
116 | { | ||
117 | DocLnk *file = new DocLnk( applnk_filename ); | ||
118 | |||
119 | location->setEditText( file->file() ); | ||
120 | goClicked(); | ||
121 | } | ||