summaryrefslogtreecommitdiff
path: root/noncore/net/ubrowser/mainview.cpp
Unidiff
Diffstat (limited to 'noncore/net/ubrowser/mainview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/ubrowser/mainview.cpp24
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
115void MainView::setDocument( const QString& applnk_filename )
116{
117 DocLnk *file = new DocLnk( applnk_filename );
118
119 location->setEditText( file->file() );
120 goClicked();
121}