diff options
| author | Andrea Diamantini <adjam7@gmail.com> | 2009-05-25 00:05:16 +0200 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2009-05-25 00:05:16 +0200 | 
| commit | fca022bc0c708f82871850eaab94839c37c2013f (patch) | |
| tree | 5feffee3a6a645b08a7e03c0136a8523677d38aa /src | |
| parent | Initial kdewebkit porting. STEP 1 DONE (diff) | |
| download | rekonq-fca022bc0c708f82871850eaab94839c37c2013f.tar.xz | |
no inline functions, as suggested
Diffstat (limited to 'src')
| -rw-r--r-- | src/bookmarks.cpp | 6 | ||||
| -rw-r--r-- | src/bookmarks.h | 5 | ||||
| -rw-r--r-- | src/mainview.cpp | 43 | ||||
| -rw-r--r-- | src/mainview.h | 14 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 6 | ||||
| -rw-r--r-- | src/mainwindow.h | 5 | ||||
| -rw-r--r-- | src/urlbar.cpp | 18 | ||||
| -rw-r--r-- | src/urlbar.h | 16 | ||||
| -rw-r--r-- | src/webview.cpp | 36 | ||||
| -rw-r--r-- | src/webview.h | 13 | 
10 files changed, 127 insertions, 35 deletions
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index eb500985..9490ed0f 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -66,6 +66,12 @@ void BookmarkOwner::openBookmark(const KBookmark & bookmark,  } +bool BookmarkOwner::supportsTabs() const +{ +    return true; +} + +  QString BookmarkOwner::currentUrl() const  {      return Application::instance()->mainWindow()->currentTab()->url().url(); diff --git a/src/bookmarks.h b/src/bookmarks.h index fef91413..8b4cf8e5 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -93,10 +93,7 @@ public:      /**      * This function returns whether the owner supports tabs.      */ -    virtual bool supportsTabs() const -    { -        return true; -    } +    virtual bool supportsTabs() const;      /**      * Called if the user wants to open every bookmark in this folder in a new tab. diff --git a/src/mainview.cpp b/src/mainview.cpp index 8f3bf197..9ba711ed 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -108,6 +108,49 @@ void MainView::postLaunch()      m_recentlyClosedTabsAction->setEnabled(false);  } + +UrlBar *MainView::currentUrlBar() const  +{  +    return urlBar(-1);  +} + + +TabBar *MainView::tabBar() const  +{  +    return m_tabBar;  +} + + +StackedUrlBar *MainView::urlBarStack() const  +{  +    return m_urlBars;  +} + + +WebView *MainView::currentWebView() const  +{  +    return webView(currentIndex());  +} + + +int MainView::webViewIndex(WebView *webView) const  +{  +    return indexOf(webView);  +} + + +KAction *MainView::recentlyClosedTabsAction() const  +{  +    return m_recentlyClosedTabsAction;  +} + + +void MainView::setMakeBackTab(bool b)  +{  +    m_makeBackTab = b;  +} + +  void MainView::showTabBar()  {      if (ReKonfig::alwaysShowTabBar()) diff --git a/src/mainview.h b/src/mainview.h index ceb8d1bf..435ccc40 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -66,17 +66,17 @@ public:  public:      UrlBar *urlBar(int index) const; -    UrlBar *currentUrlBar() const { return urlBar(-1); } +    UrlBar *currentUrlBar() const;      WebView *webView(int index) const;      QList<WebView *> tabs();    // ?      // inlines -    TabBar *tabBar() const { return m_tabBar; } -    StackedUrlBar *urlBarStack() const { return m_urlBars; } -    WebView *currentWebView() const { return webView(currentIndex()); } -    int webViewIndex(WebView *webView) const { return indexOf(webView); } -    KAction *recentlyClosedTabsAction() const { return m_recentlyClosedTabsAction; } -    void setMakeBackTab(bool b) { m_makeBackTab = b; } +    TabBar *tabBar() const; +    StackedUrlBar *urlBarStack() const; +    WebView *currentWebView() const; +    int webViewIndex(WebView *webView) const; +    KAction *recentlyClosedTabsAction() const; +    void setMakeBackTab(bool b);      /**       * show and hide TabBar if user doesn't choose diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 83ff514b..39455d92 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -143,6 +143,12 @@ MainWindow::~MainWindow()  } +SidePanel *MainWindow::sidePanel() +{ +    return m_sidePanel; +} + +  void MainWindow::postLaunch()  {      // setup history menu: this has to be done AFTER setupGUI!! diff --git a/src/mainwindow.h b/src/mainwindow.h index 61d8f27b..a4574612 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -73,10 +73,7 @@ private:      void setupHistoryMenu();      void setupToolBars();      void setupSidePanel(); -    SidePanel *sidePanel() -    { -        return m_sidePanel; -    } +    SidePanel *sidePanel();  public slots:      void slotHome(); diff --git a/src/urlbar.cpp b/src/urlbar.cpp index e2756aa6..e1971ced 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -81,6 +81,24 @@ UrlBar::~UrlBar()  } +void UrlBar::selectAll() const +{ +    lineEdit()->selectAll(); +} + + +KUrl UrlBar::url() const +{ +    return m_currentUrl; +} + + +KLineEdit *UrlBar::lineEdit() const +{ +    return m_lineEdit; +} + +  void UrlBar::setupLineEdit()  {      // Make m_lineEdit background transparent diff --git a/src/urlbar.h b/src/urlbar.h index d8fb9029..02d709bb 100644 --- a/src/urlbar.h +++ b/src/urlbar.h @@ -49,15 +49,8 @@ public:      UrlBar(QWidget *parent = 0);      ~UrlBar(); -    void selectAll() const -    { -        lineEdit()->selectAll(); -    } -    KUrl url() const -    { -        return m_currentUrl; -    } - +    void selectAll() const; +    KUrl url() const;      QSize sizeHint() const;  signals: @@ -80,10 +73,7 @@ protected:  private:      void setupLineEdit(); -    KLineEdit *lineEdit() const -    { -        return m_lineEdit; -    } +    KLineEdit *lineEdit() const;      static QLinearGradient generateGradient(const QColor &color, int height); diff --git a/src/webview.cpp b/src/webview.cpp index a635adb7..374a06a8 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -80,12 +80,48 @@ WebView::WebView(QWidget* parent)  } +WebPage *WebView::webPage() const +{ +    return m_page;  +} + + +KUrl WebView::url() const  +{  +    return KUrl(QWebView::url());  +} + + +QString WebView::lastStatusBarText() const +{  +    return m_statusBarText;  +} + + +int WebView::progress() const +{  +    return m_progress;  +} + +  void WebView::load(const KUrl &url)  {      QWebView::load(url);  } +void WebView::setProgress(int progress)  +{  +    m_progress = progress;  +} + + +void WebView::setStatusBarText(const QString &string)  +{  +    m_statusBarText = string;  +} + +  void WebView::contextMenuEvent(QContextMenuEvent *event)  {      QWebHitTestResult result = page()->mainFrame()->hitTestContent(event->pos()); diff --git a/src/webview.h b/src/webview.h index d2dc2bad..56693597 100644 --- a/src/webview.h +++ b/src/webview.h @@ -58,11 +58,10 @@ class WebView : public KWebView  public:      WebView(QWidget *parent = 0); -    // inline -    WebPage *webPage() const { return m_page; } -    KUrl url() const { return KUrl(QWebView::url()); } -    QString lastStatusBarText() const { return m_statusBarText; } -    int progress() const { return m_progress; } +    WebPage *webPage() const; +    KUrl url() const; +    QString lastStatusBarText() const; +    int progress() const;  public Q_SLOTS:      void load(const KUrl &url); @@ -85,9 +84,9 @@ protected:      void keyPressEvent(QKeyEvent *event);  private slots: -    void setProgress(int progress) { m_progress = progress; } +    void setProgress(int progress);      void loadFinished(); -    void setStatusBarText(const QString &string) { m_statusBarText = string; } +    void setStatusBarText(const QString &string);      void downloadRequested(const QNetworkRequest &request);      void openLinkInNewTab();  | 
