Remove the destructor of MainView Remove m_loadingGitPath from MainView Make the invariants of MainView explicit Update the name of MainView attribute to follow the conventions Update the name of WebTab attributes to follow the conventions Use QObject cleaning for the destruction of WebView children

Review Request #100148 - Created Nov. 14, 2010 and submitted

Information
Benjamin Poulain
rekonq
master
Reviewers
rekonq
Remove the destructor of MainView

The destructor of MainView was redundant with the cleaning
mechanism of QObject. It is removed to simplify the class.

Remove m_loadingGitPath from MainView

The attribute m_loadingGitPath is an invariant of runtime,
it is not specific to MainView objects.

The path has been changed to a constant of the implementation.

Make the invariants of MainView explicit

Enforce the invariant of MainView by making the pointer const.

Update the name of MainView attribute to follow the conventions


Update the name of WebTab attributes to follow the conventions

Most classes of Rekonq uses m_ as a prefix for attribute,
this patch update WebTab to follow this convention.

Use QObject cleaning for the destruction of WebView children

The destructor of QObject already destroy the children and
disconnect the object. To reduce code complexity of WebView,
we rely on this mechanism instead of doing manually.

Move download handling from WebView to WebPage

Handling download is a responsibility of WebPage, the connection
to the implementation is better done in WebPage than in WebView.

Add an assertion to ensure the consistency of WebView during development


Update the name of WebView attribute to conform to the conventions

Most classes of Rekonq uses m_ prefix for attribute name, this
patches update WebView to follow those conventions.

  
Pierre Rossi
Sorry about the delay, there are lots of changes in there so that's a lot of scrolling involved. But it looks all good to me :)
Thanks for doing the spring cleanup !
Andrea Diamantini
This patch looks really good! (thanks!!)
I have just one question about (but not really related to your job): during MainView first development, working on the new tab toolbutton, we couldn't reach the goal of showing it without "wasting" a MainWindow pointer on (the m_parentWindow one).
Can this be removed some ways, eg calling the parent() function?
  1. Not sure if I understand the problem, but yeah, parent() and qobject_cast should be enough for that.
  2. Pierre, the problem is not trivial as the MainView instance is created on MainWindow ctor, and calls it in its own ctor itself. Just removing the MainWindow pointer, so using the parent() function instead of the parent pointer does not work.
    It seems the parent() method cannot yet be called in the son ctor if you create the son in father ctor. (Sorry for the confusion of my explanation. I hope someone of you will guess my idea..)
Loading...