Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 06, 2012
Caio Marcelo de Oliveira Filho Parameter errorType renamed to errorDomain in loadFailed() signal
Reviewed-by: Jesus Sanchez-Palencia
25af6bb
Caio Marcelo de Oliveira Filho Make window geometry persistent again
Reviewed-by: Alexis Menard
6edbb1a
16 src/ApplicationStateTracker.cpp
View
@@ -36,18 +36,20 @@ ApplicationStateTracker::~ApplicationStateTracker()
saveState();
}
-void ApplicationStateTracker::updateWindowGeometry()
+void ApplicationStateTracker::updateWindowGeometry(const QRect& geometry)
{
- // FIXME : implement that in QWindow.
- // m_windowGeometry = m_window->saveGeometry();
+ // FIXME: We should improve this to consider window state as well.
+ m_windowGeometry = geometry;
}
void ApplicationStateTracker::restoreWindowGeometry()
{
- // FIXME : implement that in QWindow.
- // QSettings settings;
- // if (!m_window->restoreGeometry(settings.value("mainWindowGeometry").toByteArray()))
- m_window->resize(800, 600);
+ QSettings settings;
+ QRect geometry = settings.value("mainWindowGeometry").toRect();
+ if (geometry.isValid())
+ m_window->setGeometry(geometry);
+ else
+ m_window->resize(800, 600);
}
void ApplicationStateTracker::updateUrlsOpened(const QStringList& urls)
5 src/ApplicationStateTracker.h
View
@@ -18,6 +18,7 @@
#define ApplicationStateTracker_h
#include <QtCore/QObject>
+#include <QtCore/QRect>
#include <QtCore/QStringList>
#include <QtCore/QTimer>
@@ -30,7 +31,7 @@ class ApplicationStateTracker : public QObject {
ApplicationStateTracker(BrowserWindow*);
virtual ~ApplicationStateTracker();
- void updateWindowGeometry();
+ void updateWindowGeometry(const QRect&);
void restoreWindowGeometry();
void updateUrlsOpened(const QStringList&);
@@ -46,7 +47,7 @@ private slots:
QTimer m_saveTimer;
BrowserWindow* m_window;
- QByteArray m_windowGeometry;
+ QRect m_windowGeometry;
QStringList m_urlsOpened;
};
7 src/BrowserWindow.cpp
View
@@ -102,13 +102,12 @@ QString BrowserWindow::decideDownloadPath(const QString& suggestedFilename)
void BrowserWindow::moveEvent(QMoveEvent* event)
{
- m_stateTracker.updateWindowGeometry();
- QQuickView::moveEvent(event);
-}
+ m_stateTracker.updateWindowGeometry(geometry());
+ QQuickView::moveEvent(event);}
void BrowserWindow::resizeEvent(QResizeEvent* event)
{
- m_stateTracker.updateWindowGeometry();
+ m_stateTracker.updateWindowGeometry(geometry());
QQuickView::resizeEvent(event);
}
2  src/qml/PageWidget.qml
View
@@ -53,7 +53,7 @@ Item {
onLoadFailed: {
root.isLoading = false
- if (errorType == WebView.NetworkError && errorCode == NetworkReply.OperationCanceledError)
+ if (errorDomain == WebView.NetworkErrorDomain && errorCode == NetworkReply.OperationCanceledError)
return;
loadUrl(fallbackUrl(url))
}

No commit comments for this range

Something went wrong with that request. Please try again.