|
|
|
@ -224,8 +224,9 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
actionEditBookmarks->setVisible(false); |
|
|
|
|
delete _bookmarks; _bookmarks=0; |
|
|
|
|
} |
|
|
|
|
if (!_kiosk && !_startUrl && _settings.flag("SaveWindowState") |
|
|
|
|
&& _settings()) |
|
|
|
|
if (!_kiosk && |
|
|
|
|
((!_startUrl && _settings.flag("SaveWindowState") && _settings()) || |
|
|
|
|
_bookmarkfile.readable())) |
|
|
|
|
loadWin(); |
|
|
|
|
if (urls.size()) load(urls.at(0)); |
|
|
|
|
for (int i(1); i<urls.size(); ++i) load(urls.at(i), newTab()); |
|
|
|
@ -269,8 +270,9 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
|
|
|
|
|
void closeEvent(QCloseEvent *event) { |
|
|
|
|
LOG; |
|
|
|
|
if (!_kiosk && !_startUrl && _settings.flag("SaveWindowState") |
|
|
|
|
&& _settings()) |
|
|
|
|
if (!_kiosk && |
|
|
|
|
((!_startUrl && _settings.flag("SaveWindowState") && _settings()) || |
|
|
|
|
_bookmarkfile.writeable())) |
|
|
|
|
saveWin(); |
|
|
|
|
QMainWindow::closeEvent(event); |
|
|
|
|
QApplication::exit(0); |
|
|
|
@ -863,8 +865,8 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
|
|
|
|
|
void saveWin() { |
|
|
|
|
LOG<<"Save Window State"; |
|
|
|
|
if (!_settings()) return; |
|
|
|
|
saveBookmarks(); |
|
|
|
|
if (!_settings()) return; |
|
|
|
|
QStringList tabs; |
|
|
|
|
for (int i(0); i<_tabs->count(); ++i) |
|
|
|
|
tabs<<qobject_cast<QWebView*>(_tabs->widget(i))->url().toString(); |
|
|
|
@ -892,6 +894,7 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
void loadWin() { |
|
|
|
|
LOG; |
|
|
|
|
loadBookmarks(); |
|
|
|
|
if (!_settings()) return; |
|
|
|
|
QStringList tabs(_settings()->value("Window/Tabs").toStringList()); |
|
|
|
|
int oldCnt(_tabs->count()); |
|
|
|
|
for (QStringList::iterator it(tabs.begin()); it!=tabs.end(); ++it) { |
|
|
|
|